diff --git a/.config/hakari.toml b/.config/hakari.toml new file mode 100644 index 0000000000000..ae33c8d16be19 --- /dev/null +++ b/.config/hakari.toml @@ -0,0 +1,28 @@ +# This file contains settings for `cargo hakari`. +# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options. + +# Right now we're only using hakari in a sort of hybrid manually managed mode +# to enforce that rocksdb is built only a single time in the workspace +hakari-package = "typed-store-workspace-hack" + +# Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above. +dep-format-version = "4" + +# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended. +# Hakari works much better with the new feature resolver. +# For more about the new feature resolver, see: +# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver +resolver = "2" + +# Add triples corresponding to platforms commonly used by developers here. +# https://doc.rust-lang.org/rustc/platform-support.html +platforms = [ + "x86_64-unknown-linux-gnu", + "x86_64-apple-darwin", + # "x86_64-pc-windows-msvc", +] + +# Write out exact versions rather than a semver range. (Defaults to false.) +# exact-versions = true +output-single-feature = true +unify-target-host = "unify-if-both" diff --git a/Cargo.lock b/Cargo.lock index b6c1a36f55377..d333734b1fd18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,9 +262,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -277,36 +277,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2232,9 +2232,9 @@ dependencies = [ [[package]] name = "bigdecimal" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" +checksum = "8f850665a0385e070b64c38d2354e6c104c8479c59868d1e48a0c13ee2c7a1c1" dependencies = [ "autocfg", "libm", @@ -2251,7 +2251,7 @@ checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bin-version" -version = "1.36.1" +version = "1.36.2" dependencies = [ "const-str", "git-version", @@ -3216,9 +3216,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -7268,9 +7268,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" +checksum = "a1f72d3e19488cf7d8ea52d2fc0f8754fc933398b337cd3cbdb28aaeb35159ef" dependencies = [ "console", "lazy_static", @@ -7872,9 +7872,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "a00419de735aac21d53b0de5ce2c03bd3627277cf471300f27ebc89f7d828047" [[package]] name = "libquickjs-sys" @@ -11170,18 +11170,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2 1.0.89", "quote 1.0.37", @@ -11190,9 +11190,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -12225,9 +12225,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -12896,9 +12896,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno", @@ -14244,7 +14244,7 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "sui" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anemo", "anyhow", @@ -14458,7 +14458,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "arrow 52.2.0", @@ -14510,7 +14510,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer-derive" -version = "1.36.1" +version = "1.36.2" dependencies = [ "proc-macro2 1.0.89", "quote 1.0.37", @@ -14519,7 +14519,7 @@ dependencies = [ [[package]] name = "sui-archival" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "byteorder", @@ -14644,7 +14644,7 @@ dependencies = [ [[package]] name = "sui-bridge" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "arc-swap", @@ -14694,7 +14694,7 @@ dependencies = [ [[package]] name = "sui-bridge-cli" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "clap", @@ -14774,7 +14774,7 @@ dependencies = [ [[package]] name = "sui-cluster-test" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-trait", @@ -14967,7 +14967,7 @@ dependencies = [ [[package]] name = "sui-data-ingestion" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-trait", @@ -15063,7 +15063,7 @@ dependencies = [ [[package]] name = "sui-e2e-tests" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "assert_cmd", @@ -15181,7 +15181,7 @@ dependencies = [ [[package]] name = "sui-faucet" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-recursion", @@ -15240,7 +15240,7 @@ dependencies = [ [[package]] name = "sui-framework-snapshot" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "bcs", @@ -15304,7 +15304,7 @@ dependencies = [ [[package]] name = "sui-graphql-config" -version = "1.36.1" +version = "1.36.2" dependencies = [ "quote 1.0.37", "syn 1.0.109", @@ -15324,7 +15324,7 @@ dependencies = [ [[package]] name = "sui-graphql-rpc" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-graphql", @@ -15423,7 +15423,7 @@ dependencies = [ [[package]] name = "sui-indexer" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-trait", @@ -15697,7 +15697,7 @@ dependencies = [ [[package]] name = "sui-light-client" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-trait", @@ -15735,7 +15735,7 @@ dependencies = [ [[package]] name = "sui-metric-checker" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "backoff", @@ -15756,7 +15756,7 @@ dependencies = [ [[package]] name = "sui-move" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "assert_cmd", @@ -15798,7 +15798,7 @@ dependencies = [ [[package]] name = "sui-move-build" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "datatest-stable", @@ -15822,7 +15822,7 @@ dependencies = [ [[package]] name = "sui-move-lsp" -version = "1.36.1" +version = "1.36.2" dependencies = [ "bin-version", "clap", @@ -15954,7 +15954,7 @@ dependencies = [ [[package]] name = "sui-node" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anemo", "anemo-tower", @@ -16006,7 +16006,7 @@ dependencies = [ [[package]] name = "sui-open-rpc" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "bcs", @@ -16042,7 +16042,7 @@ dependencies = [ [[package]] name = "sui-oracle" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "bcs", @@ -16072,7 +16072,7 @@ dependencies = [ [[package]] name = "sui-package-dump" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "bcs", @@ -16089,7 +16089,7 @@ dependencies = [ [[package]] name = "sui-package-management" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "move-core-types", @@ -16290,7 +16290,7 @@ dependencies = [ [[package]] name = "sui-rosetta" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-trait", @@ -16335,7 +16335,7 @@ dependencies = [ [[package]] name = "sui-rpc-loadgen" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-trait", @@ -16364,7 +16364,7 @@ dependencies = [ [[package]] name = "sui-sdk" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-recursion", @@ -16420,7 +16420,7 @@ dependencies = [ [[package]] name = "sui-security-watchdog" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "arrow-array 52.2.0", @@ -16467,7 +16467,7 @@ dependencies = [ [[package]] name = "sui-single-node-benchmark" -version = "1.36.1" +version = "1.36.2" dependencies = [ "async-trait", "bcs", @@ -16530,7 +16530,7 @@ dependencies = [ [[package]] name = "sui-source-validation" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "colored", @@ -16656,7 +16656,7 @@ dependencies = [ [[package]] name = "sui-surfer" -version = "1.36.1" +version = "1.36.2" dependencies = [ "async-trait", "bcs", @@ -16761,7 +16761,7 @@ dependencies = [ [[package]] name = "sui-test-validator" -version = "1.36.1" +version = "1.36.2" [[package]] name = "sui-tls" @@ -16787,7 +16787,7 @@ dependencies = [ [[package]] name = "sui-tool" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anemo", "anemo-cli", @@ -17069,7 +17069,7 @@ dependencies = [ [[package]] name = "suins-indexer" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "async-trait", @@ -17109,7 +17109,7 @@ dependencies = [ [[package]] name = "suiop-cli" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "axum 0.7.7", @@ -18650,9 +18650,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typeshare" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f17399b76c2e743d58eac0635d7686e9c00f48cd4776f00695d9882a7d3187" +checksum = "19be0f411120091e76e13e5a0186d8e2bcc3e7e244afdb70152197f1a8486ceb" dependencies = [ "chrono", "serde", @@ -19123,9 +19123,9 @@ dependencies = [ [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -20172,7 +20172,7 @@ dependencies = [ [[package]] name = "x" -version = "1.36.1" +version = "1.36.2" dependencies = [ "anyhow", "camino", diff --git a/Cargo.toml b/Cargo.toml index b03618b5a67e7..32e233cd05e0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -203,7 +203,7 @@ members = [ [workspace.package] # This version string will be inherited by sui-core, sui-faucet, sui-node, sui-tools, sui-sdk, sui-move-build, and sui crates. -version = "1.36.1" +version = "1.36.2" [profile.release] # debug = 1 means line charts only, which is minimum needed for good stack traces diff --git a/apps/wallet/src/ui/app/pages/swap/utils.ts b/apps/wallet/src/ui/app/pages/swap/utils.ts index f83f840c5ea13..676fd3148795c 100644 --- a/apps/wallet/src/ui/app/pages/swap/utils.ts +++ b/apps/wallet/src/ui/app/pages/swap/utils.ts @@ -23,11 +23,6 @@ import { z } from 'zod'; export const DEFAULT_MAX_SLIPPAGE_PERCENTAGE = 1; -export const W_USDC_TYPE_ARG = - '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN'; -export const USDC_TYPE_ARG = - '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC'; - export const W_USDC_TYPE_ARG = '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN'; export const USDC_TYPE_ARG = diff --git a/crates/sui-benchmark/tests/simtest.rs b/crates/sui-benchmark/tests/simtest.rs index fcb22e160de14..7c9407ca3b26c 100644 --- a/crates/sui-benchmark/tests/simtest.rs +++ b/crates/sui-benchmark/tests/simtest.rs @@ -409,6 +409,7 @@ mod test { } }); register_fail_point_async("consensus-delay", || delay_failpoint(10..20, 0.001)); + register_fail_point_async("write_object_entry", || delay_failpoint(10..20, 0.001)); register_fail_point_async("writeback-cache-commit", || delay_failpoint(10..20, 0.001)); diff --git a/crates/sui-bridge/src/types.rs b/crates/sui-bridge/src/types.rs index d4d69e1bf10ed..13aba4d461839 100644 --- a/crates/sui-bridge/src/types.rs +++ b/crates/sui-bridge/src/types.rs @@ -147,23 +147,6 @@ impl core::fmt::Display for BridgeCommittee { } } -impl core::fmt::Display for BridgeCommittee { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> std::fmt::Result { - for m in self.members.values() { - writeln!( - f, - "pubkey: {:?}, url: {:?}, stake: {:?}, blocklisted: {}, eth address: {:x}", - Hex::encode(m.pubkey_bytes().as_bytes()), - m.base_url, - m.voting_power, - m.is_blocklisted, - m.pubkey_bytes().to_eth_address(), - )?; - } - Ok(()) - } -} - impl CommitteeTrait for BridgeCommittee { // Note: blocklisted members are always excluded. fn shuffle_by_stake_with_rng( diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 3b994c0e84e90..2270302518446 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -11,6 +11,7 @@ use crate::verify_indexes::verify_indexes; use anyhow::anyhow; use arc_swap::{ArcSwap, Guard}; use async_trait::async_trait; +use authority_per_epoch_store::CertLockGuard; use chrono::prelude::*; use fastcrypto::encoding::Base58; use fastcrypto::encoding::Encoding; @@ -1227,7 +1228,13 @@ impl AuthorityState { self.enqueue_certificates_for_execution(vec![certificate.clone()], epoch_store); } - self.notify_read_effects(*certificate.digest()).await + // tx could be reverted when epoch ends, so we must be careful not to return a result + // here after the epoch ends. + epoch_store + .within_alive_epoch(self.notify_read_effects(*certificate.digest())) + .await + .map_err(|_| SuiError::EpochEnded(epoch_store.epoch())) + .and_then(|r| r) } /// Awaits the effects of executing a user transaction. @@ -1236,12 +1243,20 @@ impl AuthorityState { pub async fn await_transaction_effects( &self, digest: TransactionDigest, + epoch_store: &Arc, ) -> SuiResult { let _metrics_guard = self.metrics.await_transaction_latency.start_timer(); debug!("await_transaction"); // TODO(fastpath): Add handling for transactions rejected by Mysticeti fast path. - self.notify_read_effects(digest).await + // TODO(fastpath): Can an MFP transaction be reverted after epoch ends? If so, + // same warning as above applies: We must be careful not to return a result + // here after the epoch ends. + epoch_store + .within_alive_epoch(self.notify_read_effects(digest)) + .await + .map_err(|_| SuiError::EpochEnded(epoch_store.epoch())) + .and_then(|r| r) } /// Internal logic to execute a certificate. @@ -1267,7 +1282,22 @@ impl AuthorityState { debug!("execute_certificate_internal"); let tx_digest = certificate.digest(); - let input_objects = self.read_objects_for_execution(certificate, epoch_store)?; + + // prevent concurrent executions of the same tx. + let tx_guard = epoch_store.acquire_tx_guard(certificate).await?; + + // The cert could have been processed by a concurrent attempt of the same cert, so check if + // the effects have already been written. + if let Some(effects) = self + .get_transaction_cache_reader() + .get_executed_effects(tx_digest)? + { + tx_guard.release(); + return Ok((effects, None)); + } + + let input_objects = + self.read_objects_for_execution(tx_guard.as_lock_guard(), certificate, epoch_store)?; if expected_effects_digest.is_none() { // We could be re-executing a previously executed but uncommitted transaction, perhaps after @@ -1277,12 +1307,6 @@ impl AuthorityState { expected_effects_digest = epoch_store.get_signed_effects_digest(tx_digest)?; } - // This acquires a lock on the tx digest to prevent multiple concurrent executions of the - // same tx. While we don't need this for safety (tx sequencing is ultimately atomic), it is - // very common to receive the same tx multiple times simultaneously due to gossip, so we - // may as well hold the lock and save the cpu time for other requests. - let tx_guard = epoch_store.acquire_tx_guard(certificate).await?; - self.process_certificate( tx_guard, certificate, @@ -1296,6 +1320,7 @@ impl AuthorityState { pub fn read_objects_for_execution( &self, + tx_lock: &CertLockGuard, certificate: &VerifiedExecutableTransaction, epoch_store: &Arc, ) -> SuiResult { @@ -1308,6 +1333,7 @@ impl AuthorityState { self.input_loader.read_objects_for_execution( epoch_store.as_ref(), &certificate.key(), + tx_lock, input_objects, epoch_store.epoch(), ) @@ -1397,15 +1423,6 @@ impl AuthorityState { } }); - // The cert could have been processed by a concurrent attempt of the same cert, so check if - // the effects have already been written. - if let Some(effects) = self - .get_transaction_cache_reader() - .get_executed_effects(&digest)? - { - tx_guard.release(); - return Ok((effects, None)); - } let execution_guard = self .execution_lock_for_executable_transaction(certificate) .await; @@ -3226,7 +3243,16 @@ impl AuthorityState { ); self.committee_store.insert_new_committee(&new_committee)?; + + // Wait until no transactions are being executed. let mut execution_lock = self.execution_lock_for_reconfiguration().await; + + // Terminate all epoch-specific tasks (those started with within_alive_epoch). + cur_epoch_store.epoch_terminated().await; + + // Safe to being reconfiguration now. No transactions are being executed, + // and no epoch-specific tasks are running. + // TODO: revert_uncommitted_epoch_transactions will soon be unnecessary - // clear_state_end_of_epoch() can simply drop all uncommitted transactions self.revert_uncommitted_epoch_transactions(cur_epoch_store) @@ -5121,7 +5147,7 @@ impl AuthorityState { ); fail_point_async!("change_epoch_tx_delay"); - let _tx_lock = epoch_store.acquire_tx_lock(tx_digest).await; + let tx_lock = epoch_store.acquire_tx_lock(tx_digest).await; // The tx could have been executed by state sync already - if so simply return an error. // The checkpoint builder will shortly be terminated by reconfiguration anyway. @@ -5149,7 +5175,8 @@ impl AuthorityState { ) .await?; - let input_objects = self.read_objects_for_execution(&executable_tx, epoch_store)?; + let input_objects = + self.read_objects_for_execution(&tx_lock, &executable_tx, epoch_store)?; let (temporary_store, effects, _execution_error_opt) = self.prepare_certificate(&execution_guard, &executable_tx, input_objects, epoch_store)?; @@ -5240,7 +5267,6 @@ impl AuthorityState { cur_epoch_store.get_chain_identifier(), ); self.epoch_store.store(new_epoch_store.clone()); - cur_epoch_store.epoch_terminated().await; Ok(new_epoch_store) } diff --git a/crates/sui-core/src/authority/authority_per_epoch_store.rs b/crates/sui-core/src/authority/authority_per_epoch_store.rs index 70c1e98bbb2e1..a7bd73380550e 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -129,6 +129,16 @@ pub struct CertTxGuard(#[allow(unused)] CertLockGuard); impl CertTxGuard { pub fn release(self) {} pub fn commit_tx(self) {} + pub fn as_lock_guard(&self) -> &CertLockGuard { + &self.0 + } +} + +impl CertLockGuard { + pub fn dummy_for_tests() -> Self { + let lock = Arc::new(tokio::sync::Mutex::new(())); + Self(lock.try_lock_owned().unwrap()) + } } type JwkAggregator = GenericMultiStakeAggregator<(JwkId, JWK), true>; @@ -1333,23 +1343,29 @@ impl AuthorityPerEpochStore { &self, key: &TransactionKey, objects: &[InputObjectKind], - ) -> BTreeSet { - let mut shared_locks = HashMap::::new(); + ) -> SuiResult> { + let shared_locks = + once_cell::unsync::OnceCell::>>::new(); objects .iter() .map(|kind| { - match kind { + Ok(match kind { InputObjectKind::SharedMoveObject { id, .. } => { - if shared_locks.is_empty() { - shared_locks = self - .get_shared_locks(key) - .expect("Read from storage should not fail!") - .into_iter() - .collect(); - } - // If we can't find the locked version, it means - // 1. either we have a bug that skips shared object version assignment - // 2. or we have some DB corruption + let shared_locks = shared_locks + .get_or_init(|| { + self.get_shared_locks(key) + .expect("reading shared locks should not fail") + .map(|locks| locks.into_iter().collect()) + }) + .as_ref() + // Shared version assignments could have been deleted if the tx just + // finished executing concurrently. + .ok_or(SuiError::GenericAuthorityError { + error: "no shared locks".to_string(), + })?; + + // If we found locks, but they are missing the assignment for this object, + // it indicates a serious inconsistency! let Some(version) = shared_locks.get(id) else { panic!( "Shared object locks should have been set. key: {key:?}, obj \ @@ -1366,7 +1382,7 @@ impl AuthorityPerEpochStore { id: objref.0, version: objref.1, }, - } + }) }) .collect() } @@ -2845,7 +2861,6 @@ impl AuthorityPerEpochStore { }; let make_checkpoint = should_accept_tx || final_round; if make_checkpoint { - // Generate pending checkpoint for regular user tx. let checkpoint_height = if self.randomness_state_enabled() { consensus_commit_info.round * 2 } else { @@ -2866,29 +2881,34 @@ impl AuthorityPerEpochStore { } } checkpoint_roots.extend(roots.into_iter()); + + if let Some(randomness_round) = randomness_round { + randomness_roots.insert(TransactionKey::RandomnessRound( + self.epoch(), + randomness_round, + )); + } + + // Determine whether to write pending checkpoint for user tx with randomness. + // - If randomness is not generated for this commit, we will skip the + // checkpoint with the associated height. Therefore checkpoint heights may + // not be contiguous. + // - Exception: if DKG fails, we always need to write out a PendingCheckpoint + // for randomness tx that are canceled. + let should_write_random_checkpoint = + randomness_round.is_some() || (dkg_failed && !randomness_roots.is_empty()); + let pending_checkpoint = PendingCheckpointV2::V2(PendingCheckpointV2Contents { roots: checkpoint_roots, details: PendingCheckpointInfo { timestamp_ms: consensus_commit_info.timestamp, - last_of_epoch: final_round && randomness_round.is_none(), + last_of_epoch: final_round && !should_write_random_checkpoint, checkpoint_height, }, }); self.write_pending_checkpoint(&mut output, &pending_checkpoint)?; - // Generate pending checkpoint for user tx with randomness. - // - If randomness is not generated for this commit, we will skip the - // checkpoint with the associated height. Therefore checkpoint heights may - // not be contiguous. - // - Exception: if DKG fails, we always need to write out a PendingCheckpoint - // for randomness tx that are canceled. - if let Some(randomness_round) = randomness_round { - randomness_roots.insert(TransactionKey::RandomnessRound( - self.epoch(), - randomness_round, - )); - } - if randomness_round.is_some() || (dkg_failed && !randomness_roots.is_empty()) { + if should_write_random_checkpoint { let pending_checkpoint = PendingCheckpointV2::V2(PendingCheckpointV2Contents { roots: randomness_roots.into_iter().collect(), details: PendingCheckpointInfo { @@ -4293,12 +4313,8 @@ impl GetSharedLocks for AuthorityPerEpochStore { fn get_shared_locks( &self, key: &TransactionKey, - ) -> Result, SuiError> { - Ok(self - .tables()? - .assigned_shared_object_versions_v2 - .get(key)? - .unwrap_or_default()) + ) -> SuiResult>> { + Ok(self.tables()?.assigned_shared_object_versions_v2.get(key)?) } } diff --git a/crates/sui-core/src/authority_server.rs b/crates/sui-core/src/authority_server.rs index a5ece01381f9b..1c0d3e567b79b 100644 --- a/crates/sui-core/src/authority_server.rs +++ b/crates/sui-core/src/authority_server.rs @@ -828,7 +828,7 @@ impl ValidatorService { .await? } ConsensusTransactionKind::UserTransaction(tx) => { - self.state.await_transaction_effects(*tx.digest()).await? + self.state.await_transaction_effects(*tx.digest(), epoch_store).await? } _ => panic!("`handle_submit_to_consensus` received transaction that is not a CertifiedTransaction or UserTransaction"), }; diff --git a/crates/sui-core/src/execution_cache.rs b/crates/sui-core/src/execution_cache.rs index 83cca46df4ccb..c26c57134568c 100644 --- a/crates/sui-core/src/execution_cache.rs +++ b/crates/sui-core/src/execution_cache.rs @@ -8,6 +8,7 @@ use crate::authority::epoch_start_configuration::EpochStartConfiguration; use crate::authority::AuthorityStore; use crate::state_accumulator::AccumulatorStore; use crate::transaction_outputs::TransactionOutputs; +use mysten_common::fatal; use sui_types::bridge::Bridge; use futures::{future::BoxFuture, FutureExt}; @@ -587,6 +588,13 @@ pub trait TransactionCacheRead: Send + Sync { digests: &'a [TransactionDigest], ) -> BoxFuture<'a, SuiResult>>; + /// Wait until the effects of the given transactions are available and return them. + /// WARNING: If calling this on a transaction that could be reverted, you must be + /// sure that this function cannot be called during reconfiguration. The best way to + /// do this is to wrap your future in EpochStore::within_alive_epoch. Holding an + /// ExecutionLockReadGuard would also prevent reconfig from happening while waiting, + /// but this is very dangerous, as it could prevent reconfiguration from ever + /// occurring! fn notify_read_executed_effects<'a>( &'a self, digests: &'a [TransactionDigest], @@ -597,7 +605,7 @@ pub trait TransactionCacheRead: Send + Sync { self.multi_get_effects(&digests).map(|effects| { effects .into_iter() - .map(|e| e.expect("digests must exist")) + .map(|e| e.unwrap_or_else(|| fatal!("digests must exist"))) .collect() }) } diff --git a/crates/sui-core/src/execution_cache/writeback_cache.rs b/crates/sui-core/src/execution_cache/writeback_cache.rs index 8431429b683db..5ff74be1c0182 100644 --- a/crates/sui-core/src/execution_cache/writeback_cache.rs +++ b/crates/sui-core/src/execution_cache/writeback_cache.rs @@ -463,15 +463,37 @@ impl WritebackCache { trace!(?object_id, ?version, ?object, "inserting object entry"); fail_point_async!("write_object_entry"); self.metrics.record_cache_write("object"); - self.dirty - .objects - .entry(*object_id) - .or_default() - .insert(version, object.clone()); + + // We must hold the lock for the object entry while inserting to the + // object_by_id_cache. Otherwise, a surprising bug can occur: + // + // 1. A thread executing TX1 can write object (O,1) to the dirty set and then pause. + // 2. TX2, which reads (O,1) can begin executing, because TransactionManager immediately + // schedules transactions if their inputs are available. It does not matter that TX1 + // hasn't finished executing yet. + // 3. TX2 can write (O,2) to both the dirty set and the object_by_id_cache. + // 4. The thread executing TX1 can resume and write (O,1) to the object_by_id_cache. + // + // Now, any subsequent attempt to get the latest version of O will return (O,1) instead of + // (O,2). + // + // This seems very unlikely, but it may be possible under the following circumstances: + // - While a thread is unlikely to pause for so long, moka cache uses optimistic + // lock-free algorithms that have retry loops. Possibly, under high contention, this + // code might spin for a surprisingly long time. + // - Additionally, many concurrent re-executions of the same tx could happen due to + // the tx finalizer, plus checkpoint executor, consensus, and RPCs from fullnodes. + let mut entry = self.dirty.objects.entry(*object_id).or_default(); + self.cached.object_by_id_cache.insert( *object_id, - Arc::new(Mutex::new(LatestObjectCacheEntry::Object(version, object))), + Arc::new(Mutex::new(LatestObjectCacheEntry::Object( + version, + object.clone(), + ))), ); + + entry.insert(version, object); } async fn write_marker_value( diff --git a/crates/sui-core/src/execution_driver.rs b/crates/sui-core/src/execution_driver.rs index ca433a8a4d383..9154c32ea9db1 100644 --- a/crates/sui-core/src/execution_driver.rs +++ b/crates/sui-core/src/execution_driver.rs @@ -86,6 +86,16 @@ pub async fn execution_process( let digest = *certificate.digest(); trace!(?digest, "Pending certificate execution activated."); + if epoch_store.epoch() != certificate.epoch() { + info!( + ?digest, + cur_epoch = epoch_store.epoch(), + cert_epoch = certificate.epoch(), + "Ignoring certificate from previous epoch." + ); + continue; + } + let limit = limit.clone(); // hold semaphore permit until task completes. unwrap ok because we never close // the semaphore in this context. diff --git a/crates/sui-core/src/transaction_input_loader.rs b/crates/sui-core/src/transaction_input_loader.rs index b9f1028598c88..ee70de4829e7c 100644 --- a/crates/sui-core/src/transaction_input_loader.rs +++ b/crates/sui-core/src/transaction_input_loader.rs @@ -1,13 +1,16 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::execution_cache::ObjectCacheRead; +use crate::{ + authority::authority_per_epoch_store::CertLockGuard, execution_cache::ObjectCacheRead, +}; use itertools::izip; +use mysten_common::fatal; use once_cell::unsync::OnceCell; use std::collections::HashMap; use std::sync::Arc; use sui_types::{ - base_types::{EpochId, ObjectID, ObjectRef, SequenceNumber, TransactionDigest}, + base_types::{EpochId, ObjectRef, TransactionDigest}, error::{SuiError, SuiResult, UserInputError}, storage::{GetSharedLocks, ObjectKey}, transaction::{ @@ -126,10 +129,11 @@ impl TransactionInputLoader { &self, shared_lock_store: &impl GetSharedLocks, tx_key: &TransactionKey, + _tx_lock: &CertLockGuard, // see below for why this is needed input_object_kinds: &[InputObjectKind], epoch_id: EpochId, ) -> SuiResult { - let shared_locks_cell: OnceCell> = OnceCell::new(); + let shared_locks_cell: OnceCell>> = OnceCell::new(); let mut results = vec![None; input_object_kinds.len()]; let mut object_keys = Vec::with_capacity(input_object_kinds.len()); @@ -153,17 +157,22 @@ impl TransactionInputLoader { fetches.push((i, input)); } InputObjectKind::SharedMoveObject { id, .. } => { - let shared_locks = shared_locks_cell.get_or_try_init(|| { - Ok::, SuiError>( + let shared_locks = shared_locks_cell + .get_or_init(|| { shared_lock_store - .get_shared_locks(tx_key)? - .into_iter() - .collect(), - ) - })?; - // If we can't find the locked version, it means - // 1. either we have a bug that skips shared object version assignment - // 2. or we have some DB corruption + .get_shared_locks(tx_key) + .expect("loading shared locks should not fail") + .map(|locks| locks.into_iter().collect()) + }) + .as_ref() + .unwrap_or_else(|| { + // Important to hold the _tx_lock here - otherwise it would be possible + // for a concurrent execution of the same tx to enter this point after the + // first execution has finished and the shared locks have been deleted. + fatal!("Failed to get shared locks for transaction {tx_key:?}"); + }); + + // If we find a set of locks but an object is missing, it indicates a serious inconsistency: let version = shared_locks.get(id).unwrap_or_else(|| { panic!("Shared object locks should have been set. key: {tx_key:?}, obj id: {id:?}") }); diff --git a/crates/sui-core/src/transaction_manager.rs b/crates/sui-core/src/transaction_manager.rs index 0ffd0c7a92b51..88290bb4caaaa 100644 --- a/crates/sui-core/src/transaction_manager.rs +++ b/crates/sui-core/src/transaction_manager.rs @@ -9,6 +9,7 @@ use std::{ }; use lru::LruCache; +use mysten_common::fatal; use mysten_metrics::monitored_scope; use parking_lot::RwLock; use sui_types::{ @@ -414,7 +415,7 @@ impl TransactionManager { .transaction_cache_read .is_tx_already_executed(&digest) .unwrap_or_else(|err| { - panic!("Failed to check if tx is already executed: {:?}", err) + fatal!("Failed to check if tx is already executed: {:?}", err) }) { self.metrics @@ -432,7 +433,7 @@ impl TransactionManager { let mut receiving_objects: HashSet = HashSet::new(); let certs: Vec<_> = certs .into_iter() - .map(|(cert, fx_digest)| { + .filter_map(|(cert, fx_digest)| { let input_object_kinds = cert .data() .intent_message() @@ -440,7 +441,24 @@ impl TransactionManager { .input_objects() .expect("input_objects() cannot fail"); let mut input_object_keys = - epoch_store.get_input_object_keys(&cert.key(), &input_object_kinds); + match epoch_store.get_input_object_keys(&cert.key(), &input_object_kinds) { + Ok(keys) => keys, + Err(e) => { + // Because we do not hold the transaction lock during enqueue, it is possible + // that the transaction was executed and the shared version assignments deleted + // since the earlier check. This is a rare race condition, and it is better to + // handle it ad-hoc here than to hold tx locks for every cert for the duration + // of this function in order to remove the race. + if self + .transaction_cache_read + .is_tx_already_executed(cert.digest()) + .expect("is_tx_already_executed cannot fail") + { + return None; + } + fatal!("Failed to get input object keys: {:?}", e); + } + }; if input_object_kinds.len() != input_object_keys.len() { error!("Duplicated input objects: {:?}", input_object_kinds); @@ -467,7 +485,7 @@ impl TransactionManager { } } - (cert, fx_digest, input_object_keys) + Some((cert, fx_digest, input_object_keys)) }) .collect(); diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index 70ec3e454c5de..f3e4d4646bf42 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -4742,6 +4742,7 @@ async fn test_shared_object_transaction_ok() { .epoch_store_for_testing() .get_shared_locks(&certificate.key()) .expect("Reading shared locks should not fail") + .expect("Locks should be set") .into_iter() .find_map(|(object_id, version)| { if object_id == shared_object_id { @@ -4858,6 +4859,7 @@ async fn test_consensus_commit_prologue_generation() { .epoch_store_for_testing() .get_shared_locks(txn_key) .unwrap() + .expect("locks should be set") .iter() .filter_map(|(id, seq)| { if id == &SUI_CLOCK_OBJECT_ID { @@ -6216,6 +6218,7 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() { .epoch_store_for_testing() .get_shared_locks(&cancelled_txn.key()) .expect("Reading shared locks should not fail") + .expect("locks should be set") .into_iter() .collect::>(); assert_eq!( @@ -6234,6 +6237,7 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() { .read_objects_for_execution( authority.epoch_store_for_testing().as_ref(), &cancelled_txn.key(), + &CertLockGuard::dummy_for_tests(), &cancelled_txn .data() .transaction_data() diff --git a/crates/sui-framework/docs/sui-system/stake_subsidy.md b/crates/sui-framework/docs/sui-system/stake_subsidy.md index f66978db04aec..8147ace90ae4f 100644 --- a/crates/sui-framework/docs/sui-system/stake_subsidy.md +++ b/crates/sui-framework/docs/sui-system/stake_subsidy.md @@ -9,6 +9,7 @@ title: Module `0x3::stake_subsidy` - [Function `create`](#0x3_stake_subsidy_create) - [Function `advance_epoch`](#0x3_stake_subsidy_advance_epoch) - [Function `current_epoch_subsidy_amount`](#0x3_stake_subsidy_current_epoch_subsidy_amount) +- [Function `get_distribution_counter`](#0x3_stake_subsidy_get_distribution_counter)
use 0x1::u64;
@@ -169,7 +170,6 @@ Advance the epoch counter and draw down the subsidy for the epoch.
 
     // Drawn down the subsidy for this epoch.
     let stake_subsidy = self.balance.split(to_withdraw);
