Skip to content

Commit

Permalink
[bridge] [cheerypick to 1.32] enable bridge on mainnet (#19199)
Browse files Browse the repository at this point in the history
## Description 

enable bridge creation on mainnet by setting `bridge` is true. Before
this change, the value true for testnet and devnet, but not mainnet. So
this only applies to mainnet.


## Test plan 

it creates a new version 56 and enables bridge feature flag on mainnet.
This change creates
*
[sui_protocol_config__test__Mainnet_version_56.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_56.snap)
and
*
[sui_protocol_config__test__Testnet_version_56.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_56.snap)

and it does NOT change
*
[sui_protocol_config__test__Testnet_version_55.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_55.snap)
and

[sui_protocol_config__test__Mainnet_version_55.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_55.snap)

I did the following checks:
*
[sui_protocol_config__test__Mainnet_version_56.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_56.snap)
is different from existing
[sui_protocol_config__test__Mainnet_version_55.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_55.snap)
for bridge: [diff](https://www.diffchecker.com/50VcWjj8/)
*
[sui_protocol_config__test__Testnet_version_56.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_56.snap)
and
[sui_protocol_config__test__Testnet_version_55.snap](https://github.com/MystenLabs/sui/blob/4b2e1ab739cee34e4075717b52766eb3a07946df/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_55.snap)
are the same: [diff](https://www.diffchecker.com/6NbvoYmk/)

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [x] Protocol: 
- [x] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
longbowlu committed Sep 3, 2024
1 parent 32e55c6 commit a5eab1a
Show file tree
Hide file tree
Showing 7 changed files with 1,006 additions and 18 deletions.
2 changes: 1 addition & 1 deletion crates/sui-open-rpc/spec/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@
"name": "Result",
"value": {
"minSupportedProtocolVersion": "1",
"maxSupportedProtocolVersion": "55",
"maxSupportedProtocolVersion": "56",
"protocolVersion": "6",
"featureFlags": {
"accept_zklogin_in_multisig": false,
Expand Down
8 changes: 7 additions & 1 deletion crates/sui-protocol-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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 = 55;
const MAX_PROTOCOL_VERSION: u64 = 56;

// Record history of protocol version allocations here:
//
Expand Down Expand Up @@ -169,6 +169,7 @@ const MAX_PROTOCOL_VERSION: u64 = 55;
// Enable soft bundle on mainnet.
// Version 55: Enable enums on mainnet.
// Rethrow serialization type layout errors instead of converting them.
// Version 56: Enable bridge on mainnet.

#[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub struct ProtocolVersion(u64);
Expand Down Expand Up @@ -2683,6 +2684,11 @@ impl ProtocolConfig {

cfg.feature_flags.rethrow_serialization_type_layout_errors = true;
}
56 => {
if chain == Chain::Mainnet {
cfg.feature_flags.bridge = true;
}
}
// Use this template when making changes:
//
// // modify an existing constant.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
---
source: crates/sui-protocol-config/src/lib.rs
expression: "ProtocolConfig::get_for_version(cur, *chain_id)"
---
version: 56
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: TotalTxCount
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
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
gas_model_version: 8
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: 52
validator_validate_metadata_data_cost_per_byte: 2
crypto_invalid_arguments_cost: 100
bls12381_bls12381_min_sig_verify_cost_base: 52
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: 52
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: 52
ecdsa_k1_ecrecover_keccak256_msg_cost_per_byte: 2
ecdsa_k1_ecrecover_keccak256_msg_cost_per_block: 2
ecdsa_k1_ecrecover_sha256_cost_base: 52
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: 52
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: 52
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: 52
ecdsa_r1_ecrecover_keccak256_msg_cost_per_byte: 2
ecdsa_r1_ecrecover_keccak256_msg_cost_per_block: 2
ecdsa_r1_ecrecover_sha256_cost_base: 52
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: 52
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: 52
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: 52
ecvrf_ecvrf_verify_alpha_string_cost_per_byte: 2
ecvrf_ecvrf_verify_alpha_string_cost_per_block: 2
ed25519_ed25519_verify_cost_base: 52
ed25519_ed25519_verify_msg_cost_per_byte: 2
ed25519_ed25519_verify_msg_cost_per_block: 2
groth16_prepare_verifying_key_bls12381_cost_base: 52
groth16_prepare_verifying_key_bn254_cost_base: 52
groth16_verify_groth16_proof_internal_bls12381_cost_base: 52
groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input: 2
groth16_verify_groth16_proof_internal_bn254_cost_base: 52
groth16_verify_groth16_proof_internal_bn254_cost_per_public_input: 2
groth16_verify_groth16_proof_internal_public_input_cost_per_byte: 2
hash_blake2b256_cost_base: 52
hash_blake2b256_data_cost_per_byte: 2
hash_blake2b256_data_cost_per_block: 2
hash_keccak256_cost_base: 52
hash_keccak256_data_cost_per_byte: 2
hash_keccak256_data_cost_per_block: 2
group_ops_bls12381_decode_scalar_cost: 52
group_ops_bls12381_decode_g1_cost: 52
group_ops_bls12381_decode_g2_cost: 52
group_ops_bls12381_decode_gt_cost: 52
group_ops_bls12381_scalar_add_cost: 52
group_ops_bls12381_g1_add_cost: 52
group_ops_bls12381_g2_add_cost: 52
group_ops_bls12381_gt_add_cost: 52
group_ops_bls12381_scalar_sub_cost: 52
group_ops_bls12381_g1_sub_cost: 52
group_ops_bls12381_g2_sub_cost: 52
group_ops_bls12381_gt_sub_cost: 52
group_ops_bls12381_scalar_mul_cost: 52
group_ops_bls12381_g1_mul_cost: 52
group_ops_bls12381_g2_mul_cost: 52
group_ops_bls12381_gt_mul_cost: 52
group_ops_bls12381_scalar_div_cost: 52
group_ops_bls12381_g1_div_cost: 52
group_ops_bls12381_g2_div_cost: 52
group_ops_bls12381_gt_div_cost: 52
group_ops_bls12381_g1_hash_to_base_cost: 52
group_ops_bls12381_g2_hash_to_base_cost: 52
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: 52
group_ops_bls12381_g2_msm_base_cost: 52
group_ops_bls12381_g1_msm_base_cost_per_input: 52
group_ops_bls12381_g2_msm_base_cost_per_input: 52
group_ops_bls12381_msm_max_len: 32
group_ops_bls12381_pairing_cost: 52
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: 1000
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
max_accumulated_txn_cost_per_object_in_narwhal_commit: 100
max_deferral_rounds_for_congestion_control: 10
min_checkpoint_interval_ms: 200
checkpoint_summary_version_specific_data: 1
max_soft_bundle_size: 5
bridge_should_try_to_finalize_committee: false
max_accumulated_txn_cost_per_object_in_mysticeti_commit: 10

Loading

0 comments on commit a5eab1a

Please sign in to comment.