From 630ca14675411f2d40fcdb4c31aad87835cf65e3 Mon Sep 17 00:00:00 2001 From: Shio Coder Date: Thu, 26 Dec 2024 14:33:13 +0800 Subject: [PATCH 1/7] [SIP-45] Add amplification_factor histogram --- crates/sui-core/src/consensus_adapter.rs | 27 ++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/crates/sui-core/src/consensus_adapter.rs b/crates/sui-core/src/consensus_adapter.rs index 4254beeac9b08..0481648ea852f 100644 --- a/crates/sui-core/src/consensus_adapter.rs +++ b/crates/sui-core/src/consensus_adapter.rs @@ -79,6 +79,7 @@ pub struct ConsensusAdapterMetrics { pub sequencing_certificate_positions_moved: Histogram, pub sequencing_certificate_preceding_disconnected: Histogram, pub sequencing_certificate_processed: IntCounterVec, + pub sequencing_certificate_amplification_factor: Histogram, pub sequencing_in_flight_semaphore_wait: IntGauge, pub sequencing_in_flight_submissions: IntGauge, pub sequencing_estimated_latency: IntGauge, @@ -185,6 +186,12 @@ impl ConsensusAdapterMetrics { registry, ) .unwrap(), + sequencing_certificate_amplification_factor: register_histogram_with_registry!( + "sequencing_certificate_amplification_factor", + "The amplification factor used by consensus adapter to submit to consensus.", + SEQUENCING_CERTIFICATE_POSITION_BUCKETS.to_vec(), + registry, + ).unwrap(), } } @@ -354,11 +361,11 @@ impl ConsensusAdapter { &self, epoch_store: &Arc, transactions: &[ConsensusTransaction], - ) -> (impl Future, usize, usize, usize) { + ) -> (impl Future, usize, usize, usize, usize) { if transactions.iter().any(|tx| tx.is_user_transaction()) { // UserTransactions are generally sent to just one validator and should // be submitted to consensus without delay. - return (tokio::time::sleep(Duration::ZERO), 0, 0, 0); + return (tokio::time::sleep(Duration::ZERO), 0, 0, 0, 0); } // Use the minimum digest to compute submit delay. @@ -375,6 +382,7 @@ impl ConsensusAdapter { _ => None, }) .min(); + let mut amplification_factor = 0; let (duration, position, positions_moved, preceding_disconnected) = match min_digest_and_gas_price { @@ -382,7 +390,7 @@ impl ConsensusAdapter { // TODO: Make this configurable. let k = 5; let multipler = gas_price / epoch_store.reference_gas_price(); - let amplification_factor = if multipler >= k { multipler } else { 0 }; + amplification_factor = if multipler >= k { multipler } else { 0 }; self.await_submit_delay_user_transaction( epoch_store.committee(), digest, @@ -396,6 +404,7 @@ impl ConsensusAdapter { position, positions_moved, preceding_disconnected, + amplification_factor as usize, ) } @@ -703,7 +712,7 @@ impl ConsensusAdapter { let mut guard = InflightDropGuard::acquire(&self, tx_type); // Create the waiter until the node's turn comes to submit to consensus - let (await_submit, position, positions_moved, preceding_disconnected) = + let (await_submit, position, positions_moved, preceding_disconnected, amplification_factor) = self.await_submit_delay(epoch_store, &transactions[..]); // Create the waiter until the transaction is processed by consensus or via checkpoint @@ -763,6 +772,7 @@ impl ConsensusAdapter { guard.position = Some(position); guard.positions_moved = Some(positions_moved); guard.preceding_disconnected = Some(preceding_disconnected); + guard.amplification_factor = Some(amplification_factor); let _permit: SemaphorePermit = self .submit_semaphore @@ -1154,6 +1164,7 @@ struct InflightDropGuard<'a> { position: Option, positions_moved: Option, preceding_disconnected: Option, + amplification_factor: Option, tx_type: &'static str, processed_method: ProcessedMethod, } @@ -1185,6 +1196,7 @@ impl<'a> InflightDropGuard<'a> { position: None, positions_moved: None, preceding_disconnected: None, + amplification_factor: None, tx_type, processed_method: ProcessedMethod::Consensus, } @@ -1226,6 +1238,13 @@ impl<'a> Drop for InflightDropGuard<'a> { .observe(preceding_disconnected as f64); }; + if let Some(amplification_factor) = self.amplification_factor { + self.adapter + .metrics + .sequencing_certificate_amplification_factor + .observe(amplification_factor as f64); + }; + let latency = self.start.elapsed(); let processed_method = match self.processed_method { ProcessedMethod::Consensus => "processed_via_consensus", From ce16e819c946cf41c0956b1b63bbdcdec4603855 Mon Sep 17 00:00:00 2001 From: Shio Coder Date: Thu, 26 Dec 2024 14:58:26 +0800 Subject: [PATCH 2/7] [SIP-45] Make K configurable and increase max gas price for testnet --- crates/sui-core/src/consensus_adapter.rs | 10 ++++++++-- crates/sui-protocol-config/src/lib.rs | 9 +++++++++ .../sui_protocol_config__test__Mainnet_version_70.snap | 3 ++- .../sui_protocol_config__test__Testnet_version_70.snap | 5 +++-- .../sui_protocol_config__test__version_70.snap | 5 +++-- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/crates/sui-core/src/consensus_adapter.rs b/crates/sui-core/src/consensus_adapter.rs index 0481648ea852f..4b16b8879ad4a 100644 --- a/crates/sui-core/src/consensus_adapter.rs +++ b/crates/sui-core/src/consensus_adapter.rs @@ -387,8 +387,14 @@ impl ConsensusAdapter { let (duration, position, positions_moved, preceding_disconnected) = match min_digest_and_gas_price { Some((digest, gas_price)) => { - // TODO: Make this configurable. - let k = 5; + let protocol_config_k = epoch_store.protocol_config().sip_45_k(); + let k = if protocol_config_k == 0 { + // Disable amplification if k is not set. + u64::MAX + } else { + protocol_config_k + }; + let multipler = gas_price / epoch_store.reference_gas_price(); amplification_factor = if multipler >= k { multipler } else { 0 }; self.await_submit_delay_user_transaction( diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 5413b0d87a5c0..426059f0f4f47 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -1333,6 +1333,9 @@ pub struct ProtocolConfig { /// Adds an absolute cap on the maximum transaction cost when using TotalGasBudgetWithCap at /// the given multiple of the per-commit budget. gas_budget_based_txn_cost_absolute_cap_commit_count: Option, + + /// SIP-45: K in the formula `amplification_factor = max(0, gas_price / reference_gas_price - K)`. + sip_45_k: Option, } // feature flags @@ -2251,6 +2254,8 @@ impl ProtocolConfig { gas_budget_based_txn_cost_cap_factor: None, gas_budget_based_txn_cost_absolute_cap_commit_count: None, + + sip_45_k: None, // When adding a new constant, set it to None in the earliest version, like this: // new_constant: None, }; @@ -3007,6 +3012,8 @@ impl ProtocolConfig { // Enable probing for accepted rounds in round prober for testnet cfg.feature_flags .consensus_round_prober_probe_accepted_rounds = true; + // [SIP-45] Set max gas price to 1T. + cfg.max_gas_price = Some(1_000_000_000_000); } cfg.poseidon_bn254_cost_per_block = Some(388); @@ -3083,6 +3090,8 @@ impl ProtocolConfig { cfg.group_ops_bls12381_uncompressed_g1_sum_max_terms = Some(1200); cfg.validator_validate_metadata_cost_base = Some(20000); + + cfg.sip_45_k = Some(5); } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap index bdbdf0df72acb..29eee2fb4d64b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap @@ -1,6 +1,7 @@ --- source: crates/sui-protocol-config/src/lib.rs expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +snapshot_kind: text --- version: 70 feature_flags: @@ -339,4 +340,4 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 - +sip_45_k: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap index 80a180c7d6200..0509e88b038a7 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap @@ -1,6 +1,7 @@ --- source: crates/sui-protocol-config/src/lib.rs expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +snapshot_kind: text --- version: 70 feature_flags: @@ -103,7 +104,7 @@ max_move_object_size: 256000 max_move_package_size: 102400 max_publish_or_upgrade_per_ptb: 5 max_tx_gas: 50000000000 -max_gas_price: 100000 +max_gas_price: 1000000000000 max_gas_computation_bucket: 5000000 gas_rounding_step: 1000 max_loop_depth: 5 @@ -342,4 +343,4 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 - +sip_45_k: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap index be386a34a2d68..33132abe26e60 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap @@ -1,6 +1,7 @@ --- source: crates/sui-protocol-config/src/lib.rs expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +snapshot_kind: text --- version: 70 feature_flags: @@ -109,7 +110,7 @@ max_move_object_size: 256000 max_move_package_size: 102400 max_publish_or_upgrade_per_ptb: 5 max_tx_gas: 50000000000 -max_gas_price: 100000 +max_gas_price: 1000000000000 max_gas_computation_bucket: 5000000 gas_rounding_step: 1000 max_loop_depth: 5 @@ -351,4 +352,4 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 - +sip_45_k: 5 From e80b9972044a38c33824980f2e2929ad48206769 Mon Sep 17 00:00:00 2001 From: Shio Coder Date: Fri, 27 Dec 2024 08:31:25 +0800 Subject: [PATCH 3/7] [SIP-45] Use protocol version 71 --- crates/sui-core/src/consensus_adapter.rs | 12 +- crates/sui-protocol-config/src/lib.rs | 19 +- ...ocol_config__test__Mainnet_version_70.snap | 1 - ...ocol_config__test__Mainnet_version_71.snap | 343 +++++++++++++++++ ...ocol_config__test__Testnet_version_70.snap | 3 +- ...ocol_config__test__Testnet_version_71.snap | 346 +++++++++++++++++ ...sui_protocol_config__test__version_70.snap | 3 +- ...sui_protocol_config__test__version_71.snap | 355 ++++++++++++++++++ 8 files changed, 1062 insertions(+), 20 deletions(-) create mode 100644 crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_71.snap create mode 100644 crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap create mode 100644 crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap diff --git a/crates/sui-core/src/consensus_adapter.rs b/crates/sui-core/src/consensus_adapter.rs index 4b16b8879ad4a..7d22fa338622d 100644 --- a/crates/sui-core/src/consensus_adapter.rs +++ b/crates/sui-core/src/consensus_adapter.rs @@ -387,14 +387,10 @@ impl ConsensusAdapter { let (duration, position, positions_moved, preceding_disconnected) = match min_digest_and_gas_price { Some((digest, gas_price)) => { - let protocol_config_k = epoch_store.protocol_config().sip_45_k(); - let k = if protocol_config_k == 0 { - // Disable amplification if k is not set. - u64::MAX - } else { - protocol_config_k - }; - + let k = epoch_store + .protocol_config() + .sip_45_consensus_amplification_threshold_as_option() + .unwrap_or(u64::MAX); let multipler = gas_price / epoch_store.reference_gas_price(); amplification_factor = if multipler >= k { multipler } else { 0 }; self.await_submit_delay_user_transaction( diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 426059f0f4f47..50eb2421431b3 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -18,7 +18,7 @@ use tracing::{info, warn}; /// The minimum and maximum protocol versions supported by this build. const MIN_PROTOCOL_VERSION: u64 = 1; -const MAX_PROTOCOL_VERSION: u64 = 70; +const MAX_PROTOCOL_VERSION: u64 = 71; // Record history of protocol version allocations here: // @@ -203,6 +203,7 @@ const MAX_PROTOCOL_VERSION: u64 = 70; // Add new gas model version to update charging of native functions. // Add std::uq64_64 module to Move stdlib. // Improve gas/wall time efficiency of some Move stdlib vector functions +// Version 71: [SIP-45] Increase max gas price to 1T. Enable consensus amplification. #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -1335,7 +1336,8 @@ pub struct ProtocolConfig { gas_budget_based_txn_cost_absolute_cap_commit_count: Option, /// SIP-45: K in the formula `amplification_factor = max(0, gas_price / reference_gas_price - K)`. - sip_45_k: Option, + /// This is the threshold for activating consensus amplification. + sip_45_consensus_amplification_threshold: Option, } // feature flags @@ -2255,7 +2257,7 @@ impl ProtocolConfig { gas_budget_based_txn_cost_absolute_cap_commit_count: None, - sip_45_k: None, + sip_45_consensus_amplification_threshold: None, // When adding a new constant, set it to None in the earliest version, like this: // new_constant: None, }; @@ -3012,8 +3014,6 @@ impl ProtocolConfig { // Enable probing for accepted rounds in round prober for testnet cfg.feature_flags .consensus_round_prober_probe_accepted_rounds = true; - // [SIP-45] Set max gas price to 1T. - cfg.max_gas_price = Some(1_000_000_000_000); } cfg.poseidon_bn254_cost_per_block = Some(388); @@ -3090,8 +3090,13 @@ impl ProtocolConfig { cfg.group_ops_bls12381_uncompressed_g1_sum_max_terms = Some(1200); cfg.validator_validate_metadata_cost_base = Some(20000); - - cfg.sip_45_k = Some(5); + } + 71 => { + if chain != Chain::Mainnet { + // [SIP-45] Set max gas price to 1T. + cfg.max_gas_price = Some(1_000_000_000_000); + } + cfg.sip_45_consensus_amplification_threshold = Some(5); } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap index 29eee2fb4d64b..32b26d798d5ac 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap @@ -340,4 +340,3 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 -sip_45_k: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_71.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_71.snap new file mode 100644 index 0000000000000..da60e40a70a2d --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_71.snap @@ -0,0 +1,343 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +snapshot_kind: text +--- +version: 71 +feature_flags: + package_upgrades: true + commit_root_state_digest: true + advance_epoch_start_time_in_safe_mode: true + loaded_child_objects_fixed: true + missing_type_is_compatibility_error: true + scoring_decision_with_validity_cutoff: true + consensus_order_end_of_epoch_last: true + disallow_adding_abilities_on_upgrade: true + disable_invariant_violation_check_in_swap_loc: true + advance_to_highest_supported_protocol_version: true + ban_entry_init: true + package_digest_hash_module: true + disallow_change_struct_type_params_on_upgrade: true + no_extraneous_module_bytes: true + narwhal_versioned_metadata: true + zklogin_auth: true + consensus_transaction_ordering: ByGasPrice + simplified_unwrap_then_delete: true + upgraded_multisig_supported: true + txn_base_cost_as_multiplier: true + shared_object_deletion: true + narwhal_new_leader_election_schedule: true + loaded_child_object_format: true + enable_jwk_consensus_updates: true + end_of_epoch_transaction_supported: true + simple_conservation_checks: true + loaded_child_object_format_type: true + receive_objects: true + random_beacon: true + bridge: true + enable_effects_v2: true + narwhal_certificate_v2: true + verify_legacy_zklogin_address: true + recompute_has_public_transfer_in_execution: true + accept_zklogin_in_multisig: true + include_consensus_digest_in_prologue: true + hardened_otw_check: true + allow_receiving_object_id: true + enable_coin_deny_list: true + enable_group_ops_native_functions: true + reject_mutable_random_on_entry_functions: true + per_object_congestion_control_mode: TotalGasBudgetWithCap + consensus_choice: Mysticeti + consensus_network: Tonic + zklogin_max_epoch_upper_bound_delta: 30 + mysticeti_leader_scoring_and_schedule: true + reshare_at_same_initial_version: true + resolve_abort_locations_to_package_id: true + mysticeti_use_committed_subdag_digest: true + record_consensus_determined_version_assignments_in_prologue: true + fresh_vm_on_framework_upgrade: true + prepend_prologue_tx_in_consensus_commit_in_checkpoints: true + mysticeti_num_leaders_per_round: 1 + soft_bundle: true + enable_coin_deny_list_v2: true + rethrow_serialization_type_layout_errors: true + consensus_distributed_vote_scoring_strategy: true + consensus_round_prober: true + validate_identifier_inputs: true + relocate_event_module: true + disallow_new_modules_in_deps_only_packages: true + native_charging_v2: true +max_tx_size_bytes: 131072 +max_input_objects: 2048 +max_size_written_objects: 5000000 +max_size_written_objects_system_tx: 50000000 +max_serialized_tx_effects_size_bytes: 524288 +max_serialized_tx_effects_size_bytes_system_tx: 8388608 +max_gas_payment_objects: 256 +max_modules_in_publish: 64 +max_package_dependencies: 32 +max_arguments: 512 +max_type_arguments: 16 +max_type_argument_depth: 16 +max_pure_argument_size: 16384 +max_programmable_tx_commands: 1024 +move_binary_format_version: 7 +min_move_binary_format_version: 6 +binary_module_handles: 100 +binary_struct_handles: 300 +binary_function_handles: 1500 +binary_function_instantiations: 750 +binary_signatures: 1000 +binary_constant_pool: 4000 +binary_identifiers: 10000 +binary_address_identifiers: 100 +binary_struct_defs: 200 +binary_struct_def_instantiations: 100 +binary_function_defs: 1000 +binary_field_handles: 500 +binary_field_instantiations: 250 +binary_friend_decls: 100 +max_move_object_size: 256000 +max_move_package_size: 102400 +max_publish_or_upgrade_per_ptb: 5 +max_tx_gas: 50000000000 +max_gas_price: 100000 +max_gas_computation_bucket: 5000000 +gas_rounding_step: 1000 +max_loop_depth: 5 +max_generic_instantiation_length: 32 +max_function_parameters: 128 +max_basic_blocks: 1024 +max_value_stack_size: 1024 +max_type_nodes: 256 +max_push_size: 10000 +max_struct_definitions: 200 +max_function_definitions: 1000 +max_fields_in_struct: 32 +max_dependency_depth: 100 +max_num_event_emit: 1024 +max_num_new_move_object_ids: 2048 +max_num_new_move_object_ids_system_tx: 32768 +max_num_deleted_move_object_ids: 2048 +max_num_deleted_move_object_ids_system_tx: 32768 +max_num_transferred_move_object_ids: 2048 +max_num_transferred_move_object_ids_system_tx: 32768 +max_event_emit_size: 256000 +max_event_emit_size_total: 65536000 +max_move_vector_len: 262144 +max_move_identifier_len: 128 +max_move_value_depth: 128 +max_back_edges_per_function: 10000 +max_back_edges_per_module: 10000 +max_verifier_meter_ticks_per_function: 16000000 +max_meter_ticks_per_module: 16000000 +max_meter_ticks_per_package: 16000000 +object_runtime_max_num_cached_objects: 1000 +object_runtime_max_num_cached_objects_system_tx: 16000 +object_runtime_max_num_store_entries: 1000 +object_runtime_max_num_store_entries_system_tx: 16000 +base_tx_cost_fixed: 1000 +package_publish_cost_fixed: 1000 +base_tx_cost_per_byte: 0 +package_publish_cost_per_byte: 80 +obj_access_cost_read_per_byte: 15 +obj_access_cost_mutate_per_byte: 40 +obj_access_cost_delete_per_byte: 40 +obj_access_cost_verify_per_byte: 200 +max_type_to_layout_nodes: 512 +gas_model_version: 9 +obj_data_cost_refundable: 100 +obj_metadata_cost_non_refundable: 50 +storage_rebate_rate: 9900 +storage_fund_reinvest_rate: 500 +reward_slashing_rate: 10000 +storage_gas_price: 76 +max_transactions_per_checkpoint: 10000 +max_checkpoint_size_bytes: 31457280 +buffer_stake_for_protocol_upgrade_bps: 5000 +address_from_bytes_cost_base: 52 +address_to_u256_cost_base: 52 +address_from_u256_cost_base: 52 +config_read_setting_impl_cost_base: 100 +config_read_setting_impl_cost_per_byte: 40 +dynamic_field_hash_type_and_key_cost_base: 100 +dynamic_field_hash_type_and_key_type_cost_per_byte: 2 +dynamic_field_hash_type_and_key_value_cost_per_byte: 2 +dynamic_field_hash_type_and_key_type_tag_cost_per_byte: 2 +dynamic_field_add_child_object_cost_base: 100 +dynamic_field_add_child_object_type_cost_per_byte: 10 +dynamic_field_add_child_object_value_cost_per_byte: 10 +dynamic_field_add_child_object_struct_tag_cost_per_byte: 10 +dynamic_field_borrow_child_object_cost_base: 100 +dynamic_field_borrow_child_object_child_ref_cost_per_byte: 10 +dynamic_field_borrow_child_object_type_cost_per_byte: 10 +dynamic_field_remove_child_object_cost_base: 100 +dynamic_field_remove_child_object_child_cost_per_byte: 2 +dynamic_field_remove_child_object_type_cost_per_byte: 2 +dynamic_field_has_child_object_cost_base: 100 +dynamic_field_has_child_object_with_ty_cost_base: 100 +dynamic_field_has_child_object_with_ty_type_cost_per_byte: 2 +dynamic_field_has_child_object_with_ty_type_tag_cost_per_byte: 2 +event_emit_cost_base: 52 +event_emit_value_size_derivation_cost_per_byte: 2 +event_emit_tag_size_derivation_cost_per_byte: 5 +event_emit_output_cost_per_byte: 10 +object_borrow_uid_cost_base: 52 +object_delete_impl_cost_base: 52 +object_record_new_uid_cost_base: 52 +transfer_transfer_internal_cost_base: 52 +transfer_freeze_object_cost_base: 52 +transfer_share_object_cost_base: 52 +transfer_receive_object_cost_base: 52 +tx_context_derive_id_cost_base: 52 +types_is_one_time_witness_cost_base: 52 +types_is_one_time_witness_type_tag_cost_per_byte: 2 +types_is_one_time_witness_type_cost_per_byte: 2 +validator_validate_metadata_cost_base: 20000 +validator_validate_metadata_data_cost_per_byte: 2 +crypto_invalid_arguments_cost: 100 +bls12381_bls12381_min_sig_verify_cost_base: 44064 +bls12381_bls12381_min_sig_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_sig_verify_msg_cost_per_block: 2 +bls12381_bls12381_min_pk_verify_cost_base: 49282 +bls12381_bls12381_min_pk_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_pk_verify_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_keccak256_cost_base: 500 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_sha256_cost_base: 500 +ecdsa_k1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_k1_decompress_pubkey_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_cost_base: 1470 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_k1_secp256k1_verify_sha256_cost_base: 1470 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_keccak256_cost_base: 1173 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_sha256_cost_base: 1173 +ecdsa_r1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_keccak256_cost_base: 4225 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_sha256_cost_base: 4225 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_block: 2 +ecvrf_ecvrf_verify_cost_base: 4848 +ecvrf_ecvrf_verify_alpha_string_cost_per_byte: 2 +ecvrf_ecvrf_verify_alpha_string_cost_per_block: 2 +ed25519_ed25519_verify_cost_base: 1802 +ed25519_ed25519_verify_msg_cost_per_byte: 2 +ed25519_ed25519_verify_msg_cost_per_block: 2 +groth16_prepare_verifying_key_bls12381_cost_base: 53838 +groth16_prepare_verifying_key_bn254_cost_base: 82010 +groth16_verify_groth16_proof_internal_bls12381_cost_base: 72090 +groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input: 8213 +groth16_verify_groth16_proof_internal_bn254_cost_base: 115502 +groth16_verify_groth16_proof_internal_bn254_cost_per_public_input: 9484 +groth16_verify_groth16_proof_internal_public_input_cost_per_byte: 2 +hash_blake2b256_cost_base: 10 +hash_blake2b256_data_cost_per_byte: 2 +hash_blake2b256_data_cost_per_block: 2 +hash_keccak256_cost_base: 10 +hash_keccak256_data_cost_per_byte: 2 +hash_keccak256_data_cost_per_block: 2 +poseidon_bn254_cost_per_block: 388 +group_ops_bls12381_decode_scalar_cost: 7 +group_ops_bls12381_decode_g1_cost: 2848 +group_ops_bls12381_decode_g2_cost: 3770 +group_ops_bls12381_decode_gt_cost: 3068 +group_ops_bls12381_scalar_add_cost: 10 +group_ops_bls12381_g1_add_cost: 1556 +group_ops_bls12381_g2_add_cost: 3048 +group_ops_bls12381_gt_add_cost: 188 +group_ops_bls12381_scalar_sub_cost: 10 +group_ops_bls12381_g1_sub_cost: 1550 +group_ops_bls12381_g2_sub_cost: 3019 +group_ops_bls12381_gt_sub_cost: 497 +group_ops_bls12381_scalar_mul_cost: 11 +group_ops_bls12381_g1_mul_cost: 4842 +group_ops_bls12381_g2_mul_cost: 9108 +group_ops_bls12381_gt_mul_cost: 27490 +group_ops_bls12381_scalar_div_cost: 91 +group_ops_bls12381_g1_div_cost: 5091 +group_ops_bls12381_g2_div_cost: 9206 +group_ops_bls12381_gt_div_cost: 27804 +group_ops_bls12381_g1_hash_to_base_cost: 2962 +group_ops_bls12381_g2_hash_to_base_cost: 8688 +group_ops_bls12381_g1_hash_to_cost_per_byte: 2 +group_ops_bls12381_g2_hash_to_cost_per_byte: 2 +group_ops_bls12381_g1_msm_base_cost: 62648 +group_ops_bls12381_g2_msm_base_cost: 131192 +group_ops_bls12381_g1_msm_base_cost_per_input: 1333 +group_ops_bls12381_g2_msm_base_cost_per_input: 3216 +group_ops_bls12381_msm_max_len: 32 +group_ops_bls12381_pairing_cost: 26897 +group_ops_bls12381_g1_to_uncompressed_g1_cost: 2099 +group_ops_bls12381_uncompressed_g1_to_g1_cost: 677 +group_ops_bls12381_uncompressed_g1_sum_base_cost: 77 +group_ops_bls12381_uncompressed_g1_sum_cost_per_term: 26 +group_ops_bls12381_uncompressed_g1_sum_max_terms: 1200 +hmac_hmac_sha3_256_cost_base: 52 +hmac_hmac_sha3_256_input_cost_per_byte: 2 +hmac_hmac_sha3_256_input_cost_per_block: 2 +check_zklogin_id_cost_base: 200 +check_zklogin_issuer_cost_base: 200 +bcs_per_byte_serialized_cost: 2 +bcs_legacy_min_output_size_cost: 1 +bcs_failure_cost: 52 +hash_sha2_256_base_cost: 52 +hash_sha2_256_per_byte_cost: 2 +hash_sha2_256_legacy_min_input_len_cost: 1 +hash_sha3_256_base_cost: 52 +hash_sha3_256_per_byte_cost: 2 +hash_sha3_256_legacy_min_input_len_cost: 1 +type_name_get_base_cost: 52 +type_name_get_per_byte_cost: 2 +string_check_utf8_base_cost: 52 +string_check_utf8_per_byte_cost: 2 +string_is_char_boundary_base_cost: 52 +string_sub_string_base_cost: 52 +string_sub_string_per_byte_cost: 2 +string_index_of_base_cost: 52 +string_index_of_per_byte_pattern_cost: 2 +string_index_of_per_byte_searched_cost: 2 +vector_empty_base_cost: 52 +vector_length_base_cost: 52 +vector_push_back_base_cost: 52 +vector_push_back_legacy_per_abstract_memory_unit_cost: 2 +vector_borrow_base_cost: 52 +vector_pop_back_base_cost: 52 +vector_destroy_empty_base_cost: 52 +vector_swap_base_cost: 52 +debug_print_base_cost: 52 +debug_print_stack_trace_base_cost: 52 +execution_version: 3 +consensus_bad_nodes_stake_threshold: 20 +max_jwk_votes_per_validator_per_epoch: 240 +max_age_of_jwk_in_epochs: 1 +random_beacon_reduction_allowed_delta: 800 +random_beacon_reduction_lower_bound: 500 +random_beacon_dkg_timeout_round: 3000 +random_beacon_min_round_interval_ms: 500 +random_beacon_dkg_version: 1 +consensus_max_transaction_size_bytes: 262144 +consensus_max_transactions_in_block_bytes: 524288 +consensus_max_num_transactions_in_block: 512 +consensus_voting_rounds: 40 +max_accumulated_txn_cost_per_object_in_narwhal_commit: 40 +max_deferral_rounds_for_congestion_control: 10 +max_txn_cost_overage_per_object_in_commit: 18446744073709551615 +min_checkpoint_interval_ms: 200 +checkpoint_summary_version_specific_data: 1 +max_soft_bundle_size: 5 +bridge_should_try_to_finalize_committee: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 +max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 +gas_budget_based_txn_cost_cap_factor: 400000 +gas_budget_based_txn_cost_absolute_cap_commit_count: 50 +sip_45_consensus_amplification_threshold: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap index 0509e88b038a7..5ece9e9fd6baa 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap @@ -104,7 +104,7 @@ max_move_object_size: 256000 max_move_package_size: 102400 max_publish_or_upgrade_per_ptb: 5 max_tx_gas: 50000000000 -max_gas_price: 1000000000000 +max_gas_price: 100000 max_gas_computation_bucket: 5000000 gas_rounding_step: 1000 max_loop_depth: 5 @@ -343,4 +343,3 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 -sip_45_k: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap new file mode 100644 index 0000000000000..4ed35e18c0072 --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap @@ -0,0 +1,346 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +snapshot_kind: text +--- +version: 71 +feature_flags: + package_upgrades: true + commit_root_state_digest: true + advance_epoch_start_time_in_safe_mode: true + loaded_child_objects_fixed: true + missing_type_is_compatibility_error: true + scoring_decision_with_validity_cutoff: true + consensus_order_end_of_epoch_last: true + disallow_adding_abilities_on_upgrade: true + disable_invariant_violation_check_in_swap_loc: true + advance_to_highest_supported_protocol_version: true + ban_entry_init: true + package_digest_hash_module: true + disallow_change_struct_type_params_on_upgrade: true + no_extraneous_module_bytes: true + narwhal_versioned_metadata: true + zklogin_auth: true + consensus_transaction_ordering: ByGasPrice + simplified_unwrap_then_delete: true + upgraded_multisig_supported: true + txn_base_cost_as_multiplier: true + shared_object_deletion: true + narwhal_new_leader_election_schedule: true + loaded_child_object_format: true + enable_jwk_consensus_updates: true + end_of_epoch_transaction_supported: true + simple_conservation_checks: true + loaded_child_object_format_type: true + receive_objects: true + random_beacon: true + bridge: true + enable_effects_v2: true + narwhal_certificate_v2: true + verify_legacy_zklogin_address: true + recompute_has_public_transfer_in_execution: true + accept_zklogin_in_multisig: true + include_consensus_digest_in_prologue: true + hardened_otw_check: true + allow_receiving_object_id: true + enable_coin_deny_list: true + enable_group_ops_native_functions: true + reject_mutable_random_on_entry_functions: true + per_object_congestion_control_mode: TotalGasBudgetWithCap + consensus_choice: Mysticeti + consensus_network: Tonic + zklogin_max_epoch_upper_bound_delta: 30 + mysticeti_leader_scoring_and_schedule: true + reshare_at_same_initial_version: true + resolve_abort_locations_to_package_id: true + mysticeti_use_committed_subdag_digest: true + record_consensus_determined_version_assignments_in_prologue: true + fresh_vm_on_framework_upgrade: true + prepend_prologue_tx_in_consensus_commit_in_checkpoints: true + mysticeti_num_leaders_per_round: 1 + soft_bundle: true + enable_coin_deny_list_v2: true + rethrow_serialization_type_layout_errors: true + consensus_distributed_vote_scoring_strategy: true + consensus_round_prober: true + validate_identifier_inputs: true + relocate_event_module: true + uncompressed_g1_group_elements: true + disallow_new_modules_in_deps_only_packages: true + consensus_smart_ancestor_selection: true + consensus_round_prober_probe_accepted_rounds: true + native_charging_v2: true +max_tx_size_bytes: 131072 +max_input_objects: 2048 +max_size_written_objects: 5000000 +max_size_written_objects_system_tx: 50000000 +max_serialized_tx_effects_size_bytes: 524288 +max_serialized_tx_effects_size_bytes_system_tx: 8388608 +max_gas_payment_objects: 256 +max_modules_in_publish: 64 +max_package_dependencies: 32 +max_arguments: 512 +max_type_arguments: 16 +max_type_argument_depth: 16 +max_pure_argument_size: 16384 +max_programmable_tx_commands: 1024 +move_binary_format_version: 7 +min_move_binary_format_version: 6 +binary_module_handles: 100 +binary_struct_handles: 300 +binary_function_handles: 1500 +binary_function_instantiations: 750 +binary_signatures: 1000 +binary_constant_pool: 4000 +binary_identifiers: 10000 +binary_address_identifiers: 100 +binary_struct_defs: 200 +binary_struct_def_instantiations: 100 +binary_function_defs: 1000 +binary_field_handles: 500 +binary_field_instantiations: 250 +binary_friend_decls: 100 +max_move_object_size: 256000 +max_move_package_size: 102400 +max_publish_or_upgrade_per_ptb: 5 +max_tx_gas: 50000000000 +max_gas_price: 1000000000000 +max_gas_computation_bucket: 5000000 +gas_rounding_step: 1000 +max_loop_depth: 5 +max_generic_instantiation_length: 32 +max_function_parameters: 128 +max_basic_blocks: 1024 +max_value_stack_size: 1024 +max_type_nodes: 256 +max_push_size: 10000 +max_struct_definitions: 200 +max_function_definitions: 1000 +max_fields_in_struct: 32 +max_dependency_depth: 100 +max_num_event_emit: 1024 +max_num_new_move_object_ids: 2048 +max_num_new_move_object_ids_system_tx: 32768 +max_num_deleted_move_object_ids: 2048 +max_num_deleted_move_object_ids_system_tx: 32768 +max_num_transferred_move_object_ids: 2048 +max_num_transferred_move_object_ids_system_tx: 32768 +max_event_emit_size: 256000 +max_event_emit_size_total: 65536000 +max_move_vector_len: 262144 +max_move_identifier_len: 128 +max_move_value_depth: 128 +max_back_edges_per_function: 10000 +max_back_edges_per_module: 10000 +max_verifier_meter_ticks_per_function: 16000000 +max_meter_ticks_per_module: 16000000 +max_meter_ticks_per_package: 16000000 +object_runtime_max_num_cached_objects: 1000 +object_runtime_max_num_cached_objects_system_tx: 16000 +object_runtime_max_num_store_entries: 1000 +object_runtime_max_num_store_entries_system_tx: 16000 +base_tx_cost_fixed: 1000 +package_publish_cost_fixed: 1000 +base_tx_cost_per_byte: 0 +package_publish_cost_per_byte: 80 +obj_access_cost_read_per_byte: 15 +obj_access_cost_mutate_per_byte: 40 +obj_access_cost_delete_per_byte: 40 +obj_access_cost_verify_per_byte: 200 +max_type_to_layout_nodes: 512 +gas_model_version: 9 +obj_data_cost_refundable: 100 +obj_metadata_cost_non_refundable: 50 +storage_rebate_rate: 9900 +storage_fund_reinvest_rate: 500 +reward_slashing_rate: 10000 +storage_gas_price: 76 +max_transactions_per_checkpoint: 10000 +max_checkpoint_size_bytes: 31457280 +buffer_stake_for_protocol_upgrade_bps: 5000 +address_from_bytes_cost_base: 52 +address_to_u256_cost_base: 52 +address_from_u256_cost_base: 52 +config_read_setting_impl_cost_base: 100 +config_read_setting_impl_cost_per_byte: 40 +dynamic_field_hash_type_and_key_cost_base: 100 +dynamic_field_hash_type_and_key_type_cost_per_byte: 2 +dynamic_field_hash_type_and_key_value_cost_per_byte: 2 +dynamic_field_hash_type_and_key_type_tag_cost_per_byte: 2 +dynamic_field_add_child_object_cost_base: 100 +dynamic_field_add_child_object_type_cost_per_byte: 10 +dynamic_field_add_child_object_value_cost_per_byte: 10 +dynamic_field_add_child_object_struct_tag_cost_per_byte: 10 +dynamic_field_borrow_child_object_cost_base: 100 +dynamic_field_borrow_child_object_child_ref_cost_per_byte: 10 +dynamic_field_borrow_child_object_type_cost_per_byte: 10 +dynamic_field_remove_child_object_cost_base: 100 +dynamic_field_remove_child_object_child_cost_per_byte: 2 +dynamic_field_remove_child_object_type_cost_per_byte: 2 +dynamic_field_has_child_object_cost_base: 100 +dynamic_field_has_child_object_with_ty_cost_base: 100 +dynamic_field_has_child_object_with_ty_type_cost_per_byte: 2 +dynamic_field_has_child_object_with_ty_type_tag_cost_per_byte: 2 +event_emit_cost_base: 52 +event_emit_value_size_derivation_cost_per_byte: 2 +event_emit_tag_size_derivation_cost_per_byte: 5 +event_emit_output_cost_per_byte: 10 +object_borrow_uid_cost_base: 52 +object_delete_impl_cost_base: 52 +object_record_new_uid_cost_base: 52 +transfer_transfer_internal_cost_base: 52 +transfer_freeze_object_cost_base: 52 +transfer_share_object_cost_base: 52 +transfer_receive_object_cost_base: 52 +tx_context_derive_id_cost_base: 52 +types_is_one_time_witness_cost_base: 52 +types_is_one_time_witness_type_tag_cost_per_byte: 2 +types_is_one_time_witness_type_cost_per_byte: 2 +validator_validate_metadata_cost_base: 20000 +validator_validate_metadata_data_cost_per_byte: 2 +crypto_invalid_arguments_cost: 100 +bls12381_bls12381_min_sig_verify_cost_base: 44064 +bls12381_bls12381_min_sig_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_sig_verify_msg_cost_per_block: 2 +bls12381_bls12381_min_pk_verify_cost_base: 49282 +bls12381_bls12381_min_pk_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_pk_verify_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_keccak256_cost_base: 500 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_sha256_cost_base: 500 +ecdsa_k1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_k1_decompress_pubkey_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_cost_base: 1470 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_k1_secp256k1_verify_sha256_cost_base: 1470 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_keccak256_cost_base: 1173 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_sha256_cost_base: 1173 +ecdsa_r1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_keccak256_cost_base: 4225 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_sha256_cost_base: 4225 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_block: 2 +ecvrf_ecvrf_verify_cost_base: 4848 +ecvrf_ecvrf_verify_alpha_string_cost_per_byte: 2 +ecvrf_ecvrf_verify_alpha_string_cost_per_block: 2 +ed25519_ed25519_verify_cost_base: 1802 +ed25519_ed25519_verify_msg_cost_per_byte: 2 +ed25519_ed25519_verify_msg_cost_per_block: 2 +groth16_prepare_verifying_key_bls12381_cost_base: 53838 +groth16_prepare_verifying_key_bn254_cost_base: 82010 +groth16_verify_groth16_proof_internal_bls12381_cost_base: 72090 +groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input: 8213 +groth16_verify_groth16_proof_internal_bn254_cost_base: 115502 +groth16_verify_groth16_proof_internal_bn254_cost_per_public_input: 9484 +groth16_verify_groth16_proof_internal_public_input_cost_per_byte: 2 +hash_blake2b256_cost_base: 10 +hash_blake2b256_data_cost_per_byte: 2 +hash_blake2b256_data_cost_per_block: 2 +hash_keccak256_cost_base: 10 +hash_keccak256_data_cost_per_byte: 2 +hash_keccak256_data_cost_per_block: 2 +poseidon_bn254_cost_per_block: 388 +group_ops_bls12381_decode_scalar_cost: 7 +group_ops_bls12381_decode_g1_cost: 2848 +group_ops_bls12381_decode_g2_cost: 3770 +group_ops_bls12381_decode_gt_cost: 3068 +group_ops_bls12381_scalar_add_cost: 10 +group_ops_bls12381_g1_add_cost: 1556 +group_ops_bls12381_g2_add_cost: 3048 +group_ops_bls12381_gt_add_cost: 188 +group_ops_bls12381_scalar_sub_cost: 10 +group_ops_bls12381_g1_sub_cost: 1550 +group_ops_bls12381_g2_sub_cost: 3019 +group_ops_bls12381_gt_sub_cost: 497 +group_ops_bls12381_scalar_mul_cost: 11 +group_ops_bls12381_g1_mul_cost: 4842 +group_ops_bls12381_g2_mul_cost: 9108 +group_ops_bls12381_gt_mul_cost: 27490 +group_ops_bls12381_scalar_div_cost: 91 +group_ops_bls12381_g1_div_cost: 5091 +group_ops_bls12381_g2_div_cost: 9206 +group_ops_bls12381_gt_div_cost: 27804 +group_ops_bls12381_g1_hash_to_base_cost: 2962 +group_ops_bls12381_g2_hash_to_base_cost: 8688 +group_ops_bls12381_g1_hash_to_cost_per_byte: 2 +group_ops_bls12381_g2_hash_to_cost_per_byte: 2 +group_ops_bls12381_g1_msm_base_cost: 62648 +group_ops_bls12381_g2_msm_base_cost: 131192 +group_ops_bls12381_g1_msm_base_cost_per_input: 1333 +group_ops_bls12381_g2_msm_base_cost_per_input: 3216 +group_ops_bls12381_msm_max_len: 32 +group_ops_bls12381_pairing_cost: 26897 +group_ops_bls12381_g1_to_uncompressed_g1_cost: 2099 +group_ops_bls12381_uncompressed_g1_to_g1_cost: 677 +group_ops_bls12381_uncompressed_g1_sum_base_cost: 77 +group_ops_bls12381_uncompressed_g1_sum_cost_per_term: 26 +group_ops_bls12381_uncompressed_g1_sum_max_terms: 1200 +hmac_hmac_sha3_256_cost_base: 52 +hmac_hmac_sha3_256_input_cost_per_byte: 2 +hmac_hmac_sha3_256_input_cost_per_block: 2 +check_zklogin_id_cost_base: 200 +check_zklogin_issuer_cost_base: 200 +bcs_per_byte_serialized_cost: 2 +bcs_legacy_min_output_size_cost: 1 +bcs_failure_cost: 52 +hash_sha2_256_base_cost: 52 +hash_sha2_256_per_byte_cost: 2 +hash_sha2_256_legacy_min_input_len_cost: 1 +hash_sha3_256_base_cost: 52 +hash_sha3_256_per_byte_cost: 2 +hash_sha3_256_legacy_min_input_len_cost: 1 +type_name_get_base_cost: 52 +type_name_get_per_byte_cost: 2 +string_check_utf8_base_cost: 52 +string_check_utf8_per_byte_cost: 2 +string_is_char_boundary_base_cost: 52 +string_sub_string_base_cost: 52 +string_sub_string_per_byte_cost: 2 +string_index_of_base_cost: 52 +string_index_of_per_byte_pattern_cost: 2 +string_index_of_per_byte_searched_cost: 2 +vector_empty_base_cost: 52 +vector_length_base_cost: 52 +vector_push_back_base_cost: 52 +vector_push_back_legacy_per_abstract_memory_unit_cost: 2 +vector_borrow_base_cost: 52 +vector_pop_back_base_cost: 52 +vector_destroy_empty_base_cost: 52 +vector_swap_base_cost: 52 +debug_print_base_cost: 52 +debug_print_stack_trace_base_cost: 52 +execution_version: 3 +consensus_bad_nodes_stake_threshold: 20 +max_jwk_votes_per_validator_per_epoch: 240 +max_age_of_jwk_in_epochs: 1 +random_beacon_reduction_allowed_delta: 800 +random_beacon_reduction_lower_bound: 500 +random_beacon_dkg_timeout_round: 3000 +random_beacon_min_round_interval_ms: 500 +random_beacon_dkg_version: 1 +consensus_max_transaction_size_bytes: 262144 +consensus_max_transactions_in_block_bytes: 524288 +consensus_max_num_transactions_in_block: 512 +consensus_voting_rounds: 40 +max_accumulated_txn_cost_per_object_in_narwhal_commit: 40 +max_deferral_rounds_for_congestion_control: 10 +max_txn_cost_overage_per_object_in_commit: 18446744073709551615 +min_checkpoint_interval_ms: 200 +checkpoint_summary_version_specific_data: 1 +max_soft_bundle_size: 5 +bridge_should_try_to_finalize_committee: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 +max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 +gas_budget_based_txn_cost_cap_factor: 400000 +gas_budget_based_txn_cost_absolute_cap_commit_count: 50 +sip_45_consensus_amplification_threshold: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap index 33132abe26e60..267565f5affea 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap @@ -110,7 +110,7 @@ max_move_object_size: 256000 max_move_package_size: 102400 max_publish_or_upgrade_per_ptb: 5 max_tx_gas: 50000000000 -max_gas_price: 1000000000000 +max_gas_price: 100000 max_gas_computation_bucket: 5000000 gas_rounding_step: 1000 max_loop_depth: 5 @@ -352,4 +352,3 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 -sip_45_k: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap new file mode 100644 index 0000000000000..5d352e02eda09 --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap @@ -0,0 +1,355 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +snapshot_kind: text +--- +version: 71 +feature_flags: + package_upgrades: true + commit_root_state_digest: true + advance_epoch_start_time_in_safe_mode: true + loaded_child_objects_fixed: true + missing_type_is_compatibility_error: true + scoring_decision_with_validity_cutoff: true + consensus_order_end_of_epoch_last: true + disallow_adding_abilities_on_upgrade: true + disable_invariant_violation_check_in_swap_loc: true + advance_to_highest_supported_protocol_version: true + ban_entry_init: true + package_digest_hash_module: true + disallow_change_struct_type_params_on_upgrade: true + no_extraneous_module_bytes: true + narwhal_versioned_metadata: true + zklogin_auth: true + consensus_transaction_ordering: ByGasPrice + simplified_unwrap_then_delete: true + upgraded_multisig_supported: true + txn_base_cost_as_multiplier: true + shared_object_deletion: true + narwhal_new_leader_election_schedule: true + loaded_child_object_format: true + enable_jwk_consensus_updates: true + end_of_epoch_transaction_supported: true + simple_conservation_checks: true + loaded_child_object_format_type: true + receive_objects: true + random_beacon: true + bridge: true + enable_effects_v2: true + narwhal_certificate_v2: true + verify_legacy_zklogin_address: true + recompute_has_public_transfer_in_execution: true + accept_zklogin_in_multisig: true + include_consensus_digest_in_prologue: true + hardened_otw_check: true + allow_receiving_object_id: true + enable_poseidon: true + enable_coin_deny_list: true + enable_group_ops_native_functions: true + enable_group_ops_native_function_msm: true + reject_mutable_random_on_entry_functions: true + per_object_congestion_control_mode: TotalGasBudgetWithCap + consensus_choice: Mysticeti + consensus_network: Tonic + zklogin_max_epoch_upper_bound_delta: 30 + mysticeti_leader_scoring_and_schedule: true + reshare_at_same_initial_version: true + resolve_abort_locations_to_package_id: true + mysticeti_use_committed_subdag_digest: true + enable_vdf: true + record_consensus_determined_version_assignments_in_prologue: true + fresh_vm_on_framework_upgrade: true + prepend_prologue_tx_in_consensus_commit_in_checkpoints: true + mysticeti_num_leaders_per_round: 1 + soft_bundle: true + enable_coin_deny_list_v2: true + passkey_auth: true + authority_capabilities_v2: true + rethrow_serialization_type_layout_errors: true + consensus_distributed_vote_scoring_strategy: true + consensus_round_prober: true + validate_identifier_inputs: true + mysticeti_fastpath: true + relocate_event_module: true + uncompressed_g1_group_elements: true + disallow_new_modules_in_deps_only_packages: true + consensus_smart_ancestor_selection: true + consensus_round_prober_probe_accepted_rounds: true + native_charging_v2: true +max_tx_size_bytes: 131072 +max_input_objects: 2048 +max_size_written_objects: 5000000 +max_size_written_objects_system_tx: 50000000 +max_serialized_tx_effects_size_bytes: 524288 +max_serialized_tx_effects_size_bytes_system_tx: 8388608 +max_gas_payment_objects: 256 +max_modules_in_publish: 64 +max_package_dependencies: 32 +max_arguments: 512 +max_type_arguments: 16 +max_type_argument_depth: 16 +max_pure_argument_size: 16384 +max_programmable_tx_commands: 1024 +move_binary_format_version: 7 +min_move_binary_format_version: 6 +binary_module_handles: 100 +binary_struct_handles: 300 +binary_function_handles: 1500 +binary_function_instantiations: 750 +binary_signatures: 1000 +binary_constant_pool: 4000 +binary_identifiers: 10000 +binary_address_identifiers: 100 +binary_struct_defs: 200 +binary_struct_def_instantiations: 100 +binary_function_defs: 1000 +binary_field_handles: 500 +binary_field_instantiations: 250 +binary_friend_decls: 100 +max_move_object_size: 256000 +max_move_package_size: 102400 +max_publish_or_upgrade_per_ptb: 5 +max_tx_gas: 50000000000 +max_gas_price: 1000000000000 +max_gas_computation_bucket: 5000000 +gas_rounding_step: 1000 +max_loop_depth: 5 +max_generic_instantiation_length: 32 +max_function_parameters: 128 +max_basic_blocks: 1024 +max_value_stack_size: 1024 +max_type_nodes: 256 +max_push_size: 10000 +max_struct_definitions: 200 +max_function_definitions: 1000 +max_fields_in_struct: 32 +max_dependency_depth: 100 +max_num_event_emit: 1024 +max_num_new_move_object_ids: 2048 +max_num_new_move_object_ids_system_tx: 32768 +max_num_deleted_move_object_ids: 2048 +max_num_deleted_move_object_ids_system_tx: 32768 +max_num_transferred_move_object_ids: 2048 +max_num_transferred_move_object_ids_system_tx: 32768 +max_event_emit_size: 256000 +max_event_emit_size_total: 65536000 +max_move_vector_len: 262144 +max_move_identifier_len: 128 +max_move_value_depth: 128 +max_back_edges_per_function: 10000 +max_back_edges_per_module: 10000 +max_verifier_meter_ticks_per_function: 16000000 +max_meter_ticks_per_module: 16000000 +max_meter_ticks_per_package: 16000000 +object_runtime_max_num_cached_objects: 1000 +object_runtime_max_num_cached_objects_system_tx: 16000 +object_runtime_max_num_store_entries: 1000 +object_runtime_max_num_store_entries_system_tx: 16000 +base_tx_cost_fixed: 1000 +package_publish_cost_fixed: 1000 +base_tx_cost_per_byte: 0 +package_publish_cost_per_byte: 80 +obj_access_cost_read_per_byte: 15 +obj_access_cost_mutate_per_byte: 40 +obj_access_cost_delete_per_byte: 40 +obj_access_cost_verify_per_byte: 200 +max_type_to_layout_nodes: 512 +gas_model_version: 9 +obj_data_cost_refundable: 100 +obj_metadata_cost_non_refundable: 50 +storage_rebate_rate: 9900 +storage_fund_reinvest_rate: 500 +reward_slashing_rate: 10000 +storage_gas_price: 76 +max_transactions_per_checkpoint: 10000 +max_checkpoint_size_bytes: 31457280 +buffer_stake_for_protocol_upgrade_bps: 5000 +address_from_bytes_cost_base: 52 +address_to_u256_cost_base: 52 +address_from_u256_cost_base: 52 +config_read_setting_impl_cost_base: 100 +config_read_setting_impl_cost_per_byte: 40 +dynamic_field_hash_type_and_key_cost_base: 100 +dynamic_field_hash_type_and_key_type_cost_per_byte: 2 +dynamic_field_hash_type_and_key_value_cost_per_byte: 2 +dynamic_field_hash_type_and_key_type_tag_cost_per_byte: 2 +dynamic_field_add_child_object_cost_base: 100 +dynamic_field_add_child_object_type_cost_per_byte: 10 +dynamic_field_add_child_object_value_cost_per_byte: 10 +dynamic_field_add_child_object_struct_tag_cost_per_byte: 10 +dynamic_field_borrow_child_object_cost_base: 100 +dynamic_field_borrow_child_object_child_ref_cost_per_byte: 10 +dynamic_field_borrow_child_object_type_cost_per_byte: 10 +dynamic_field_remove_child_object_cost_base: 100 +dynamic_field_remove_child_object_child_cost_per_byte: 2 +dynamic_field_remove_child_object_type_cost_per_byte: 2 +dynamic_field_has_child_object_cost_base: 100 +dynamic_field_has_child_object_with_ty_cost_base: 100 +dynamic_field_has_child_object_with_ty_type_cost_per_byte: 2 +dynamic_field_has_child_object_with_ty_type_tag_cost_per_byte: 2 +event_emit_cost_base: 52 +event_emit_value_size_derivation_cost_per_byte: 2 +event_emit_tag_size_derivation_cost_per_byte: 5 +event_emit_output_cost_per_byte: 10 +object_borrow_uid_cost_base: 52 +object_delete_impl_cost_base: 52 +object_record_new_uid_cost_base: 52 +transfer_transfer_internal_cost_base: 52 +transfer_freeze_object_cost_base: 52 +transfer_share_object_cost_base: 52 +transfer_receive_object_cost_base: 52 +tx_context_derive_id_cost_base: 52 +types_is_one_time_witness_cost_base: 52 +types_is_one_time_witness_type_tag_cost_per_byte: 2 +types_is_one_time_witness_type_cost_per_byte: 2 +validator_validate_metadata_cost_base: 20000 +validator_validate_metadata_data_cost_per_byte: 2 +crypto_invalid_arguments_cost: 100 +bls12381_bls12381_min_sig_verify_cost_base: 44064 +bls12381_bls12381_min_sig_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_sig_verify_msg_cost_per_block: 2 +bls12381_bls12381_min_pk_verify_cost_base: 49282 +bls12381_bls12381_min_pk_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_pk_verify_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_keccak256_cost_base: 500 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_sha256_cost_base: 500 +ecdsa_k1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_k1_decompress_pubkey_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_cost_base: 1470 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_k1_secp256k1_verify_sha256_cost_base: 1470 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_keccak256_cost_base: 1173 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_sha256_cost_base: 1173 +ecdsa_r1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_keccak256_cost_base: 4225 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_sha256_cost_base: 4225 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_block: 2 +ecvrf_ecvrf_verify_cost_base: 4848 +ecvrf_ecvrf_verify_alpha_string_cost_per_byte: 2 +ecvrf_ecvrf_verify_alpha_string_cost_per_block: 2 +ed25519_ed25519_verify_cost_base: 1802 +ed25519_ed25519_verify_msg_cost_per_byte: 2 +ed25519_ed25519_verify_msg_cost_per_block: 2 +groth16_prepare_verifying_key_bls12381_cost_base: 53838 +groth16_prepare_verifying_key_bn254_cost_base: 82010 +groth16_verify_groth16_proof_internal_bls12381_cost_base: 72090 +groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input: 8213 +groth16_verify_groth16_proof_internal_bn254_cost_base: 115502 +groth16_verify_groth16_proof_internal_bn254_cost_per_public_input: 9484 +groth16_verify_groth16_proof_internal_public_input_cost_per_byte: 2 +hash_blake2b256_cost_base: 10 +hash_blake2b256_data_cost_per_byte: 2 +hash_blake2b256_data_cost_per_block: 2 +hash_keccak256_cost_base: 10 +hash_keccak256_data_cost_per_byte: 2 +hash_keccak256_data_cost_per_block: 2 +poseidon_bn254_cost_base: 260 +poseidon_bn254_cost_per_block: 388 +group_ops_bls12381_decode_scalar_cost: 7 +group_ops_bls12381_decode_g1_cost: 2848 +group_ops_bls12381_decode_g2_cost: 3770 +group_ops_bls12381_decode_gt_cost: 3068 +group_ops_bls12381_scalar_add_cost: 10 +group_ops_bls12381_g1_add_cost: 1556 +group_ops_bls12381_g2_add_cost: 3048 +group_ops_bls12381_gt_add_cost: 188 +group_ops_bls12381_scalar_sub_cost: 10 +group_ops_bls12381_g1_sub_cost: 1550 +group_ops_bls12381_g2_sub_cost: 3019 +group_ops_bls12381_gt_sub_cost: 497 +group_ops_bls12381_scalar_mul_cost: 11 +group_ops_bls12381_g1_mul_cost: 4842 +group_ops_bls12381_g2_mul_cost: 9108 +group_ops_bls12381_gt_mul_cost: 27490 +group_ops_bls12381_scalar_div_cost: 91 +group_ops_bls12381_g1_div_cost: 5091 +group_ops_bls12381_g2_div_cost: 9206 +group_ops_bls12381_gt_div_cost: 27804 +group_ops_bls12381_g1_hash_to_base_cost: 2962 +group_ops_bls12381_g2_hash_to_base_cost: 8688 +group_ops_bls12381_g1_hash_to_cost_per_byte: 2 +group_ops_bls12381_g2_hash_to_cost_per_byte: 2 +group_ops_bls12381_g1_msm_base_cost: 62648 +group_ops_bls12381_g2_msm_base_cost: 131192 +group_ops_bls12381_g1_msm_base_cost_per_input: 1333 +group_ops_bls12381_g2_msm_base_cost_per_input: 3216 +group_ops_bls12381_msm_max_len: 32 +group_ops_bls12381_pairing_cost: 26897 +group_ops_bls12381_g1_to_uncompressed_g1_cost: 2099 +group_ops_bls12381_uncompressed_g1_to_g1_cost: 677 +group_ops_bls12381_uncompressed_g1_sum_base_cost: 77 +group_ops_bls12381_uncompressed_g1_sum_cost_per_term: 26 +group_ops_bls12381_uncompressed_g1_sum_max_terms: 1200 +hmac_hmac_sha3_256_cost_base: 52 +hmac_hmac_sha3_256_input_cost_per_byte: 2 +hmac_hmac_sha3_256_input_cost_per_block: 2 +check_zklogin_id_cost_base: 200 +check_zklogin_issuer_cost_base: 200 +vdf_verify_vdf_cost: 1500 +vdf_hash_to_input_cost: 100 +bcs_per_byte_serialized_cost: 2 +bcs_legacy_min_output_size_cost: 1 +bcs_failure_cost: 52 +hash_sha2_256_base_cost: 52 +hash_sha2_256_per_byte_cost: 2 +hash_sha2_256_legacy_min_input_len_cost: 1 +hash_sha3_256_base_cost: 52 +hash_sha3_256_per_byte_cost: 2 +hash_sha3_256_legacy_min_input_len_cost: 1 +type_name_get_base_cost: 52 +type_name_get_per_byte_cost: 2 +string_check_utf8_base_cost: 52 +string_check_utf8_per_byte_cost: 2 +string_is_char_boundary_base_cost: 52 +string_sub_string_base_cost: 52 +string_sub_string_per_byte_cost: 2 +string_index_of_base_cost: 52 +string_index_of_per_byte_pattern_cost: 2 +string_index_of_per_byte_searched_cost: 2 +vector_empty_base_cost: 52 +vector_length_base_cost: 52 +vector_push_back_base_cost: 52 +vector_push_back_legacy_per_abstract_memory_unit_cost: 2 +vector_borrow_base_cost: 52 +vector_pop_back_base_cost: 52 +vector_destroy_empty_base_cost: 52 +vector_swap_base_cost: 52 +debug_print_base_cost: 52 +debug_print_stack_trace_base_cost: 52 +execution_version: 3 +consensus_bad_nodes_stake_threshold: 20 +max_jwk_votes_per_validator_per_epoch: 240 +max_age_of_jwk_in_epochs: 1 +random_beacon_reduction_allowed_delta: 800 +random_beacon_reduction_lower_bound: 500 +random_beacon_dkg_timeout_round: 3000 +random_beacon_min_round_interval_ms: 500 +random_beacon_dkg_version: 1 +consensus_max_transaction_size_bytes: 262144 +consensus_max_transactions_in_block_bytes: 524288 +consensus_max_num_transactions_in_block: 512 +consensus_voting_rounds: 40 +max_accumulated_txn_cost_per_object_in_narwhal_commit: 40 +max_deferral_rounds_for_congestion_control: 10 +max_txn_cost_overage_per_object_in_commit: 18446744073709551615 +min_checkpoint_interval_ms: 200 +checkpoint_summary_version_specific_data: 1 +max_soft_bundle_size: 5 +bridge_should_try_to_finalize_committee: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 +max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 +gas_budget_based_txn_cost_cap_factor: 400000 +gas_budget_based_txn_cost_absolute_cap_commit_count: 50 +sip_45_consensus_amplification_threshold: 5 From 36a44a291c3ebbb429e5c72253283ec262bf99f8 Mon Sep 17 00:00:00 2001 From: Mingwei Tian Date: Sat, 28 Dec 2024 11:28:55 -0800 Subject: [PATCH 4/7] fix snapshot errors --- crates/sui-core/src/consensus_adapter.rs | 5 +-- crates/sui-open-rpc/spec/openrpc.json | 3 +- ...ocol_config__test__Mainnet_version_70.snap | 2 +- ...ocol_config__test__Testnet_version_70.snap | 2 +- ...sui_protocol_config__test__version_70.snap | 2 +- ...ests__genesis_config_snapshot_matches.snap | 3 +- ..._populated_genesis_snapshot_matches-2.snap | 31 +++++++++---------- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/crates/sui-core/src/consensus_adapter.rs b/crates/sui-core/src/consensus_adapter.rs index 7d22fa338622d..e831179825bf3 100644 --- a/crates/sui-core/src/consensus_adapter.rs +++ b/crates/sui-core/src/consensus_adapter.rs @@ -391,8 +391,9 @@ impl ConsensusAdapter { .protocol_config() .sip_45_consensus_amplification_threshold_as_option() .unwrap_or(u64::MAX); - let multipler = gas_price / epoch_store.reference_gas_price(); - amplification_factor = if multipler >= k { multipler } else { 0 }; + let multiplier = + gas_price / std::cmp::max(epoch_store.reference_gas_price(), 1); + amplification_factor = if multiplier >= k { multiplier } else { 0 }; self.await_submit_delay_user_transaction( epoch_store.committee(), digest, diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 025b5e64aa977..091641a0dd37e 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -1294,7 +1294,7 @@ "name": "Result", "value": { "minSupportedProtocolVersion": "1", - "maxSupportedProtocolVersion": "70", + "maxSupportedProtocolVersion": "71", "protocolVersion": "6", "featureFlags": { "accept_zklogin_in_multisig": false, @@ -1903,6 +1903,7 @@ "reward_slashing_rate": { "u64": "10000" }, + "sip_45_consensus_amplification_threshold": null, "storage_fund_reinvest_rate": { "u64": "500" }, diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap index 32b26d798d5ac..bdbdf0df72acb 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_70.snap @@ -1,7 +1,6 @@ --- source: crates/sui-protocol-config/src/lib.rs expression: "ProtocolConfig::get_for_version(cur, *chain_id)" -snapshot_kind: text --- version: 70 feature_flags: @@ -340,3 +339,4 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap index 5ece9e9fd6baa..80a180c7d6200 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_70.snap @@ -1,7 +1,6 @@ --- source: crates/sui-protocol-config/src/lib.rs expression: "ProtocolConfig::get_for_version(cur, *chain_id)" -snapshot_kind: text --- version: 70 feature_flags: @@ -343,3 +342,4 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap index 267565f5affea..be386a34a2d68 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_70.snap @@ -1,7 +1,6 @@ --- source: crates/sui-protocol-config/src/lib.rs expression: "ProtocolConfig::get_for_version(cur, *chain_id)" -snapshot_kind: text --- version: 70 feature_flags: @@ -352,3 +351,4 @@ max_accumulated_txn_cost_per_object_in_mysticeti_commit: 18500000 max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000 gas_budget_based_txn_cost_cap_factor: 400000 gas_budget_based_txn_cost_absolute_cap_commit_count: 50 + diff --git a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__genesis_config_snapshot_matches.snap b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__genesis_config_snapshot_matches.snap index 5ef4629fd2567..c0f72853b5f6b 100644 --- a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__genesis_config_snapshot_matches.snap +++ b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__genesis_config_snapshot_matches.snap @@ -6,7 +6,7 @@ ssfn_config_info: ~ validator_config_info: ~ parameters: chain_start_timestamp_ms: 0 - protocol_version: 70 + protocol_version: 71 allow_insertion_of_extra_objects: true epoch_duration_ms: 86400000 stake_subsidy_start_epoch: 0 @@ -49,4 +49,3 @@ accounts: - 30000000000000000 - 30000000000000000 - 30000000000000000 - diff --git a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap index 465c0e7b34ebe..3fa9e4e3330b7 100644 --- a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap +++ b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap @@ -3,7 +3,7 @@ source: crates/sui-swarm-config/tests/snapshot_tests.rs expression: genesis.sui_system_object().into_genesis_version_for_tooling() --- epoch: 0 -protocol_version: 70 +protocol_version: 71 system_state_version: 1 validators: total_stake: 20000000000000000 @@ -240,13 +240,13 @@ validators: next_epoch_worker_address: ~ extra_fields: id: - id: "0xd336ec43763c7e6cb1a58af9e463220f7f28afb4bf5ac683e53c87ffe1df0a4c" + id: "0xcd6cf436267d64b2b5ba20c633881d1a6c7b6a9b006e8c93838e6e912da3b64b" size: 0 voting_power: 10000 - operation_cap_id: "0x8dab96e36a4870498181e5f793537a9430944acddf495603c6afa93cc37f3889" + operation_cap_id: "0x92be09c8cf0a9e736a39695425de68e60aab91363695c30237efa54fc8f10b0b" gas_price: 1000 staking_pool: - id: "0x131722dffbbebd704bf861887766f9b11b8ff4ae88e014b1d343eee977d3b4bc" + id: "0x5b08312cc36eb96d4ac2abb863f58c4ac610944e31a70c631e8dac5025ff3d96" activation_epoch: 0 deactivation_epoch: ~ sui_balance: 20000000000000000 @@ -254,14 +254,14 @@ validators: value: 0 pool_token_balance: 20000000000000000 exchange_rates: - id: "0x87e0379fe286c022d350f16878363aa19706f483aabf4d5b28cbe64b737bfbb9" + id: "0xf5ea2d403686a71778606c202944e3ece8834fd694b4d416ded5e2571c043d1f" size: 1 pending_stake: 0 pending_total_sui_withdraw: 0 pending_pool_token_withdraw: 0 extra_fields: id: - id: "0x4391b75bfd492755194154168d934d80fce1c2b661b08de7eee4c353ab2c2302" + id: "0xf93072985e12f9464c80f005a37b485e0e286760593b5f467e7e2fe0bfec362e" size: 0 commission_rate: 200 next_epoch_stake: 20000000000000000 @@ -269,27 +269,27 @@ validators: next_epoch_commission_rate: 200 extra_fields: id: - id: "0x152af272a7a45cc3216bc6355b7dcfd0e4ed47271b4821d4af3566fb87e957fd" + id: "0x8d5ea4c7ecfaf945debd1b29d70fd8c8b46ce0393d945f68b41426bd4d38e66f" size: 0 pending_active_validators: contents: - id: "0xa0aa2ed79148441eba1d8cf0c080a6136a55376c58e9451b4c5a2507d49e2f80" + id: "0x0dead6a70ff01bf106a635d38305ccac21fa0c76ce61c7f856a8a22a57afd10a" size: 0 pending_removals: [] staking_pool_mappings: - id: "0xb31a46b712d3bce7378b42f74d5514b46d2d5532a267dad65d6627b638acd908" + id: "0x3032fd3aad31839c2ae398adf6e8c2d004a90559f42ce019de8e8325e853cfe4" size: 1 inactive_validators: - id: "0x10b278cfadb57996d8c63c0c15c1aa9656d3ff2e0c6384fdc006b6a9b5a37597" + id: "0x8a5b3d8b3bd756e6f7255df5ceec12332997dac4ccda2fc7a161223a6f8b8318" size: 0 validator_candidates: - id: "0x4f013d2a81f8c361a9411df03397dc5cdae04023c68fe2b15a1334cc7fab78c4" + id: "0x9116819fa6532cc674171d989ef96e1ab4a08b1750fdd77b7da6124d6b2f1344" size: 0 at_risk_validators: contents: [] extra_fields: id: - id: "0xd8d77e98c2913975291b41b79954b1f679f0193ddecde2158b6fd899ebecf93d" + id: "0x28d3c4849301bb825be9c8bd2479020915a97e8959482bd18b2e34e6a35f9304" size: 0 storage_fund: total_object_storage_rebates: @@ -306,7 +306,7 @@ parameters: validator_low_stake_grace_period: 7 extra_fields: id: - id: "0x6dd6b96ea34c02dc9ca19574bd3689c7680b7910a34ace35b5960d62b2f89f24" + id: "0x642a5340b910c058025d03bb71d18a6bfb175627ec384b409107fe36c7ac5294" size: 0 reference_gas_price: 1000 validator_report_records: @@ -320,7 +320,7 @@ stake_subsidy: stake_subsidy_decrease_rate: 1000 extra_fields: id: - id: "0xf6c77f67f7f190260b807bbcaef13dc3a4054fb7f85927c969d5b0d50c162c23" + id: "0x4d35369e7cd2fafae28fe50468fdc4e3b89a02cd4f9fe7ef5764770fb2a84106" size: 0 safe_mode: false safe_mode_storage_rewards: @@ -332,6 +332,5 @@ safe_mode_non_refundable_storage_fee: 0 epoch_start_timestamp_ms: 10 extra_fields: id: - id: "0xa2545fec3666cb6bbd9099d52f2e461d4d679511ed481f8a95f4c99bfbaaf6dd" + id: "0xc772e5006729cabf62b9598a8bbf168820bf2f175287dd55fb87bb9de12f01a6" size: 0 - From 06ae3148c899a84501ae192b4d71ac8dd091f002 Mon Sep 17 00:00:00 2001 From: Mingwei Tian Date: Sat, 28 Dec 2024 16:23:55 -0800 Subject: [PATCH 5/7] fix txn fuzz tests --- .../src/account_universe/transfer_gen.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs b/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs index b98569b597c85..917dee1ba6854 100644 --- a/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs +++ b/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs @@ -469,22 +469,24 @@ impl AUTransactionGen for P2PTransferGenRandomGasRandomPriceRandomSponsorship { max_gas_price: PROTOCOL_CONFIG.max_gas_price(), }, }), + // NOTE: at protocol version 71, gas budget can be both too high and too low. + // So the variants here need to be ordered same as the checks in gas_v2.rs RunInfo { - gas_budget_too_low: true, + gas_budget_too_high: true, .. } => Err(SuiError::UserInputError { - error: UserInputError::GasBudgetTooLow { + error: UserInputError::GasBudgetTooHigh { gas_budget: self.gas, - min_budget: PROTOCOL_CONFIG.base_tx_cost_fixed() * self.gas_price, + max_budget: PROTOCOL_CONFIG.max_tx_gas(), }, }), RunInfo { - gas_budget_too_high: true, + gas_budget_too_low: true, .. } => Err(SuiError::UserInputError { - error: UserInputError::GasBudgetTooHigh { + error: UserInputError::GasBudgetTooLow { gas_budget: self.gas, - max_budget: PROTOCOL_CONFIG.max_tx_gas(), + min_budget: PROTOCOL_CONFIG.base_tx_cost_fixed() * self.gas_price, }, }), RunInfo { From fa6065c79e0364511c5a89cb3eb476c466f7432f Mon Sep 17 00:00:00 2001 From: Shio Coder Date: Tue, 31 Dec 2024 08:17:46 +0800 Subject: [PATCH 6/7] Remove max gas price change --- crates/sui-protocol-config/src/lib.rs | 6 +----- .../sui_protocol_config__test__Testnet_version_71.snap | 2 +- .../snapshots/sui_protocol_config__test__version_71.snap | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 50eb2421431b3..12eeda60cb939 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -203,7 +203,7 @@ const MAX_PROTOCOL_VERSION: u64 = 71; // Add new gas model version to update charging of native functions. // Add std::uq64_64 module to Move stdlib. // Improve gas/wall time efficiency of some Move stdlib vector functions -// Version 71: [SIP-45] Increase max gas price to 1T. Enable consensus amplification. +// Version 71: [SIP-45] Enable consensus amplification. #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -3092,10 +3092,6 @@ impl ProtocolConfig { cfg.validator_validate_metadata_cost_base = Some(20000); } 71 => { - if chain != Chain::Mainnet { - // [SIP-45] Set max gas price to 1T. - cfg.max_gas_price = Some(1_000_000_000_000); - } cfg.sip_45_consensus_amplification_threshold = Some(5); } // Use this template when making changes: diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap index 4ed35e18c0072..f991ccca7c4de 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_71.snap @@ -104,7 +104,7 @@ max_move_object_size: 256000 max_move_package_size: 102400 max_publish_or_upgrade_per_ptb: 5 max_tx_gas: 50000000000 -max_gas_price: 1000000000000 +max_gas_price: 100000 max_gas_computation_bucket: 5000000 gas_rounding_step: 1000 max_loop_depth: 5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap index 5d352e02eda09..c64bf5b86add9 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_71.snap @@ -110,7 +110,7 @@ max_move_object_size: 256000 max_move_package_size: 102400 max_publish_or_upgrade_per_ptb: 5 max_tx_gas: 50000000000 -max_gas_price: 1000000000000 +max_gas_price: 100000 max_gas_computation_bucket: 5000000 gas_rounding_step: 1000 max_loop_depth: 5 From 1e93d7a8b932fa24e85d1371e11dbd46690c60bd Mon Sep 17 00:00:00 2001 From: Mingwei Tian Date: Mon, 30 Dec 2024 20:59:25 -0800 Subject: [PATCH 7/7] revert txn fuzzer test change --- .../src/account_universe/transfer_gen.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs b/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs index 917dee1ba6854..b98569b597c85 100644 --- a/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs +++ b/crates/transaction-fuzzer/src/account_universe/transfer_gen.rs @@ -469,24 +469,22 @@ impl AUTransactionGen for P2PTransferGenRandomGasRandomPriceRandomSponsorship { max_gas_price: PROTOCOL_CONFIG.max_gas_price(), }, }), - // NOTE: at protocol version 71, gas budget can be both too high and too low. - // So the variants here need to be ordered same as the checks in gas_v2.rs RunInfo { - gas_budget_too_high: true, + gas_budget_too_low: true, .. } => Err(SuiError::UserInputError { - error: UserInputError::GasBudgetTooHigh { + error: UserInputError::GasBudgetTooLow { gas_budget: self.gas, - max_budget: PROTOCOL_CONFIG.max_tx_gas(), + min_budget: PROTOCOL_CONFIG.base_tx_cost_fixed() * self.gas_price, }, }), RunInfo { - gas_budget_too_low: true, + gas_budget_too_high: true, .. } => Err(SuiError::UserInputError { - error: UserInputError::GasBudgetTooLow { + error: UserInputError::GasBudgetTooHigh { gas_budget: self.gas, - min_budget: PROTOCOL_CONFIG.base_tx_cost_fixed() * self.gas_price, + max_budget: PROTOCOL_CONFIG.max_tx_gas(), }, }), RunInfo {