diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index d318e1e95a581..ec5cafba31ce7 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -206,16 +206,25 @@ pub struct NodeConfig { pub enable_db_write_stall: Option, } -#[derive(Clone, Debug, Deserialize, Serialize, Default)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "kebab-case")] pub enum ExecutionCacheConfig { - #[default] PassthroughCache, WritebackCache { + /// Maximum number of entries in each cache. (There are several different caches). + /// If None, the default of 10000 is used. max_cache_size: Option, }, } +impl Default for ExecutionCacheConfig { + fn default() -> Self { + ExecutionCacheConfig::WritebackCache { + max_cache_size: None, + } + } +} + #[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[serde(rename_all = "lowercase")] pub enum ServerType { diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 8cd70a152f6b4..29145b56438b5 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -5034,7 +5034,7 @@ impl AuthorityState { .protocol_config() .simplified_unwrap_then_delete(); self.get_accumulator_store() - .iter_live_object_set(include_wrapped_object) + .iter_cached_live_object_set_for_testing(include_wrapped_object) } #[cfg(test)] @@ -5053,6 +5053,8 @@ impl AuthorityState { .bulk_insert_genesis_objects(objects)?; self.get_object_cache_reader() .force_reload_system_packages(&BuiltInFramework::all_package_ids()); + self.get_reconfig_api() + .clear_state_end_of_epoch(&self.execution_lock_for_reconfiguration().await); Ok(()) } } diff --git a/crates/sui-core/src/authority/authority_test_utils.rs b/crates/sui-core/src/authority/authority_test_utils.rs index ab2009c2e82d6..a55c820334da5 100644 --- a/crates/sui-core/src/authority/authority_test_utils.rs +++ b/crates/sui-core/src/authority/authority_test_utils.rs @@ -519,7 +519,7 @@ pub async fn publish_package_on_single_authority( dep_original_addresses: impl IntoIterator, dep_ids: Vec, state: &Arc, -) -> SuiResult<(ObjectID, ObjectRef)> { +) -> SuiResult<(TransactionDigest, (ObjectID, ObjectRef))> { let mut build_config = BuildConfig::new_for_testing(); for (addr_name, obj_id) in dep_original_addresses { build_config @@ -561,7 +561,7 @@ pub async fn publish_package_on_single_authority( .find(|c| matches!(c.1, Owner::AddressOwner(..))) .unwrap() .0; - Ok((package_id, cap_object)) + Ok((*effects.transaction_digest(), (package_id, cap_object))) } pub async fn upgrade_package_on_single_authority( @@ -574,7 +574,7 @@ pub async fn upgrade_package_on_single_authority( dep_original_addresses: impl IntoIterator, dep_id_mapping: impl IntoIterator, state: &Arc, -) -> SuiResult { +) -> SuiResult<(TransactionDigest, ObjectID)> { let package = build_test_modules_with_dep_addr(path, dep_original_addresses, dep_id_mapping); let with_unpublished_deps = false; @@ -606,5 +606,5 @@ pub async fn upgrade_package_on_single_authority( .unwrap() .0 .0; - Ok(package_id) + Ok((*effects.transaction_digest(), package_id)) } diff --git a/crates/sui-core/src/authority/test_authority_builder.rs b/crates/sui-core/src/authority/test_authority_builder.rs index 6ba9dd32d4801..f0a0df27bf354 100644 --- a/crates/sui-core/src/authority/test_authority_builder.rs +++ b/crates/sui-core/src/authority/test_authority_builder.rs @@ -362,6 +362,12 @@ impl<'a> TestAuthorityBuilder<'a> { .await .unwrap(); + state + .get_cache_commit() + .commit_transaction_outputs(epoch_store.epoch(), &[*genesis.transaction().digest()]) + .await + .unwrap(); + // We want to insert these objects directly instead of relying on genesis because // genesis process would set the previous transaction field for these objects, which would // change their object digest. This makes it difficult to write tests that want to use diff --git a/crates/sui-core/src/execution_cache.rs b/crates/sui-core/src/execution_cache.rs index 226c4efa3b7c6..83cca46df4ccb 100644 --- a/crates/sui-core/src/execution_cache.rs +++ b/crates/sui-core/src/execution_cache.rs @@ -104,7 +104,7 @@ impl ExecutionCacheTraitPointers { } } -static ENABLE_WRITEBACK_CACHE_ENV_VAR: &str = "ENABLE_WRITEBACK_CACHE"; +static DISABLE_WRITEBACK_CACHE_ENV_VAR: &str = "DISABLE_WRITEBACK_CACHE"; #[derive(Debug)] pub enum ExecutionCacheConfigType { @@ -130,12 +130,12 @@ pub fn choose_execution_cache(config: &ExecutionCacheConfig) -> ExecutionCacheCo } } - if std::env::var(ENABLE_WRITEBACK_CACHE_ENV_VAR).is_ok() - || matches!(config, ExecutionCacheConfig::WritebackCache { .. }) + if std::env::var(DISABLE_WRITEBACK_CACHE_ENV_VAR).is_ok() + || matches!(config, ExecutionCacheConfig::PassthroughCache) { - ExecutionCacheConfigType::WritebackCache - } else { ExecutionCacheConfigType::PassthroughCache + } else { + ExecutionCacheConfigType::WritebackCache } } @@ -158,13 +158,13 @@ pub fn build_execution_cache_from_env( ) -> ExecutionCacheTraitPointers { let execution_cache_metrics = Arc::new(ExecutionCacheMetrics::new(prometheus_registry)); - if std::env::var(ENABLE_WRITEBACK_CACHE_ENV_VAR).is_ok() { + if std::env::var(DISABLE_WRITEBACK_CACHE_ENV_VAR).is_ok() { ExecutionCacheTraitPointers::new( - WritebackCache::new(store.clone(), execution_cache_metrics).into(), + PassthroughCache::new(store.clone(), execution_cache_metrics).into(), ) } else { ExecutionCacheTraitPointers::new( - PassthroughCache::new(store.clone(), execution_cache_metrics).into(), + WritebackCache::new(store.clone(), execution_cache_metrics).into(), ) } } @@ -847,11 +847,11 @@ macro_rules! implement_passthrough_traits { impl ExecutionCacheReconfigAPI for $implementor { fn insert_genesis_object(&self, object: Object) -> SuiResult { - self.store.insert_genesis_object(object) + self.insert_genesis_object_impl(object) } fn bulk_insert_genesis_objects(&self, objects: &[Object]) -> SuiResult { - self.store.bulk_insert_genesis_objects(objects) + self.bulk_insert_genesis_objects_impl(objects) } fn revert_state_update(&self, digest: &TransactionDigest) -> SuiResult { diff --git a/crates/sui-core/src/execution_cache/object_locks.rs b/crates/sui-core/src/execution_cache/object_locks.rs index 97eda0cccf875..f77b9fde6155a 100644 --- a/crates/sui-core/src/execution_cache/object_locks.rs +++ b/crates/sui-core/src/execution_cache/object_locks.rs @@ -128,7 +128,6 @@ impl ObjectLocks { let live_digest = live_object.digest(); if obj_ref.2 != live_digest { - debug!("object digest mismatch: {:?} vs {:?}", obj_ref, live_digest); return Err(SuiError::UserInputError { error: UserInputError::InvalidObjectDigest { object_id: obj_ref.0, diff --git a/crates/sui-core/src/execution_cache/passthrough_cache.rs b/crates/sui-core/src/execution_cache/passthrough_cache.rs index c60abb4a98f00..1518bda18a0d6 100644 --- a/crates/sui-core/src/execution_cache/passthrough_cache.rs +++ b/crates/sui-core/src/execution_cache/passthrough_cache.rs @@ -76,6 +76,14 @@ impl PassthroughCache { }) .ok(); } + + fn bulk_insert_genesis_objects_impl(&self, objects: &[Object]) -> SuiResult { + self.store.bulk_insert_genesis_objects(objects) + } + + fn insert_genesis_object_impl(&self, object: Object) -> SuiResult { + self.store.insert_genesis_object(object) + } } impl ObjectCacheRead for PassthroughCache { diff --git a/crates/sui-core/src/execution_cache/writeback_cache.rs b/crates/sui-core/src/execution_cache/writeback_cache.rs index 2b770f740d50a..de932f7354810 100644 --- a/crates/sui-core/src/execution_cache/writeback_cache.rs +++ b/crates/sui-core/src/execution_cache/writeback_cache.rs @@ -1146,16 +1146,34 @@ impl WritebackCache { self.packages.invalidate(object_id); } self.cached.object_by_id_cache.invalidate(object_id); + self.cached.object_cache.invalidate(object_id); } for ObjectKey(object_id, _) in outputs.deleted.iter().chain(outputs.wrapped.iter()) { self.cached.object_by_id_cache.invalidate(object_id); + self.cached.object_cache.invalidate(object_id); } // Note: individual object entries are removed when clear_state_end_of_epoch_impl is called Ok(()) } + fn bulk_insert_genesis_objects_impl(&self, objects: &[Object]) -> SuiResult { + self.store.bulk_insert_genesis_objects(objects)?; + for obj in objects { + dbg!("invalidagted!", obj.id()); + self.cached.object_cache.invalidate(&obj.id()); + self.cached.object_by_id_cache.invalidate(&obj.id()); + } + Ok(()) + } + + fn insert_genesis_object_impl(&self, object: Object) -> SuiResult { + self.cached.object_by_id_cache.invalidate(&object.id()); + self.cached.object_cache.invalidate(&object.id()); + self.store.insert_genesis_object(object) + } + pub fn clear_caches_and_assert_empty(&self) { info!("clearing caches"); self.cached.clear_and_assert_empty(); diff --git a/crates/sui-core/src/test_utils.rs b/crates/sui-core/src/test_utils.rs index 190e30caedd60..c9fcc1033fe0c 100644 --- a/crates/sui-core/src/test_utils.rs +++ b/crates/sui-core/src/test_utils.rs @@ -85,9 +85,11 @@ pub async fn send_and_confirm_transaction( .epoch_store_for_testing() .protocol_config() .simplified_unwrap_then_delete(); - let mut state = state_acc.accumulate_live_object_set(include_wrapped_tombstone); + let mut state = + state_acc.accumulate_cached_live_object_set_for_testing(include_wrapped_tombstone); let (result, _execution_error_opt) = authority.try_execute_for_test(&certificate).await?; - let state_after = state_acc.accumulate_live_object_set(include_wrapped_tombstone); + let state_after = + state_acc.accumulate_cached_live_object_set_for_testing(include_wrapped_tombstone); let effects_acc = state_acc.accumulate_effects( vec![result.inner().data().clone()], epoch_store.protocol_config(), diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index cda49efeab040..71b406679101a 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -3363,23 +3363,25 @@ async fn test_store_revert_transfer_sui() { .await .unwrap(); - let db = &authority_state.database_for_testing(); - db.revert_state_update(&tx_digest).unwrap(); + let cache = authority_state.get_object_cache_reader(); + let tx_cache = authority_state.get_transaction_cache_reader(); + let reconfig_api = authority_state.get_reconfig_api(); + reconfig_api.revert_state_update(&tx_digest).unwrap(); + reconfig_api + .clear_state_end_of_epoch(&authority_state.execution_lock_for_reconfiguration().await); assert_eq!( - db.get_object(&gas_object_id).unwrap().unwrap().owner, + cache.get_object(&gas_object_id).unwrap().unwrap().owner, Owner::AddressOwner(sender), ); assert_eq!( - db.get_latest_object_ref_or_tombstone(gas_object_id) + cache + .get_latest_object_ref_or_tombstone(gas_object_id) .unwrap() .unwrap(), gas_object_ref ); - // Transaction should not be deleted on revert in case it's needed - // to execute a future state sync checkpoint. - assert!(db.get_transaction_block(&tx_digest).unwrap().is_some()); - assert!(!db.is_tx_already_executed(&tx_digest).unwrap()); + assert!(!tx_cache.is_tx_already_executed(&tx_digest).unwrap()); } #[tokio::test] @@ -3400,6 +3402,15 @@ async fn test_store_revert_wrap_move_call() { .await .unwrap(); + authority_state + .get_cache_commit() + .commit_transaction_outputs( + authority_state.epoch_store_for_testing().epoch(), + &[*create_effects.transaction_digest()], + ) + .await + .unwrap(); + assert!(create_effects.status().is_ok()); assert_eq!(create_effects.created().len(), 1); @@ -3436,18 +3447,21 @@ async fn test_store_revert_wrap_move_call() { let wrapper_v0 = wrap_effects.created()[0].0; - let db = &authority_state.database_for_testing(); - db.revert_state_update(&wrap_digest).unwrap(); + let cache = &authority_state.get_object_cache_reader(); + let reconfig_api = authority_state.get_reconfig_api(); + reconfig_api.revert_state_update(&wrap_digest).unwrap(); + reconfig_api + .clear_state_end_of_epoch(&authority_state.execution_lock_for_reconfiguration().await); // The wrapped object is unwrapped once again (accessible from storage). - let object = db.get_object(&object_v0.0).unwrap().unwrap(); + let object = cache.get_object(&object_v0.0).unwrap().unwrap(); assert_eq!(object.version(), object_v0.1); // The wrapper doesn't exist - assert!(db.get_object(&wrapper_v0.0).unwrap().is_none()); + assert!(cache.get_object(&wrapper_v0.0).unwrap().is_none()); // The gas is uncharged - let gas = db.get_object(&gas_object_id).unwrap().unwrap(); + let gas = cache.get_object(&gas_object_id).unwrap().unwrap(); assert_eq!(gas.version(), create_effects.gas_object().0 .1); } @@ -3485,6 +3499,18 @@ async fn test_store_revert_unwrap_move_call() { .await .unwrap(); + authority_state + .get_cache_commit() + .commit_transaction_outputs( + authority_state.epoch_store_for_testing().epoch(), + &[ + *create_effects.transaction_digest(), + *wrap_effects.transaction_digest(), + ], + ) + .await + .unwrap(); + assert!(wrap_effects.status().is_ok()); assert_eq!(wrap_effects.created().len(), 1); assert_eq!(wrap_effects.wrapped().len(), 1); @@ -3522,21 +3548,25 @@ async fn test_store_revert_unwrap_move_call() { assert_eq!(unwrap_effects.unwrapped().len(), 1); assert_eq!(unwrap_effects.unwrapped()[0].0 .0, object_v0.0); - let db = &authority_state.database_for_testing(); + let cache = &authority_state.get_object_cache_reader(); + let reconfig_api = authority_state.get_reconfig_api(); - db.revert_state_update(&unwrap_digest).unwrap(); + reconfig_api.revert_state_update(&unwrap_digest).unwrap(); + reconfig_api + .clear_state_end_of_epoch(&authority_state.execution_lock_for_reconfiguration().await); // The unwrapped object is wrapped once again - assert!(db.get_object(&object_v0.0).unwrap().is_none()); + assert!(cache.get_object(&object_v0.0).unwrap().is_none()); // The wrapper exists - let wrapper = db.get_object(&wrapper_v0.0).unwrap().unwrap(); + let wrapper = cache.get_object(&wrapper_v0.0).unwrap().unwrap(); assert_eq!(wrapper.version(), wrapper_v0.1); // The gas is uncharged - let gas = db.get_object(&gas_object_id).unwrap().unwrap(); + let gas = cache.get_object(&gas_object_id).unwrap().unwrap(); assert_eq!(gas.version(), wrap_effects.gas_object().0 .1); } + #[tokio::test] async fn test_store_get_dynamic_object() { let (_, fields) = create_and_retrieve_df_info(ident_str!("add_ofield")).await; @@ -3743,6 +3773,18 @@ async fn test_store_revert_add_ofield() { let outer_v0 = create_outer_effects.created()[0].0; let inner_v0 = create_inner_effects.created()[0].0; + authority_state + .get_cache_commit() + .commit_transaction_outputs( + authority_state.epoch_store_for_testing().epoch(), + &[ + *create_outer_effects.transaction_digest(), + *create_inner_effects.transaction_digest(), + ], + ) + .await + .unwrap(); + let add_txn = to_sender_signed_transaction( TransactionData::new_move_call( sender, @@ -3777,27 +3819,31 @@ async fn test_store_revert_add_ofield() { let outer_v1 = find_by_id(&add_effects.mutated(), outer_v0.0).unwrap(); let inner_v1 = find_by_id(&add_effects.mutated(), inner_v0.0).unwrap(); - let db = &authority_state.database_for_testing(); + let cache = authority_state.get_object_cache_reader(); + let reconfig_api = &authority_state.get_reconfig_api(); - let outer = db.get_object(&outer_v0.0).unwrap().unwrap(); + let outer = cache.get_object(&outer_v0.0).unwrap().unwrap(); assert_eq!(outer.version(), outer_v1.1); - let field = db.get_object(&field_v0.0).unwrap().unwrap(); + let field = cache.get_object(&field_v0.0).unwrap().unwrap(); assert_eq!(field.owner, Owner::ObjectOwner(outer_v0.0.into())); - let inner = db.get_object(&inner_v0.0).unwrap().unwrap(); + let inner = cache.get_object(&inner_v0.0).unwrap().unwrap(); assert_eq!(inner.version(), inner_v1.1); assert_eq!(inner.owner, Owner::ObjectOwner(field_v0.0.into())); - db.revert_state_update(&add_digest).unwrap(); + reconfig_api.revert_state_update(&add_digest).unwrap(); + + reconfig_api + .clear_state_end_of_epoch(&authority_state.execution_lock_for_reconfiguration().await); - let outer = db.get_object(&outer_v0.0).unwrap().unwrap(); + let outer = cache.get_object(&outer_v0.0).unwrap().unwrap(); assert_eq!(outer.version(), outer_v0.1); // Field no longer exists - assert!(db.get_object(&field_v0.0).unwrap().is_none()); + assert!(cache.get_object(&field_v0.0).unwrap().is_none()); - let inner = db.get_object(&inner_v0.0).unwrap().unwrap(); + let inner = cache.get_object(&inner_v0.0).unwrap().unwrap(); assert_eq!(inner.version(), inner_v0.1); assert_eq!(inner.owner, Owner::AddressOwner(sender)); } @@ -3854,6 +3900,19 @@ async fn test_store_revert_remove_ofield() { assert!(add_effects.status().is_ok()); assert_eq!(add_effects.created().len(), 1); + authority_state + .get_cache_commit() + .commit_transaction_outputs( + authority_state.epoch_store_for_testing().epoch(), + &[ + *create_outer_effects.transaction_digest(), + *create_inner_effects.transaction_digest(), + *add_effects.transaction_digest(), + ], + ) + .await + .unwrap(); + let field_v0 = add_effects.created()[0].0; let outer_v1 = find_by_id(&add_effects.mutated(), outer_v0.0).unwrap(); let inner_v1 = find_by_id(&add_effects.mutated(), inner_v0.0).unwrap(); @@ -3889,24 +3948,29 @@ async fn test_store_revert_remove_ofield() { let outer_v2 = find_by_id(&remove_effects.mutated(), outer_v0.0).unwrap(); let inner_v2 = find_by_id(&remove_effects.mutated(), inner_v0.0).unwrap(); - let db = &authority_state.database_for_testing(); + let cache = &authority_state.get_object_cache_reader(); + let reconfig_api = &authority_state.get_reconfig_api(); - let outer = db.get_object(&outer_v0.0).unwrap().unwrap(); + let outer = cache.get_object(&outer_v0.0).unwrap().unwrap(); assert_eq!(outer.version(), outer_v2.1); - let inner = db.get_object(&inner_v0.0).unwrap().unwrap(); + let inner = cache.get_object(&inner_v0.0).unwrap().unwrap(); assert_eq!(inner.owner, Owner::AddressOwner(sender)); assert_eq!(inner.version(), inner_v2.1); - db.revert_state_update(&remove_ofield_digest).unwrap(); + reconfig_api + .revert_state_update(&remove_ofield_digest) + .unwrap(); + reconfig_api + .clear_state_end_of_epoch(&authority_state.execution_lock_for_reconfiguration().await); - let outer = db.get_object(&outer_v0.0).unwrap().unwrap(); + let outer = cache.get_object(&outer_v0.0).unwrap().unwrap(); assert_eq!(outer.version(), outer_v1.1); - let field = db.get_object(&field_v0.0).unwrap().unwrap(); + let field = cache.get_object(&field_v0.0).unwrap().unwrap(); assert_eq!(field.owner, Owner::ObjectOwner(outer_v0.0.into())); - let inner = db.get_object(&inner_v0.0).unwrap().unwrap(); + let inner = cache.get_object(&inner_v0.0).unwrap().unwrap(); assert_eq!(inner.owner, Owner::ObjectOwner(field_v0.0.into())); assert_eq!(inner.version(), inner_v1.1); } diff --git a/crates/sui-core/src/unit_tests/transaction_deny_tests.rs b/crates/sui-core/src/unit_tests/transaction_deny_tests.rs index c8c6ad7c04cb0..d0f9cb6bf2979 100644 --- a/crates/sui-core/src/unit_tests/transaction_deny_tests.rs +++ b/crates/sui-core/src/unit_tests/transaction_deny_tests.rs @@ -289,7 +289,7 @@ async fn test_package_denied() { let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); // Publish 3 packages, where b depends on c, and a depends on b. // Also upgrade c to c', and upgrade b to b' (which will start using c' instead of c as dependency). - let (package_c, cap_c) = publish_package_on_single_authority( + let (tx_c, (package_c, cap_c)) = publish_package_on_single_authority( &path.join("src/unit_tests/data/package_deny/c"), accounts[0].0, &accounts[0].1, @@ -300,7 +300,7 @@ async fn test_package_denied() { ) .await .unwrap(); - let (package_b, cap_b) = publish_package_on_single_authority( + let (tx_b, (package_b, cap_b)) = publish_package_on_single_authority( &path.join("src/unit_tests/data/package_deny/b"), accounts[0].0, &accounts[0].1, @@ -311,7 +311,7 @@ async fn test_package_denied() { ) .await .unwrap(); - let (package_a, cap_a) = publish_package_on_single_authority( + let (tx_a, (package_a, cap_a)) = publish_package_on_single_authority( &path.join("src/unit_tests/data/package_deny/a"), accounts[0].0, &accounts[0].1, @@ -322,7 +322,7 @@ async fn test_package_denied() { ) .await .unwrap(); - let package_c_prime = upgrade_package_on_single_authority( + let (tx_c_prime, package_c_prime) = upgrade_package_on_single_authority( &path.join("src/unit_tests/data/package_deny/c"), accounts[0].0, &accounts[0].1, @@ -335,7 +335,7 @@ async fn test_package_denied() { ) .await .unwrap(); - let package_b_prime = upgrade_package_on_single_authority( + let (tx_b_prime, package_b_prime) = upgrade_package_on_single_authority( &path.join("src/unit_tests/data/package_deny/b"), accounts[0].0, &accounts[0].1, @@ -349,6 +349,15 @@ async fn test_package_denied() { .await .unwrap(); + state + .get_cache_commit() + .commit_transaction_outputs( + state.epoch_store_for_testing().epoch(), + &[tx_c, tx_b, tx_a, tx_c_prime, tx_b_prime], + ) + .await + .unwrap(); + // Re-create the state such that we could deny package c. let state = reload_state_with_new_deny_config( &network_config, diff --git a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap index 0602ac47887bc..cf26a2e09769d 100644 --- a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap +++ b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap @@ -158,7 +158,9 @@ validator_configs: check-system-overload-at-signing: true max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 - execution-cache: passthrough-cache + execution-cache: + writeback-cache: + max_cache_size: ~ enable-soft-bundle: true enable-validator-tx-finalizer: true verifier-signing-config: @@ -322,7 +324,9 @@ validator_configs: check-system-overload-at-signing: true max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 - execution-cache: passthrough-cache + execution-cache: + writeback-cache: + max_cache_size: ~ enable-soft-bundle: true enable-validator-tx-finalizer: true verifier-signing-config: @@ -486,7 +490,9 @@ validator_configs: check-system-overload-at-signing: true max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 - execution-cache: passthrough-cache + execution-cache: + writeback-cache: + max_cache_size: ~ enable-soft-bundle: true enable-validator-tx-finalizer: true verifier-signing-config: @@ -650,7 +656,9 @@ validator_configs: check-system-overload-at-signing: true max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 - execution-cache: passthrough-cache + execution-cache: + writeback-cache: + max_cache_size: ~ enable-soft-bundle: true enable-validator-tx-finalizer: true verifier-signing-config: @@ -814,7 +822,9 @@ validator_configs: check-system-overload-at-signing: true max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 - execution-cache: passthrough-cache + execution-cache: + writeback-cache: + max_cache_size: ~ enable-soft-bundle: true enable-validator-tx-finalizer: true verifier-signing-config: @@ -978,7 +988,9 @@ validator_configs: check-system-overload-at-signing: true max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 - execution-cache: passthrough-cache + execution-cache: + writeback-cache: + max_cache_size: ~ enable-soft-bundle: true enable-validator-tx-finalizer: true verifier-signing-config: @@ -1142,7 +1154,9 @@ validator_configs: check-system-overload-at-signing: true max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 - execution-cache: passthrough-cache + execution-cache: + writeback-cache: + max_cache_size: ~ enable-soft-bundle: true enable-validator-tx-finalizer: true verifier-signing-config: @@ -1158,3 +1172,4 @@ account_keys: - mfPjCoE6SX0Sl84MnmNS/LS+tfPpkn7I8tziuk2g0WM= - 5RWlYF22jS9i76zLl8jP2D3D8GC5ht+IP1dWUBGZxi8= genesis: "[fake genesis]" + diff --git a/crates/sui-types/src/transaction.rs b/crates/sui-types/src/transaction.rs index 269760fe3687b..1ed5c8c751438 100644 --- a/crates/sui-types/src/transaction.rs +++ b/crates/sui-types/src/transaction.rs @@ -2864,7 +2864,7 @@ pub struct ObjectReadResult { pub object: ObjectReadResultKind, } -#[derive(Clone, Debug)] +#[derive(Clone)] pub enum ObjectReadResultKind { Object(Object), // The version of the object that the transaction intended to read, and the digest of the tx @@ -2874,6 +2874,22 @@ pub enum ObjectReadResultKind { CancelledTransactionSharedObject(SequenceNumber), } +impl std::fmt::Debug for ObjectReadResultKind { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + ObjectReadResultKind::Object(obj) => { + write!(f, "Object({:?})", obj.compute_object_reference()) + } + ObjectReadResultKind::DeletedSharedObject(seq, digest) => { + write!(f, "DeletedSharedObject({}, {:?})", seq, digest) + } + ObjectReadResultKind::CancelledTransactionSharedObject(seq) => { + write!(f, "CancelledTransactionSharedObject({})", seq) + } + } + } +} + impl From for ObjectReadResultKind { fn from(object: Object) -> Self { Self::Object(object) @@ -3019,6 +3035,12 @@ pub struct InputObjects { objects: Vec, } +impl std::fmt::Debug for InputObjects { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_list().entries(self.objects.iter()).finish() + } +} + // An InputObjects new-type that has been verified by sui-transaction-checks, and can be // safely passed to execution. pub struct CheckedInputObjects(InputObjects); diff --git a/docker/sui-network/docker-compose-antithesis.yaml b/docker/sui-network/docker-compose-antithesis.yaml index 1e67f2884507c..bbbe237f85b79 100644 --- a/docker/sui-network/docker-compose-antithesis.yaml +++ b/docker/sui-network/docker-compose-antithesis.yaml @@ -65,6 +65,7 @@ services: container_name: validator3 hostname: validator3 environment: + - DISABLE_WRITEBACK_CACHE=1 - RUST_BACKTRACE=1 - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,consensus=debug,jsonrpsee=error - RPC_WORKER_THREAD=12 @@ -92,6 +93,7 @@ services: container_name: validator4 hostname: validator4 environment: + - DISABLE_WRITEBACK_CACHE=1 - RUST_BACKTRACE=1 - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,consensus=debug,jsonrpsee=error - RPC_WORKER_THREAD=12