Skip to content

Commit

Permalink
remove(node): remove enable_group_ops_native_functions feature flag (
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer authored Oct 25, 2024
1 parent 26f0e0f commit 2ab4f69
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 73 deletions.
1 change: 0 additions & 1 deletion crates/iota-open-rpc/spec/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,6 @@
"bridge": false,
"disable_invariant_violation_check_in_swap_loc": true,
"enable_group_ops_native_function_msm": true,
"enable_group_ops_native_functions": true,
"enable_jwk_consensus_updates": false,
"enable_poseidon": true,
"enable_vdf": true,
Expand Down
11 changes: 0 additions & 11 deletions crates/iota-protocol-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ struct FeatureFlags {
#[serde(skip_serializing_if = "is_false")]
enable_poseidon: bool,

// Enable native functions for group operations.
#[serde(skip_serializing_if = "is_false")]
enable_group_ops_native_functions: bool,

// Enable native function for msm.
#[serde(skip_serializing_if = "is_false")]
enable_group_ops_native_function_msm: bool,
Expand Down Expand Up @@ -1029,10 +1025,6 @@ impl ProtocolConfig {
self.feature_flags.enable_poseidon
}

pub fn enable_group_ops_native_functions(&self) -> bool {
self.feature_flags.enable_group_ops_native_functions
}

pub fn enable_group_ops_native_function_msm(&self) -> bool {
self.feature_flags.enable_group_ops_native_function_msm
}
Expand Down Expand Up @@ -1623,9 +1615,6 @@ impl ProtocolConfig {

cfg.feature_flags.consensus_transaction_ordering = ConsensusTransactionOrdering::ByGasPrice;

// Enable group ops and all networks (but not msm)
cfg.feature_flags.enable_group_ops_native_functions = true;

// MoveVM related flags
{
cfg.feature_flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "ProtocolConfig::get_for_version(cur, *chain_id)"
version: 1
feature_flags:
consensus_transaction_ordering: ByGasPrice
enable_group_ops_native_functions: true
per_object_congestion_control_mode: TotalTxCount
zklogin_max_epoch_upper_bound_delta: 30
mysticeti_leader_scoring_and_schedule: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "ProtocolConfig::get_for_version(cur, *chain_id)"
version: 1
feature_flags:
consensus_transaction_ordering: ByGasPrice
enable_group_ops_native_functions: true
per_object_congestion_control_mode: TotalTxCount
zklogin_max_epoch_upper_bound_delta: 30
mysticeti_leader_scoring_and_schedule: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ version: 1
feature_flags:
consensus_transaction_ordering: ByGasPrice
enable_poseidon: true
enable_group_ops_native_functions: true
enable_group_ops_native_function_msm: true
per_object_congestion_control_mode: TotalTxCount
zklogin_max_epoch_upper_bound_delta: 30
Expand Down
29 changes: 0 additions & 29 deletions iota-execution/latest/iota-move-natives/src/crypto/group_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ pub const NOT_SUPPORTED_ERROR: u64 = 0;
pub const INVALID_INPUT_ERROR: u64 = 1;
pub const INPUT_TOO_LONG_ERROR: u64 = 2;

fn is_supported(context: &NativeContext) -> bool {
context
.extensions()
.get::<ObjectRuntime>()
.protocol_config
.enable_group_ops_native_functions()
}

fn is_msm_supported(context: &NativeContext) -> bool {
context
.extensions()
Expand Down Expand Up @@ -184,9 +176,6 @@ pub fn internal_validate(
debug_assert!(args.len() == 2);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let bytes_ref = pop_arg!(args, VectorRef);
let bytes = bytes_ref.as_bytes_ref();
Expand Down Expand Up @@ -233,9 +222,6 @@ pub fn internal_add(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -293,9 +279,6 @@ pub fn internal_sub(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -353,9 +336,6 @@ pub fn internal_mul(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -428,9 +408,6 @@ pub fn internal_div(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -501,9 +478,6 @@ pub fn internal_hash_to(
debug_assert!(args.len() == 2);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let m_ref = pop_arg!(args, VectorRef);
let m = m_ref.as_bytes_ref();
Expand Down Expand Up @@ -735,9 +709,6 @@ pub fn internal_pairing(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down
29 changes: 0 additions & 29 deletions iota-execution/v0/iota-move-natives/src/crypto/group_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ pub const NOT_SUPPORTED_ERROR: u64 = 0;
pub const INVALID_INPUT_ERROR: u64 = 1;
pub const INPUT_TOO_LONG_ERROR: u64 = 2;

fn is_supported(context: &NativeContext) -> bool {
context
.extensions()
.get::<ObjectRuntime>()
.protocol_config
.enable_group_ops_native_functions()
}

fn is_msm_supported(context: &NativeContext) -> bool {
context
.extensions()
Expand Down Expand Up @@ -184,9 +176,6 @@ pub fn internal_validate(
debug_assert!(args.len() == 2);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let bytes_ref = pop_arg!(args, VectorRef);
let bytes = bytes_ref.as_bytes_ref();
Expand Down Expand Up @@ -233,9 +222,6 @@ pub fn internal_add(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -293,9 +279,6 @@ pub fn internal_sub(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -353,9 +336,6 @@ pub fn internal_mul(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -428,9 +408,6 @@ pub fn internal_div(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down Expand Up @@ -501,9 +478,6 @@ pub fn internal_hash_to(
debug_assert!(args.len() == 2);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let m_ref = pop_arg!(args, VectorRef);
let m = m_ref.as_bytes_ref();
Expand Down Expand Up @@ -735,9 +709,6 @@ pub fn internal_pairing(
debug_assert!(args.len() == 3);

let cost = context.gas_used();
if !is_supported(context) {
return Ok(NativeResult::err(cost, NOT_SUPPORTED_ERROR));
}

let e2_ref = pop_arg!(args, VectorRef);
let e2 = e2_ref.as_bytes_ref();
Expand Down

0 comments on commit 2ab4f69

Please sign in to comment.