-
     self.distribution_counter = self.distribution_counter + 1;
 
     // Decrease the subsidy amount only when the current period ends.
@@ -210,4 +210,29 @@ Returns the amount of stake subsidy to be added at the end of the current epoch.
 
 
 
+
+
+
+
+## Function `get_distribution_counter`
+
+Returns the number of distributions that have occurred.
+
+
+
public(friend) fun get_distribution_counter(self: &stake_subsidy::StakeSubsidy): u64
+
+ + + +
+Implementation + + +
public(package) fun get_distribution_counter(self: &StakeSubsidy): u64 {
+    self.distribution_counter
+}
+
+ + +
diff --git a/crates/sui-framework/docs/sui-system/sui_system_state_inner.md b/crates/sui-framework/docs/sui-system/sui_system_state_inner.md index f4357743de41d..ae65fd0a93402 100644 --- a/crates/sui-framework/docs/sui-system/sui_system_state_inner.md +++ b/crates/sui-framework/docs/sui-system/sui_system_state_inner.md @@ -2163,18 +2163,31 @@ gas coins. let storage_charge = storage_reward.value(); let computation_charge = computation_reward.value(); + let mut stake_subsidy = balance::zero(); + // during the transition from epoch N to epoch N + 1, ctx.epoch() will return N + let old_epoch = ctx.epoch(); // Include stake subsidy in the rewards given out to validators and stakers. // Delay distributing any stake subsidies until after `stake_subsidy_start_epoch`. // And if this epoch is shorter than the regular epoch duration, don't distribute any stake subsidy. - let stake_subsidy = - if (ctx.epoch() >= self.parameters.stake_subsidy_start_epoch && - epoch_start_timestamp_ms >= prev_epoch_start_timestamp + self.parameters.epoch_duration_ms) - { - self.stake_subsidy.advance_epoch() - } else { - balance::zero() + if (old_epoch >= self.parameters.stake_subsidy_start_epoch && + epoch_start_timestamp_ms >= prev_epoch_start_timestamp + self.parameters.epoch_duration_ms) + { + // special case for epoch 560 -> 561 change bug. add extra subsidies for "safe mode" + // where reward distribution was skipped. use distribution counter and epoch check to + // avoiding affecting devnet and testnet + if (self.stake_subsidy.get_distribution_counter() == 540 && old_epoch > 560) { + // safe mode was entered on the change from 560 to 561. so 560 was the first epoch without proper subsidy distribution + let first_safe_mode_epoch = 560; + let safe_mode_epoch_count = old_epoch - first_safe_mode_epoch; + safe_mode_epoch_count.do!(|_| { + stake_subsidy.join(self.stake_subsidy.advance_epoch()); + }); + // done with catchup for safe mode epochs. distribution counter is now >540, we won't hit this again + // fall through to the normal logic, which will add subsidies for the current epoch }; + stake_subsidy.join(self.stake_subsidy.advance_epoch()); + }; let stake_subsidy_amount = stake_subsidy.value(); computation_reward.join(stake_subsidy); diff --git a/crates/sui-framework/docs/sui-system/validator.md b/crates/sui-framework/docs/sui-system/validator.md index db50fa3400a9d..3c0250ae74815 100644 --- a/crates/sui-framework/docs/sui-system/validator.md +++ b/crates/sui-framework/docs/sui-system/validator.md @@ -1076,6 +1076,8 @@ Request to add stake to the validator's staking pool, processed at the end of th let sui = self.staking_pool.redeem_fungible_staked_sui(fungible_staked_sui, ctx); + self.next_epoch_stake = self.next_epoch_stake - sui.value(); + event::emit( RedeemingFungibleStakedSuiEvent { pool_id: self.staking_pool_id(), @@ -1346,7 +1348,8 @@ Process pending stakes and withdraws, called at the end of the epoch.
public(package) fun process_pending_stakes_and_withdraws(self: &mut Validator, ctx: &TxContext) {
     self.staking_pool.process_pending_stakes_and_withdraws(ctx);
-    assert!(stake_amount(self) == self.next_epoch_stake, EInvalidStakeAmount);
+    // TODO: bring this assertion back when we are ready.
+    // assert!(stake_amount(self) == self.next_epoch_stake, EInvalidStakeAmount);
 }
 
