From 2ab4f692ea453621355b5100567ee082cea57701 Mon Sep 17 00:00:00 2001 From: muXxer Date: Fri, 25 Oct 2024 15:31:34 +0200 Subject: [PATCH] remove(node): remove `enable_group_ops_native_functions` feature flag (#3667) --- crates/iota-open-rpc/spec/openrpc.json | 1 - crates/iota-protocol-config/src/lib.rs | 11 ------- ...tocol_config__test__Mainnet_version_1.snap | 1 - ...tocol_config__test__Testnet_version_1.snap | 1 - ...iota_protocol_config__test__version_1.snap | 1 - .../iota-move-natives/src/crypto/group_ops.rs | 29 ------------------- .../iota-move-natives/src/crypto/group_ops.rs | 29 ------------------- 7 files changed, 73 deletions(-) diff --git a/crates/iota-open-rpc/spec/openrpc.json b/crates/iota-open-rpc/spec/openrpc.json index 9acb5367c22..44dd2ef8b52 100644 --- a/crates/iota-open-rpc/spec/openrpc.json +++ b/crates/iota-open-rpc/spec/openrpc.json @@ -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, diff --git a/crates/iota-protocol-config/src/lib.rs b/crates/iota-protocol-config/src/lib.rs index 102acdb7665..cd8a2995dd1 100644 --- a/crates/iota-protocol-config/src/lib.rs +++ b/crates/iota-protocol-config/src/lib.rs @@ -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, @@ -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 } @@ -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 diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap index d3a28ed0f71..c8cda7a52f8 100644 --- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap +++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap @@ -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 diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap index c5b1553d010..d9c40394b74 100644 --- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap +++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap @@ -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 diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap index 0e7e0f78d3c..91c43303ac6 100644 --- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap +++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap @@ -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 diff --git a/iota-execution/latest/iota-move-natives/src/crypto/group_ops.rs b/iota-execution/latest/iota-move-natives/src/crypto/group_ops.rs index 8bdf7de36d2..5c8fe823dc1 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/group_ops.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/group_ops.rs @@ -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::() - .protocol_config - .enable_group_ops_native_functions() -} - fn is_msm_supported(context: &NativeContext) -> bool { context .extensions() @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); diff --git a/iota-execution/v0/iota-move-natives/src/crypto/group_ops.rs b/iota-execution/v0/iota-move-natives/src/crypto/group_ops.rs index 8bdf7de36d2..5c8fe823dc1 100644 --- a/iota-execution/v0/iota-move-natives/src/crypto/group_ops.rs +++ b/iota-execution/v0/iota-move-natives/src/crypto/group_ops.rs @@ -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::() - .protocol_config - .enable_group_ops_native_functions() -} - fn is_msm_supported(context: &NativeContext) -> bool { context .extensions() @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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();