diff --git a/Cargo.lock b/Cargo.lock index 53d81127b4df5..618ac4a81ce81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom 0.2.11", "once_cell", @@ -92,9 +92,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if", "getrandom 0.2.11", @@ -2796,6 +2796,7 @@ dependencies = [ "derivative", "move-binary-format", "move-core-types", + "move-vm-types", "proptest", "proptest-derive 0.4.0", "rayon", @@ -4400,6 +4401,7 @@ dependencies = [ "either", "move-binary-format", "move-core-types", + "move-vm-types", "rand 0.7.3", "serde", "test-case", @@ -8577,7 +8579,7 @@ version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "114a100a9aa9f4c468a7b9e96626cdab267bb652660d8408e8f6d56d4c310edd" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "camino", "cargo_metadata 0.18.1", "cfg-if", @@ -8697,7 +8699,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] @@ -8706,7 +8708,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", ] [[package]] @@ -8715,7 +8717,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "allocator-api2", ] @@ -9328,7 +9330,7 @@ version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "321f0f839cd44a4686e9504b0a62b4d69a50b62072144c71c68f5873c167b8d9" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "clap 4.4.14", "crossbeam-channel", "crossbeam-utils", @@ -9372,7 +9374,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ab388864246d58a276e60e7569a833d9cc4cd75c66e5ca77c177dad38e59996" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", "dashmap", "hashbrown 0.12.3", "once_cell", @@ -12980,7 +12982,7 @@ name = "processor" version = "1.0.0" source = "git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=9936ec73cef251fb01fd2c47412e064cad3975c2#9936ec73cef251fb01fd2c47412e064cad3975c2" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "anyhow", "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processors.git?rev=9936ec73cef251fb01fd2c47412e064cad3975c2)", "aptos-protos 1.1.2", diff --git a/aptos-move/aptos-aggregator/src/delayed_change.rs b/aptos-move/aptos-aggregator/src/delayed_change.rs index df1fef613eec4..4535d891bd644 100644 --- a/aptos-move/aptos-aggregator/src/delayed_change.rs +++ b/aptos-move/aptos-aggregator/src/delayed_change.rs @@ -251,8 +251,9 @@ impl DelayedApplyEntry { #[cfg(test)] mod test { use super::*; - use crate::{bounded_math::SignedU128, types::DelayedFieldID}; + use crate::bounded_math::SignedU128; use claims::{assert_err, assert_ok}; + use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use DelayedApplyChange::*; use DelayedChange::*; use DelayedFieldValue::*; diff --git a/aptos-move/aptos-aggregator/src/delayed_field_extension.rs b/aptos-move/aptos-aggregator/src/delayed_field_extension.rs index 6fd72449a9194..bd696d489fe17 100644 --- a/aptos-move/aptos-aggregator/src/delayed_field_extension.rs +++ b/aptos-move/aptos-aggregator/src/delayed_field_extension.rs @@ -7,8 +7,8 @@ use crate::{ delta_change_set::DeltaWithMax, resolver::DelayedFieldResolver, types::{ - code_invariant_error, expect_ok, DelayedFieldID, DelayedFieldValue, - DelayedFieldsSpeculativeError, PanicOr, ReadPosition, + code_invariant_error, expect_ok, DelayedFieldValue, DelayedFieldsSpeculativeError, PanicOr, + ReadPosition, }, }; use aptos_types::delayed_fields::{ @@ -16,6 +16,7 @@ use aptos_types::delayed_fields::{ SnapshotToStringFormula, }; use move_binary_format::errors::PartialVMResult; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::collections::{btree_map::Entry, BTreeMap}; fn get_delayed_field_value_from_storage( diff --git a/aptos-move/aptos-aggregator/src/resolver.rs b/aptos-move/aptos-aggregator/src/resolver.rs index f91bc257c851e..5203e1ca30639 100644 --- a/aptos-move/aptos-aggregator/src/resolver.rs +++ b/aptos-move/aptos-aggregator/src/resolver.rs @@ -6,7 +6,7 @@ use crate::{ bounded_math::SignedU128, delta_change_set::{serialize, DeltaOp}, types::{ - code_invariant_error, DelayedFieldID, DelayedFieldValue, DelayedFieldsSpeculativeError, + code_invariant_error, DelayedFieldValue, DelayedFieldsSpeculativeError, DeltaApplicationFailureReason, PanicOr, }, }; @@ -21,6 +21,7 @@ use aptos_types::{ }; use move_binary_format::errors::{PartialVMError, PartialVMResult}; use move_core_types::{language_storage::StructTag, value::MoveTypeLayout, vm_status::StatusCode}; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::{ collections::{BTreeMap, HashSet}, fmt::Debug, diff --git a/aptos-move/aptos-aggregator/src/tests/types.rs b/aptos-move/aptos-aggregator/src/tests/types.rs index 4b0a6d25b7b1a..2ff5950808d64 100644 --- a/aptos-move/aptos-aggregator/src/tests/types.rs +++ b/aptos-move/aptos-aggregator/src/tests/types.rs @@ -7,8 +7,7 @@ use crate::{ delta_change_set::serialize, resolver::{TAggregatorV1View, TDelayedFieldView}, types::{ - code_invariant_error, expect_ok, DelayedFieldID, DelayedFieldValue, - DelayedFieldsSpeculativeError, PanicOr, + code_invariant_error, expect_ok, DelayedFieldValue, DelayedFieldsSpeculativeError, PanicOr, }, }; use aptos_types::{ @@ -20,7 +19,7 @@ use aptos_types::{ }; use move_binary_format::errors::PartialVMResult; use move_core_types::{language_storage::StructTag, value::MoveTypeLayout}; -use move_vm_types::delayed_values::delayed_field_id::ExtractUniqueIndex; +use move_vm_types::delayed_values::delayed_field_id::{DelayedFieldID, ExtractUniqueIndex}; use std::{ cell::RefCell, collections::{BTreeMap, HashMap, HashSet}, diff --git a/aptos-move/aptos-aggregator/src/types.rs b/aptos-move/aptos-aggregator/src/types.rs index 8042070812b9c..a4530bb750cef 100644 --- a/aptos-move/aptos-aggregator/src/types.rs +++ b/aptos-move/aptos-aggregator/src/types.rs @@ -3,17 +3,15 @@ use crate::bounded_math::SignedU128; use aptos_logger::error; -// TODO[agg_v2](cleanup): After aggregators_v2 branch land, consolidate these, instead of using alias here -pub use aptos_types::delayed_fields::PanicError; +use aptos_types::delayed_fields::PanicError; use move_binary_format::errors::PartialVMError; use move_core_types::{ value::{IdentifierMappingKind, MoveTypeLayout}, vm_status::StatusCode, }; -pub use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use move_vm_types::{ delayed_values::{ - delayed_field_id::TryFromMoveValue, + delayed_field_id::{DelayedFieldID, TryFromMoveValue}, derived_string_snapshot::{ bytes_and_width_to_derived_string_struct, derived_string_struct_to_bytes_and_length, is_derived_string_struct_layout, diff --git a/aptos-move/aptos-vm-types/Cargo.toml b/aptos-move/aptos-vm-types/Cargo.toml index ab17a99fafbc3..72f92e55e866b 100644 --- a/aptos-move/aptos-vm-types/Cargo.toml +++ b/aptos-move/aptos-vm-types/Cargo.toml @@ -24,6 +24,7 @@ claims = { workspace = true } either = { workspace = true } move-binary-format = { workspace = true } move-core-types = { workspace = true } +move-vm-types = { workspace = true } rand = { workspace = true } serde = { workspace = true } diff --git a/aptos-move/aptos-vm-types/src/change_set.rs b/aptos-move/aptos-vm-types/src/change_set.rs index f7eb506a66c30..5f79f116ef614 100644 --- a/aptos-move/aptos-vm-types/src/change_set.rs +++ b/aptos-move/aptos-vm-types/src/change_set.rs @@ -13,7 +13,7 @@ use aptos_aggregator::{ delayed_change::DelayedChange, delta_change_set::{serialize, DeltaOp}, resolver::AggregatorV1Resolver, - types::{code_invariant_error, DelayedFieldID}, + types::code_invariant_error, }; use aptos_types::{ contract_event::ContractEvent, @@ -34,6 +34,7 @@ use move_core_types::{ value::MoveTypeLayout, vm_status::StatusCode, }; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use rand::Rng; use std::{ collections::{ diff --git a/aptos-move/aptos-vm-types/src/resolver.rs b/aptos-move/aptos-vm-types/src/resolver.rs index 25c072a62d848..8f2fb475bb5ec 100644 --- a/aptos-move/aptos-vm-types/src/resolver.rs +++ b/aptos-move/aptos-vm-types/src/resolver.rs @@ -1,10 +1,7 @@ // Copyright © Aptos Foundation // SPDX-License-Identifier: Apache-2.0 -use aptos_aggregator::{ - resolver::{TAggregatorV1View, TDelayedFieldView}, - types::DelayedFieldID, -}; +use aptos_aggregator::resolver::{TAggregatorV1View, TDelayedFieldView}; use aptos_types::{ serde_helper::bcs_utils::size_u32_as_uleb128, state_store::{ @@ -19,6 +16,7 @@ use aptos_types::{ use bytes::Bytes; use move_binary_format::errors::{PartialVMError, PartialVMResult}; use move_core_types::{language_storage::StructTag, value::MoveTypeLayout, vm_status::StatusCode}; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::collections::{BTreeMap, HashMap}; /// Allows to query resources from the state. diff --git a/aptos-move/aptos-vm-types/src/tests/test_change_set.rs b/aptos-move/aptos-vm-types/src/tests/test_change_set.rs index 78dd909d718fc..35289fc0ba9b4 100644 --- a/aptos-move/aptos-vm-types/src/tests/test_change_set.rs +++ b/aptos-move/aptos-vm-types/src/tests/test_change_set.rs @@ -15,7 +15,6 @@ use aptos_aggregator::{ bounded_math::SignedU128, delayed_change::{DelayedApplyChange, DelayedChange}, delta_change_set::DeltaWithMax, - types::DelayedFieldID, }; use aptos_types::{ access_path::AccessPath, @@ -34,6 +33,7 @@ use move_core_types::{ value::MoveTypeLayout, vm_status::StatusCode, }; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::{collections::BTreeMap, sync::Arc}; /// Testcases: diff --git a/aptos-move/aptos-vm-types/src/tests/utils.rs b/aptos-move/aptos-vm-types/src/tests/utils.rs index 0d5eee8ca441d..b69590b271a3b 100644 --- a/aptos-move/aptos-vm-types/src/tests/utils.rs +++ b/aptos-move/aptos-vm-types/src/tests/utils.rs @@ -10,7 +10,6 @@ use crate::{ use aptos_aggregator::{ delayed_change::DelayedChange, delta_change_set::{delta_add, DeltaOp}, - types::DelayedFieldID, }; use aptos_types::{ account_address::AccountAddress, @@ -26,6 +25,7 @@ use move_core_types::{ language_storage::{StructTag, TypeTag}, value::MoveTypeLayout, }; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::{collections::BTreeMap, sync::Arc}; pub(crate) struct MockChangeSetChecker; diff --git a/aptos-move/aptos-vm/src/block_executor/mod.rs b/aptos-move/aptos-vm/src/block_executor/mod.rs index 48ad0bafb22b8..76e303eeacdfd 100644 --- a/aptos-move/aptos-vm/src/block_executor/mod.rs +++ b/aptos-move/aptos-vm/src/block_executor/mod.rs @@ -10,7 +10,6 @@ use crate::{ }; use aptos_aggregator::{ delayed_change::DelayedChange, delta_change_set::DeltaOp, resolver::TAggregatorV1View, - types::DelayedFieldID, }; use aptos_block_executor::{ errors::BlockExecutionError, executor::BlockExecutor, @@ -38,6 +37,7 @@ use move_core_types::{ value::MoveTypeLayout, vm_status::{StatusCode, VMStatus}, }; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use once_cell::sync::OnceCell; use rayon::ThreadPool; use std::{ diff --git a/aptos-move/aptos-vm/src/data_cache.rs b/aptos-move/aptos-vm/src/data_cache.rs index 24470633a44dd..4c316a650d4d2 100644 --- a/aptos-move/aptos-vm/src/data_cache.rs +++ b/aptos-move/aptos-vm/src/data_cache.rs @@ -13,7 +13,7 @@ use crate::{ use aptos_aggregator::{ bounded_math::SignedU128, resolver::{TAggregatorV1View, TDelayedFieldView}, - types::{DelayedFieldID, DelayedFieldValue, DelayedFieldsSpeculativeError, PanicOr}, + types::{DelayedFieldValue, DelayedFieldsSpeculativeError, PanicOr}, }; use aptos_table_natives::{TableHandle, TableResolver}; use aptos_types::{ @@ -43,6 +43,7 @@ use move_core_types::{ resolver::{resource_size, ModuleResolver, ResourceResolver}, value::MoveTypeLayout, }; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::{ cell::RefCell, collections::{BTreeMap, HashMap, HashSet}, diff --git a/aptos-move/aptos-vm/src/move_vm_ext/respawned_session.rs b/aptos-move/aptos-vm/src/move_vm_ext/respawned_session.rs index 940ad9a0f717d..c742b86b18de8 100644 --- a/aptos-move/aptos-vm/src/move_vm_ext/respawned_session.rs +++ b/aptos-move/aptos-vm/src/move_vm_ext/respawned_session.rs @@ -12,8 +12,7 @@ use aptos_aggregator::{ delta_change_set::DeltaWithMax, resolver::{TAggregatorV1View, TDelayedFieldView}, types::{ - code_invariant_error, expect_ok, DelayedFieldID, DelayedFieldValue, - DelayedFieldsSpeculativeError, PanicOr, + code_invariant_error, expect_ok, DelayedFieldValue, DelayedFieldsSpeculativeError, PanicOr, }, }; use aptos_gas_algebra::Fee; @@ -44,6 +43,7 @@ use move_core_types::{ value::MoveTypeLayout, vm_status::{err_msg, StatusCode, VMStatus}, }; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::{ collections::{BTreeMap, HashMap, HashSet}, sync::Arc, diff --git a/aptos-move/aptos-vm/src/natives.rs b/aptos-move/aptos-vm/src/natives.rs index 1ff10bb7da49b..71f3a2ae616b5 100644 --- a/aptos-move/aptos-vm/src/natives.rs +++ b/aptos-move/aptos-vm/src/natives.rs @@ -10,10 +10,7 @@ use aptos_aggregator::{ types::{DelayedFieldsSpeculativeError, PanicOr}, }; #[cfg(feature = "testing")] -use aptos_aggregator::{ - resolver::TDelayedFieldView, - types::{DelayedFieldID, DelayedFieldValue}, -}; +use aptos_aggregator::{resolver::TDelayedFieldView, types::DelayedFieldValue}; #[cfg(feature = "testing")] use aptos_framework::natives::{cryptography::algebra::AlgebraContext, event::NativeEventContext}; use aptos_gas_schedule::{MiscGasParameters, NativeGasParameters, LATEST_GAS_FEATURE_VERSION}; @@ -41,6 +38,8 @@ use move_binary_format::errors::PartialVMResult; use move_core_types::{language_storage::StructTag, value::MoveTypeLayout}; use move_vm_runtime::native_functions::NativeFunctionTable; #[cfg(feature = "testing")] +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; +#[cfg(feature = "testing")] use std::{ collections::{BTreeMap, HashSet}, sync::Arc, diff --git a/aptos-move/block-executor/src/captured_reads.rs b/aptos-move/block-executor/src/captured_reads.rs index d70a9bab34ed4..b9c9929434c6b 100644 --- a/aptos-move/block-executor/src/captured_reads.rs +++ b/aptos-move/block-executor/src/captured_reads.rs @@ -756,9 +756,9 @@ impl UnsyncReadSet { mod test { use super::*; use crate::proptest_types::types::{raw_metadata, KeyType, MockEvent, ValueType}; - use aptos_aggregator::types::DelayedFieldID; use aptos_mvhashmap::types::StorageVersion; use claims::{assert_err, assert_gt, assert_matches, assert_none, assert_ok, assert_some_eq}; + use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use test_case::test_case; #[test] diff --git a/aptos-move/block-executor/src/proptest_types/types.rs b/aptos-move/block-executor/src/proptest_types/types.rs index b81992f7f4c44..9bd38c5f2bfc4 100644 --- a/aptos-move/block-executor/src/proptest_types/types.rs +++ b/aptos-move/block-executor/src/proptest_types/types.rs @@ -10,7 +10,6 @@ use aptos_aggregator::{ delayed_change::DelayedChange, delta_change_set::{delta_add, delta_sub, serialize, DeltaOp}, resolver::TAggregatorV1View, - types::DelayedFieldID, }; use aptos_mvhashmap::types::TxnIndex; use aptos_types::{ @@ -34,6 +33,7 @@ use aptos_vm_types::resolver::{TExecutorView, TResourceGroupView}; use bytes::Bytes; use claims::{assert_ge, assert_le, assert_ok}; use move_core_types::value::MoveTypeLayout; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use once_cell::sync::OnceCell; use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*, proptest, sample::Index}; use proptest_derive::Arbitrary; diff --git a/aptos-move/block-executor/src/value_exchange.rs b/aptos-move/block-executor/src/value_exchange.rs index 9dab64fcb8512..5170291e6dba5 100644 --- a/aptos-move/block-executor/src/value_exchange.rs +++ b/aptos-move/block-executor/src/value_exchange.rs @@ -4,10 +4,11 @@ use crate::view::{LatestView, ViewState}; use aptos_aggregator::{ resolver::TDelayedFieldView, - types::{code_invariant_error, DelayedFieldValue, PanicError, ReadPosition}, + types::{code_invariant_error, DelayedFieldValue, ReadPosition}, }; use aptos_mvhashmap::{types::TxnIndex, versioned_delayed_fields::TVersionedDelayedFieldView}; use aptos_types::{ + delayed_fields::PanicError, executable::Executable, state_store::{state_value::StateValueMetadata, TStateView}, transaction::BlockExecutableTransaction as Transaction, diff --git a/aptos-move/framework/src/natives/aggregator_natives/context.rs b/aptos-move/framework/src/natives/aggregator_natives/context.rs index 4632997c00ac6..cfbf821a8ebc3 100644 --- a/aptos-move/framework/src/natives/aggregator_natives/context.rs +++ b/aptos-move/framework/src/natives/aggregator_natives/context.rs @@ -8,7 +8,6 @@ use aptos_aggregator::{ delayed_field_extension::DelayedFieldData, delta_change_set::DeltaOp, resolver::{AggregatorV1Resolver, DelayedFieldResolver}, - types::DelayedFieldID, }; use aptos_types::{ delayed_fields::PanicError, @@ -16,6 +15,7 @@ use aptos_types::{ }; use better_any::{Tid, TidAble}; use move_core_types::value::MoveTypeLayout; +use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use std::{ cell::RefCell, collections::{BTreeMap, HashSet}, diff --git a/aptos-move/mvhashmap/Cargo.toml b/aptos-move/mvhashmap/Cargo.toml index 1be6297a183e2..3610582999b34 100644 --- a/aptos-move/mvhashmap/Cargo.toml +++ b/aptos-move/mvhashmap/Cargo.toml @@ -27,6 +27,7 @@ dashmap = { workspace = true } derivative = { workspace = true } move-binary-format = { workspace = true } move-core-types = { workspace = true } +move-vm-types = { workspace = true } serde = { workspace = true } [dev-dependencies] diff --git a/aptos-move/mvhashmap/src/versioned_delayed_fields.rs b/aptos-move/mvhashmap/src/versioned_delayed_fields.rs index 3908c32ca2d91..951ca8a1c9e5e 100644 --- a/aptos-move/mvhashmap/src/versioned_delayed_fields.rs +++ b/aptos-move/mvhashmap/src/versioned_delayed_fields.rs @@ -4,8 +4,9 @@ use crate::types::{AtomicTxnIndex, MVDelayedFieldsError, TxnIndex}; use aptos_aggregator::{ delayed_change::{ApplyBase, DelayedApplyEntry, DelayedEntry}, - types::{code_invariant_error, DelayedFieldValue, PanicError, PanicOr, ReadPosition}, + types::{code_invariant_error, DelayedFieldValue, PanicOr, ReadPosition}, }; +use aptos_types::delayed_fields::PanicError; use claims::assert_matches; use crossbeam::utils::CachePadded; use dashmap::DashMap; @@ -711,10 +712,10 @@ mod test { use super::*; use aptos_aggregator::{ bounded_math::SignedU128, delta_change_set::DeltaOp, delta_math::DeltaHistory, - types::DelayedFieldID, }; use aptos_types::delayed_fields::SnapshotToStringFormula; use claims::{assert_err_eq, assert_ok_eq, assert_some}; + use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID; use test_case::test_case; // Different type acronyms used for generating different test cases.