diff --git a/crates/sui-framework/packages/sui-system/sources/stake_subsidy.move b/crates/sui-framework/packages/sui-system/sources/stake_subsidy.move index d0760d97a88c0..d355a69c8489a 100644 --- a/crates/sui-framework/packages/sui-system/sources/stake_subsidy.move +++ b/crates/sui-framework/packages/sui-system/sources/stake_subsidy.move @@ -65,7 +65,6 @@ module sui_system::stake_subsidy { // Drawn down the subsidy for this epoch. let stake_subsidy = self.balance.split(to_withdraw); - self.distribution_counter = self.distribution_counter + 1; // Decrease the subsidy amount only when the current period ends. @@ -83,9 +82,13 @@ module sui_system::stake_subsidy { self.current_distribution_amount.min(self.balance.value()) } - #[test_only] /// Returns the number of distributions that have occurred. public(package) fun get_distribution_counter(self: &StakeSubsidy): u64 { self.distribution_counter } + + #[test_only] + public(package) fun set_distribution_counter(self: &mut StakeSubsidy, distribution_counter: u64) { + self.distribution_counter = distribution_counter; + } } diff --git a/crates/sui-framework/packages/sui-system/sources/sui_system.move b/crates/sui-framework/packages/sui-system/sources/sui_system.move index 916c2cd55b33b..641cc3f9dd86e 100644 --- a/crates/sui-framework/packages/sui-system/sources/sui_system.move +++ b/crates/sui-framework/packages/sui-system/sources/sui_system.move @@ -726,6 +726,17 @@ module sui_system::sui_system { self.get_stake_subsidy_distribution_counter() } + #[test_only] + public fun set_stake_subsidy_distribution_counter(wrapper: &mut SuiSystemState, counter: u64) { + let self = load_system_state_mut(wrapper); + self.set_stake_subsidy_distribution_counter(counter) + } + + #[test_only] + public fun inner_mut_for_testing(wrapper: &mut SuiSystemState): &mut SuiSystemStateInnerV2 { + wrapper.load_system_state_mut() + } + // CAUTION: THIS CODE IS ONLY FOR TESTING AND THIS MACRO MUST NEVER EVER BE REMOVED. Creates a // candidate validator - bypassing the proof of possession check and other metadata validation // in the process. diff --git a/crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move b/crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move index 121a12fc75b94..4384f3fcd2599 100644 --- a/crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move +++ b/crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move @@ -865,18 +865,31 @@ module sui_system::sui_system_state_inner { let storage_charge = storage_reward.value(); let computation_charge = computation_reward.value(); + let mut stake_subsidy = balance::zero(); + // during the transition from epoch N to epoch N + 1, ctx.epoch() will return N + let old_epoch = ctx.epoch(); // Include stake subsidy in the rewards given out to validators and stakers. // Delay distributing any stake subsidies until after `stake_subsidy_start_epoch`. // And if this epoch is shorter than the regular epoch duration, don't distribute any stake subsidy. - let stake_subsidy = - if (ctx.epoch() >= self.parameters.stake_subsidy_start_epoch && - epoch_start_timestamp_ms >= prev_epoch_start_timestamp + self.parameters.epoch_duration_ms) - { - self.stake_subsidy.advance_epoch() - } else { - balance::zero() + if (old_epoch >= self.parameters.stake_subsidy_start_epoch && + epoch_start_timestamp_ms >= prev_epoch_start_timestamp + self.parameters.epoch_duration_ms) + { + // special case for epoch 560 -> 561 change bug. add extra subsidies for "safe mode" + // where reward distribution was skipped. use distribution counter and epoch check to + // avoiding affecting devnet and testnet + if (self.stake_subsidy.get_distribution_counter() == 540 && old_epoch > 560) { + // safe mode was entered on the change from 560 to 561. so 560 was the first epoch without proper subsidy distribution + let first_safe_mode_epoch = 560; + let safe_mode_epoch_count = old_epoch - first_safe_mode_epoch; + safe_mode_epoch_count.do!(|_| { + stake_subsidy.join(self.stake_subsidy.advance_epoch()); + }); + // done with catchup for safe mode epochs. distribution counter is now >540, we won't hit this again + // fall through to the normal logic, which will add subsidies for the current epoch }; + stake_subsidy.join(self.stake_subsidy.advance_epoch()); + }; let stake_subsidy_amount = stake_subsidy.value(); computation_reward.join(stake_subsidy); @@ -1127,6 +1140,16 @@ module sui_system::sui_system_state_inner { self.validators.request_add_validator(min_joining_stake_for_testing, ctx); } + #[test_only] + public(package) fun set_stake_subsidy_distribution_counter(self: &mut SuiSystemStateInnerV2, counter: u64) { + self.stake_subsidy.set_distribution_counter(counter) + } + + #[test_only] + public(package) fun epoch_duration_ms(self: &SuiSystemStateInnerV2): u64 { + self.parameters.epoch_duration_ms + } + // CAUTION: THIS CODE IS ONLY FOR TESTING AND THIS MACRO MUST NEVER EVER BE REMOVED. Creates a // candidate validator - bypassing the proof of possession check and other metadata validation // in the process. diff --git a/crates/sui-framework/packages/sui-system/sources/validator.move b/crates/sui-framework/packages/sui-system/sources/validator.move index da6157014541e..0019ea7dd42dd 100644 --- a/crates/sui-framework/packages/sui-system/sources/validator.move +++ b/crates/sui-framework/packages/sui-system/sources/validator.move @@ -352,6 +352,8 @@ module sui_system::validator { let sui = self.staking_pool.redeem_fungible_staked_sui(fungible_staked_sui, ctx); + self.next_epoch_stake = self.next_epoch_stake - sui.value(); + event::emit( RedeemingFungibleStakedSuiEvent { pool_id: self.staking_pool_id(), @@ -462,7 +464,8 @@ module sui_system::validator { /// Process pending stakes and withdraws, called at the end of the epoch. public(package) fun process_pending_stakes_and_withdraws(self: &mut Validator, ctx: &TxContext) { self.staking_pool.process_pending_stakes_and_withdraws(ctx); - assert!(stake_amount(self) == self.next_epoch_stake, EInvalidStakeAmount); + // TODO: bring this assertion back when we are ready. + // assert!(stake_amount(self) == self.next_epoch_stake, EInvalidStakeAmount); } /// Returns true if the validator is preactive. diff --git a/crates/sui-framework/packages/sui-system/tests/rewards_distribution_tests.move b/crates/sui-framework/packages/sui-system/tests/rewards_distribution_tests.move index 7c04d28e61aca..ec94cbf81a1bf 100644 --- a/crates/sui-framework/packages/sui-system/tests/rewards_distribution_tests.move +++ b/crates/sui-framework/packages/sui-system/tests/rewards_distribution_tests.move @@ -3,6 +3,7 @@ #[test_only] module sui_system::rewards_distribution_tests { + use sui::balance; use sui::test_scenario::{Self, Scenario}; use sui_system::sui_system::SuiSystemState; use sui_system::validator_cap::UnverifiedValidatorOperationCap; @@ -491,4 +492,140 @@ module sui_system::rewards_distribution_tests { scenario.return_to_sender(cap); test_scenario::return_shared(system_state); } + + fun check_distribution_counter_invariant(system: &mut SuiSystemState, ctx: &TxContext) { + assert!(ctx.epoch() == system.epoch()); + // first subsidy distribution was at epoch 20, so counter should always be ahead by 20 + assert_eq(system.get_stake_subsidy_distribution_counter() + 20, ctx.epoch()); + } + + #[test] + fun test_stake_subsidy_with_safe_mode_epoch_562_to_563() { + set_up_sui_system_state_with_big_amounts(); + + let mut test = test_scenario::begin(VALIDATOR_ADDR_1); + let mut sui_system = test.take_shared(); + let ctx = test.ctx(); + // mimic state during epoch 562, if we're in safe mode since the 560 -> 561 epoch change + let start_epoch: u64 = 562; + let start_distribution_counter = 540; + let epoch_start_time = 100000000000; + let epoch_duration = sui_system.inner_mut_for_testing().epoch_duration_ms(); + + // increment epoch number (safe mode emulation) + start_epoch.do!(|_| ctx.increment_epoch_number()); + sui_system.set_epoch_for_testing(start_epoch); + sui_system.set_stake_subsidy_distribution_counter(start_distribution_counter); + + assert!(ctx.epoch() == start_epoch); + assert!(ctx.epoch() == sui_system.epoch()); + assert!(sui_system.get_stake_subsidy_distribution_counter() == start_distribution_counter); + + // perform advance epoch + sui_system + .inner_mut_for_testing() + .advance_epoch(start_epoch + 1, 65, balance::zero(), balance::zero(), 0, 0, 0, 0, epoch_start_time, ctx) + .destroy_for_testing(); // balance returned from `advance_epoch` + ctx.increment_epoch_number(); + + // should distribute 3 epochs worth of subsidies: 560, 561, 562 + assert_eq(sui_system.get_stake_subsidy_distribution_counter(), start_distribution_counter + 3); + check_distribution_counter_invariant(&mut sui_system, ctx); + + // ensure that next epoch change only distributes one epoch's worth + sui_system + .inner_mut_for_testing() + .advance_epoch(start_epoch + 2, 65, balance::zero(), balance::zero(), 0, 0, 0, 0, epoch_start_time + epoch_duration, ctx) + .destroy_for_testing(); // balance returned from `advance_epoch` + ctx.increment_epoch_number(); + + // should distribute 1 epoch's worth of subsidies: 563 only + assert_eq(sui_system.get_stake_subsidy_distribution_counter(), start_distribution_counter + 4); + check_distribution_counter_invariant(&mut sui_system, ctx); + + test_scenario::return_shared(sui_system); + test.end(); + } + + #[test] + fun test_stake_subsidy_with_safe_mode_epoch_563_to_564() { + set_up_sui_system_state_with_big_amounts(); + + let mut test = test_scenario::begin(VALIDATOR_ADDR_1); + let mut sui_system = test.take_shared(); + let ctx = test.ctx(); + // mimic state during epoch 563, if we're in safe mode since the 560 -> 561 epoch change + let start_epoch: u64 = 563; + let start_distribution_counter = 540; + let epoch_start_time = 100000000000; + let epoch_duration = sui_system.inner_mut_for_testing().epoch_duration_ms(); + + // increment epoch number (safe mode emulation) + start_epoch.do!(|_| ctx.increment_epoch_number()); + sui_system.set_epoch_for_testing(start_epoch); + sui_system.set_stake_subsidy_distribution_counter(start_distribution_counter); + + assert!(ctx.epoch() == start_epoch); + assert!(ctx.epoch() == sui_system.epoch()); + assert!(sui_system.get_stake_subsidy_distribution_counter() == start_distribution_counter); + + // perform advance epoch + sui_system + .inner_mut_for_testing() + .advance_epoch(start_epoch + 1, 65, balance::zero(), balance::zero(), 0, 0, 0, 0, epoch_start_time, ctx) + .destroy_for_testing(); // balance returned from `advance_epoch` + ctx.increment_epoch_number(); + + // should distribute 4 epochs worth of subsidies: 560, 561, 562, 563 + assert_eq(sui_system.get_stake_subsidy_distribution_counter(), start_distribution_counter + 4); + check_distribution_counter_invariant(&mut sui_system, ctx); + + // ensure that next epoch change only distributes one epoch's worth + sui_system + .inner_mut_for_testing() + .advance_epoch(start_epoch + 2, 65, balance::zero(), balance::zero(), 0, 0, 0, 0, epoch_start_time + epoch_duration, ctx) + .destroy_for_testing(); // balance returned from `advance_epoch` + ctx.increment_epoch_number(); + + // should distribute 1 epoch's worth of subsidies + assert_eq(sui_system.get_stake_subsidy_distribution_counter(), start_distribution_counter + 5); + check_distribution_counter_invariant(&mut sui_system, ctx); + + test_scenario::return_shared(sui_system); + test.end(); + } + + #[test] + // Test that the fix for the subsidy distribution doesn't affect testnet, + // where the distribution has no epoch delay, and the condition could result + // in arithmetic error. + fun test_stake_subsidy_with_safe_mode_testnet() { + use std::unit_test::assert_eq; + + set_up_sui_system_state_with_big_amounts(); + + let mut test = test_scenario::begin(VALIDATOR_ADDR_1); + let mut sui_system = test.take_shared(); + + let ctx = test.ctx(); + + // increment epoch number (safe mode emulation) + 540u64.do!(|_| ctx.increment_epoch_number()); + sui_system.set_epoch_for_testing(540); + sui_system.set_stake_subsidy_distribution_counter(540); + + assert!(ctx.epoch() == 540); + assert!(sui_system.get_stake_subsidy_distribution_counter() == 540); + + // perform advance epoch + sui_system + .inner_mut_for_testing() + .advance_epoch(541, 65, balance::zero(), balance::zero(), 0, 0, 0, 0, 100000000000, ctx) + .destroy_for_testing(); // balance returned from `advance_epoch` + + assert_eq!(sui_system.get_stake_subsidy_distribution_counter(), 541); + + test_scenario::return_shared(sui_system); + test.end(); + } } diff --git a/crates/sui-framework/packages/sui-system/tests/sui_system_tests.move b/crates/sui-framework/packages/sui-system/tests/sui_system_tests.move index d333f4e64a642..c7fd42a3d1b20 100644 --- a/crates/sui-framework/packages/sui-system/tests/sui_system_tests.move +++ b/crates/sui-framework/packages/sui-system/tests/sui_system_tests.move @@ -1095,8 +1095,8 @@ module sui_system::sui_system_tests { let mut system_state = scenario.take_shared(); let staked_sui = system_state.request_add_stake_non_entry( - coin::mint_for_testing(100_000_000_000, scenario.ctx()), - @0x1, + coin::mint_for_testing(100_000_000_000, scenario.ctx()), + @0x1, scenario.ctx() ); @@ -1107,20 +1107,23 @@ module sui_system::sui_system_tests { let mut system_state = scenario.take_shared(); let fungible_staked_sui = system_state.convert_to_fungible_staked_sui( - staked_sui, + staked_sui, scenario.ctx() ); assert!(fungible_staked_sui.value() == 100_000_000_000, 0); let sui = system_state.redeem_fungible_staked_sui( - fungible_staked_sui, + fungible_staked_sui, scenario.ctx() ); assert!(sui.value() == 100_000_000_000, 0); test_scenario::return_shared(system_state); + + advance_epoch(scenario); + sui::test_utils::destroy(sui); scenario_val.end(); } diff --git a/crates/sui-framework/packages_compiled/sui-system b/crates/sui-framework/packages_compiled/sui-system index 2f5cc8064c3d9..f8cb9f3ffdf58 100644 Binary files a/crates/sui-framework/packages_compiled/sui-system and b/crates/sui-framework/packages_compiled/sui-system differ diff --git a/crates/sui-framework/published_api.txt b/crates/sui-framework/published_api.txt index 4d9f1f6f33262..700a87f99761d 100644 --- a/crates/sui-framework/published_api.txt +++ b/crates/sui-framework/published_api.txt @@ -691,6 +691,9 @@ advance_epoch current_epoch_subsidy_amount public fun 0x3::stake_subsidy +get_distribution_counter + public(package) fun + 0x3::stake_subsidy SystemParameters public struct 0x3::sui_system_state_inner diff --git a/crates/sui-indexer/src/handlers/checkpoint_handler.rs b/crates/sui-indexer/src/handlers/checkpoint_handler.rs index be4e0d375a923..dd0b00359a631 100644 --- a/crates/sui-indexer/src/handlers/checkpoint_handler.rs +++ b/crates/sui-indexer/src/handlers/checkpoint_handler.rs @@ -8,7 +8,7 @@ use async_trait::async_trait; use itertools::Itertools; use sui_types::dynamic_field::DynamicFieldInfo; use tokio_util::sync::CancellationToken; -use tracing::info; +use tracing::{info, warn}; use move_core_types::language_storage::{StructTag, TypeTag}; use mysten_metrics::{get_metrics, spawn_monitored_task}; @@ -29,7 +29,7 @@ use crate::errors::IndexerError; use crate::handlers::committer::start_tx_checkpoint_commit_task; use crate::metrics::IndexerMetrics; use crate::models::display::StoredDisplay; -use crate::models::epoch::{EndOfEpochUpdate, StartOfEpochUpdate}; +use crate::models::epoch::{EndOfEpochUpdate, EpochEndInfo, EpochStartInfo, StartOfEpochUpdate}; use crate::models::obj_indices::StoredObjectVersion; use crate::store::{IndexerStore, PgIndexerStore}; use crate::types::{ @@ -153,12 +153,7 @@ impl CheckpointHandler { get_sui_system_state(&checkpoint_object_store)?.into_sui_system_state_summary(); return Ok(Some(EpochToCommit { last_epoch: None, - new_epoch: StartOfEpochUpdate::new( - system_state_summary, - 0, //first_checkpoint_id - 0, // first_tx_sequence_number - None, - ), + new_epoch: StartOfEpochUpdate::new(system_state_summary, EpochStartInfo::default()), })); } @@ -170,24 +165,34 @@ impl CheckpointHandler { let system_state_summary = get_sui_system_state(&checkpoint_object_store)?.into_sui_system_state_summary(); - let epoch_event = transactions + let epoch_event_opt = transactions .iter() - .flat_map(|t| t.events.as_ref().map(|e| &e.data)) - .flatten() - .find(|ev| ev.is_system_epoch_info_event()) - .unwrap_or_else(|| { - panic!( - "Can't find SystemEpochInfoEvent in epoch end checkpoint {}", - checkpoint_summary.sequence_number() - ) - }); - - let event = bcs::from_bytes::(&epoch_event.contents)?; + .find_map(|t| { + t.events.as_ref()?.data.iter().find_map(|ev| { + if ev.is_system_epoch_info_event() { + Some(bcs::from_bytes::(&ev.contents)) + } else { + None + } + }) + }) + .transpose()?; + if epoch_event_opt.is_none() { + warn!( + "No SystemEpochInfoEvent found at end of epoch {}, some epoch data will be set to default.", + checkpoint_summary.epoch, + ); + assert!( + system_state_summary.safe_mode, + "Sui is not in safe mode but no SystemEpochInfoEvent found at end of epoch {}", + checkpoint_summary.epoch + ); + } // At some point while committing data in epoch X - 1, we will encounter a new epoch X. We // want to retrieve X - 2's network total transactions to calculate the number of // transactions that occurred in epoch X - 1. - let network_tx_count_prev_epoch = match system_state_summary.epoch { + let first_tx_sequence_number = match system_state_summary.epoch { // If first epoch change, this number is 0 1 => Ok(0), _ => { @@ -204,18 +209,20 @@ impl CheckpointHandler { } }?; + let epoch_end_info = EpochEndInfo::new(epoch_event_opt.as_ref()); + let epoch_start_info = EpochStartInfo::new( + checkpoint_summary.sequence_number.saturating_add(1), + checkpoint_summary.network_total_transactions, + epoch_event_opt.as_ref(), + ); + Ok(Some(EpochToCommit { last_epoch: Some(EndOfEpochUpdate::new( checkpoint_summary, - &event, - network_tx_count_prev_epoch, + first_tx_sequence_number, + epoch_end_info, )), - new_epoch: StartOfEpochUpdate::new( - system_state_summary, - checkpoint_summary.sequence_number + 1, // first_checkpoint_id - checkpoint_summary.network_total_transactions, - Some(&event), - ), + new_epoch: StartOfEpochUpdate::new(system_state_summary, epoch_start_info), })) } diff --git a/crates/sui-indexer/src/models/epoch.rs b/crates/sui-indexer/src/models/epoch.rs index 0918e50c72c35..d8e943f4c245c 100644 --- a/crates/sui-indexer/src/models/epoch.rs +++ b/crates/sui-indexer/src/models/epoch.rs @@ -117,36 +117,81 @@ pub struct QueryableEpochSystemState { pub system_state: Vec, } -impl StartOfEpochUpdate { +#[derive(Default)] +pub struct EpochStartInfo { + pub first_checkpoint_id: u64, + pub first_tx_sequence_number: u64, + pub total_stake: u64, + pub storage_fund_balance: u64, +} + +impl EpochStartInfo { pub fn new( - new_system_state_summary: SuiSystemStateSummary, first_checkpoint_id: u64, first_tx_sequence_number: u64, - event: Option<&SystemEpochInfoEvent>, + epoch_event_opt: Option<&SystemEpochInfoEvent>, + ) -> Self { + Self { + first_checkpoint_id, + first_tx_sequence_number, + total_stake: epoch_event_opt.map(|e| e.total_stake).unwrap_or_default(), + storage_fund_balance: epoch_event_opt + .map(|e| e.storage_fund_balance) + .unwrap_or_default(), + } + } +} + +impl StartOfEpochUpdate { + pub fn new( + new_system_state_summary: SuiSystemStateSummary, + epoch_start_info: EpochStartInfo, ) -> Self { Self { epoch: new_system_state_summary.epoch as i64, system_state_summary_json: serde_json::to_value(new_system_state_summary.clone()) .unwrap(), - first_checkpoint_id: first_checkpoint_id as i64, - first_tx_sequence_number: first_tx_sequence_number as i64, + first_checkpoint_id: epoch_start_info.first_checkpoint_id as i64, + first_tx_sequence_number: epoch_start_info.first_tx_sequence_number as i64, epoch_start_timestamp: new_system_state_summary.epoch_start_timestamp_ms as i64, reference_gas_price: new_system_state_summary.reference_gas_price as i64, protocol_version: new_system_state_summary.protocol_version as i64, - // NOTE: total_stake and storage_fund_balance are about new epoch, - // although the event is generated at the end of the previous epoch, - // the event is optional b/c no such event for the first epoch. - total_stake: event.map(|e| e.total_stake as i64).unwrap_or(0), - storage_fund_balance: event.map(|e| e.storage_fund_balance as i64).unwrap_or(0), + total_stake: epoch_start_info.total_stake as i64, + storage_fund_balance: epoch_start_info.storage_fund_balance as i64, } } } +#[derive(Default)] +pub struct EpochEndInfo { + pub storage_fund_reinvestment: u64, + pub storage_charge: u64, + pub storage_rebate: u64, + pub leftover_storage_fund_inflow: u64, + pub stake_subsidy_amount: u64, + pub total_gas_fees: u64, + pub total_stake_rewards_distributed: u64, +} + +impl EpochEndInfo { + pub fn new(epoch_event_opt: Option<&SystemEpochInfoEvent>) -> Self { + epoch_event_opt.map_or_else(Self::default, |epoch_event| Self { + storage_fund_reinvestment: epoch_event.storage_fund_reinvestment, + storage_charge: epoch_event.storage_charge, + storage_rebate: epoch_event.storage_rebate, + leftover_storage_fund_inflow: epoch_event.leftover_storage_fund_inflow, + stake_subsidy_amount: epoch_event.stake_subsidy_amount, + total_gas_fees: epoch_event.total_gas_fees, + total_stake_rewards_distributed: epoch_event.total_stake_rewards_distributed, + }) + } +} + impl EndOfEpochUpdate { pub fn new( last_checkpoint_summary: &CertifiedCheckpointSummary, - event: &SystemEpochInfoEvent, first_tx_sequence_number: u64, + epoch_end_info: EpochEndInfo, ) -> Self { Self { epoch: last_checkpoint_summary.epoch as i64, @@ -154,13 +199,13 @@ impl EndOfEpochUpdate { - first_tx_sequence_number) as i64, last_checkpoint_id: *last_checkpoint_summary.sequence_number() as i64, epoch_end_timestamp: last_checkpoint_summary.timestamp_ms as i64, - storage_fund_reinvestment: event.storage_fund_reinvestment as i64, - storage_charge: event.storage_charge as i64, - storage_rebate: event.storage_rebate as i64, - leftover_storage_fund_inflow: event.leftover_storage_fund_inflow as i64, - stake_subsidy_amount: event.stake_subsidy_amount as i64, - total_gas_fees: event.total_gas_fees as i64, - total_stake_rewards_distributed: event.total_stake_rewards_distributed as i64, + storage_fund_reinvestment: epoch_end_info.storage_fund_reinvestment as i64, + storage_charge: epoch_end_info.storage_charge as i64, + storage_rebate: epoch_end_info.storage_rebate as i64, + leftover_storage_fund_inflow: epoch_end_info.leftover_storage_fund_inflow as i64, + stake_subsidy_amount: epoch_end_info.stake_subsidy_amount as i64, + total_gas_fees: epoch_end_info.total_gas_fees as i64, + total_stake_rewards_distributed: epoch_end_info.total_stake_rewards_distributed as i64, epoch_commitments: bcs::to_bytes( &last_checkpoint_summary .end_of_epoch_data diff --git a/crates/sui-indexer/src/store/pg_indexer_store.rs b/crates/sui-indexer/src/store/pg_indexer_store.rs index 2f9aaa5d81cb3..b1d1af7b31ed6 100644 --- a/crates/sui-indexer/src/store/pg_indexer_store.rs +++ b/crates/sui-indexer/src/store/pg_indexer_store.rs @@ -298,13 +298,10 @@ impl PgIndexerStore { let mut connection = self.pool.get().await?; - watermarks::table - .select(watermarks::checkpoint_hi_inclusive) - .filter(watermarks::pipeline.eq("objects_snapshot")) - .first::(&mut connection) + objects_snapshot::table + .select(max(objects_snapshot::checkpoint_sequence_number)) + .first::>(&mut connection) .await - // Handle case where the watermark is not set yet - .optional() .map_err(Into::into) .map(|v| v.map(|v| v as u64)) .context( diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 251b8df3073d9..beba109eedafe 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -12,7 +12,7 @@ "name": "Apache-2.0", "url": "https://raw.githubusercontent.com/MystenLabs/sui/main/LICENSE" }, - "version": "1.36.1" + "version": "1.36.2" }, "methods": [ { @@ -1293,7 +1293,7 @@ "name": "Result", "value": { "minSupportedProtocolVersion": "1", - "maxSupportedProtocolVersion": "65", + "maxSupportedProtocolVersion": "67", "protocolVersion": "6", "featureFlags": { "accept_zklogin_in_multisig": false, diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 835463599f7b8..36e57a8e7c7a9 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 = 65; +const MAX_PROTOCOL_VERSION: u64 = 67; // Record history of protocol version allocations here: // @@ -185,7 +185,11 @@ const MAX_PROTOCOL_VERSION: u64 = 65; // Add feature flag for Mysticeti fastpath. // Version 62: Makes the event's sending module package upgrade-aware. // Version 63: Enable gas based congestion control in consensus commit. -// Version 64: Switch to distributed vote scoring in consensus in mainnet +// Version 64: Revert congestion control change. +// Version 65: Enable distributed vote scoring in mainnet. +// Version 66: Revert distributed vote scoring in mainnet. +// Framework fix for fungible staking book-keeping. +// Version 67: Re-enable distributed vote scoring in mainnet. #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -2844,6 +2848,18 @@ impl ProtocolConfig { cfg.feature_flags .consensus_distributed_vote_scoring_strategy = true; } + 66 => { + if chain == Chain::Mainnet { + // Revert the distributed vote scoring for mainnet (for one protocol upgrade) + cfg.feature_flags + .consensus_distributed_vote_scoring_strategy = false; + } + } + 67 => { + // Enable it once again. + cfg.feature_flags + .consensus_distributed_vote_scoring_strategy = true; + } // Use this template when making changes: // // // modify an existing constant. diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_66.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_66.snap new file mode 100644 index 0000000000000..07a447b25d844 --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_66.snap @@ -0,0 +1,329 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 66 +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 + consensus_round_prober: true + validate_identifier_inputs: true + relocate_event_module: 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: 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: 700 +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: 40 +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: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 3 +gas_budget_based_txn_cost_cap_factor: 400000 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_67.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_67.snap new file mode 100644 index 0000000000000..f050b4e16302d --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_67.snap @@ -0,0 +1,330 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 67 +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 + consensus_distributed_vote_scoring_strategy: true + consensus_round_prober: true + validate_identifier_inputs: true + relocate_event_module: 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: 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: 700 +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: 40 +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: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 3 +gas_budget_based_txn_cost_cap_factor: 400000 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_66.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_66.snap new file mode 100644 index 0000000000000..4d141e8b8de23 --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_66.snap @@ -0,0 +1,330 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 66 +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 + consensus_distributed_vote_scoring_strategy: true + consensus_round_prober: true + validate_identifier_inputs: true + relocate_event_module: 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: 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: 700 +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: 40 +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: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 3 +gas_budget_based_txn_cost_cap_factor: 400000 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_67.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_67.snap new file mode 100644 index 0000000000000..f050b4e16302d --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_67.snap @@ -0,0 +1,330 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 67 +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 + consensus_distributed_vote_scoring_strategy: true + consensus_round_prober: true + validate_identifier_inputs: true + relocate_event_module: 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: 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: 700 +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: 40 +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: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 3 +gas_budget_based_txn_cost_cap_factor: 400000 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_66.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_66.snap new file mode 100644 index 0000000000000..747c437d6bbee --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_66.snap @@ -0,0 +1,340 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 66 +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: 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 + 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 +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: 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 +poseidon_bn254_cost_base: 260 +poseidon_bn254_cost_per_block: 10 +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 +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: 700 +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: 40 +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: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 3 +gas_budget_based_txn_cost_cap_factor: 400000 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_67.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_67.snap new file mode 100644 index 0000000000000..f7710f5f46b34 --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_67.snap @@ -0,0 +1,340 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 67 +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: 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 + 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 +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: 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 +poseidon_bn254_cost_base: 260 +poseidon_bn254_cost_per_block: 10 +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 +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: 700 +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: 40 +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: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 3 +gas_budget_based_txn_cost_cap_factor: 400000 + diff --git a/crates/sui-single-node-benchmark/src/mock_storage.rs b/crates/sui-single-node-benchmark/src/mock_storage.rs index c6f03fe1bb8bd..78d9eedb0ec82 100644 --- a/crates/sui-single-node-benchmark/src/mock_storage.rs +++ b/crates/sui-single-node-benchmark/src/mock_storage.rs @@ -48,7 +48,7 @@ impl InMemoryObjectStore { tx_key: &TransactionKey, input_object_kinds: &[InputObjectKind], ) -> SuiResult { - let shared_locks_cell: OnceCell> = OnceCell::new(); + let shared_locks_cell: OnceCell>> = OnceCell::new(); let mut input_objects = Vec::new(); for kind in input_object_kinds { let obj: Option = match kind { @@ -58,11 +58,17 @@ impl InMemoryObjectStore { } InputObjectKind::SharedMoveObject { id, .. } => { - let shared_locks = shared_locks_cell.get_or_try_init(|| { - Ok::, SuiError>( - shared_locks.get_shared_locks(tx_key)?.into_iter().collect(), - ) - })?; + let shared_locks = shared_locks_cell + .get_or_init(|| { + shared_locks + .get_shared_locks(tx_key) + .expect("get_shared_locks should not fail") + .map(|l| l.into_iter().collect()) + }) + .as_ref() + .ok_or_else(|| SuiError::GenericAuthorityError { + error: "Shared object locks should have been set.".to_string(), + })?; let version = shared_locks.get(id).unwrap_or_else(|| { panic!("Shared object locks should have been set. key: {tx_key:?}, obj id: {id:?}") }); @@ -174,7 +180,7 @@ impl GetSharedLocks for InMemoryObjectStore { fn get_shared_locks( &self, _key: &TransactionKey, - ) -> Result, SuiError> { + ) -> SuiResult>> { unreachable!() } } 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 74ac933740527..78fe0ed302647 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: 65 + protocol_version: 67 allow_insertion_of_extra_objects: true epoch_duration_ms: 86400000 stake_subsidy_start_epoch: 0 @@ -49,3 +49,4 @@ 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 d36c1fad5d370..0e47e237cd9a5 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: 65 +protocol_version: 67 system_state_version: 1 validators: total_stake: 20000000000000000 @@ -240,13 +240,13 @@ validators: next_epoch_worker_address: ~ extra_fields: id: - id: "0x834dab6f0617450d0dcfc6dd58e2a918d439fe50d2f914ac6e60dbbc38328ad3" + id: "0xe7d6e165096d0034c4c9ba70611937a441375b2a61bc9fa066bcf7ce04b57cf3" size: 0 voting_power: 10000 - operation_cap_id: "0x72b130e2d852f3468d46e67179268cf2b1a000855a549b0dcab002426836a768" + operation_cap_id: "0x355d1ef0c2ee7241d418319d934f153d55fae186fadcb3aa0255febd98035f5e" gas_price: 1000 staking_pool: - id: "0xdc1b1962050243cbe5efd781c560b88d1c4d43da28ddc1b3f1b558210ca24009" + id: "0xe4c58ef573f4378771467ef9df2a00083328d55d108e9a2645a1881078d6f715" activation_epoch: 0 deactivation_epoch: ~ sui_balance: 20000000000000000 @@ -254,14 +254,14 @@ validators: value: 0 pool_token_balance: 20000000000000000 exchange_rates: - id: "0xb972b09a2f5914997289ba4ebbff641d7f0a3faae622ee29997c1f6713fe7e78" + id: "0x8a0906bfa8feb2df1adafff0cbf8da32ef8cceade944eb447828ec426f8fd37f" size: 1 pending_stake: 0 pending_total_sui_withdraw: 0 pending_pool_token_withdraw: 0 extra_fields: id: - id: "0xc6dec0733287765e9f8600169f776566db59a0f6cb1a854de1865db22cda913d" + id: "0x96756b1f7eb0ceba9defb0e1e8f1934f8fead5397d42a78f8b9226c52be862eb" size: 0 commission_rate: 200 next_epoch_stake: 20000000000000000 @@ -269,27 +269,27 @@ validators: next_epoch_commission_rate: 200 extra_fields: id: - id: "0xe6c77a880c82d4f3e1b8a5d503f3a8e88881de8c7b722e66569ff35f8f505d29" + id: "0x33a28b2b6132638b2964cb9e6d5b3f69258a2ab3bcf7cc3f5fec7d1b13751fc4" size: 0 pending_active_validators: contents: - id: "0xb84831d86c7697202c857ede215fb5739e4c68e1aee6051efb99496833578d22" + id: "0x982a7e03c2e4f57b35cc0617492990cf1a200443de891fd05f235ce3e0f1387e" size: 0 pending_removals: [] staking_pool_mappings: - id: "0xb892dd544e8efe2b3c9c89be5689a297ca4ef59804308a81b11c1d89b90f6e18" + id: "0x88a3c8e207eb66a55d894c4071f260322b0d6a429432cdc852502d8aeb736f90" size: 1 inactive_validators: - id: "0xe285cf22b5d3c56a32961398e8f64a9f4282eb94782aef9080d9a6954e85c7d5" + id: "0xde510a1dc91f90cd0ec41545de8ac311dd0b356f0180965007a270f8ff785ba5" size: 0 validator_candidates: - id: "0x207f4b15b8cd26b0af90e308b677c2589bd914280198b2e8e8528a37f7240c35" + id: "0xe3dd61a97fec3ed47b017292cb4c6e8ead05cb2d21afd6a7c7d3d607c5295722" size: 0 at_risk_validators: contents: [] extra_fields: id: - id: "0x41921a36773858d7ea5e092810acf3e1ecbd5927a34ec4f460a2988390a57969" + id: "0xddf01752e13e66989f10ff99eb6eb80239356569ba15853dd1fd665c20a9533d" size: 0 storage_fund: total_object_storage_rebates: @@ -306,7 +306,7 @@ parameters: validator_low_stake_grace_period: 7 extra_fields: id: - id: "0xe96139872f584b831f86b074cf24c6158f23dd472df821c8b75a5777463d1c3d" + id: "0xf1b6ec3ffe18693281a30727e25e0f582cab6fe00be1a1a9c9c82c60beff64a1" size: 0 reference_gas_price: 1000 validator_report_records: @@ -320,7 +320,7 @@ stake_subsidy: stake_subsidy_decrease_rate: 1000 extra_fields: id: - id: "0xe1172cf766a6e4d4fb8d0a228d794e097462e114626bdedce942087b1c029965" + id: "0xaa8ebb8c4801be341f069bd3c23e816f53a92400262adbc55e5544a435b38eba" size: 0 safe_mode: false safe_mode_storage_rewards: @@ -332,5 +332,6 @@ safe_mode_non_refundable_storage_fee: 0 epoch_start_timestamp_ms: 10 extra_fields: id: - id: "0x531d74b5c7080de67c235dd165095164784ab991a92932bc878c60eaf4fa2a3d" + id: "0xbe252726f02caf130b1c8594c5b78d880fef12d93227a26898ddfd458ead1c19" size: 0 + diff --git a/crates/sui-transactional-test-runner/src/lib.rs b/crates/sui-transactional-test-runner/src/lib.rs index 854ab9d096d81..abf62845c2cb6 100644 --- a/crates/sui-transactional-test-runner/src/lib.rs +++ b/crates/sui-transactional-test-runner/src/lib.rs @@ -15,6 +15,7 @@ use simulacrum::SimulatorStore; use simulator_persisted_store::PersistedStore; use std::path::Path; use std::sync::Arc; +use sui_core::authority::authority_per_epoch_store::CertLockGuard; use sui_core::authority::authority_test_utils::send_and_confirm_transaction_with_execution_error; use sui_core::authority::AuthorityState; use sui_json_rpc::authority_state::StateRead; @@ -142,7 +143,11 @@ impl TransactionalAdapter for ValidatorWithFullnode { ); let epoch_store = self.validator.load_epoch_store_one_call_per_task().clone(); - self.validator.read_objects_for_execution(&tx, &epoch_store) + self.validator.read_objects_for_execution( + &CertLockGuard::dummy_for_tests(), + &tx, + &epoch_store, + ) } fn prepare_txn( diff --git a/crates/sui-types/src/storage/mod.rs b/crates/sui-types/src/storage/mod.rs index 93cb31330eb24..bdb9462b0fa3e 100644 --- a/crates/sui-types/src/storage/mod.rs +++ b/crates/sui-types/src/storage/mod.rs @@ -609,5 +609,5 @@ pub trait GetSharedLocks: Send + Sync { fn get_shared_locks( &self, key: &TransactionKey, - ) -> Result, SuiError>; + ) -> SuiResult>>; } diff --git a/docs/site/src/pages/index.js b/docs/site/src/pages/index.js index 35e4c66203ce0..081e10cfc486c 100644 --- a/docs/site/src/pages/index.js +++ b/docs/site/src/pages/index.js @@ -88,17 +88,6 @@ export default function Home() { Standards - - - Tokenomics - - - Cryptography - - - Standards - -