From cf6d11e6474caf0b92b68a81eb12d2b5322a69cf Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 11 Jul 2024 11:18:50 -0700 Subject: [PATCH 001/163] Refactor CommitteeWithNetworkMetadata --- .../src/embedded_reconfig_observer.rs | 2 +- .../src/fullnode_reconfig_observer.rs | 8 +- crates/sui-benchmark/src/lib.rs | 2 +- crates/sui-config/src/genesis.rs | 4 +- crates/sui-core/src/authority_aggregator.rs | 8 +- crates/sui-core/src/authority_client.rs | 10 +- crates/sui-core/src/checkpoints/mod.rs | 5 +- .../src/quorum_driver/reconfig_observer.rs | 2 +- .../src/unit_tests/authority_tests.rs | 5 +- .../tests/reconfiguration_tests.rs | 2 +- crates/sui-genesis-builder/src/lib.rs | 9 +- crates/sui-swarm-config/src/network_config.rs | 6 +- crates/sui-types/src/committee.rs | 40 +++++- .../epoch_start_sui_system_state.rs | 13 +- .../simtest_sui_system_state_inner.rs | 114 +++++++++--------- .../sui_system_state_inner_v1.rs | 41 ++++--- .../sui_system_state_inner_v2.rs | 50 ++++---- .../sui_system_state_summary.rs | 46 +++---- 18 files changed, 203 insertions(+), 164 deletions(-) diff --git a/crates/sui-benchmark/src/embedded_reconfig_observer.rs b/crates/sui-benchmark/src/embedded_reconfig_observer.rs index 3634ac9bc6eda..9976491327bfd 100644 --- a/crates/sui-benchmark/src/embedded_reconfig_observer.rs +++ b/crates/sui-benchmark/src/embedded_reconfig_observer.rs @@ -50,7 +50,7 @@ impl EmbeddedReconfigObserver { Err(err) => Err(err), Ok(committee_info) => { let network_config = default_mysten_network_config(); - let new_epoch = committee_info.committee.epoch; + let new_epoch = committee_info.epoch(); if new_epoch <= cur_epoch { trace!( cur_epoch, diff --git a/crates/sui-benchmark/src/fullnode_reconfig_observer.rs b/crates/sui-benchmark/src/fullnode_reconfig_observer.rs index 1a44aff8db313..5aeef9db64b5b 100644 --- a/crates/sui-benchmark/src/fullnode_reconfig_observer.rs +++ b/crates/sui-benchmark/src/fullnode_reconfig_observer.rs @@ -69,10 +69,10 @@ impl ReconfigObserver for FullNodeReconfigObserver { let epoch_id = sui_system_state.epoch; if epoch_id > quorum_driver.current_epoch() { debug!(epoch_id, "Got SuiSystemState in newer epoch"); - let new_committee = sui_system_state - .get_sui_committee_for_benchmarking() - .committee; - let _ = self.committee_store.insert_new_committee(&new_committee); + let new_committee = sui_system_state.get_sui_committee_for_benchmarking(); + let _ = self + .committee_store + .insert_new_committee(new_committee.committee()); match AuthorityAggregator::new_from_committee( sui_system_state.get_sui_committee_for_benchmarking(), &self.committee_store, diff --git a/crates/sui-benchmark/src/lib.rs b/crates/sui-benchmark/src/lib.rs index 31c0294a5289c..f693fe872320b 100644 --- a/crates/sui-benchmark/src/lib.rs +++ b/crates/sui-benchmark/src/lib.rs @@ -274,7 +274,7 @@ impl LocalValidatorAggregatorProxy { registry, reconfig_fullnode_rpc_url, clients, - committee.committee, + committee.committee().clone(), ) .await } diff --git a/crates/sui-config/src/genesis.rs b/crates/sui-config/src/genesis.rs index c3eaa4f6657dd..e94470327f538 100644 --- a/crates/sui-config/src/genesis.rs +++ b/crates/sui-config/src/genesis.rs @@ -140,9 +140,9 @@ impl Genesis { self.sui_system_object().reference_gas_price() } - // TODO: No need to return SuiResult. + // TODO: No need to return SuiResult. Also consider return &. pub fn committee(&self) -> SuiResult { - Ok(self.committee_with_network().committee) + Ok(self.committee_with_network().committee().clone()) } pub fn sui_system_wrapper_object(&self) -> SuiSystemStateWrapper { diff --git a/crates/sui-core/src/authority_aggregator.rs b/crates/sui-core/src/authority_aggregator.rs index 3e5ebda3dc831..a9d48bdcd7345 100644 --- a/crates/sui-core/src/authority_aggregator.rs +++ b/crates/sui-core/src/authority_aggregator.rs @@ -607,7 +607,7 @@ impl AuthorityAggregator { // TODO: It's likely safer to do the following operations atomically, in case this function // gets called from different threads. It cannot happen today, but worth the caution. - let new_committee = committee.committee; + let new_committee = committee.committee().clone(); if disallow_missing_intermediate_committees { fp_ensure!( self.committee.epoch + 1 == new_committee.epoch, @@ -737,7 +737,7 @@ impl AuthorityAggregator { let authority_clients = make_network_authority_clients_with_network_config(&committee, &net_config)?; Ok(Self::new_with_metrics( - committee.committee, + committee.committee().clone(), committee_store.clone(), authority_clients, safe_client_metrics_base, @@ -1957,11 +1957,11 @@ impl<'a> AuthorityAggregatorBuilder<'a> { let committee_store = if let Some(committee_store) = self.committee_store { committee_store } else { - Arc::new(CommitteeStore::new_for_testing(&committee.committee)) + Arc::new(CommitteeStore::new_for_testing(committee.committee())) }; Ok(( AuthorityAggregator::new( - committee.committee, + committee.committee().clone(), committee_store, auth_clients.clone(), registry, diff --git a/crates/sui-core/src/authority_client.rs b/crates/sui-core/src/authority_client.rs index ac41e51cbc3fb..e05a0063a3205 100644 --- a/crates/sui-core/src/authority_client.rs +++ b/crates/sui-core/src/authority_client.rs @@ -262,14 +262,8 @@ pub fn make_network_authority_clients_with_network_config( network_config: &Config, ) -> anyhow::Result> { let mut authority_clients = BTreeMap::new(); - for (name, _stakes) in &committee.committee.voting_rights { - let address = &committee - .network_metadata - .get(name) - .ok_or_else(|| { - SuiError::from("Missing network metadata in CommitteeWithNetworkMetadata") - })? - .network_address; + for (name, (_state, network_metadata)) in committee.validators() { + let address = network_metadata.network_address.clone(); let address = address.rewrite_udp_to_tcp(); let maybe_channel = network_config.connect_lazy(&address).map_err(|e| { tracing::error!( diff --git a/crates/sui-core/src/checkpoints/mod.rs b/crates/sui-core/src/checkpoints/mod.rs index 0d9ef76494f5e..9225c8b67f3f7 100644 --- a/crates/sui-core/src/checkpoints/mod.rs +++ b/crates/sui-core/src/checkpoints/mod.rs @@ -1432,7 +1432,10 @@ impl CheckpointBuilder { ) .await?; - let committee = system_state_obj.get_current_epoch_committee().committee; + let committee = system_state_obj + .get_current_epoch_committee() + .committee() + .clone(); // This must happen after the call to augment_epoch_last_checkpoint, // otherwise we will not capture the change_epoch tx. diff --git a/crates/sui-core/src/quorum_driver/reconfig_observer.rs b/crates/sui-core/src/quorum_driver/reconfig_observer.rs index 8668b5e002d25..8d4660b214ca2 100644 --- a/crates/sui-core/src/quorum_driver/reconfig_observer.rs +++ b/crates/sui-core/src/quorum_driver/reconfig_observer.rs @@ -96,7 +96,7 @@ impl ReconfigObserver for OnsiteReconfigObserver { let committee = system_state.get_current_epoch_committee(); info!( "Got reconfig message. New committee: {}", - committee.committee + committee.committee() ); if committee.epoch() > quorum_driver.current_epoch() { let authority_agg = diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index e3f337be3f241..59157da08e309 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -3215,7 +3215,10 @@ async fn test_genesis_sui_system_state_object() { .get_sui_system_state_object_for_testing() .unwrap(); assert_eq!( - &sui_system_state.get_current_epoch_committee().committee, + &sui_system_state + .get_current_epoch_committee() + .committee() + .clone(), authority_state .epoch_store_for_testing() .committee() diff --git a/crates/sui-e2e-tests/tests/reconfiguration_tests.rs b/crates/sui-e2e-tests/tests/reconfiguration_tests.rs index 2ffdac83c401d..050db3fdfe343 100644 --- a/crates/sui-e2e-tests/tests/reconfiguration_tests.rs +++ b/crates/sui-e2e-tests/tests/reconfiguration_tests.rs @@ -572,7 +572,7 @@ async fn test_inactive_validator_pool_read() { assert_eq!( system_state .get_current_epoch_committee() - .committee + .committee() .num_members(), 4 ); diff --git a/crates/sui-genesis-builder/src/lib.rs b/crates/sui-genesis-builder/src/lib.rs index 91a0b1ce1096f..fbab297181074 100644 --- a/crates/sui-genesis-builder/src/lib.rs +++ b/crates/sui-genesis-builder/src/lib.rs @@ -205,7 +205,10 @@ impl Builder { fn committee(objects: &[Object]) -> Committee { let sui_system_object = get_sui_system_state(&objects).expect("Sui System State object must always exist"); - sui_system_object.get_current_epoch_committee().committee + sui_system_object + .get_current_epoch_committee() + .committee() + .clone() } pub fn protocol_version(&self) -> ProtocolVersion { @@ -520,7 +523,7 @@ impl Builder { assert!(staked_sui_objects.is_empty()); } - let committee = system_state.get_current_epoch_committee().committee; + let committee = system_state.get_current_epoch_committee(); for signature in self.signatures.values() { if self.validators.get(&signature.authority).is_none() { panic!("found signature for unknown validator: {:#?}", signature); @@ -530,7 +533,7 @@ impl Builder { .verify_secure( unsigned_genesis.checkpoint(), Intent::sui_app(IntentScope::CheckpointSummary), - &committee, + committee.committee(), ) .expect("signature should be valid"); } diff --git a/crates/sui-swarm-config/src/network_config.rs b/crates/sui-swarm-config/src/network_config.rs index eab789e1726ee..91b5fbf812f9c 100644 --- a/crates/sui-swarm-config/src/network_config.rs +++ b/crates/sui-swarm-config/src/network_config.rs @@ -28,9 +28,9 @@ impl NetworkConfig { pub fn net_addresses(&self) -> Vec { self.genesis .committee_with_network() - .network_metadata - .into_values() - .map(|n| n.network_address) + .validators() + .values() + .map(|(_, n)| n.network_address.clone()) .collect() } diff --git a/crates/sui-types/src/committee.rs b/crates/sui-types/src/committee.rs index 96ee20f035974..05e4e99b5f395 100644 --- a/crates/sui-types/src/committee.rs +++ b/crates/sui-types/src/committee.rs @@ -7,6 +7,7 @@ use crate::crypto::{random_committee_key_pairs_of_size, AuthorityKeyPair, Author use crate::error::{SuiError, SuiResult}; use crate::multiaddr::Multiaddr; use fastcrypto::traits::KeyPair; +use once_cell::sync::OnceCell; use rand::rngs::ThreadRng; use rand::seq::SliceRandom; use rand::Rng; @@ -347,13 +348,42 @@ pub struct NetworkMetadata { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct CommitteeWithNetworkMetadata { - pub committee: Committee, - pub network_metadata: BTreeMap, + epoch_id: EpochId, + validators: BTreeMap, + + #[serde(skip)] + committee: OnceCell, } impl CommitteeWithNetworkMetadata { + pub fn new( + epoch_id: EpochId, + validators: BTreeMap, + ) -> Self { + Self { + epoch_id, + validators, + committee: OnceCell::new(), + } + } pub fn epoch(&self) -> EpochId { - self.committee.epoch() + self.epoch_id + } + + pub fn validators(&self) -> &BTreeMap { + &self.validators + } + + pub fn committee(&self) -> &Committee { + self.committee.get_or_init(|| { + Committee::new( + self.epoch_id, + self.validators + .iter() + .map(|(name, (stake, _))| (*name, *stake)) + .collect(), + ) + }) } } @@ -361,8 +391,8 @@ impl Display for CommitteeWithNetworkMetadata { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!( f, - "CommitteeWithNetworkMetadata (committee={}, network_metadata={:?})", - self.committee, self.network_metadata + "CommitteeWithNetworkMetadata (epoch={}, validators={:?})", + self.epoch_id, self.validators ) } } diff --git a/crates/sui-types/src/sui_system_state/epoch_start_sui_system_state.rs b/crates/sui-types/src/sui_system_state/epoch_start_sui_system_state.rs index 121c1afab082e..2f867d2b12721 100644 --- a/crates/sui-types/src/sui_system_state/epoch_start_sui_system_state.rs +++ b/crates/sui-types/src/sui_system_state/epoch_start_sui_system_state.rs @@ -153,14 +153,14 @@ impl EpochStartSystemStateTrait for EpochStartSystemStateV1 { } fn get_sui_committee_with_network_metadata(&self) -> CommitteeWithNetworkMetadata { - let (voting_rights, network_metadata) = self + let validators = self .active_validators .iter() .map(|validator| { ( - (validator.authority_name(), validator.voting_power), + validator.authority_name(), ( - validator.authority_name(), + validator.voting_power, NetworkMetadata { network_address: validator.sui_net_address.clone(), narwhal_primary_address: validator.narwhal_primary_address.clone(), @@ -168,12 +168,9 @@ impl EpochStartSystemStateTrait for EpochStartSystemStateV1 { ), ) }) - .unzip(); + .collect(); - CommitteeWithNetworkMetadata { - committee: Committee::new(self.epoch, voting_rights), - network_metadata, - } + CommitteeWithNetworkMetadata::new(self.epoch, validators) } fn get_sui_committee(&self) -> Committee { diff --git a/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs b/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs index c92854b55d96a..3ee52ac91ce2f 100644 --- a/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs +++ b/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs @@ -164,24 +164,26 @@ impl SuiSystemStateTrait for SimTestSuiSystemStateInnerV1 { } fn get_current_epoch_committee(&self) -> CommitteeWithNetworkMetadata { - let mut voting_rights = BTreeMap::new(); - let mut network_metadata = BTreeMap::new(); - for validator in &self.validators.active_validators { - let verified_metadata = validator.verified_metadata(); - let name = verified_metadata.sui_pubkey_bytes(); - voting_rights.insert(name, validator.voting_power); - network_metadata.insert( - name, - NetworkMetadata { - network_address: verified_metadata.net_address.clone(), - narwhal_primary_address: verified_metadata.primary_address.clone(), - }, - ); - } - CommitteeWithNetworkMetadata { - committee: Committee::new(self.epoch, voting_rights), - network_metadata, - } + let validators = self + .validators + .active_validators + .iter() + .map(|validator| { + let verified_metadata = validator.verified_metadata(); + let name = verified_metadata.sui_pubkey_bytes(); + ( + name, + ( + validator.voting_power, + NetworkMetadata { + network_address: verified_metadata.net_address.clone(), + narwhal_primary_address: verified_metadata.primary_address.clone(), + }, + ), + ) + }) + .collect(); + CommitteeWithNetworkMetadata::new(self.epoch, validators) } fn get_pending_active_validators( @@ -278,24 +280,26 @@ impl SuiSystemStateTrait for SimTestSuiSystemStateInnerShallowV2 { } fn get_current_epoch_committee(&self) -> CommitteeWithNetworkMetadata { - let mut voting_rights = BTreeMap::new(); - let mut network_metadata = BTreeMap::new(); - for validator in &self.validators.active_validators { - let verified_metadata = validator.verified_metadata(); - let name = verified_metadata.sui_pubkey_bytes(); - voting_rights.insert(name, validator.voting_power); - network_metadata.insert( - name, - NetworkMetadata { - network_address: verified_metadata.net_address.clone(), - narwhal_primary_address: verified_metadata.primary_address.clone(), - }, - ); - } - CommitteeWithNetworkMetadata { - committee: Committee::new(self.epoch, voting_rights), - network_metadata, - } + let validators = self + .validators + .active_validators + .iter() + .map(|validator| { + let verified_metadata = validator.verified_metadata(); + let name = verified_metadata.sui_pubkey_bytes(); + ( + name, + ( + validator.voting_power, + NetworkMetadata { + network_address: verified_metadata.net_address.clone(), + narwhal_primary_address: verified_metadata.primary_address.clone(), + }, + ), + ) + }) + .collect(); + CommitteeWithNetworkMetadata::new(self.epoch, validators) } fn get_pending_active_validators( @@ -421,24 +425,26 @@ impl SuiSystemStateTrait for SimTestSuiSystemStateInnerDeepV2 { } fn get_current_epoch_committee(&self) -> CommitteeWithNetworkMetadata { - let mut voting_rights = BTreeMap::new(); - let mut network_metadata = BTreeMap::new(); - for validator in &self.validators.active_validators { - let verified_metadata = validator.verified_metadata(); - let name = verified_metadata.sui_pubkey_bytes(); - voting_rights.insert(name, validator.voting_power); - network_metadata.insert( - name, - NetworkMetadata { - network_address: verified_metadata.net_address.clone(), - narwhal_primary_address: verified_metadata.primary_address.clone(), - }, - ); - } - CommitteeWithNetworkMetadata { - committee: Committee::new(self.epoch, voting_rights), - network_metadata, - } + let validators = self + .validators + .active_validators + .iter() + .map(|validator| { + let verified_metadata = validator.verified_metadata(); + let name = verified_metadata.sui_pubkey_bytes(); + ( + name, + ( + validator.voting_power, + NetworkMetadata { + network_address: verified_metadata.net_address.clone(), + narwhal_primary_address: verified_metadata.primary_address.clone(), + }, + ), + ) + }) + .collect(); + CommitteeWithNetworkMetadata::new(self.epoch, validators) } fn get_pending_active_validators( diff --git a/crates/sui-types/src/sui_system_state/sui_system_state_inner_v1.rs b/crates/sui-types/src/sui_system_state/sui_system_state_inner_v1.rs index 737210dedb253..397c4635f2d5d 100644 --- a/crates/sui-types/src/sui_system_state/sui_system_state_inner_v1.rs +++ b/crates/sui-types/src/sui_system_state/sui_system_state_inner_v1.rs @@ -4,7 +4,7 @@ use crate::balance::Balance; use crate::base_types::{ObjectID, SuiAddress}; use crate::collection_types::{Bag, Table, TableVec, VecMap, VecSet}; -use crate::committee::{Committee, CommitteeWithNetworkMetadata, NetworkMetadata}; +use crate::committee::{CommitteeWithNetworkMetadata, NetworkMetadata}; use crate::crypto::verify_proof_of_possession; use crate::crypto::AuthorityPublicKeyBytes; use crate::error::SuiError; @@ -16,7 +16,6 @@ use anyhow::Result; use fastcrypto::traits::ToFromBytes; use once_cell::sync::OnceCell; use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; use super::epoch_start_sui_system_state::EpochStartValidatorInfoV1; use super::sui_system_state_summary::{SuiSystemStateSummary, SuiValidatorSummary}; @@ -543,24 +542,26 @@ impl SuiSystemStateTrait for SuiSystemStateInnerV1 { } fn get_current_epoch_committee(&self) -> CommitteeWithNetworkMetadata { - let mut voting_rights = BTreeMap::new(); - let mut network_metadata = BTreeMap::new(); - for validator in &self.validators.active_validators { - let verified_metadata = validator.verified_metadata(); - let name = verified_metadata.sui_pubkey_bytes(); - voting_rights.insert(name, validator.voting_power); - network_metadata.insert( - name, - NetworkMetadata { - network_address: verified_metadata.net_address.clone(), - narwhal_primary_address: verified_metadata.primary_address.clone(), - }, - ); - } - CommitteeWithNetworkMetadata { - committee: Committee::new(self.epoch, voting_rights), - network_metadata, - } + let validators = self + .validators + .active_validators + .iter() + .map(|validator| { + let verified_metadata = validator.verified_metadata(); + let name = verified_metadata.sui_pubkey_bytes(); + ( + name, + ( + validator.voting_power, + NetworkMetadata { + network_address: verified_metadata.net_address.clone(), + narwhal_primary_address: verified_metadata.primary_address.clone(), + }, + ), + ) + }) + .collect(); + CommitteeWithNetworkMetadata::new(self.epoch, validators) } fn get_pending_active_validators( diff --git a/crates/sui-types/src/sui_system_state/sui_system_state_inner_v2.rs b/crates/sui-types/src/sui_system_state/sui_system_state_inner_v2.rs index dd8798580bdab..f0863c2119466 100644 --- a/crates/sui-types/src/sui_system_state/sui_system_state_inner_v2.rs +++ b/crates/sui-types/src/sui_system_state/sui_system_state_inner_v2.rs @@ -1,10 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +use super::epoch_start_sui_system_state::EpochStartValidatorInfoV1; +use super::sui_system_state_inner_v1::ValidatorV1; +use super::sui_system_state_summary::{SuiSystemStateSummary, SuiValidatorSummary}; +use super::{AdvanceEpochParams, SuiSystemStateTrait}; use crate::balance::Balance; use crate::base_types::SuiAddress; use crate::collection_types::{Bag, Table, TableVec, VecMap, VecSet}; -use crate::committee::{Committee, CommitteeWithNetworkMetadata, NetworkMetadata}; +use crate::committee::{CommitteeWithNetworkMetadata, NetworkMetadata}; use crate::error::SuiError; use crate::storage::ObjectStore; use crate::sui_system_state::epoch_start_sui_system_state::EpochStartSystemState; @@ -13,12 +17,6 @@ use crate::sui_system_state::sui_system_state_inner_v1::{ StakeSubsidyV1, StorageFundV1, ValidatorSetV1, }; use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; - -use super::epoch_start_sui_system_state::EpochStartValidatorInfoV1; -use super::sui_system_state_inner_v1::ValidatorV1; -use super::sui_system_state_summary::{SuiSystemStateSummary, SuiValidatorSummary}; -use super::{AdvanceEpochParams, SuiSystemStateTrait}; /// Rust version of the Move sui::sui_system::SystemParametersV2 type #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] @@ -120,24 +118,26 @@ impl SuiSystemStateTrait for SuiSystemStateInnerV2 { } fn get_current_epoch_committee(&self) -> CommitteeWithNetworkMetadata { - let mut voting_rights = BTreeMap::new(); - let mut network_metadata = BTreeMap::new(); - for validator in &self.validators.active_validators { - let verified_metadata = validator.verified_metadata(); - let name = verified_metadata.sui_pubkey_bytes(); - voting_rights.insert(name, validator.voting_power); - network_metadata.insert( - name, - NetworkMetadata { - network_address: verified_metadata.net_address.clone(), - narwhal_primary_address: verified_metadata.primary_address.clone(), - }, - ); - } - CommitteeWithNetworkMetadata { - committee: Committee::new(self.epoch, voting_rights), - network_metadata, - } + let validators = self + .validators + .active_validators + .iter() + .map(|validator| { + let verified_metadata = validator.verified_metadata(); + let name = verified_metadata.sui_pubkey_bytes(); + ( + name, + ( + validator.voting_power, + NetworkMetadata { + network_address: verified_metadata.net_address.clone(), + narwhal_primary_address: verified_metadata.primary_address.clone(), + }, + ), + ) + }) + .collect(); + CommitteeWithNetworkMetadata::new(self.epoch, validators) } fn get_pending_active_validators( diff --git a/crates/sui-types/src/sui_system_state/sui_system_state_summary.rs b/crates/sui-types/src/sui_system_state/sui_system_state_summary.rs index 71884d5ac7c2d..0b76e4c344b02 100644 --- a/crates/sui-types/src/sui_system_state/sui_system_state_summary.rs +++ b/crates/sui-types/src/sui_system_state/sui_system_state_summary.rs @@ -1,8 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +use super::{SuiSystemState, SuiSystemStateTrait}; use crate::base_types::{AuthorityName, ObjectID, SuiAddress}; -use crate::committee::{Committee, CommitteeWithNetworkMetadata, NetworkMetadata}; +use crate::committee::{CommitteeWithNetworkMetadata, NetworkMetadata}; use crate::dynamic_field::get_dynamic_field_from_store; use crate::error::SuiError; use crate::id::ID; @@ -16,9 +17,6 @@ use fastcrypto::traits::ToFromBytes; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_with::serde_as; -use std::collections::BTreeMap; - -use super::{SuiSystemState, SuiSystemStateTrait}; /// This is the JSON-RPC type for the SUI system state object. /// It flattens all fields to make them top-level fields such that it as minimum @@ -188,24 +186,28 @@ pub struct SuiSystemStateSummary { impl SuiSystemStateSummary { pub fn get_sui_committee_for_benchmarking(&self) -> CommitteeWithNetworkMetadata { - let mut voting_rights = BTreeMap::new(); - let mut network_metadata = BTreeMap::new(); - for validator in &self.active_validators { - let name = AuthorityName::from_bytes(&validator.protocol_pubkey_bytes).unwrap(); - voting_rights.insert(name, validator.voting_power); - network_metadata.insert( - name, - NetworkMetadata { - network_address: Multiaddr::try_from(validator.net_address.clone()).unwrap(), - narwhal_primary_address: Multiaddr::try_from(validator.primary_address.clone()) - .unwrap(), - }, - ); - } - CommitteeWithNetworkMetadata { - committee: Committee::new(self.epoch, voting_rights), - network_metadata, - } + let validators = self + .active_validators + .iter() + .map(|validator| { + let name = AuthorityName::from_bytes(&validator.protocol_pubkey_bytes).unwrap(); + ( + name, + ( + validator.voting_power, + NetworkMetadata { + network_address: Multiaddr::try_from(validator.net_address.clone()) + .unwrap(), + narwhal_primary_address: Multiaddr::try_from( + validator.primary_address.clone(), + ) + .unwrap(), + }, + ), + ) + }) + .collect(); + CommitteeWithNetworkMetadata::new(self.epoch, validators) } } From a093c4a9662e20de994c246c9c6293e594b24e09 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 11 Jul 2024 18:31:28 -0700 Subject: [PATCH 002/163] Make sure AuthAgg construction cannot fail (#18617) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/fullnode_reconfig_observer.rs | 13 +-- crates/sui-benchmark/src/lib.rs | 3 +- crates/sui-core/src/authority_aggregator.rs | 24 ++--- crates/sui-core/src/authority_client.rs | 6 +- crates/sui-core/src/checkpoints/mod.rs | 3 +- .../src/quorum_driver/reconfig_observer.rs | 6 -- .../sui-core/src/transaction_orchestrator.rs | 8 +- .../tests/traffic_control_tests.rs | 12 +-- .../tests/transaction_orchestrator_tests.rs | 96 +++++++++---------- crates/sui-node/src/lib.rs | 2 +- 10 files changed, 72 insertions(+), 101 deletions(-) diff --git a/crates/sui-benchmark/src/fullnode_reconfig_observer.rs b/crates/sui-benchmark/src/fullnode_reconfig_observer.rs index 5aeef9db64b5b..bfd4c83b2aa12 100644 --- a/crates/sui-benchmark/src/fullnode_reconfig_observer.rs +++ b/crates/sui-benchmark/src/fullnode_reconfig_observer.rs @@ -73,21 +73,14 @@ impl ReconfigObserver for FullNodeReconfigObserver { let _ = self .committee_store .insert_new_committee(new_committee.committee()); - match AuthorityAggregator::new_from_committee( + let auth_agg = AuthorityAggregator::new_from_committee( sui_system_state.get_sui_committee_for_benchmarking(), &self.committee_store, self.safe_client_metrics_base.clone(), self.auth_agg_metrics.clone(), Arc::new(HashMap::new()), - ) { - Ok(auth_agg) => { - quorum_driver.update_validators(Arc::new(auth_agg)).await - } - Err(err) => error!( - "Can't create AuthorityAggregator from SuiSystemState: {:?}", - err - ), - } + ); + quorum_driver.update_validators(Arc::new(auth_agg)).await } else { trace!( epoch_id, diff --git a/crates/sui-benchmark/src/lib.rs b/crates/sui-benchmark/src/lib.rs index f693fe872320b..01f21df71b345 100644 --- a/crates/sui-benchmark/src/lib.rs +++ b/crates/sui-benchmark/src/lib.rs @@ -266,8 +266,7 @@ impl LocalValidatorAggregatorProxy { &committee, DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_REQUEST_TIMEOUT_SEC, - ) - .unwrap(); + ); Self::new_impl( aggregator, diff --git a/crates/sui-core/src/authority_aggregator.rs b/crates/sui-core/src/authority_aggregator.rs index a9d48bdcd7345..26a8159bacb2c 100644 --- a/crates/sui-core/src/authority_aggregator.rs +++ b/crates/sui-core/src/authority_aggregator.rs @@ -582,13 +582,7 @@ impl AuthorityAggregator { disallow_missing_intermediate_committees: bool, ) -> SuiResult> { let network_clients = - make_network_authority_clients_with_network_config(&committee, network_config) - .map_err(|err| SuiError::GenericAuthorityError { - error: format!( - "Failed to make authority clients from committee {committee}, err: {:?}", - err - ), - })?; + make_network_authority_clients_with_network_config(&committee, network_config); let safe_clients = network_clients .into_iter() @@ -697,11 +691,13 @@ impl AuthorityAggregator { committee_store: &Arc, safe_client_metrics_base: SafeClientMetricsBase, auth_agg_metrics: AuthAggMetrics, - ) -> anyhow::Result { + ) -> Self { // TODO: We should get the committee from the epoch store instead to ensure consistency. // Instead of this function use AuthorityEpochStore::epoch_start_configuration() to access this object everywhere // besides when we are reading fields for the current epoch - let sui_system_state = store.get_sui_system_state_object_unsafe()?; + let sui_system_state = store + .get_sui_system_state_object_unsafe() + .expect("Get system state object should never fail"); let committee = sui_system_state.get_current_epoch_committee(); let validator_display_names = sui_system_state .into_sui_system_state_summary() @@ -732,18 +728,18 @@ impl AuthorityAggregator { safe_client_metrics_base: SafeClientMetricsBase, auth_agg_metrics: Arc, validator_display_names: Arc>, - ) -> anyhow::Result { + ) -> Self { let net_config = default_mysten_network_config(); let authority_clients = - make_network_authority_clients_with_network_config(&committee, &net_config)?; - Ok(Self::new_with_metrics( + make_network_authority_clients_with_network_config(&committee, &net_config); + Self::new_with_metrics( committee.committee().clone(), committee_store.clone(), authority_clients, safe_client_metrics_base, auth_agg_metrics, validator_display_names, - )) + ) } } @@ -1953,7 +1949,7 @@ impl<'a> AuthorityAggregatorBuilder<'a> { &committee, DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_REQUEST_TIMEOUT_SEC, - )?; + ); let committee_store = if let Some(committee_store) = self.committee_store { committee_store } else { diff --git a/crates/sui-core/src/authority_client.rs b/crates/sui-core/src/authority_client.rs index e05a0063a3205..78461b0656476 100644 --- a/crates/sui-core/src/authority_client.rs +++ b/crates/sui-core/src/authority_client.rs @@ -260,7 +260,7 @@ impl AuthorityAPI for NetworkAuthorityClient { pub fn make_network_authority_clients_with_network_config( committee: &CommitteeWithNetworkMetadata, network_config: &Config, -) -> anyhow::Result> { +) -> BTreeMap { let mut authority_clients = BTreeMap::new(); for (name, (_state, network_metadata)) in committee.validators() { let address = network_metadata.network_address.clone(); @@ -276,14 +276,14 @@ pub fn make_network_authority_clients_with_network_config( let client = NetworkAuthorityClient::new_lazy(maybe_channel); authority_clients.insert(*name, client); } - Ok(authority_clients) + authority_clients } pub fn make_authority_clients_with_timeout_config( committee: &CommitteeWithNetworkMetadata, connect_timeout: Duration, request_timeout: Duration, -) -> anyhow::Result> { +) -> BTreeMap { let mut network_config = mysten_network::config::Config::new(); network_config.connect_timeout = Some(connect_timeout); network_config.request_timeout = Some(request_timeout); diff --git a/crates/sui-core/src/checkpoints/mod.rs b/crates/sui-core/src/checkpoints/mod.rs index 9225c8b67f3f7..2bf1dfaca8fcd 100644 --- a/crates/sui-core/src/checkpoints/mod.rs +++ b/crates/sui-core/src/checkpoints/mod.rs @@ -2058,8 +2058,7 @@ async fn diagnose_split_brain( .get_sui_committee_with_network_metadata(); let network_config = default_mysten_network_config(); let network_clients = - make_network_authority_clients_with_network_config(&committee, &network_config) - .expect("Failed to make authority clients from committee {committee}"); + make_network_authority_clients_with_network_config(&committee, &network_config); // Query all disagreeing validators let response_futures = digest_to_validator diff --git a/crates/sui-core/src/quorum_driver/reconfig_observer.rs b/crates/sui-core/src/quorum_driver/reconfig_observer.rs index 8d4660b214ca2..330c083f9e587 100644 --- a/crates/sui-core/src/quorum_driver/reconfig_observer.rs +++ b/crates/sui-core/src/quorum_driver/reconfig_observer.rs @@ -59,12 +59,6 @@ impl OnsiteReconfigObserver { self.safe_client_metrics_base.clone(), self.auth_agg_metrics.clone(), ) - .unwrap_or_else(|e| { - panic!( - "Failed to create AuthorityAggregator from System State: {:?}", - e - ) - }) } } diff --git a/crates/sui-core/src/transaction_orchestrator.rs b/crates/sui-core/src/transaction_orchestrator.rs index f648a43657676..569ad1de2b92d 100644 --- a/crates/sui-core/src/transaction_orchestrator.rs +++ b/crates/sui-core/src/transaction_orchestrator.rs @@ -68,7 +68,7 @@ impl TransactiondOrchestrator { reconfig_channel: Receiver, parent_path: &Path, prometheus_registry: &Registry, - ) -> anyhow::Result { + ) -> Self { let safe_client_metrics_base = SafeClientMetricsBase::new(prometheus_registry); let auth_agg_metrics = AuthAggMetrics::new(prometheus_registry); let validators = AuthorityAggregator::new_from_local_system_state( @@ -76,7 +76,7 @@ impl TransactiondOrchestrator { validator_state.committee_store(), safe_client_metrics_base.clone(), auth_agg_metrics.clone(), - )?; + ); let observer = OnsiteReconfigObserver::new( reconfig_channel, @@ -85,13 +85,13 @@ impl TransactiondOrchestrator { safe_client_metrics_base, auth_agg_metrics, ); - Ok(TransactiondOrchestrator::new( + TransactiondOrchestrator::new( Arc::new(validators), validator_state, parent_path, prometheus_registry, observer, - )) + ) } } diff --git a/crates/sui-e2e-tests/tests/traffic_control_tests.rs b/crates/sui-e2e-tests/tests/traffic_control_tests.rs index 243f81e915448..694c2790a6e16 100644 --- a/crates/sui-e2e-tests/tests/traffic_control_tests.rs +++ b/crates/sui-e2e-tests/tests/traffic_control_tests.rs @@ -226,8 +226,7 @@ async fn test_validator_traffic_control_error_blocked() -> Result<(), anyhow::Er let local_clients = make_network_authority_clients_with_network_config( &committee, &default_mysten_network_config(), - ) - .unwrap(); + ); let (_, auth_client) = local_clients.first_key_value().unwrap(); // transaction signed using user wallet from a different chain/genesis, @@ -350,8 +349,7 @@ async fn test_validator_traffic_control_error_delegated() -> Result<(), anyhow:: let local_clients = make_network_authority_clients_with_network_config( &committee, &default_mysten_network_config(), - ) - .unwrap(); + ); let (_, auth_client) = local_clients.first_key_value().unwrap(); // transaction signed using user wallet from a different chain/genesis, @@ -494,7 +492,7 @@ async fn test_traffic_control_dead_mans_switch() -> Result<(), anyhow::Error> { let _tc = TrafficController::spawn_for_test(policy_config, Some(firewall_config)); assert!( !drain_path.exists(), - "Expected drain file to not exist after statup unless previously set", + "Expected drain file to not exist after startup unless previously set", ); // after n seconds with no traffic, the dead mans switch should be engaged @@ -512,7 +510,7 @@ async fn test_traffic_control_dead_mans_switch() -> Result<(), anyhow::Error> { for _ in 0..3 { assert!( drain_path.exists(), - "Expected drain file to be disabled at statup unless previously enabled", + "Expected drain file to be disabled at startup unless previously enabled", ); tokio::time::sleep(tokio::time::Duration::from_secs(3)).await; } @@ -604,7 +602,7 @@ async fn test_traffic_sketch_with_slow_blocks() { // due to averaging, we will take 4 seconds to start blocking, then // will be in blocklist for 1 second (roughly) assert!(metrics.num_blocked as f64 > (expected_requests as f64 / 4.0) * 0.90); - // 10 clients, blocked at least every 5 sceonds, over 20 seconds + // 10 clients, blocked at least every 5 seconds, over 20 seconds assert!(metrics.num_blocklist_adds >= 40); assert!(metrics.abs_time_to_first_block.unwrap() < Duration::from_secs(5)); assert!(metrics.total_time_blocked > Duration::from_millis(3500)); diff --git a/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs b/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs index 2bb8f2fd5f4dd..7af2f617b5508 100644 --- a/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs +++ b/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs @@ -35,16 +35,14 @@ async fn test_blocking_execution() -> Result<(), anyhow::Error> { let temp_dir = tempfile::tempdir().unwrap(); let registry = Registry::new(); // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle - .with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }) - .unwrap(); + let orchestrator = handle.with(|node| { + TransactiondOrchestrator::new_with_network_clients( + node.state(), + node.subscribe_to_epoch_change(), + temp_dir.path(), + ®istry, + ) + }); let txn_count = 4; let mut txns = batch_make_transfer_transactions(context, txn_count).await; @@ -127,16 +125,14 @@ async fn test_fullnode_wal_log() -> Result<(), anyhow::Error> { tokio::task::yield_now().await; let registry = Registry::new(); // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle - .with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }) - .unwrap(); + let orchestrator = handle.with(|node| { + TransactiondOrchestrator::new_with_network_clients( + node.state(), + node.subscribe_to_epoch_change(), + temp_dir.path(), + ®istry, + ) + }); let txn_count = 2; let context = &mut test_cluster.wallet; @@ -343,16 +339,14 @@ async fn execute_transaction_v3() -> Result<(), anyhow::Error> { let temp_dir = tempfile::tempdir().unwrap(); let registry = Registry::new(); // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle - .with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }) - .unwrap(); + let orchestrator = handle.with(|node| { + TransactiondOrchestrator::new_with_network_clients( + node.state(), + node.subscribe_to_epoch_change(), + temp_dir.path(), + ®istry, + ) + }); let txn_count = 1; let mut txns = batch_make_transfer_transactions(context, txn_count).await; @@ -384,23 +378,23 @@ async fn execute_transaction_v3() -> Result<(), anyhow::Error> { .collect::>(); expected_output_objects.sort_by_key(|&(id, _version, _digest)| id); - let mut actual_input_objects_recieved = response + let mut actual_input_objects_received = response .input_objects .unwrap() .iter() .map(|object| (object.id(), object.version())) .collect::>(); - actual_input_objects_recieved.sort_by_key(|&(id, _version)| id); - assert_eq!(expected_input_objects, actual_input_objects_recieved); + actual_input_objects_received.sort_by_key(|&(id, _version)| id); + assert_eq!(expected_input_objects, actual_input_objects_received); - let mut actual_output_objects_recieved = response + let mut actual_output_objects_received = response .output_objects .unwrap() .iter() .map(|object| (object.id(), object.version(), object.digest())) .collect::>(); - actual_output_objects_recieved.sort_by_key(|&(id, _version, _digest)| id); - assert_eq!(expected_output_objects, actual_output_objects_recieved); + actual_output_objects_received.sort_by_key(|&(id, _version, _digest)| id); + assert_eq!(expected_output_objects, actual_output_objects_received); Ok(()) } @@ -414,16 +408,14 @@ async fn execute_transaction_v3_staking_transaction() -> Result<(), anyhow::Erro let temp_dir = tempfile::tempdir().unwrap(); let registry = Registry::new(); // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle - .with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }) - .unwrap(); + let orchestrator = handle.with(|node| { + TransactiondOrchestrator::new_with_network_clients( + node.state(), + node.subscribe_to_epoch_change(), + temp_dir.path(), + ®istry, + ) + }); let validator_address = context .get_client() @@ -456,23 +448,23 @@ async fn execute_transaction_v3_staking_transaction() -> Result<(), anyhow::Erro .collect::>(); expected_output_objects.sort_by_key(|&(id, _version, _digest)| id); - let mut actual_input_objects_recieved = response + let mut actual_input_objects_received = response .input_objects .unwrap() .iter() .map(|object| (object.id(), object.version())) .collect::>(); - actual_input_objects_recieved.sort_by_key(|&(id, _version)| id); - assert_eq!(expected_input_objects, actual_input_objects_recieved); + actual_input_objects_received.sort_by_key(|&(id, _version)| id); + assert_eq!(expected_input_objects, actual_input_objects_received); - let mut actual_output_objects_recieved = response + let mut actual_output_objects_received = response .output_objects .unwrap() .iter() .map(|object| (object.id(), object.version(), object.digest())) .collect::>(); - actual_output_objects_recieved.sort_by_key(|&(id, _version, _digest)| id); - assert_eq!(expected_output_objects, actual_output_objects_recieved); + actual_output_objects_received.sort_by_key(|&(id, _version, _digest)| id); + assert_eq!(expected_output_objects, actual_output_objects_received); Ok(()) } diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index 2f840129bc5d6..f398c28793d6c 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -696,7 +696,7 @@ impl SuiNode { end_of_epoch_receiver, &config.db_path(), &prometheus_registry, - )?, + ), )) } else { None From e48c9c4095607e98432ab556804c4f67feab7835 Mon Sep 17 00:00:00 2001 From: John Naulty Jr Date: Thu, 11 Jul 2024 19:02:19 -0700 Subject: [PATCH 003/163] build statically-linked sui-node for testing on glibc-based hosts (#18611) ## Description Update Deterministic Sui Build to compile a statically-linked binary. StageX uses `musl` for compiling `sui-node`. In order for this to run the `sui-node` binary directly on glibc-based linux macines, it must be statically linked. ## Test plan Cherry-pick commit to `testnet` branch and test on a private testnet. * build docker image * extract `sui-node` binary * confirm statically linked (run `file` on mac, `ldd` on linux) * upload to baremetal test server + run * check build is still deterministic from github action build, linux machine, macOS machine --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- docker/sui-node-deterministic/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/sui-node-deterministic/Dockerfile b/docker/sui-node-deterministic/Dockerfile index 5a8afa600be4c..0821cfb824c26 100644 --- a/docker/sui-node-deterministic/Dockerfile +++ b/docker/sui-node-deterministic/Dockerfile @@ -60,11 +60,11 @@ ARG PROFILE ARG GIT_REVISION ENV RUST_BACKTRACE=1 -ENV RUSTFLAGS='-C target-feature=-crt-static -C codegen-units=1' +ENV RUSTFLAGS='-C target-feature=+crt-static -C codegen-units=1' ENV GIT_REVISION=${GIT_REVISION} ENV PROFILE=${PROFILE} -RUN --network=none cargo build --frozen --profile ${PROFILE} --bin sui-node +RUN --network=none cargo build --target x86_64-unknown-linux-musl --frozen --profile ${PROFILE} --bin sui-node FROM scratch AS install @@ -78,7 +78,7 @@ COPY --from=musl . /rootfs # support current + legacy paths RUN mkdir -p /rootfs/opt/sui/bin RUN mkdir -p /rootfs/usr/local/bin -COPY --from=build sui/target/release/sui-node /rootfs/opt/sui/bin/sui-node +COPY --from=build sui/target/x86_64-unknown-linux-musl/release/sui-node /rootfs/opt/sui/bin/sui-node RUN --network=none find /rootfs -exec touch -hcd "@0" "{}" + From 5f7b89026c28d554e743f4df9e4ac96446b5ea04 Mon Sep 17 00:00:00 2001 From: Eugene Boguslavsky Date: Thu, 11 Jul 2024 19:13:40 -0700 Subject: [PATCH 004/163] Sui v1.30.0 Version Bump (#18631) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Sui v1.30.0 Version Bump ## Test plan 👀 --- Cargo.lock | 112 +++++++++++++------------- Cargo.toml | 2 +- crates/sui-open-rpc/spec/openrpc.json | 2 +- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55d85f7c3457b..b3a445d9b4930 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1806,7 +1806,7 @@ checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" [[package]] name = "bin-version" -version = "1.29.0" +version = "1.30.0" dependencies = [ "const-str", "git-version", @@ -11808,7 +11808,7 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "sui" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anemo", "anyhow", @@ -11879,7 +11879,7 @@ dependencies = [ "sui-package-management", "sui-protocol-config", "sui-replay", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-simulator", "sui-source-validation", "sui-swarm", @@ -12023,7 +12023,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "arrow", @@ -12077,7 +12077,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer-derive" -version = "1.29.0" +version = "1.30.0" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", @@ -12086,7 +12086,7 @@ dependencies = [ [[package]] name = "sui-archival" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "byteorder", @@ -12194,7 +12194,7 @@ dependencies = [ "sui-macros", "sui-network", "sui-protocol-config", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-simulator", "sui-storage", "sui-surfer", @@ -12212,7 +12212,7 @@ dependencies = [ [[package]] name = "sui-bridge" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "arc-swap", @@ -12247,7 +12247,7 @@ dependencies = [ "sui-json-rpc-api", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-test-transaction-builder", "sui-types", "tap", @@ -12263,7 +12263,7 @@ dependencies = [ [[package]] name = "sui-bridge-cli" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "clap", @@ -12280,7 +12280,7 @@ dependencies = [ "sui-config", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-types", "telemetry-subscribers", "tokio", @@ -12309,7 +12309,7 @@ dependencies = [ "sui-config", "sui-data-ingestion-core", "sui-json-rpc-types", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-test-transaction-builder", "sui-types", "tap", @@ -12321,7 +12321,7 @@ dependencies = [ [[package]] name = "sui-cluster-test" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-trait", @@ -12345,7 +12345,7 @@ dependencies = [ "sui-json", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-swarm", "sui-swarm-config", "sui-test-transaction-builder", @@ -12531,7 +12531,7 @@ dependencies = [ [[package]] name = "sui-data-ingestion" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-trait", @@ -12593,7 +12593,7 @@ dependencies = [ [[package]] name = "sui-e2e-tests" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "assert_cmd", @@ -12637,7 +12637,7 @@ dependencies = [ "sui-node", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-simulator", "sui-storage", "sui-swarm", @@ -12710,7 +12710,7 @@ dependencies = [ [[package]] name = "sui-faucet" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-recursion", @@ -12730,7 +12730,7 @@ dependencies = [ "sui-config", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-types", "tap", "telemetry-subscribers", @@ -12768,7 +12768,7 @@ dependencies = [ [[package]] name = "sui-framework-snapshot" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "bcs", @@ -12830,7 +12830,7 @@ dependencies = [ [[package]] name = "sui-graphql-config" -version = "1.29.0" +version = "1.30.0" dependencies = [ "quote 1.0.35", "syn 1.0.107", @@ -12907,7 +12907,7 @@ dependencies = [ "sui-package-resolver", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-swarm-config", "sui-test-transaction-builder", "sui-types", @@ -12947,7 +12947,7 @@ dependencies = [ [[package]] name = "sui-indexer" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-trait", @@ -12990,7 +12990,7 @@ dependencies = [ "sui-package-resolver", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-test-transaction-builder", "sui-transaction-builder", "sui-types", @@ -13123,7 +13123,7 @@ dependencies = [ "sui-open-rpc", "sui-open-rpc-macros", "sui-protocol-config", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-simulator", "sui-swarm-config", "sui-test-transaction-builder", @@ -13184,7 +13184,7 @@ dependencies = [ [[package]] name = "sui-light-client" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-trait", @@ -13201,7 +13201,7 @@ dependencies = [ "sui-json-rpc-types", "sui-package-resolver", "sui-rest-api", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-types", "tokio", ] @@ -13218,7 +13218,7 @@ dependencies = [ [[package]] name = "sui-metric-checker" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "backoff", @@ -13239,7 +13239,7 @@ dependencies = [ [[package]] name = "sui-move" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "assert_cmd", @@ -13281,7 +13281,7 @@ dependencies = [ [[package]] name = "sui-move-build" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "datatest-stable", @@ -13305,7 +13305,7 @@ dependencies = [ [[package]] name = "sui-move-lsp" -version = "1.29.0" +version = "1.30.0" dependencies = [ "bin-version", "clap", @@ -13435,7 +13435,7 @@ dependencies = [ [[package]] name = "sui-node" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anemo", "anemo-tower", @@ -13484,7 +13484,7 @@ dependencies = [ [[package]] name = "sui-open-rpc" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "bcs", @@ -13520,7 +13520,7 @@ dependencies = [ [[package]] name = "sui-oracle" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "bcs", @@ -13540,7 +13540,7 @@ dependencies = [ "sui-json-rpc-types", "sui-keys", "sui-move-build", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-types", "tap", "telemetry-subscribers", @@ -13550,14 +13550,14 @@ dependencies = [ [[package]] name = "sui-package-management" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "move-core-types", "move-package", "move-symbol-pool", "sui-json-rpc-types", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-types", "tracing", ] @@ -13698,7 +13698,7 @@ dependencies = [ "sui-json-rpc-api", "sui-json-rpc-types", "sui-protocol-config", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-storage", "sui-transaction-checks", "sui-types", @@ -13742,7 +13742,7 @@ dependencies = [ [[package]] name = "sui-rosetta" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-trait", @@ -13770,7 +13770,7 @@ dependencies = [ "sui-keys", "sui-move-build", "sui-node", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-swarm-config", "sui-types", "telemetry-subscribers", @@ -13784,7 +13784,7 @@ dependencies = [ [[package]] name = "sui-rpc-loadgen" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-trait", @@ -13802,7 +13802,7 @@ dependencies = [ "sui-json-rpc", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-types", "telemetry-subscribers", "test-cluster", @@ -13832,7 +13832,7 @@ dependencies = [ [[package]] name = "sui-sdk" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-recursion", @@ -13868,7 +13868,7 @@ dependencies = [ [[package]] name = "sui-security-watchdog" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "arrow-array", @@ -13915,7 +13915,7 @@ dependencies = [ [[package]] name = "sui-single-node-benchmark" -version = "1.29.0" +version = "1.30.0" dependencies = [ "async-trait", "bcs", @@ -13977,7 +13977,7 @@ dependencies = [ [[package]] name = "sui-source-validation" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "colored", @@ -13994,7 +13994,7 @@ dependencies = [ "rand 0.8.5", "sui-json-rpc-types", "sui-move-build", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-test-transaction-builder", "sui-types", "tar", @@ -14030,7 +14030,7 @@ dependencies = [ "sui-json-rpc-types", "sui-move", "sui-move-build", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-source-validation", "telemetry-subscribers", "tempfile", @@ -14102,7 +14102,7 @@ dependencies = [ [[package]] name = "sui-surfer" -version = "1.29.0" +version = "1.30.0" dependencies = [ "async-trait", "bcs", @@ -14200,13 +14200,13 @@ dependencies = [ "shared-crypto", "sui-genesis-builder", "sui-move-build", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-types", ] [[package]] name = "sui-test-validator" -version = "1.29.0" +version = "1.30.0" [[package]] name = "sui-tls" @@ -14231,7 +14231,7 @@ dependencies = [ [[package]] name = "sui-tool" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anemo", "anemo-cli", @@ -14267,7 +14267,7 @@ dependencies = [ "sui-network", "sui-protocol-config", "sui-replay", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-snapshot", "sui-storage", "sui-types", @@ -14521,7 +14521,7 @@ dependencies = [ [[package]] name = "suins-indexer" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "async-trait", @@ -14882,7 +14882,7 @@ dependencies = [ "sui-macros", "sui-node", "sui-protocol-config", - "sui-sdk 1.29.0", + "sui-sdk 1.30.0", "sui-simulator", "sui-swarm", "sui-swarm-config", @@ -16616,7 +16616,7 @@ dependencies = [ [[package]] name = "x" -version = "1.29.0" +version = "1.30.0" dependencies = [ "anyhow", "camino", diff --git a/Cargo.toml b/Cargo.toml index 8d02dd4d6df0a..b72524382288f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -199,7 +199,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.29.0" +version = "1.30.0" [profile.release] # debug = 1 means line charts only, which is minimum needed for good stack traces diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 8aaf95972d1de..3fa4107fbdf40 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.29.0" + "version": "1.30.0" }, "methods": [ { From 8cc4a8dcb3b2df8e59b34add5772a1c5cf28f79e Mon Sep 17 00:00:00 2001 From: Todd Nowacki Date: Thu, 11 Jul 2024 19:25:28 -0700 Subject: [PATCH 005/163] [deny list v2] Added additional transactional tests (#18600) ## Description - Added transactional tests around specific underlying config behavior - Cannot yet add config specific tests as those APIs are not `public` ## Test plan - New tests --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> --- .../delete_setting_object_same_epoch.exp | 109 ++++++++ .../delete_setting_object_same_epoch.move | 79 ++++++ .../delete_setting_object_set_once.exp | 185 +++++++++++++ .../delete_setting_object_set_once.move | 94 +++++++ .../delete_setting_object_set_twice.exp | 262 ++++++++++++++++++ .../delete_setting_object_set_twice.move | 107 +++++++ .../tests/deny_list_v2/double_add.exp | 52 ++++ .../tests/deny_list_v2/double_add.move | 69 +++++ 8 files changed, 957 insertions(+) create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.move create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.exp create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.move create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.exp create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.move create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.exp create mode 100644 crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.move diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp new file mode 100644 index 0000000000000..966917bd65198 --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp @@ -0,0 +1,109 @@ +processed 12 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1 'publish'. lines 9-53: +created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 20428800, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2 'run'. lines 54-56: +events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 48, 51, 51, 49, 100, 56, 101, 49, 98, 99, 98, 101, 55, 102, 100, 51, 97, 54, 101, 48, 97, 102, 102, 55, 99, 56, 56, 98, 50, 53, 97, 57, 54, 51, 102, 48, 51, 56, 102, 48, 51, 98, 97, 49, 53, 48, 51, 101, 48, 53, 98, 57, 56, 49, 102, 102, 101, 98, 56, 56, 98, 101, 98, 52, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 116, 239, 154, 198, 227, 43, 235, 247, 62, 51, 2, 238, 1, 255, 251, 178, 127, 24, 217, 192, 109, 173, 216, 65, 206, 45, 158, 164, 2, 239, 79, 140] } +created: object(2,0), object(2,1), object(2,2) +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2746260, non_refundable_storage_fee: 27740 + +task 3 'run'. lines 57-59: +created: object(3,0) +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 4356396, non_refundable_storage_fee: 44004 + +task 4 'view-object'. lines 60-60: +Owner: Object ID: ( fake(2,0) ) +Version: 3 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,1), + }, + }, + name: sui::deny_list::AddressKey { + pos0: B, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 0u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[], + }, + }, + ], + }, + }, +} + +task 5 'view-object'. lines 62-64: +Owner: Object ID: ( fake(2,0) ) +Version: 4 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + name: sui::deny_list::GlobalPauseKey { + dummy_field: false, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 0u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[], + }, + }, + ], + }, + }, +} + +task 6 'run'. lines 65-67: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +deleted: object(2,1) +gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6794172, non_refundable_storage_fee: 68628 + +task 7 'run'. lines 68-70: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +deleted: object(3,0) +gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6591024, non_refundable_storage_fee: 66576 + +task 8 'view-object'. lines 71-71: +No object at id 2,1 + +task 9 'view-object'. lines 73-75: +No object at id 3,0 + +task 10 'run'. lines 76-78: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 11 'run'. lines 79-79: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.move b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.move new file mode 100644 index 0000000000000..e401c3f1d7436 --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.move @@ -0,0 +1,79 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// This test verifies the correct deletion of the Config's setting object within the same epoch +// that it was created + +//# init --accounts A B --addresses test=0x0 + +//# publish --sender A +module test::regulated_coin { + use sui::coin; + use sui::deny_list::DenyList; + + public struct REGULATED_COIN has drop {} + + fun init(otw: REGULATED_COIN, ctx: &mut TxContext) { + let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2( + otw, + 9, + b"RC", + b"REGULATED_COIN", + b"A new regulated coin", + option::none(), + true, + ctx + ); + let coin = coin::mint(&mut treasury_cap, 10000, ctx); + transfer::public_transfer(coin, tx_context::sender(ctx)); + transfer::public_transfer(deny_cap, tx_context::sender(ctx)); + transfer::public_freeze_object(treasury_cap); + transfer::public_freeze_object(metadata); + } + + entry fun assert_address_deny_status( + deny_list: &DenyList, + addr: address, + expected: bool, + ) { + let status = coin::deny_list_v2_contains_next_epoch(deny_list, addr); + assert!(status == expected, 0); + } + + entry fun assert_global_pause_status( + deny_list: &DenyList, + expected: bool, + ) { + let status = + coin::deny_list_v2_is_global_pause_enabled_next_epoch(deny_list); + assert!(status == expected, 0); + } +} + +// Deny account B. +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Enable global pause. +//# run sui::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// View the setting objects +//# view-object 2,1 + +//# view-object 3,0 + +// Undeny account B. +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Disable global pause. +//# run sui::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Verify the setting objects are deleted +//# view-object 2,1 + +//# view-object 3,0 + +// Assert that the address is no longer denied. +//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B false --sender A + +// Assert that global pause is disabled. +//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) false --sender A diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.exp new file mode 100644 index 0000000000000..90c22151acc7f --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.exp @@ -0,0 +1,185 @@ +processed 18 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1 'publish'. lines 9-53: +created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 20428800, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2 'run'. lines 54-56: +events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 48, 51, 51, 49, 100, 56, 101, 49, 98, 99, 98, 101, 55, 102, 100, 51, 97, 54, 101, 48, 97, 102, 102, 55, 99, 56, 56, 98, 50, 53, 97, 57, 54, 51, 102, 48, 51, 56, 102, 48, 51, 98, 97, 49, 53, 48, 51, 101, 48, 53, 98, 57, 56, 49, 102, 102, 101, 98, 56, 56, 98, 101, 98, 52, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 116, 239, 154, 198, 227, 43, 235, 247, 62, 51, 2, 238, 1, 255, 251, 178, 127, 24, 217, 192, 109, 173, 216, 65, 206, 45, 158, 164, 2, 239, 79, 140] } +created: object(2,0), object(2,1), object(2,2) +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2746260, non_refundable_storage_fee: 27740 + +task 3 'run'. lines 57-59: +created: object(3,0) +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 4356396, non_refundable_storage_fee: 44004 + +task 4 'view-object'. lines 60-60: +Owner: Object ID: ( fake(2,0) ) +Version: 3 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,1), + }, + }, + name: sui::deny_list::AddressKey { + pos0: B, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 0u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[], + }, + }, + ], + }, + }, +} + +task 5 'view-object'. lines 62-62: +Owner: Object ID: ( fake(2,0) ) +Version: 4 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + name: sui::deny_list::GlobalPauseKey { + dummy_field: false, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 0u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[], + }, + }, + ], + }, + }, +} + +task 6 'advance-epoch'. lines 64-66: +Epoch advanced: 1 + +task 7 'run'. lines 67-69: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(2,1) +gas summary: computation_cost: 1000000, storage_cost: 6862800, storage_rebate: 6794172, non_refundable_storage_fee: 68628 + +task 8 'run'. lines 70-72: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(3,0) +gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 6591024, non_refundable_storage_fee: 66576 + +task 9 'view-object'. lines 73-73: +Owner: Object ID: ( fake(2,0) ) +Version: 5 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,1), + }, + }, + name: sui::deny_list::AddressKey { + pos0: B, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 1u64, + newer_value: std::option::Option { + vec: vector[], + }, + older_value_opt: std::option::Option { + vec: vector[ + true, + ], + }, + }, + ], + }, + }, +} + +task 10 'view-object'. lines 75-75: +Owner: Object ID: ( fake(2,0) ) +Version: 6 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + name: sui::deny_list::GlobalPauseKey { + dummy_field: false, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 1u64, + newer_value: std::option::Option { + vec: vector[], + }, + older_value_opt: std::option::Option { + vec: vector[ + true, + ], + }, + }, + ], + }, + }, +} + +task 11 'advance-epoch'. lines 77-79: +Epoch advanced: 2 + +task 12 'run'. lines 80-82: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +deleted: object(2,1) +gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6794172, non_refundable_storage_fee: 68628 + +task 13 'run'. lines 83-85: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +deleted: object(3,0) +gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6591024, non_refundable_storage_fee: 66576 + +task 14 'view-object'. lines 86-86: +No object at id 2,1 + +task 15 'view-object'. lines 88-90: +No object at id 3,0 + +task 16 'run'. lines 91-93: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 17 'run'. lines 94-94: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.move b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.move new file mode 100644 index 0000000000000..046c50efe70b3 --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_once.move @@ -0,0 +1,94 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// This test verifies the correct deletion of the Config's setting object after the epoch it was +// created. THe value is set only in one epoch. + +//# init --accounts A B --addresses test=0x0 + +//# publish --sender A +module test::regulated_coin { + use sui::coin; + use sui::deny_list::DenyList; + + public struct REGULATED_COIN has drop {} + + fun init(otw: REGULATED_COIN, ctx: &mut TxContext) { + let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2( + otw, + 9, + b"RC", + b"REGULATED_COIN", + b"A new regulated coin", + option::none(), + true, + ctx + ); + let coin = coin::mint(&mut treasury_cap, 10000, ctx); + transfer::public_transfer(coin, tx_context::sender(ctx)); + transfer::public_transfer(deny_cap, tx_context::sender(ctx)); + transfer::public_freeze_object(treasury_cap); + transfer::public_freeze_object(metadata); + } + + entry fun assert_address_deny_status( + deny_list: &DenyList, + addr: address, + expected: bool, + ) { + let status = coin::deny_list_v2_contains_next_epoch(deny_list, addr); + assert!(status == expected, 0); + } + + entry fun assert_global_pause_status( + deny_list: &DenyList, + expected: bool, + ) { + let status = + coin::deny_list_v2_is_global_pause_enabled_next_epoch(deny_list); + assert!(status == expected, 0); + } +} + +// Deny account B. +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Enable global pause. +//# run sui::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// View the setting objects +//# view-object 2,1 + +//# view-object 3,0 + +//# advance-epoch + +// Undeny account B. +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Disable global pause. +//# run sui::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Verify the setting objects are still present +//# view-object 2,1 + +//# view-object 3,0 + +//# advance-epoch + +// Undeny account B. +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Disable global pause. +//# run sui::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Verify the setting objects are deleted +//# view-object 2,1 + +//# view-object 3,0 + +// Assert that the address is no longer denied. +//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B false --sender A + +// Assert that global pause is disabled. +//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) false --sender A diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.exp new file mode 100644 index 0000000000000..278b53bbb78a4 --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.exp @@ -0,0 +1,262 @@ +processed 23 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1 'publish'. lines 9-53: +created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 20428800, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2 'run'. lines 54-56: +events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 48, 51, 51, 49, 100, 56, 101, 49, 98, 99, 98, 101, 55, 102, 100, 51, 97, 54, 101, 48, 97, 102, 102, 55, 99, 56, 56, 98, 50, 53, 97, 57, 54, 51, 102, 48, 51, 56, 102, 48, 51, 98, 97, 49, 53, 48, 51, 101, 48, 53, 98, 57, 56, 49, 102, 102, 101, 98, 56, 56, 98, 101, 98, 52, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 116, 239, 154, 198, 227, 43, 235, 247, 62, 51, 2, 238, 1, 255, 251, 178, 127, 24, 217, 192, 109, 173, 216, 65, 206, 45, 158, 164, 2, 239, 79, 140] } +created: object(2,0), object(2,1), object(2,2) +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2746260, non_refundable_storage_fee: 27740 + +task 3 'run'. lines 57-59: +created: object(3,0) +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 4356396, non_refundable_storage_fee: 44004 + +task 4 'view-object'. lines 60-60: +Owner: Object ID: ( fake(2,0) ) +Version: 3 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,1), + }, + }, + name: sui::deny_list::AddressKey { + pos0: B, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 0u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[], + }, + }, + ], + }, + }, +} + +task 5 'view-object'. lines 62-62: +Owner: Object ID: ( fake(2,0) ) +Version: 4 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + name: sui::deny_list::GlobalPauseKey { + dummy_field: false, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 0u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[], + }, + }, + ], + }, + }, +} + +task 6 'advance-epoch'. lines 64-66: +Epoch advanced: 1 + +task 7 'run'. lines 67-69: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(2,1) +gas summary: computation_cost: 1000000, storage_cost: 6870400, storage_rebate: 6794172, non_refundable_storage_fee: 68628 + +task 8 'run'. lines 70-72: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(3,0) +gas summary: computation_cost: 1000000, storage_cost: 6665200, storage_rebate: 6591024, non_refundable_storage_fee: 66576 + +task 9 'view-object'. lines 73-73: +Owner: Object ID: ( fake(2,0) ) +Version: 5 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,1), + }, + }, + name: sui::deny_list::AddressKey { + pos0: B, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 1u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[ + true, + ], + }, + }, + ], + }, + }, +} + +task 10 'view-object'. lines 75-75: +Owner: Object ID: ( fake(2,0) ) +Version: 6 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + name: sui::deny_list::GlobalPauseKey { + dummy_field: false, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 1u64, + newer_value: std::option::Option { + vec: vector[ + true, + ], + }, + older_value_opt: std::option::Option { + vec: vector[ + true, + ], + }, + }, + ], + }, + }, +} + +task 11 'advance-epoch'. lines 77-79: +Epoch advanced: 2 + +task 12 'run'. lines 80-82: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(2,1) +gas summary: computation_cost: 1000000, storage_cost: 6862800, storage_rebate: 6801696, non_refundable_storage_fee: 68704 + +task 13 'run'. lines 83-85: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(3,0) +gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 6598548, non_refundable_storage_fee: 66652 + +task 14 'view-object'. lines 86-86: +Owner: Object ID: ( fake(2,0) ) +Version: 7 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,1), + }, + }, + name: sui::deny_list::AddressKey { + pos0: B, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 2u64, + newer_value: std::option::Option { + vec: vector[], + }, + older_value_opt: std::option::Option { + vec: vector[ + true, + ], + }, + }, + ], + }, + }, +} + +task 15 'view-object'. lines 88-88: +Owner: Object ID: ( fake(2,0) ) +Version: 8 +Contents: sui::dynamic_field::Field> { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + name: sui::deny_list::GlobalPauseKey { + dummy_field: false, + }, + value: sui::config::Setting { + data: std::option::Option> { + vec: vector[ + sui::config::SettingData { + newer_value_epoch: 2u64, + newer_value: std::option::Option { + vec: vector[], + }, + older_value_opt: std::option::Option { + vec: vector[ + true, + ], + }, + }, + ], + }, + }, +} + +task 16 'advance-epoch'. lines 90-92: +Epoch advanced: 3 + +task 17 'run'. lines 93-95: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +deleted: object(2,1) +gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6794172, non_refundable_storage_fee: 68628 + +task 18 'run'. lines 96-98: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +deleted: object(3,0) +gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6591024, non_refundable_storage_fee: 66576 + +task 19 'view-object'. lines 99-99: +No object at id 2,1 + +task 20 'view-object'. lines 101-103: +No object at id 3,0 + +task 21 'run'. lines 104-106: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 22 'run'. lines 107-107: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.move b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.move new file mode 100644 index 0000000000000..7699e38603431 --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_set_twice.move @@ -0,0 +1,107 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// This test verifies the correct deletion of the Config's setting object after the epoch it was +// created. THe value is set twice over multiple epochs. + +//# init --accounts A B --addresses test=0x0 + +//# publish --sender A +module test::regulated_coin { + use sui::coin; + use sui::deny_list::DenyList; + + public struct REGULATED_COIN has drop {} + + fun init(otw: REGULATED_COIN, ctx: &mut TxContext) { + let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2( + otw, + 9, + b"RC", + b"REGULATED_COIN", + b"A new regulated coin", + option::none(), + true, + ctx + ); + let coin = coin::mint(&mut treasury_cap, 10000, ctx); + transfer::public_transfer(coin, tx_context::sender(ctx)); + transfer::public_transfer(deny_cap, tx_context::sender(ctx)); + transfer::public_freeze_object(treasury_cap); + transfer::public_freeze_object(metadata); + } + + entry fun assert_address_deny_status( + deny_list: &DenyList, + addr: address, + expected: bool, + ) { + let status = coin::deny_list_v2_contains_next_epoch(deny_list, addr); + assert!(status == expected, 0); + } + + entry fun assert_global_pause_status( + deny_list: &DenyList, + expected: bool, + ) { + let status = + coin::deny_list_v2_is_global_pause_enabled_next_epoch(deny_list); + assert!(status == expected, 0); + } +} + +// Deny account B. +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Enable global pause. +//# run sui::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// View the setting objects +//# view-object 2,1 + +//# view-object 3,0 + +//# advance-epoch + +// Deny account B. +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Enable global pause. +//# run sui::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// View the setting objects +//# view-object 2,1 + +//# view-object 3,0 + +//# advance-epoch + +// Undeny account B. +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Disable global pause. +//# run sui::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Verify the setting objects are still present +//# view-object 2,1 + +//# view-object 3,0 + +//# advance-epoch + +// Undeny account B. +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Disable global pause. +//# run sui::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Verify the setting objects are deleted +//# view-object 2,1 + +//# view-object 3,0 + +// Assert that the address is no longer denied. +//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B false --sender A + +// Assert that global pause is disabled. +//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) false --sender A diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.exp new file mode 100644 index 0000000000000..94b60a6725031 --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.exp @@ -0,0 +1,52 @@ +processed 11 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1 'publish'. lines 9-44: +created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 19471200, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2 'run'. lines 45-47: +created: object(2,0) +mutated: object(0,0), object(1,1) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2437776, non_refundable_storage_fee: 24624 + +task 3 'run'. lines 48-50: +events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 51, 57, 57, 50, 48, 100, 100, 53, 50, 49, 99, 56, 48, 55, 101, 54, 98, 97, 99, 54, 99, 56, 97, 98, 51, 52, 102, 54, 49, 52, 48, 54, 49, 49, 53, 56, 56, 56, 49, 57, 57, 55, 56, 56, 52, 52, 98, 52, 51, 53, 57, 52, 53, 56, 57, 100, 55, 102, 56, 56, 98, 100, 57, 57, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 79, 194, 17, 174, 74, 227, 253, 26, 173, 100, 153, 228, 250, 55, 174, 175, 17, 33, 34, 53, 27, 207, 230, 188, 240, 54, 6, 177, 124, 66, 182, 148] } +created: object(3,0), object(3,1), object(3,2) +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2746260, non_refundable_storage_fee: 27740 + +task 4 'run'. lines 51-53: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(3,1) +gas summary: computation_cost: 1000000, storage_cost: 6862800, storage_rebate: 6794172, non_refundable_storage_fee: 68628 + +task 5 'run'. lines 54-56: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 6 'transfer-object'. lines 57-59: +Error: Error checking transaction input objects: AddressDeniedForCoin { address: @B, coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } + +task 7 'run'. lines 60-62: +Error: Error checking transaction input objects: AddressDeniedForCoin { address: @B, coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } + +task 8 'run'. lines 63-65: +mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) +deleted: object(3,1) +gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6794172, non_refundable_storage_fee: 68628 + +task 9 'run'. lines 66-68: +mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 10 'transfer-object'. lines 69-69: +mutated: object(0,1), object(2,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 +gas summary: computation_cost: 1000000, storage_cost: 2462400, storage_rebate: 1459656, non_refundable_storage_fee: 14744 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.move b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.move new file mode 100644 index 0000000000000..9f6bedad50171 --- /dev/null +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/double_add.move @@ -0,0 +1,69 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// This test verifies double adding an address to the deny list does not panic and still +// ensures the correct behavior when removing + +//# init --accounts A B --addresses test=0x0 + +//# publish --sender A +module test::regulated_coin { + use sui::coin; + use sui::deny_list::DenyList; + + public struct REGULATED_COIN has drop {} + + fun init(otw: REGULATED_COIN, ctx: &mut TxContext) { + let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2( + otw, + 9, + b"RC", + b"REGULATED_COIN", + b"A new regulated coin", + option::none(), + false, + ctx + ); + let coin = coin::mint(&mut treasury_cap, 10000, ctx); + transfer::public_transfer(coin, tx_context::sender(ctx)); + transfer::public_transfer(deny_cap, tx_context::sender(ctx)); + transfer::public_freeze_object(treasury_cap); + transfer::public_freeze_object(metadata); + } + + entry fun assert_address_deny_status( + deny_list: &DenyList, + addr: address, + expected: bool, + ) { + let status = coin::deny_list_v2_contains_next_epoch(deny_list, addr); + assert!(status == expected, 0); + } +} + +// Transfer away the newly minted coin works normally. +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Deny account B. +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Deny account B a second time. This should not change anything. +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Assert that the address is denied. +//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B true --sender A + +// Try transfer the coin from B. This should now be denied. +//# transfer-object 2,0 --sender B --recipient A + +// Try using the coin in a Move call. This should also be denied. +//# run sui::pay::split_and_transfer --args object(2,0) 1 @A --type-args test::regulated_coin::REGULATED_COIN --sender B + +// Undeny account B. +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A + +// Assert that the address is no longer denied. +//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B false --sender A + +// This time the transfer should work. +//# transfer-object 2,0 --sender B --recipient A From c108fd84af22410f6de69e36dc55a657cd682fa7 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 11 Jul 2024 21:04:04 -0700 Subject: [PATCH 006/163] [test] Simplify transaction orchestrator tests (#18632) ## Description There is already a orchestrator, no need to create new one in the test. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../tests/transaction_orchestrator_tests.rs | 54 ++----------------- 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs b/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs index 7af2f617b5508..3c0a50eb8074f 100644 --- a/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs +++ b/crates/sui-e2e-tests/tests/transaction_orchestrator_tests.rs @@ -1,7 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use prometheus::Registry; use std::sync::Arc; use std::time::Duration; use sui_core::authority_client::NetworkAuthorityClient; @@ -31,18 +30,7 @@ async fn test_blocking_execution() -> Result<(), anyhow::Error> { let mut test_cluster = TestClusterBuilder::new().build().await; let context = &mut test_cluster.wallet; let handle = &test_cluster.fullnode_handle.sui_node; - - let temp_dir = tempfile::tempdir().unwrap(); - let registry = Registry::new(); - // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle.with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }); + let orchestrator = handle.with(|n| n.transaction_orchestrator().as_ref().unwrap().clone()); let txn_count = 4; let mut txns = batch_make_transfer_transactions(context, txn_count).await; @@ -120,19 +108,7 @@ async fn test_fullnode_wal_log() -> Result<(), anyhow::Error> { .await; let handle = &test_cluster.fullnode_handle.sui_node; - - let temp_dir = tempfile::tempdir().unwrap(); - tokio::task::yield_now().await; - let registry = Registry::new(); - // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle.with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }); + let orchestrator = handle.with(|n| n.transaction_orchestrator().as_ref().unwrap().clone()); let txn_count = 2; let context = &mut test_cluster.wallet; @@ -335,18 +311,7 @@ async fn execute_transaction_v3() -> Result<(), anyhow::Error> { let mut test_cluster = TestClusterBuilder::new().build().await; let context = &mut test_cluster.wallet; let handle = &test_cluster.fullnode_handle.sui_node; - - let temp_dir = tempfile::tempdir().unwrap(); - let registry = Registry::new(); - // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle.with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }); + let orchestrator = handle.with(|n| n.transaction_orchestrator().as_ref().unwrap().clone()); let txn_count = 1; let mut txns = batch_make_transfer_transactions(context, txn_count).await; @@ -404,18 +369,7 @@ async fn execute_transaction_v3_staking_transaction() -> Result<(), anyhow::Erro let mut test_cluster = TestClusterBuilder::new().build().await; let context = &mut test_cluster.wallet; let handle = &test_cluster.fullnode_handle.sui_node; - - let temp_dir = tempfile::tempdir().unwrap(); - let registry = Registry::new(); - // Start orchestrator inside container so that it will be properly shutdown. - let orchestrator = handle.with(|node| { - TransactiondOrchestrator::new_with_network_clients( - node.state(), - node.subscribe_to_epoch_change(), - temp_dir.path(), - ®istry, - ) - }); + let orchestrator = handle.with(|n| n.transaction_orchestrator().as_ref().unwrap().clone()); let validator_address = context .get_client() From f7a6a6c4b16e5a8c6544831935e7b13c55b35bd0 Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Thu, 11 Jul 2024 22:11:21 -0700 Subject: [PATCH 007/163] [bridge] support rank validators by voting power when requesting signatures (#18298) ## Description In this PR we introduce a way to order validators to request signatures according to their voting power. This is useful for signatures to be verified on ethereum because the # of signatures do impact the gas cost there significantly. ## Test plan deploying on a testnet bridge node to test. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/client/bridge_authority_aggregator.rs | 24 ++++++++++++-- crates/sui-bridge/src/sui_client.rs | 2 +- crates/sui-bridge/src/types.rs | 33 +++++++++++-------- crates/sui-core/src/authority.rs | 7 ++++ crates/sui-json-rpc-types/src/sui_protocol.rs | 6 ++++ crates/sui-open-rpc/spec/openrpc.json | 13 ++++++++ crates/sui-protocol-config/src/lib.rs | 20 +++++++++++ crates/sui-rest-api/src/system.rs | 1 + crates/sui-types/src/transaction.rs | 14 +++++++- .../sui-adapter/src/execution_engine.rs | 1 + 10 files changed, 102 insertions(+), 19 deletions(-) diff --git a/crates/sui-bridge/src/client/bridge_authority_aggregator.rs b/crates/sui-bridge/src/client/bridge_authority_aggregator.rs index 44390961170d7..493873b7e8af7 100644 --- a/crates/sui-bridge/src/client/bridge_authority_aggregator.rs +++ b/crates/sui-bridge/src/client/bridge_authority_aggregator.rs @@ -14,9 +14,10 @@ use crate::types::{ }; use std::collections::btree_map::Entry; use std::collections::BTreeMap; +use std::collections::BTreeSet; use std::sync::Arc; use std::time::Duration; -use sui_common::authority_aggregation::quorum_map_then_reduce_with_timeout; +use sui_common::authority_aggregation::quorum_map_then_reduce_with_timeout_and_prefs; use sui_common::authority_aggregation::ReduceOutput; use sui_types::base_types::ConciseableName; use sui_types::committee::StakeUnit; @@ -143,7 +144,6 @@ impl GetSigsState { sig_info, ); // `BridgeClient` already verified individual signatures - // TODO: should we verify again here? Ok(Some(VerifiedCertifiedBridgeAction::new_from_verified( certified_action, ))) @@ -168,9 +168,27 @@ async fn request_sign_bridge_action_into_certification( clients: Arc>>, state: GetSigsState, ) -> BridgeResult { - let (result, _) = quorum_map_then_reduce_with_timeout( + // `preferences` is used as a trick here to influence the order of validators to be requested. + // * if `Some(_)`, then we will request validators in the order of the voting power. + // * if `None`, we still refer to voting power, but they are shuffled by randomness. + // Because ethereum gas price is not negligible, when the signatures are to be verified on ethereum, + // we pass in `Some` to make sure the validators with higher voting power are requested first + // to save gas cost. + let preference = match action { + BridgeAction::SuiToEthBridgeAction(_) => Some(BTreeSet::new()), + BridgeAction::EthToSuiBridgeAction(_) => None, + _ => { + if action.chain_id().is_sui_chain() { + None + } else { + Some(BTreeSet::new()) + } + } + }; + let (result, _) = quorum_map_then_reduce_with_timeout_and_prefs( committee, clients, + preference.as_ref(), state, |_name, client| { Box::pin(async move { client.request_sign_bridge_action(action.clone()).await }) diff --git a/crates/sui-bridge/src/sui_client.rs b/crates/sui-bridge/src/sui_client.rs index 71012a2de4f38..97586c3825c5e 100644 --- a/crates/sui-bridge/src/sui_client.rs +++ b/crates/sui-bridge/src/sui_client.rs @@ -98,7 +98,7 @@ where /// Get the mutable bridge object arg on chain. // We retry a few times in case of errors. If it fails eventually, we panic. - // In generaly it's safe to call in the beginning of the program. + // In general it's safe to call in the beginning of the program. // After the first call, the result is cached since the value should never change. pub async fn get_mutable_bridge_object_arg_must_succeed(&self) -> ObjectArg { static ARG: OnceCell = OnceCell::const_new(); diff --git a/crates/sui-bridge/src/types.rs b/crates/sui-bridge/src/types.rs index ed96a17d531b5..0d7c199e8965d 100644 --- a/crates/sui-bridge/src/types.rs +++ b/crates/sui-bridge/src/types.rs @@ -116,18 +116,19 @@ impl BridgeCommittee { } impl CommitteeTrait for BridgeCommittee { - // Note: - // 1. preference is not supported today. - // 2. blocklisted members are always excluded. + // Note: blocklisted members are always excluded. fn shuffle_by_stake_with_rng( &self, - // preference is not supported today - _preferences: Option<&BTreeSet>, + // `preferences` is used as a *flag* here to influence the order of validators to be requested. + // * if `Some(_)`, then we will request validators in the order of the voting power + // * if `None`, we still refer to voting power, but they are shuffled by randomness. + // to save gas cost. + preferences: Option<&BTreeSet>, // only attempt from these authorities. restrict_to: Option<&BTreeSet>, rng: &mut impl Rng, ) -> Vec { - let candidates = self + let mut candidates = self .members .iter() .filter_map(|(name, a)| { @@ -146,14 +147,18 @@ impl CommitteeTrait for BridgeCommittee { } }) .collect::>(); - - candidates - .choose_multiple_weighted(rng, candidates.len(), |(_, weight)| *weight as f64) - // Unwrap safe: it panics when the third parameter is larger than the size of the slice - .unwrap() - .map(|(name, _)| name) - .cloned() - .collect() + if preferences.is_some() { + candidates.sort_by(|(_, a), (_, b)| b.cmp(a)); + candidates.iter().map(|(name, _)| name.clone()).collect() + } else { + candidates + .choose_multiple_weighted(rng, candidates.len(), |(_, weight)| *weight as f64) + // Unwrap safe: it panics when the third parameter is larger than the size of the slice + .unwrap() + .map(|(name, _)| name) + .cloned() + .collect() + } } fn weight(&self, author: &BridgeAuthorityPublicKeyBytes) -> StakeUnit { diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 902b9ae5fcbcd..61662a25dc648 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -4475,6 +4475,13 @@ impl AuthorityState { info!("bridge not enabled"); return None; } + if !epoch_store + .protocol_config() + .should_try_to_finalize_bridge_committee() + { + info!("should not try to finalize bridge committee yet"); + return None; + } // Only create this transaction if bridge exists if !epoch_store.bridge_exists() { return None; diff --git a/crates/sui-json-rpc-types/src/sui_protocol.rs b/crates/sui-json-rpc-types/src/sui_protocol.rs index 9a186187660b9..4439ad4ddf13d 100644 --- a/crates/sui-json-rpc-types/src/sui_protocol.rs +++ b/crates/sui-json-rpc-types/src/sui_protocol.rs @@ -35,6 +35,11 @@ pub enum SuiProtocolConfigValue { #[serde_as(as = "DisplayFromStr")] f64, ), + Bool( + #[schemars(with = "String")] + #[serde_as(as = "DisplayFromStr")] + bool, + ), } impl From for SuiProtocolConfigValue { @@ -44,6 +49,7 @@ impl From for SuiProtocolConfigValue { ProtocolConfigValue::u32(y) => SuiProtocolConfigValue::U32(y), ProtocolConfigValue::u64(x) => SuiProtocolConfigValue::U64(x), ProtocolConfigValue::f64(z) => SuiProtocolConfigValue::F64(z), + ProtocolConfigValue::bool(z) => SuiProtocolConfigValue::Bool(z), } } } diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 3fa4107fbdf40..5f4a0bf063329 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -1403,6 +1403,7 @@ "bls12381_bls12381_min_sig_verify_msg_cost_per_byte": { "u64": "2" }, + "bridge_should_try_to_finalize_committee": null, "buffer_stake_for_protocol_upgrade_bps": { "u64": "5000" }, @@ -7962,6 +7963,18 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "bool" + ], + "properties": { + "bool": { + "type": "string" + } + }, + "additionalProperties": false } ] }, diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index b80da3381fb07..933a0ff4ead6d 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -161,6 +161,7 @@ const MAX_PROTOCOL_VERSION: u64 = 52; // Enable enums on testnet. // Add support for passkey in devnet. // Enable deny list v2 on testnet and mainnet. +// Version 54: Add feature flag to decide whether to attempt to finalize bridge committee #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -1190,6 +1191,11 @@ pub struct ProtocolConfig { /// The max number of transactions that can be included in a single Soft Bundle. max_soft_bundle_size: Option, + + /// Whether to try to form bridge committee + // Note: this is not a feature flag because we want to distinguish between + // `None` and `Some(false)`, as committee was already finalized on Testnet. + bridge_should_try_to_finalize_committee: Option, } // feature flags @@ -1377,6 +1383,14 @@ impl ProtocolConfig { ret } + pub fn should_try_to_finalize_bridge_committee(&self) -> bool { + if !self.enable_bridge() { + return false; + } + // In the older protocol version, always try to finalize the committee. + self.bridge_should_try_to_finalize_committee.unwrap_or(true) + } + pub fn enable_effects_v2(&self) -> bool { self.feature_flags.enable_effects_v2 } @@ -1955,6 +1969,8 @@ impl ProtocolConfig { checkpoint_summary_version_specific_data: None, max_soft_bundle_size: None, + + bridge_should_try_to_finalize_committee: None, // When adding a new constant, set it to None in the earliest version, like this: // new_constant: None, }; @@ -2508,6 +2524,10 @@ impl ProtocolConfig { } cfg.feature_flags.enable_coin_deny_list_v2 = true; } + 54 => { + // Do not allow bridge committee to finalize on mainnet. + cfg.bridge_should_try_to_finalize_committee = Some(chain != Chain::Mainnet); + } // Use this template when making changes: // // // modify an existing constant. diff --git a/crates/sui-rest-api/src/system.rs b/crates/sui-rest-api/src/system.rs index 117582f47a2d6..2f783ed2e35ff 100644 --- a/crates/sui-rest-api/src/system.rs +++ b/crates/sui-rest-api/src/system.rs @@ -627,6 +627,7 @@ impl From for ProtocolConfigResponse { ProtocolConfigValue::u32(y) => y.to_string(), ProtocolConfigValue::u64(z) => z.to_string(), ProtocolConfigValue::f64(f) => f.to_string(), + ProtocolConfigValue::bool(b) => b.to_string(), }; (k, v) }) diff --git a/crates/sui-types/src/transaction.rs b/crates/sui-types/src/transaction.rs index b33920bd4bde5..59368e5a5d434 100644 --- a/crates/sui-types/src/transaction.rs +++ b/crates/sui-types/src/transaction.rs @@ -449,13 +449,25 @@ impl EndOfEpochTransactionKind { )); } } - Self::BridgeStateCreate(_) | Self::BridgeCommitteeInit(_) => { + Self::BridgeStateCreate(_) => { if !config.enable_bridge() { return Err(UserInputError::Unsupported( "bridge not enabled".to_string(), )); } } + Self::BridgeCommitteeInit(_) => { + if !config.enable_bridge() { + return Err(UserInputError::Unsupported( + "bridge not enabled".to_string(), + )); + } + if !config.should_try_to_finalize_bridge_committee() { + return Err(UserInputError::Unsupported( + "should not try to finalize committee yet".to_string(), + )); + } + } } Ok(()) } diff --git a/sui-execution/latest/sui-adapter/src/execution_engine.rs b/sui-execution/latest/sui-adapter/src/execution_engine.rs index 363a818dd007a..94179bf8c679c 100644 --- a/sui-execution/latest/sui-adapter/src/execution_engine.rs +++ b/sui-execution/latest/sui-adapter/src/execution_engine.rs @@ -673,6 +673,7 @@ mod checked { } EndOfEpochTransactionKind::BridgeCommitteeInit(bridge_shared_version) => { assert!(protocol_config.enable_bridge()); + assert!(protocol_config.should_try_to_finalize_bridge_committee()); builder = setup_bridge_committee_update(builder, bridge_shared_version) } } From 02599ed5c4e03845ca3ea06bc0a9ded10fc1aa52 Mon Sep 17 00:00:00 2001 From: Rijnard van Tonder Date: Thu, 11 Jul 2024 22:24:08 -0700 Subject: [PATCH 008/163] sdk test setup: fix racy access on tmp config file (#18628) ## Description Some test setups call [`[setup(), setup()]`](https://github.com/MystenLabs/sui/blob/9c588e14f284a8feb10f29791f32ad6bb3f36ae4/sdk/typescript/test/e2e/coin-with-balance.test.ts#L22) which can cause a race on accessing the tmp `config.yaml` (which happens in the same tmp directory). This change ensures `setup()` is creates `config.yaml` in unique directories. This issue is probably what caused the flakiness in [CI](https://github.com/MystenLabs/sui/actions/runs/9897466376/job/27342099106#step:10:2279), note the: ``` Cannot open wallet config file at "/tmp/client.yaml ``` ## Test plan Tested locally that running the test creates separate directories and passes. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- sdk/typescript/test/e2e/utils/setup.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/typescript/test/e2e/utils/setup.ts b/sdk/typescript/test/e2e/utils/setup.ts index 0e96eddbe0a3a..b1af7cdd7fe74 100644 --- a/sdk/typescript/test/e2e/utils/setup.ts +++ b/sdk/typescript/test/e2e/utils/setup.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { execSync } from 'child_process'; +import { mkdtemp } from 'fs/promises'; import { tmpdir } from 'os'; import path, { resolve } from 'path'; import tmp from 'tmp'; @@ -118,7 +119,9 @@ export function getClient(url = DEFAULT_FULLNODE_URL): SuiClient { export async function setup(options: { graphQLURL?: string; rpcURL?: string } = {}) { const keypair = Ed25519Keypair.generate(); const address = keypair.getPublicKey().toSuiAddress(); - const configPath = path.join(tmpdir(), 'client.yaml'); + const tmpDirPath = path.join(tmpdir(), 'config-'); + const tmpDir = await mkdtemp(tmpDirPath); + const configPath = path.join(tmpDir, 'client.yaml'); return setupWithFundedAddress(keypair, address, configPath, options); } From a3bf1369c3dcf5e7dafc0558a1597f81fb083961 Mon Sep 17 00:00:00 2001 From: Daniel Ahn Date: Fri, 12 Jul 2024 08:19:30 -0700 Subject: [PATCH 009/163] Update local-network.mdx (#18633) Updated broken link with correct link to url of Current Tags section of the Sui NPM registry. ## Description Existing link was broken. I navigated to the correct url and replaced the link with that url (https://www.npmjs.com/package/@mysten/sui?activeTab=versions). ## Test plan How did you test the new or updated feature? I double-checked that the url is correct. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: Screenshot shows the current broken link/url: ![Screenshot 2024-07-12 003147](https://github.com/user-attachments/assets/d7cbf4ba-b54b-47d3-b568-f170b39f7f5c) --- docs/content/guides/developer/getting-started/local-network.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/guides/developer/getting-started/local-network.mdx b/docs/content/guides/developer/getting-started/local-network.mdx index 155b795b322a1..322755954cc70 100644 --- a/docs/content/guides/developer/getting-started/local-network.mdx +++ b/docs/content/guides/developer/getting-started/local-network.mdx @@ -191,5 +191,5 @@ To resolve this, switch or update to Node.js 18 and then try again. ## Test with the Sui TypeScript SDK -The published version of the Sui TypeScript SDK might be an earlier version than the version of Sui you installed for your local network. To make sure you're using the latest version of the SDK, use the `experimental`-tagged version (for example, `0.0.0-experimental-20230317184920`) in the [Current Tags](https://www.npmjs.com/package/@mysten/sui/v/0.0.0-experimental-20230127130009?activeTab=versions) section of the Sui NPM registry. +The published version of the Sui TypeScript SDK might be an earlier version than the version of Sui you installed for your local network. To make sure you're using the latest version of the SDK, use the `experimental`-tagged version (for example, `0.0.0-experimental-20230317184920`) in the [Current Tags](https://www.npmjs.com/package/@mysten/sui?activeTab=versions) section of the Sui NPM registry. From 67b18a5481ab4879af4abf54d28c98496af38dc5 Mon Sep 17 00:00:00 2001 From: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> Date: Fri, 12 Jul 2024 09:58:54 -0600 Subject: [PATCH 010/163] [docs][site] Fixes small screen nav (#18546) ## Description Fixes broken nav on small screens. Jira [DOCS-383](https://mysten.atlassian.net/browse/DOCS-383) for more info. Also applies tailwind to some styles, which should eventually be used exclusively. [docs/site/src/components/GetStartedLink/index.tsx](https://github.com/MystenLabs/sui/pull/18546/files#diff-ed1e3e4e3d31a916f33152c76fae5faaa7fad41c38d7436f441e0d977f33ac72): Removed the logic that controls the display of the Get Started link on the home page to its own component. This should make changing the location the link navigates to easier and to change the logic behind visible/hidden and other updates. Should make updates easier because only need to change the component reference of the docusaurus component instead of the related logic. [docs/site/src/components/ThemeToggle/index.tsx](https://github.com/MystenLabs/sui/pull/18546/files#diff-3951ee509e2800c54d91ed3424884e59ce6fd2dd8a8d2e71963223728cdad832): Removed the logic for showing or hiding the default theme switcher from the default docusaurus component. Moved to its own component to better support docusaurus updates in the future. Also makes replacing the default switcher in the future easier. deleted components from `theme/Navbar`: These components were swizzled from docusaurus theme but only added a style in some cases and didn't change anything in others. The Navbar component was ejected with all its children even though it didn't need to be. The Navbar component (and its children) are labeled as `not safe` for swizzling. This means that updates to docusaurus can break any changes made to these components, so should only be ejected and changed when necessary and requires checking for updates. [docs/site/src/theme/Navbar/index.js](https://github.com/MystenLabs/sui/pull/18546/files#diff-a62ab467816eb68ede0469822b5ed6637ff9af29ab3c5cb3831ccf1b321d5db4): This component was ejected from Docusaurus 2.x. The changes here are just what docusaurus updated the component to. And now that I type this, I realize that I can just delete it so that the default component gets used instead of the custom one. This means only the default component `Navbar/Content` is changed by just adding references to the two components mentioned previously (as opposed to the 5 or 6 components that were ejected originally). Styles: Styles were changed where necessary. If a style was updated, then it was also updated to use tailwind syntax. Two styles were used to remove the need for swizzling default docusaurus components, which as mentioned comes at the cost of maintenance). This approach was necessary because docusaurus reuses a lot of general classes for its components or creates dynamic ones that are suffixed by the relative path to the component. - This style selects the wrapper around the search bar so that the "get started" button on the home page displays next to the search. Prevents having to eject Navbar/Search component just to add a class. ``` [class^="navbarSearchContainer"] { @apply min-[997px]:flex min-[997px]:gap-4 } ``` - This style selects the theme switch (light/dark). Prevents having to make an additional update to the Navbar/Content component. ``` button[title^="Switch between dark and light mode"] { @apply !text-white hover:bg-sui-blue-primary } ``` ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/components/GetStartedLink/index.tsx | 19 +++++ .../site/src/components/ThemeToggle/index.tsx | 15 ++++ docs/site/src/css/custom.css | 76 ++++++++++++++----- .../src/theme/Navbar/ColorModeToggle/index.js | 21 ----- .../Navbar/ColorModeToggle/styles.module.css | 6 -- docs/site/src/theme/Navbar/Content/index.js | 23 ++---- .../theme/Navbar/Content/styles.module.css | 21 ----- docs/site/src/theme/Navbar/Layout/index.js | 55 -------------- .../src/theme/Navbar/Layout/styles.module.css | 7 -- docs/site/src/theme/Navbar/Logo/index.js | 13 ---- docs/site/src/theme/Navbar/Search/index.js | 8 -- .../src/theme/Navbar/Search/styles.module.css | 30 -------- docs/site/src/theme/Navbar/index.js | 23 ------ docs/site/tailwind.config.js | 4 + 14 files changed, 98 insertions(+), 223 deletions(-) create mode 100644 docs/site/src/components/GetStartedLink/index.tsx create mode 100644 docs/site/src/components/ThemeToggle/index.tsx delete mode 100644 docs/site/src/theme/Navbar/ColorModeToggle/index.js delete mode 100644 docs/site/src/theme/Navbar/ColorModeToggle/styles.module.css delete mode 100644 docs/site/src/theme/Navbar/Content/styles.module.css delete mode 100644 docs/site/src/theme/Navbar/Layout/index.js delete mode 100644 docs/site/src/theme/Navbar/Layout/styles.module.css delete mode 100644 docs/site/src/theme/Navbar/Logo/index.js delete mode 100644 docs/site/src/theme/Navbar/Search/index.js delete mode 100644 docs/site/src/theme/Navbar/Search/styles.module.css delete mode 100644 docs/site/src/theme/Navbar/index.js diff --git a/docs/site/src/components/GetStartedLink/index.tsx b/docs/site/src/components/GetStartedLink/index.tsx new file mode 100644 index 0000000000000..6a518b4609c99 --- /dev/null +++ b/docs/site/src/components/GetStartedLink/index.tsx @@ -0,0 +1,19 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import React from "react"; +import Link from "@docusaurus/Link"; +import { useLocation } from "@docusaurus/router"; + +export default function GetStartedLink() { + const location = useLocation(); + return ( + <> + {location.pathname === "/" && ( + + Get started + + )} + + ); +} diff --git a/docs/site/src/components/ThemeToggle/index.tsx b/docs/site/src/components/ThemeToggle/index.tsx new file mode 100644 index 0000000000000..ed23a87d10e77 --- /dev/null +++ b/docs/site/src/components/ThemeToggle/index.tsx @@ -0,0 +1,15 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import React from "react"; +import NavbarColorModeToggle from "@theme/Navbar/ColorModeToggle"; +import { useLocation } from "@docusaurus/router"; + +export default function ThemeToggle() { + const location = useLocation(); + return ( +
+ {location.pathname !== "/" && } +
+ ); +} diff --git a/docs/site/src/css/custom.css b/docs/site/src/css/custom.css index 85fdbd0546b3b..165ed525273b2 100644 --- a/docs/site/src/css/custom.css +++ b/docs/site/src/css/custom.css @@ -76,7 +76,7 @@ --sui-white: 255 255 255; --sui-card-dark: 13 20 37; --sui-card-darker: 0 23 49; - --sui-blue-primary: #4da2ff; + --sui-blue-primary: 77 162 255; --sui-gray: #ABBDCC; --sui-white: #f7f7f8; --sui-button-hover: #1a88ff; @@ -119,18 +119,25 @@ color: var(--ifm-navbar-sidebar-link-color); } -.navbar-sidebar .menu__link--active { - background-color: var(--sui-blue-primary); - color: var(--sui-gray-100); -} -[data-theme='dark'] .navbar-sidebar .menu__link--active { - background-color: var(--sui-blue-primary); - color: var(--sui-gray-100); +.navbar-sidebar .menu__link--active, .navbar-sidebar .menu__link--active:hover, [data-theme='dark'] .navbar-sidebar .menu__link--active, [data-theme='dark'] .navbar-sidebar .menu__link--active:hover { + @apply !bg-sui-blue-primary text-sui-gray-100 } + html[data-theme=dark] { background-color: var(--ifm-navbar-background-color); } + +/* Targeting the docusaurus theme switch */ +button[title^="Switch between dark and light mode"] { + @apply !text-white hover:bg-sui-blue-primary +} + +html[data-theme=light] .navbar-sidebar button.clean-btn.menu__caret { + @apply bg-sui-gray-65 +} + /** setup global style overrides */ + body { font-family: var(--primaryFont); } @@ -143,6 +150,7 @@ h1 { letter-spacing: -0.04em; } + .h1 { letter-spacing: -2.88px; margin-top: 0; @@ -160,6 +168,7 @@ h2 { line-height: 2.125rem; letter-spacing: -0.04em; } + .h2 { letter-spacing: -1.62px; margin-top: 0; @@ -203,27 +212,34 @@ h4 { line-height: 1.75rem; letter-spacing: -2%; } + @media screen and (max-width: 767px) { h1 , .h1{ font-size: 3.5rem; } + h2, .h2 { font-size: 2rem; } + h3, .h3 { font-size: 1.5rem; } + h4, .h4 { font-size: 1.2rem; } } + @media screen and (max-width: 599px) { h2, .h2 { font-size: 1.7rem; } + h3, .h3 { font-size: 1.2rem; } + h4, .h4 { font-size: 1rem; } @@ -231,21 +247,27 @@ h4 { /** Navbar overrides **/ + .navbar { border-bottom: 1px solid var(--sui-line); } + .navbar__title { visibility: hidden; } + .navbar__toggle path { stroke: var(--sui-white); } + .navbar__items { justify-content: space-between; } + .navbar__items .navbar__brand { width: 27%; } + .navbar__items .navbar__item.navbar__link { font-family: var(--headerFont); font-size: .9375rem; @@ -253,17 +275,28 @@ h4 { line-height: 1.125rem; letter-spacing: -0.02em; } + +.darkNavbarColorModeToggle { + @apply text-sui-white; +} + @media screen and (min-width: 767px) { .navbar__items.navbar__items--right { min-width: 325px; } } +.theme-toggle-wrapper button:hover { + @apply !bg-sui-blue-primary +} + /** navbar search field **/ + .DocSearch-Button-Container { width: 100%; justify-content: space-between; } + .DocSearch-Button { width: 12.5rem; height: 2.625rem !important; @@ -277,18 +310,22 @@ h4 { background: linear-gradient(0deg, rgba(247, 247, 248, 0.1), rgba(247, 247, 248, 0.1)), linear-gradient(0deg, rgba(247, 247, 248, 0.05), rgba(247, 247, 248, 0.05)) !important; } + @media screen and (max-width: 599px) { .DocSearch-Button { width: initial; } } + .DocSearch-Search-Icon { order: 2; margin-left: auto; } + .DocSearch-Search-Icon path { stroke: var(--sui-white); } + .DocSearch-Button-Keys { display: none !important; } @@ -297,32 +334,27 @@ h4 { row-gap: 1rem; column-gap: 1rem; } + .markdown h1:first-child { margin-top: 1rem; } +/*Targeting the search container so that the "start here" button displays alongside the search bar*/ +[class^="navbarSearchContainer"] { + @apply min-[997px]:flex min-[997px]:gap-4 +} /** Globals **/ .button-cta { - background-color: var(--sui-blue-primary); - color: var(--sui-white); - letter-spacing: -.3px; - cursor: pointer; - border-style: none; - border-radius: 2.25rem; - padding: .75rem 1.125rem; - font-family: var(--primaryFont); - font-size: 1rem; - font-weight: 500; - line-height: 1.125rem; - transition: background-color .3s; - display: inline-block; + @apply bg-sui-blue-primary font-sans text-sui-white -tracking-[.3px] cursor-pointer border-none rounded-[2.25rem] py-3 px-[1.125rem] text-base font-medium leading-[1.125rem] inline-block transition-colors duration-300 ease-in-out } + .button-cta:hover { background-color: var(--sui-button-hover); color: var(--sui-white); text-decoration: none; } + @media (max-width: 1050px) { .navbar .button-cta { display: none; @@ -330,9 +362,11 @@ h4 { } /** colors **/ + .text-white { color: var(--sui-white); } + .text-gray { color: var(--sui-gray); } \ No newline at end of file diff --git a/docs/site/src/theme/Navbar/ColorModeToggle/index.js b/docs/site/src/theme/Navbar/ColorModeToggle/index.js deleted file mode 100644 index 02102acceb3f8..0000000000000 --- a/docs/site/src/theme/Navbar/ColorModeToggle/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 -import React from "react"; -import { useColorMode, useThemeConfig } from "@docusaurus/theme-common"; -import ColorModeToggle from "@theme/ColorModeToggle"; -import styles from "./styles.module.css"; -export default function NavbarColorModeToggle({ className }) { - const disabled = useThemeConfig().colorMode.disableSwitch; - const { colorMode, setColorMode } = useColorMode(); - if (disabled) { - return null; - } - return ( - - ); -} diff --git a/docs/site/src/theme/Navbar/ColorModeToggle/styles.module.css b/docs/site/src/theme/Navbar/ColorModeToggle/styles.module.css deleted file mode 100644 index 0c8234785218b..0000000000000 --- a/docs/site/src/theme/Navbar/ColorModeToggle/styles.module.css +++ /dev/null @@ -1,6 +0,0 @@ -.darkNavbarColorModeToggle { - color: var(--sui-white); -} -.darkNavbarColorModeToggle:hover { - background: var(--ifm-color-gray-800); -} \ No newline at end of file diff --git a/docs/site/src/theme/Navbar/Content/index.js b/docs/site/src/theme/Navbar/Content/index.js index 0d82e2d8b4c96..61b9a0333d83d 100644 --- a/docs/site/src/theme/Navbar/Content/index.js +++ b/docs/site/src/theme/Navbar/Content/index.js @@ -1,20 +1,18 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import React from "react"; -import Link from "@docusaurus/Link"; import { useThemeConfig, ErrorCauseBoundary } from "@docusaurus/theme-common"; import { splitNavbarItems, useNavbarMobileSidebar, } from "@docusaurus/theme-common/internal"; import NavbarItem from "@theme/NavbarItem"; -import NavbarColorModeToggle from "@theme/Navbar/ColorModeToggle"; +import ThemeToggle from "@site/src/components/ThemeToggle"; import SearchBar from "@theme/SearchBar"; import NavbarMobileSidebarToggle from "@theme/Navbar/MobileSidebar/Toggle"; import NavbarLogo from "@theme/Navbar/Logo"; import NavbarSearch from "@theme/Navbar/Search"; -import styles from "./styles.module.css"; -import { useLocation } from "@docusaurus/router"; +import GetStartedLink from "@site/src/components/GetStartedLink"; function useNavbarItems() { // TODO temporary casting until ThemeConfig type is improved @@ -22,7 +20,7 @@ function useNavbarItems() { } function NavbarItems({ items }) { return ( -
+
{items.map((item, i) => ( item.type === "search"); - const isHomePage = location.pathname === "/"; return ( more flexible <> - {!isHomePage && ( - - )} + {!searchBarItem && ( - {isHomePage && ( - - Get started - - )} + )} diff --git a/docs/site/src/theme/Navbar/Content/styles.module.css b/docs/site/src/theme/Navbar/Content/styles.module.css deleted file mode 100644 index 7b8c08a742777..0000000000000 --- a/docs/site/src/theme/Navbar/Content/styles.module.css +++ /dev/null @@ -1,21 +0,0 @@ -/* -Hide color mode toggle in small viewports - */ -.navbar__items_wrapper { - display: flex; - align-items: center; - justify-content: flex-start; - flex: 8; - column-gap: 4rem; -} -@media (max-width: 1100px) { - .navbar__items_wrapper { - column-gap: 2rem; - } -} - -@media (max-width: 996px) { - .colorModeToggle { - display: none; - } -} diff --git a/docs/site/src/theme/Navbar/Layout/index.js b/docs/site/src/theme/Navbar/Layout/index.js deleted file mode 100644 index 26889a8ad872c..0000000000000 --- a/docs/site/src/theme/Navbar/Layout/index.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 -import React from "react"; -import clsx from "clsx"; -import { useThemeConfig } from "@docusaurus/theme-common"; -import { - useHideableNavbar, - useNavbarMobileSidebar, -} from "@docusaurus/theme-common/internal"; -import { translate } from "@docusaurus/Translate"; -import NavbarMobileSidebar from "@theme/Navbar/MobileSidebar"; -import styles from "./styles.module.css"; -function NavbarBackdrop(props) { - return ( -
- ); -} -export default function NavbarLayout({ children }) { - const { - navbar: { hideOnScroll, style }, - } = useThemeConfig(); - const mobileSidebar = useNavbarMobileSidebar(); - const { navbarRef, isNavbarVisible } = useHideableNavbar(hideOnScroll); - return ( - - ); -} diff --git a/docs/site/src/theme/Navbar/Layout/styles.module.css b/docs/site/src/theme/Navbar/Layout/styles.module.css deleted file mode 100644 index e72891a44ff40..0000000000000 --- a/docs/site/src/theme/Navbar/Layout/styles.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.navbarHideable { - transition: transform var(--ifm-transition-fast) ease; -} - -.navbarHidden { - transform: translate3d(0, calc(-100% - 2px), 0); -} diff --git a/docs/site/src/theme/Navbar/Logo/index.js b/docs/site/src/theme/Navbar/Logo/index.js deleted file mode 100644 index 734449bd26722..0000000000000 --- a/docs/site/src/theme/Navbar/Logo/index.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 -import React from "react"; -import Logo from "@theme/Logo"; -export default function NavbarLogo() { - return ( - - ); -} diff --git a/docs/site/src/theme/Navbar/Search/index.js b/docs/site/src/theme/Navbar/Search/index.js deleted file mode 100644 index d2cb4f8c5467c..0000000000000 --- a/docs/site/src/theme/Navbar/Search/index.js +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 -import React from "react"; -import clsx from "clsx"; -import styles from "./styles.module.css"; -export default function NavbarSearch({ children, className }) { - return
{children}
; -} diff --git a/docs/site/src/theme/Navbar/Search/styles.module.css b/docs/site/src/theme/Navbar/Search/styles.module.css deleted file mode 100644 index 52797ee25bf53..0000000000000 --- a/docs/site/src/theme/Navbar/Search/styles.module.css +++ /dev/null @@ -1,30 +0,0 @@ -/* -Workaround to avoid rendering empty search container -See https://github.com/facebook/docusaurus/pull/9385 -*/ -/* -TODO temporary @supports check, remove before 2025 -only needed for Firefox < 121 -see https://github.com/facebook/docusaurus/issues/9527#issuecomment-1805272379 - */ -@supports selector(:has(*)) { - .navbarSearchContainer:not(:has(> *)) { - display: none; - } -} - -@media (max-width: 996px) { - .searchBox { - position: absolute; - right: var(--ifm-navbar-padding-horizontal); - } -} - -@media (min-width: 997px) { - .searchBox { - padding: var(--ifm-navbar-item-padding-vertical) - var(--ifm-navbar-item-padding-horizontal); - display: flex; - column-gap: 1rem; - } -} \ No newline at end of file diff --git a/docs/site/src/theme/Navbar/index.js b/docs/site/src/theme/Navbar/index.js deleted file mode 100644 index 98eb1c547a9d0..0000000000000 --- a/docs/site/src/theme/Navbar/index.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 -import React from "react"; -import NavbarLayout from "@theme/Navbar/Layout"; -import NavbarContent from "@theme/Navbar/Content"; -import { - NavbarProvider, - ScrollControllerProvider, - ColorModeProvider, -} from "@docusaurus/theme-common/internal"; -export default function Navbar() { - return ( - - - - - - - - - - ); -} diff --git a/docs/site/tailwind.config.js b/docs/site/tailwind.config.js index 4f7335b83e53a..f74bd3040f283 100644 --- a/docs/site/tailwind.config.js +++ b/docs/site/tailwind.config.js @@ -1,6 +1,8 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +const defaultTheme = require("tailwindcss/defaultTheme"); + module.exports = { corePlugins: { preflight: false, // disable Tailwind's reset @@ -10,10 +12,12 @@ module.exports = { theme: { extend: { fontFamily: { + sans: ["Inter", ...defaultTheme.fontFamily.sans], twkeverett: ["Twkeverett"], }, colors: { "sui-black": "var(--sui-black)", + "sui-blue-primary": "rgb(var(--sui-blue-primary)/)", "sui-blue": "var(--sui-blue)", "sui-blue-bright": "var(--sui-blue-bright)", "sui-blue-light": "var(--sui-blue-light)", From 9a6a6841029a9aaaaedb475fa996ddf12c9e938a Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Fri, 12 Jul 2024 13:34:01 -0400 Subject: [PATCH 011/163] Send full sig if possible during randomness sig exchange (#18565) --- crates/sui-network/src/randomness/builder.rs | 4 +- crates/sui-network/src/randomness/mod.rs | 182 ++++++++++++++----- crates/sui-network/src/randomness/server.rs | 5 +- crates/sui-network/src/randomness/tests.rs | 85 +++++++++ 4 files changed, 229 insertions(+), 47 deletions(-) diff --git a/crates/sui-network/src/randomness/builder.rs b/crates/sui-network/src/randomness/builder.rs index 2cc96f7733881..556b69fdb0a20 100644 --- a/crates/sui-network/src/randomness/builder.rs +++ b/crates/sui-network/src/randomness/builder.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use std::{ - collections::{BTreeMap, BTreeSet, HashMap, HashSet}, + collections::{BTreeMap, HashMap, HashSet}, sync::Arc, }; @@ -132,7 +132,7 @@ impl UnstartedRandomness { round_request_time: BTreeMap::new(), future_epoch_partial_sigs: BTreeMap::new(), received_partial_sigs: BTreeMap::new(), - completed_sigs: BTreeSet::new(), + completed_sigs: BTreeMap::new(), highest_completed_round: BTreeMap::new(), }, handle, diff --git a/crates/sui-network/src/randomness/mod.rs b/crates/sui-network/src/randomness/mod.rs index fec00ebe53b42..de570bc62b4a9 100644 --- a/crates/sui-network/src/randomness/mod.rs +++ b/crates/sui-network/src/randomness/mod.rs @@ -12,7 +12,7 @@ use mysten_metrics::spawn_monitored_task; use mysten_network::anemo_ext::NetworkExt; use serde::{Deserialize, Serialize}; use std::{ - collections::{btree_map::BTreeMap, BTreeSet, HashMap}, + collections::{btree_map::BTreeMap, HashMap}, ops::Bound, sync::Arc, time::{self, Duration}, @@ -24,7 +24,7 @@ use sui_types::{ committee::EpochId, crypto::{RandomnessPartialSignature, RandomnessRound, RandomnessSignature}, }; -use tokio::sync::mpsc; +use tokio::sync::{mpsc, OnceCell}; use tracing::{debug, error, info, instrument, warn}; mod auth; @@ -51,8 +51,8 @@ pub struct SendSignaturesRequest { // defenses against too-large messages. // The protocol requires the signatures to be ordered by share index (as provided by fastcrypto). partial_sigs: Vec>, - // TODO: add support for receiving full signature from validators who have already - // reconstructed it. + // If peer already has a full signature available for the round, it's provided here in lieu + // of partial sigs. sig: Option, } @@ -131,7 +131,13 @@ enum RandomnessMessage { ), SendPartialSignatures(EpochId, RandomnessRound), CompleteRound(EpochId, RandomnessRound), - ReceivePartialSignatures(PeerId, EpochId, RandomnessRound, Vec>), + ReceiveSignatures( + PeerId, + EpochId, + RandomnessRound, + Vec>, + Option, + ), } struct RandomnessEventLoop { @@ -149,11 +155,17 @@ struct RandomnessEventLoop { dkg_output: Option>, aggregation_threshold: u16, highest_requested_round: BTreeMap, - send_tasks: BTreeMap>, + send_tasks: BTreeMap< + RandomnessRound, + ( + tokio::task::JoinHandle<()>, + Arc>, + ), + >, round_request_time: BTreeMap<(EpochId, RandomnessRound), time::Instant>, future_epoch_partial_sigs: BTreeMap<(EpochId, RandomnessRound, PeerId), Vec>>, received_partial_sigs: BTreeMap<(RandomnessRound, PeerId), Vec>, - completed_sigs: BTreeSet<(EpochId, RandomnessRound)>, + completed_sigs: BTreeMap, highest_completed_round: BTreeMap, } @@ -201,8 +213,12 @@ impl RandomnessEventLoop { self.send_partial_signatures(epoch, round) } RandomnessMessage::CompleteRound(epoch, round) => self.complete_round(epoch, round), - RandomnessMessage::ReceivePartialSignatures(peer_id, epoch, round, sigs) => { - self.receive_partial_signatures(peer_id, epoch, round, sigs) + RandomnessMessage::ReceiveSignatures(peer_id, epoch, round, partial_sigs, sig) => { + if let Some(sig) = sig { + self.receive_full_signature(peer_id, epoch, round, sig) + } else { + self.receive_partial_signatures(peer_id, epoch, round, partial_sigs) + } } } } @@ -247,7 +263,7 @@ impl RandomnessEventLoop { .and_modify(|r| *r = std::cmp::max(*r, round)) .or_insert(round); } - for (_, task) in std::mem::take(&mut self.send_tasks) { + for (_, (task, _)) in std::mem::take(&mut self.send_tasks) { task.abort(); } self.metrics.set_epoch(new_epoch); @@ -258,9 +274,7 @@ impl RandomnessEventLoop { .round_request_time .split_off(&(new_epoch, RandomnessRound(0))); self.received_partial_sigs.clear(); - self.completed_sigs = self - .completed_sigs - .split_off(&(new_epoch, RandomnessRound(0))); + self.completed_sigs.clear(); self.highest_completed_round = self.highest_completed_round.split_off(&new_epoch); // Start any pending tasks for the new epoch. @@ -336,7 +350,8 @@ impl RandomnessEventLoop { Bound::Included((RandomnessRound(0), PeerId([0; 32]))), Bound::Excluded((round + 1, PeerId([0; 32]))), )); - for (_, task) in self.send_tasks.iter().take_while(|(r, _)| **r <= round) { + self.completed_sigs = self.completed_sigs.split_off(&(round + 1)); + for (_, (task, _)) in self.send_tasks.iter().take_while(|(r, _)| **r <= round) { task.abort(); } self.send_tasks = self.send_tasks.split_off(&(round + 1)); @@ -369,7 +384,7 @@ impl RandomnessEventLoop { ); return; } - if self.completed_sigs.contains(&(epoch, round)) { + if epoch == self.epoch && self.completed_sigs.contains_key(&round) { debug!("skipping received partial sigs, we already have completed this sig"); return; } @@ -414,11 +429,7 @@ impl RandomnessEventLoop { // Accept partial signatures up to `max_partial_sigs_rounds_ahead` past the round of the // last completed signature, or the highest completed round, whichever is greater. - let last_completed_signature = self - .completed_sigs - .range(..&(epoch + 1, RandomnessRound(0))) - .next_back() - .map(|(e, r)| if *e == epoch { *r } else { RandomnessRound(0) }); + let last_completed_signature = self.completed_sigs.last_key_value().map(|(r, _)| *r); let last_completed_round = std::cmp::max(last_completed_signature, highest_completed_round) .unwrap_or(RandomnessRound(0)); if round.0 @@ -469,11 +480,6 @@ impl RandomnessEventLoop { #[instrument(level = "debug", skip_all, fields(?epoch, ?round))] fn maybe_aggregate_partial_signatures(&mut self, epoch: EpochId, round: RandomnessRound) { - if self.completed_sigs.contains(&(epoch, round)) { - info!("skipping aggregation for already-completed signature"); - return; - } - if let Some(highest_completed_round) = self.highest_completed_round.get(&epoch) { if round <= *highest_completed_round { info!("skipping aggregation for already-completed round"); @@ -498,6 +504,11 @@ impl RandomnessEventLoop { return; } + if self.completed_sigs.contains_key(&round) { + info!("skipping aggregation for already-completed signature"); + return; + } + let vss_pk = { let Some(dkg_output) = &self.dkg_output else { debug!("called maybe_aggregate_partial_signatures before DKG completed"); @@ -574,8 +585,81 @@ impl RandomnessEventLoop { } debug!("successfully generated randomness full signature"); - self.completed_sigs.insert((epoch, round)); - self.remove_partial_sigs_in_range(sig_bounds); + self.process_valid_full_signature(epoch, round, sig); + } + + #[instrument(level = "debug", skip_all, fields(?peer_id, ?epoch, ?round))] + fn receive_full_signature( + &mut self, + peer_id: PeerId, + epoch: EpochId, + round: RandomnessRound, + sig: RandomnessSignature, + ) { + let vss_pk = { + let Some(dkg_output) = &self.dkg_output else { + debug!("called receive_full_signature before DKG completed"); + return; + }; + &dkg_output.vss_pk + }; + + // Basic validity checks. + if epoch != self.epoch { + debug!("skipping received full sig, we are on epoch {}", self.epoch); + return; + } + if self.completed_sigs.contains_key(&round) { + debug!("skipping received full sigs, we already have completed this sig"); + return; + } + let highest_completed_round = self.highest_completed_round.get(&epoch).copied(); + if let Some(highest_completed_round) = &highest_completed_round { + if *highest_completed_round >= round { + debug!("skipping received full sig, we already have completed this round"); + return; + } + } + + let highest_requested_round = self.highest_requested_round.get(&epoch); + if highest_requested_round.is_none() || round > *highest_requested_round.unwrap() { + // Wait for local consensus to catch up if necessary. + debug!( + "skipping received full signature, local consensus is not caught up to its round" + ); + return; + } + + // TODO: ignore future messages from peers sending bad signatures. + if let Err(e) = + ThresholdBls12381MinSig::verify(vss_pk.c0(), &round.signature_message(), &sig) + { + info!("received invalid full signature from peer {peer_id}: {e:?}"); + return; + } + + debug!("received valid randomness full signature"); + self.process_valid_full_signature(epoch, round, sig); + } + + fn process_valid_full_signature( + &mut self, + epoch: EpochId, + round: RandomnessRound, + sig: RandomnessSignature, + ) { + assert_eq!(epoch, self.epoch); + + if let Some((_, full_sig_cell)) = self.send_tasks.get(&round) { + full_sig_cell + .set(sig) + .expect("full signature should never be processed twice"); + } + self.completed_sigs.insert(round, sig); + self.remove_partial_sigs_in_range(( + Bound::Included((round, PeerId([0; 32]))), + Bound::Excluded((round + 1, PeerId([0; 32]))), + )); self.metrics.record_completed_round(round); if let Some(start_time) = self.round_request_time.get(&(epoch, round)) { if let Some(metric) = self.metrics.round_generation_latency_metric() { @@ -583,9 +667,9 @@ impl RandomnessEventLoop { } } - let bytes = bcs::to_bytes(&sig).expect("signature serialization should not fail"); + let sig_bytes = bcs::to_bytes(&sig).expect("signature serialization should not fail"); self.randomness_tx - .try_send((epoch, round, bytes)) + .try_send((epoch, round, sig_bytes)) .expect("RandomnessRoundReceiver mailbox should not overflow or be closed"); } @@ -628,6 +712,7 @@ impl RandomnessEventLoop { break; // limit concurrent tasks } + let full_sig_cell = Arc::new(OnceCell::new()); self.send_tasks.entry(round).or_insert_with(|| { let name = self.name; let network = self.network.clone(); @@ -639,25 +724,30 @@ impl RandomnessEventLoop { shares.iter(), &round.signature_message(), ); + let full_sig_cell_clone = full_sig_cell.clone(); // Record own partial sigs. - if !self.completed_sigs.contains(&(epoch, round)) { + if !self.completed_sigs.contains_key(&round) { self.received_partial_sigs .insert((round, self.network.peer_id()), partial_sigs.clone()); rounds_to_aggregate.push((epoch, round)); } debug!("sending partial sigs for epoch {epoch}, round {round}"); - spawn_monitored_task!(RandomnessEventLoop::send_partial_signatures_task( - name, - network, - retry_interval, - metrics, - authority_info, - epoch, - round, - partial_sigs - )) + ( + spawn_monitored_task!(RandomnessEventLoop::send_signatures_task( + name, + network, + retry_interval, + metrics, + authority_info, + epoch, + round, + partial_sigs, + full_sig_cell_clone, + )), + full_sig_cell, + ) }); } @@ -689,7 +779,7 @@ impl RandomnessEventLoop { } } - async fn send_partial_signatures_task( + async fn send_signatures_task( name: AuthorityName, network: anemo::Network, retry_interval: Duration, @@ -698,6 +788,7 @@ impl RandomnessEventLoop { epoch: EpochId, round: RandomnessRound, partial_sigs: Vec, + full_sig: Arc>, ) { // For simtests, we may test not sending partial signatures. #[allow(unused_mut)] @@ -731,11 +822,16 @@ impl RandomnessEventLoop { } let mut client = RandomnessClient::new(peer.clone()); const SEND_PARTIAL_SIGNATURES_TIMEOUT: Duration = Duration::from_secs(10); + let full_sig = full_sig.get().cloned(); let request = anemo::Request::new(SendSignaturesRequest { epoch, round, - partial_sigs: partial_sigs.clone(), - sig: None, + partial_sigs: if full_sig.is_none() { + partial_sigs.clone() + } else { + Vec::new() + }, + sig: full_sig, }) .with_timeout(SEND_PARTIAL_SIGNATURES_TIMEOUT); requests.push(async move { diff --git a/crates/sui-network/src/randomness/server.rs b/crates/sui-network/src/randomness/server.rs index be60bd5e04fd0..53f0e47839bfd 100644 --- a/crates/sui-network/src/randomness/server.rs +++ b/crates/sui-network/src/randomness/server.rs @@ -26,14 +26,15 @@ impl Randomness for Server { epoch, round, partial_sigs, - sig: _, + sig, } = request.into_inner(); let _ = sender // throw away error, caller will retry - .send(RandomnessMessage::ReceivePartialSignatures( + .send(RandomnessMessage::ReceiveSignatures( peer_id, epoch, round, partial_sigs, + sig, )) .await; Ok(anemo::Response::new(())) diff --git a/crates/sui-network/src/randomness/tests.rs b/crates/sui-network/src/randomness/tests.rs index 263f737f56f63..75bfc120a32f1 100644 --- a/crates/sui-network/src/randomness/tests.rs +++ b/crates/sui-network/src/randomness/tests.rs @@ -4,6 +4,7 @@ use crate::{randomness::*, utils}; use fastcrypto::{groups::bls12381, serde_helpers::ToFromByteArray}; use fastcrypto_tbls::{mocked_dkg, nodes}; +use std::collections::BTreeSet; use sui_swarm_config::test_utils::CommitteeFixture; use sui_types::{ base_types::ConciseableName, @@ -211,6 +212,90 @@ async fn test_record_own_partial_sigs() { } } +#[tokio::test] +async fn test_receive_full_sig() { + telemetry_subscribers::init_for_testing(); + let committee_fixture = CommitteeFixture::generate(rand::rngs::OsRng, 0, 8); + let committee = committee_fixture.committee(); + + let mut randomness_rxs = Vec::new(); + let mut networks: Vec = Vec::new(); + let mut nodes = Vec::new(); + let mut handles = Vec::new(); + let mut authority_info = HashMap::new(); + + for (i, (authority, stake)) in committee.members().enumerate() { + let (tx, rx) = mpsc::channel(3); + randomness_rxs.push(rx); + let (unstarted, router) = Builder::new(*authority, tx).build(); + + let network = utils::build_network(|r| r.merge(router)); + if i < 7 { + // Leave last network disconnected to test full sig distribution. + for n in networks.iter() { + network.connect(n.local_addr()).await.unwrap(); + } + } + networks.push(network.clone()); + + let node = node_from_committee(committee, authority, *stake); + authority_info.insert(*authority, (network.peer_id(), node.id)); + nodes.push(node); + + let (r, handle) = unstarted.build(network); + handles.push((authority, handle)); + + let span = tracing::span!( + tracing::Level::INFO, + "RandomnessEventLoop", + authority = ?authority.concise(), + ); + tokio::spawn(r.start().instrument(span)); + } + info!(?authority_info, "authorities constructed"); + + let nodes = nodes::Nodes::new(nodes).unwrap(); + + // Authorities 0-6 should be able to complete the sig as normal + // using partial sigs. + for (authority, handle) in handles.iter() { + let mock_dkg_output = mocked_dkg::generate_mocked_output::( + nodes.clone(), + committee.validity_threshold().try_into().unwrap(), + 0, + committee + .authority_index(authority) + .unwrap() + .try_into() + .unwrap(), + ); + handle.send_partial_signatures(0, RandomnessRound(0)); + handle.update_epoch( + 0, + authority_info.clone(), + mock_dkg_output, + committee.validity_threshold().try_into().unwrap(), + None, + ); + } + for rx in randomness_rxs[..7].iter_mut() { + let (epoch, round, bytes) = rx.recv().await.unwrap(); + assert_eq!(0, epoch); + assert_eq!(0, round.0); + assert_ne!(0, bytes.len()); + } + // Authority 7 shouldn't have the completed sig, since it's disconnected. + assert!(randomness_rxs[7].try_recv().is_err()); + + // Connect authority 7 to a single other authority, which should be able to transmit the + // full sig. + networks[7].connect(networks[0].local_addr()).await.unwrap(); + let (epoch, round, bytes) = randomness_rxs[7].recv().await.unwrap(); + assert_eq!(0, epoch); + assert_eq!(0, round.0); + assert_ne!(0, bytes.len()); +} + #[tokio::test] async fn test_restart_recovery() { telemetry_subscribers::init_for_testing(); From 3c9b596e039f5bc35c7f38006c6363c551a57314 Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:02:15 -0700 Subject: [PATCH 012/163] [bridge] use protocol parameter to determine when to finalize bridge committee `bridge_should_try_to_finalize_committee` (#18019) ## Description Updated: we decided to introduce a protocol parameter to determine when bridge committee happens. This gives us more flexibility to include validators. As a result, we don't need the original change of threshold any more. Together with the new parameter, the old default value 7500 still acts as the minimal voting power threshold ------------------ Old description: Previously the 75% minimal stake is too low to include most validators. This PR changes it to 90%. I have two commits in this PR: * the first commit sets the value by distinguish chain id - if it's testnet, then use 7500, otherwise 9000. This is safe because on mainnet we haven't enabled registration yet. * the second commit uses a different approach with protocol config. Basically it adds a `minimal_threshold_for_bridge_committee` field and is set to 90% after the added version. In this way we don't need to differentiate chain ids. It's safe for testnet because this value won't be needed post committee initialization. I like the 2nd commit better because the code is cleaner. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: From 6b425c9718c9989c686c0c18368b411718136a07 Mon Sep 17 00:00:00 2001 From: stefan-mysten <135084671+stefan-mysten@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:30:15 -0700 Subject: [PATCH 013/163] [CLI] Make service hosts configurable in `sui start` (#18607) ## Description Make indexer, GraphQL, faucet hosts configurable. When using Docker, due to the way it sets up a network interface for the container, the services need to bind to 0.0.0.0 to be able to be accessed from outside the container. This PR enables configurable hosts for these three services via optional flags: - `--indexer-host 0.0.0.0` - `--faucet-host 0.0.0.0` - `--graphql-host 0.0.0.0` If no host flag is provided, it will use the default `0.0.0.0` one. In addition, I found a bug where if the `default_value` is not provided, calling `unwrap_or_default` will return value 0 (if that field is an int). For example, if we call `--with-graphql`, the indexer port would have been set to 0 because the `default_missing_value` is only set when the flag is passed, but not when it is not passed, which is the case here due `with-indexer` being implicit enabled. This supersedes #14701 and should close #14701. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [x] CLI: Changed `sui start` to allow configurable hosts for indexer (`--indexer-host `), GraphQL (`--graphql-host `), and faucet (`--faucet-host`) services. This will enable to use `sui start` from a Docker container. By default, all services start with `0.0.0.0` host. - [ ] Rust SDK: --- crates/sui/src/sui_commands.rs | 108 ++++++++++++++++++++++----------- crates/sui/tests/cli_tests.rs | 36 ++++++++++- 2 files changed, 107 insertions(+), 37 deletions(-) diff --git a/crates/sui/src/sui_commands.rs b/crates/sui/src/sui_commands.rs index 6e9f7b4fc51e1..b59ca8a50ad86 100644 --- a/crates/sui/src/sui_commands.rs +++ b/crates/sui/src/sui_commands.rs @@ -14,7 +14,7 @@ use move_analyzer::analyzer; use move_package::BuildConfig; use rand::rngs::OsRng; use std::io::{stderr, stdout, Write}; -use std::net::{IpAddr, Ipv4Addr}; +use std::net::{AddrParseError, IpAddr, Ipv4Addr, SocketAddr}; use std::num::NonZeroUsize; use std::path::{Path, PathBuf}; use std::sync::Arc; @@ -59,35 +59,43 @@ const CONCURRENCY_LIMIT: usize = 30; const DEFAULT_EPOCH_DURATION_MS: u64 = 60_000; const DEFAULT_FAUCET_NUM_COINS: usize = 5; // 5 coins per request was the default in sui-test-validator const DEFAULT_FAUCET_MIST_AMOUNT: u64 = 200_000_000_000; // 200 SUI +const DEFAULT_FAUCET_PORT: u16 = 9123; +#[cfg(feature = "indexer")] +const DEFAULT_GRAPHQL_PORT: u16 = 9125; +#[cfg(feature = "indexer")] +const DEFAULT_INDEXER_PORT: u16 = 9124; #[cfg(feature = "indexer")] #[derive(Args)] pub struct IndexerFeatureArgs { - /// Start an indexer with default host and port: 0.0.0.0:9124, or on the port provided. + /// Start an indexer with default host and port: 0.0.0.0:9124. This flag accepts also a port, + /// a host, or both (e.g., 0.0.0.0:9124). /// When providing a specific value, please use the = sign between the flag and value: - /// `--with-indexer=6124`. + /// `--with-indexer=6124` or `--with-indexer=0.0.0.0`, or `--with-indexer=0.0.0.0:9124` /// The indexer will be started in writer mode and reader mode. #[clap(long, - default_missing_value = "9124", + default_value = "0.0.0.0:9124", + default_missing_value = "0.0.0.0:9124", num_args = 0..=1, require_equals = true, - value_name = "INDEXER_PORT" + value_name = "INDEXER_HOST_PORT", )] - with_indexer: Option, + with_indexer: Option, - /// Start a GraphQL server on localhost and port: 127.0.0.1:9125, or on the port provided. + /// Start a GraphQL server with default host and port: 0.0.0.0:9125. This flag accepts also a + /// port, a host, or both (e.g., 0.0.0.0:9125). /// When providing a specific value, please use the = sign between the flag and value: - /// `--with-graphql=6125`. + /// `--with-graphql=6124` or `--with-graphql=0.0.0.0`, or `--with-graphql=0.0.0.0:9125` /// Note that GraphQL requires a running indexer, which will be enabled by default if the /// `--with-indexer` flag is not set. #[clap( long, - default_missing_value = "9125", + default_missing_value = "0.0.0.0:9125", num_args = 0..=1, require_equals = true, - value_name = "GRAPHQL_PORT" + value_name = "GRAPHQL_HOST_PORT" )] - with_graphql: Option, + with_graphql: Option, /// Port for the Indexer Postgres DB. Default port is 5432. #[clap(long, default_value = "5432")] @@ -156,17 +164,18 @@ pub enum SuiCommand { #[clap(long)] force_regenesis: bool, - /// Start a faucet with default host and port: 127.0.0.1:9123, or on the port provided. + /// Start a faucet with default host and port: 0.0.0.0:9123. This flag accepts also a + /// port, a host, or both (e.g., 0.0.0.0:9123). /// When providing a specific value, please use the = sign between the flag and value: - /// `--with-faucet=6123`. + /// `--with-faucet=6124` or `--with-faucet=0.0.0.0`, or `--with-faucet=0.0.0.0:9123` #[clap( long, - default_missing_value = "9123", + default_missing_value = "0.0.0.0:9123", num_args = 0..=1, require_equals = true, - value_name = "FAUCET_PORT" + value_name = "FAUCET_HOST_PORT", )] - with_faucet: Option, + with_faucet: Option, #[cfg(feature = "indexer")] #[clap(flatten)] @@ -533,7 +542,7 @@ impl SuiCommand { /// Starts a local network with the given configuration. async fn start( config: Option, - with_faucet: Option, + with_faucet: Option, #[cfg(feature = "indexer")] indexer_feature_args: IndexerFeatureArgs, force_regenesis: bool, epoch_duration_ms: Option, @@ -579,18 +588,6 @@ async fn start( ); } - #[cfg(feature = "indexer")] - if let Some(indexer_rpc_port) = with_indexer { - tracing::info!("Starting the indexer service at 0.0.0.0:{indexer_rpc_port}"); - } - #[cfg(feature = "indexer")] - if let Some(graphql_port) = with_graphql { - tracing::info!("Starting the GraphQL service at 127.0.0.1:{graphql_port}"); - } - if let Some(faucet_port) = with_faucet { - tracing::info!("Starting the faucet service at 127.0.0.1:{faucet_port}"); - } - let mut swarm_builder = Swarm::builder(); // If this is set, then no data will be persisted between runs, and a new genesis will be // generated each run. @@ -675,8 +672,10 @@ async fn start( let pg_address = format!("postgres://{pg_user}:{pg_password}@{pg_host}:{pg_port}/{pg_db_name}"); #[cfg(feature = "indexer")] - if with_indexer.is_some() { - let indexer_address = format!("0.0.0.0:{}", with_indexer.unwrap_or_default()); + if let Some(input) = with_indexer { + let indexer_address = parse_host_port(input, DEFAULT_INDEXER_PORT) + .map_err(|_| anyhow!("Invalid indexer host and port"))?; + tracing::info!("Starting the indexer service at {indexer_address}"); // Start in writer mode start_test_indexer::( Some(pg_address.clone()), @@ -699,10 +698,13 @@ async fn start( } #[cfg(feature = "indexer")] - if with_graphql.is_some() { + if let Some(input) = with_graphql { + let graphql_address = parse_host_port(input, DEFAULT_GRAPHQL_PORT) + .map_err(|_| anyhow!("Invalid graphql host and port"))?; + tracing::info!("Starting the GraphQL service at {graphql_address}"); let graphql_connection_config = ConnectionConfig::new( - Some(with_graphql.unwrap_or_default()), - None, + Some(graphql_address.port()), + Some(graphql_address.ip().to_string()), Some(pg_address), None, None, @@ -716,7 +718,11 @@ async fn start( .await; info!("GraphQL started"); } - if with_faucet.is_some() { + + if let Some(input) = with_faucet { + let faucet_address = parse_host_port(input, DEFAULT_FAUCET_PORT) + .map_err(|_| anyhow!("Invalid faucet host and port"))?; + tracing::info!("Starting the faucet service at {faucet_address}"); let config_dir = if force_regenesis { tempdir()?.into_path() } else { @@ -726,12 +732,19 @@ async fn start( } }; + let host_ip = match faucet_address { + SocketAddr::V4(addr) => *addr.ip(), + _ => bail!("Faucet configuration requires an IPv4 address"), + }; + let config = FaucetConfig { - port: with_faucet.unwrap_or_default(), + host_ip, + port: faucet_address.port(), num_coins: DEFAULT_FAUCET_NUM_COINS, amount: DEFAULT_FAUCET_MIST_AMOUNT, ..Default::default() }; + let prometheus_registry = prometheus::Registry::new(); if force_regenesis { let kp = swarm.config_mut().account_keys.swap_remove(0); @@ -1142,3 +1155,26 @@ fn read_line() -> Result { io::stdin().read_line(&mut s)?; Ok(s.trim_end().to_string()) } + +/// Parse the input string into a SocketAddr, with a default port if none is provided. +pub fn parse_host_port( + input: String, + default_port_if_missing: u16, +) -> Result { + let default_host = "0.0.0.0"; + let mut input = input; + if input.contains("localhost") { + input = input.replace("localhost", "127.0.0.1"); + } + if input.contains(':') { + input.parse::() + } else if input.contains('.') { + format!("{input}:{default_port_if_missing}").parse::() + } else if input.is_empty() { + format!("{default_host}:{default_port_if_missing}").parse::() + } else if !input.is_empty() { + format!("{default_host}:{input}").parse::() + } else { + format!("{default_host}:{default_port_if_missing}").parse::() + } +} diff --git a/crates/sui/tests/cli_tests.rs b/crates/sui/tests/cli_tests.rs index ca19cd5231545..59a13bc6e4c7e 100644 --- a/crates/sui/tests/cli_tests.rs +++ b/crates/sui/tests/cli_tests.rs @@ -3,6 +3,7 @@ use std::collections::BTreeSet; use std::io::Read; +use std::net::SocketAddr; use std::os::unix::prelude::FileExt; use std::{fmt::Write, fs::read_dir, path::PathBuf, str, thread, time::Duration}; @@ -31,7 +32,7 @@ use sui::{ estimate_gas_budget, Opts, OptsWithGas, SuiClientCommandResult, SuiClientCommands, SwitchResponse, }, - sui_commands::SuiCommand, + sui_commands::{parse_host_port, SuiCommand}, }; use sui_config::{ PersistedConfig, SUI_CLIENT_CONFIG, SUI_FULLNODE_CONFIG, SUI_GENESIS_FILENAME, @@ -3932,3 +3933,36 @@ async fn test_clever_errors() -> Result<(), anyhow::Error> { insta::assert_snapshot!(error_string); Ok(()) } + +#[tokio::test] +async fn test_parse_host_port() { + let input = "127.0.0.0"; + let result = parse_host_port(input.to_string(), 9123).unwrap(); + assert_eq!(result, "127.0.0.0:9123".parse::().unwrap()); + + let input = "127.0.0.5:9124"; + let result = parse_host_port(input.to_string(), 9123).unwrap(); + assert_eq!(result, "127.0.0.5:9124".parse::().unwrap()); + + let input = "9090"; + let result = parse_host_port(input.to_string(), 9123).unwrap(); + assert_eq!(result, "0.0.0.0:9090".parse::().unwrap()); + + let input = ""; + let result = parse_host_port(input.to_string(), 9123).unwrap(); + assert_eq!(result, "0.0.0.0:9123".parse::().unwrap()); + + let result = parse_host_port("localhost".to_string(), 9899).unwrap(); + assert_eq!(result, "127.0.0.1:9899".parse::().unwrap()); + + let input = "asg"; + assert!(parse_host_port(input.to_string(), 9123).is_err()); + let input = "127.0.0:900"; + assert!(parse_host_port(input.to_string(), 9123).is_err()); + let input = "127.0.0"; + assert!(parse_host_port(input.to_string(), 9123).is_err()); + let input = "127."; + assert!(parse_host_port(input.to_string(), 9123).is_err()); + let input = "127.9.0.1:asb"; + assert!(parse_host_port(input.to_string(), 9123).is_err()); +} From 98a2d8d9c0eafce40072b0e162633e402786084e Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:48:43 -0700 Subject: [PATCH 014/163] Add check that all executed transactions are checkpointed (and vice versa) (#18622) --- crates/sui-core/src/authority.rs | 5 +++ .../authority/authority_per_epoch_store.rs | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 61662a25dc648..4b6bc6a4167c0 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -2975,6 +2975,10 @@ impl AuthorityState { cur_epoch_store.epoch() ); + if cfg!(debug_assertions) { + cur_epoch_store.check_all_executed_transactions_in_checkpoint(); + } + if let Err(err) = self .get_reconfig_api() .expensive_check_sui_conservation(cur_epoch_store) @@ -4734,6 +4738,7 @@ impl AuthorityState { continue; } info!("Reverting {:?} at the end of epoch", digest); + epoch_store.revert_executed_transaction(&digest)?; self.get_reconfig_api().revert_state_update(&digest)?; } info!("All uncommitted local transactions reverted"); 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 c62adde0cb63d..06d0a407defb5 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -1208,6 +1208,15 @@ impl AuthorityPerEpochStore { Ok(()) } + pub fn revert_executed_transaction(&self, tx_digest: &TransactionDigest) -> SuiResult { + let tables = self.tables()?; + let mut batch = tables.effects_signatures.batch(); + batch.delete_batch(&tables.executed_in_epoch, [*tx_digest])?; + batch.delete_batch(&tables.effects_signatures, [*tx_digest])?; + batch.write()?; + Ok(()) + } + pub fn insert_effects_digest_and_signature( &self, tx_digest: &TransactionDigest, @@ -3914,6 +3923,37 @@ impl AuthorityPerEpochStore { pub fn clear_signature_cache(&self) { self.signature_verifier.clear_signature_cache(); } + + pub(crate) fn check_all_executed_transactions_in_checkpoint(&self) { + if !self.executed_in_epoch_table_enabled() { + error!("Cannot check executed transactions in checkpoint because executed_in_epoch table is not enabled"); + return; + } + let tables = self.tables().unwrap(); + + info!("Verifying that all executed transactions are in a checkpoint"); + + let mut executed_iter = tables.executed_in_epoch.unbounded_iter(); + let mut checkpointed_iter = tables.executed_transactions_to_checkpoint.unbounded_iter(); + + // verify that the two iterators (which are both sorted) are identical + loop { + let executed = executed_iter.next(); + let checkpointed = checkpointed_iter.next(); + match (executed, checkpointed) { + (Some((left, ())), Some((right, _))) => { + if left != right { + panic!("Executed transactions and checkpointed transactions do not match: {:?} {:?}", left, right); + } + } + (None, None) => break, + (left, right) => panic!( + "Executed transactions and checkpointed transactions do not match: {:?} {:?}", + left, right + ), + } + } + } } impl GetSharedLocks for AuthorityPerEpochStore { From 8e103afedf82493fe06eb30f52d28bbf25804f9f Mon Sep 17 00:00:00 2001 From: Xun Li Date: Fri, 12 Jul 2024 13:10:12 -0700 Subject: [PATCH 015/163] [RFC][core] Add validator tx finalizer (#18542) ## Description The ValidatorTxFinalizer gets called whenever a transaction is signed on a validator. It would then sleep for a min, wake up and check if the tx has already been executed, if not, use authority aggregator to finalize it. ## Test plan Added unit tests to cover various cases: 1. Basic flow 2. Epoch change 3. Tx already executed --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/mysten-metrics/src/lib.rs | 5 + crates/sui-core/src/authority.rs | 1 + .../src/authority/test_authority_builder.rs | 6 +- .../checkpoints/checkpoint_executor/tests.rs | 2 +- crates/sui-core/src/consensus_handler.rs | 2 +- crates/sui-core/src/consensus_validator.rs | 2 +- crates/sui-core/src/lib.rs | 1 + .../src/unit_tests/transaction_deny_tests.rs | 6 +- crates/sui-core/src/validator_tx_finalizer.rs | 569 ++++++++++++++++++ 9 files changed, 585 insertions(+), 9 deletions(-) create mode 100644 crates/sui-core/src/validator_tx_finalizer.rs diff --git a/crates/mysten-metrics/src/lib.rs b/crates/mysten-metrics/src/lib.rs index b7ec2be8e85fe..a25cdcbb7218c 100644 --- a/crates/mysten-metrics/src/lib.rs +++ b/crates/mysten-metrics/src/lib.rs @@ -27,6 +27,11 @@ pub use guards::*; pub const TX_TYPE_SINGLE_WRITER_TX: &str = "single_writer"; pub const TX_TYPE_SHARED_OBJ_TX: &str = "shared_object"; +pub const TX_LATENCY_SEC_BUCKETS: &[f64] = &[ + 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.5, 2., 2.5, + 3., 3.5, 4., 4.5, 5., 6., 7., 8., 9., 10., 20., 30., 60., 90., +]; + #[derive(Debug)] pub struct Metrics { pub tasks: IntGaugeVec, diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 4b6bc6a4167c0..f4dd9624a7383 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -2948,6 +2948,7 @@ impl AuthorityState { let new_epoch = new_epoch_store.epoch(); self.transaction_manager.reconfigure(new_epoch); self.epoch_store.store(new_epoch_store); + epoch_store.epoch_terminated().await; *execution_lock = new_epoch; } diff --git a/crates/sui-core/src/authority/test_authority_builder.rs b/crates/sui-core/src/authority/test_authority_builder.rs index e32bebd6a89aa..c5ad03a4bf679 100644 --- a/crates/sui-core/src/authority/test_authority_builder.rs +++ b/crates/sui-core/src/authority/test_authority_builder.rs @@ -123,12 +123,12 @@ impl<'a> TestAuthorityBuilder<'a> { self } - /// When providing a network config, we will use the first validator's + /// When providing a network config, we will use the \node_idx validator's /// key as the keypair for the new node. - pub fn with_network_config(self, config: &'a NetworkConfig) -> Self { + pub fn with_network_config(self, config: &'a NetworkConfig, node_idx: usize) -> Self { self.with_genesis_and_keypair( &config.genesis, - config.validator_configs()[0].protocol_key_pair(), + config.validator_configs()[node_idx].protocol_key_pair(), ) } diff --git a/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs b/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs index 4efa9a57714b2..440aa599f3d1d 100644 --- a/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs +++ b/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs @@ -385,7 +385,7 @@ async fn init_executor_test( let network_config = sui_swarm_config::network_config_builder::ConfigBuilder::new_with_temp_dir().build(); let state = TestAuthorityBuilder::new() - .with_network_config(&network_config) + .with_network_config(&network_config, 0) .build() .await; diff --git a/crates/sui-core/src/consensus_handler.rs b/crates/sui-core/src/consensus_handler.rs index 0fa8a04111fac..6d9b588765cad 100644 --- a/crates/sui-core/src/consensus_handler.rs +++ b/crates/sui-core/src/consensus_handler.rs @@ -912,7 +912,7 @@ mod tests { .build(); let state = TestAuthorityBuilder::new() - .with_network_config(&network_config) + .with_network_config(&network_config, 0) .build() .await; diff --git a/crates/sui-core/src/consensus_validator.rs b/crates/sui-core/src/consensus_validator.rs index 9f7c55d994200..d4d6321080112 100644 --- a/crates/sui-core/src/consensus_validator.rs +++ b/crates/sui-core/src/consensus_validator.rs @@ -241,7 +241,7 @@ mod tests { .build(); let state = TestAuthorityBuilder::new() - .with_network_config(&network_config) + .with_network_config(&network_config, 0) .build() .await; let name1 = state.name; diff --git a/crates/sui-core/src/lib.rs b/crates/sui-core/src/lib.rs index 1a9ff0c691860..b610e94a7188c 100644 --- a/crates/sui-core/src/lib.rs +++ b/crates/sui-core/src/lib.rs @@ -42,6 +42,7 @@ mod transaction_input_loader; mod transaction_manager; pub mod transaction_orchestrator; mod transaction_outputs; +pub mod validator_tx_finalizer; pub mod verify_indexes; #[cfg(test)] 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 9c10232aa12d1..c8c6ad7c04cb0 100644 --- a/crates/sui-core/src/unit_tests/transaction_deny_tests.rs +++ b/crates/sui-core/src/unit_tests/transaction_deny_tests.rs @@ -47,7 +47,7 @@ async fn setup_test(deny_config: TransactionDenyConfig) -> (NetworkConfig, Arc
Arc { TestAuthorityBuilder::new() .with_transaction_deny_config(config) - .with_network_config(network_config) + .with_network_config(network_config, 0) .with_store(state.database_for_testing().clone()) .build() .await @@ -446,7 +446,7 @@ async fn test_certificate_deny() { ); let digest = *tx.digest(); let state = TestAuthorityBuilder::new() - .with_network_config(&network_config) + .with_network_config(&network_config, 0) .with_certificate_deny_config( CertificateDenyConfigBuilder::new() .add_certificate_deny(digest) diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs new file mode 100644 index 0000000000000..989008d20894a --- /dev/null +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -0,0 +1,569 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::authority_aggregator::AuthorityAggregator; +use crate::authority_client::AuthorityAPI; +use crate::execution_cache::TransactionCacheRead; +use mysten_metrics::TX_LATENCY_SEC_BUCKETS; +use prometheus::{ + register_histogram_with_registry, register_int_counter_with_registry, Histogram, IntCounter, + Registry, +}; +#[cfg(test)] +use std::sync::atomic::{AtomicU64, Ordering::Relaxed}; +use std::sync::Arc; +use std::time::Duration; +use sui_types::transaction::VerifiedSignedTransaction; +use tokio::time::Instant; +use tracing::{debug, error, trace}; + +/// Only wake up the transaction finalization task for a given transaction +/// after 1 mins of seeing it. This gives plenty of time for the transaction +/// to become final in the normal way. We also don't want this delay to be too long +/// to reduce memory usage held up by the finalizer threads. +const TX_FINALIZATION_DELAY: Duration = Duration::from_secs(60); +/// If a transaction can not be finalized within 1 min of being woken up, give up. +const FINALIZATION_TIMEOUT: Duration = Duration::from_secs(60); + +struct ValidatorTxFinalizerMetrics { + num_finalization_attempts: IntCounter, + num_successful_finalizations: IntCounter, + finalization_latency: Histogram, + #[cfg(test)] + num_finalization_attempts_for_testing: AtomicU64, + #[cfg(test)] + num_successful_finalizations_for_testing: AtomicU64, +} + +impl ValidatorTxFinalizerMetrics { + fn new(registry: &Registry) -> Self { + Self { + num_finalization_attempts: register_int_counter_with_registry!( + "validator_tx_finalizer_num_finalization_attempts", + "Total number of attempts to finalize a transaction", + registry, + ) + .unwrap(), + num_successful_finalizations: register_int_counter_with_registry!( + "validator_tx_finalizer_num_successful_finalizations", + "Number of transactions successfully finalized", + registry, + ) + .unwrap(), + finalization_latency: register_histogram_with_registry!( + "validator_tx_finalizer_finalization_latency", + "Latency of transaction finalization", + TX_LATENCY_SEC_BUCKETS.to_vec(), + registry, + ) + .unwrap(), + #[cfg(test)] + num_finalization_attempts_for_testing: AtomicU64::new(0), + #[cfg(test)] + num_successful_finalizations_for_testing: AtomicU64::new(0), + } + } + + fn start_finalization(&self) -> Instant { + self.num_finalization_attempts.inc(); + #[cfg(test)] + self.num_finalization_attempts_for_testing + .fetch_add(1, Relaxed); + Instant::now() + } + + fn finalization_succeeded(&self, start_time: Instant) { + let latency = start_time.elapsed(); + self.num_successful_finalizations.inc(); + self.finalization_latency.observe(latency.as_secs_f64()); + #[cfg(test)] + self.num_successful_finalizations_for_testing + .fetch_add(1, Relaxed); + } +} + +/// The `ValidatorTxFinalizer` is responsible for finalizing transactions that +/// have been signed by the validator. It does this by waiting for a delay +/// after the transaction has been signed, and then attempting to finalize +/// the transaction if it has not yet been done by a fullnode. +pub struct ValidatorTxFinalizer { + agg: Arc>, + tx_finalization_delay: Duration, + finalization_timeout: Duration, + metrics: Arc, +} + +impl ValidatorTxFinalizer { + #[allow(dead_code)] + pub(crate) fn new(agg: Arc>, registry: &Registry) -> Self { + Self { + agg, + tx_finalization_delay: TX_FINALIZATION_DELAY, + finalization_timeout: FINALIZATION_TIMEOUT, + metrics: Arc::new(ValidatorTxFinalizerMetrics::new(registry)), + } + } + + #[cfg(test)] + pub(crate) fn new_for_testing( + agg: Arc>, + tx_finalization_delay: Duration, + finalization_timeout: Duration, + ) -> Self { + Self { + agg, + tx_finalization_delay, + finalization_timeout, + metrics: Arc::new(ValidatorTxFinalizerMetrics::new( + prometheus::default_registry(), + )), + } + } +} + +impl ValidatorTxFinalizer +where + C: Clone + AuthorityAPI + Send + Sync + 'static, +{ + pub async fn track_signed_tx( + &self, + cache_read: Arc, + tx: VerifiedSignedTransaction, + ) { + let tx_digest = *tx.digest(); + trace!(?tx_digest, "Tracking signed transaction"); + match self.delay_and_finalize_tx(cache_read, tx).await { + Ok(did_run) => { + if did_run { + debug!(?tx_digest, "Transaction finalized"); + } + } + Err(err) => { + error!(?tx_digest, ?err, "Failed to finalize transaction"); + } + } + } + + async fn delay_and_finalize_tx( + &self, + cache_read: Arc, + tx: VerifiedSignedTransaction, + ) -> anyhow::Result { + tokio::time::sleep(self.tx_finalization_delay).await; + let tx_digest = *tx.digest(); + trace!(?tx_digest, "Waking up to finalize transaction"); + if cache_read.is_tx_already_executed(&tx_digest)? { + trace!(?tx_digest, "Transaction already finalized"); + return Ok(false); + } + let start_time = self.metrics.start_finalization(); + debug!( + ?tx_digest, + "Invoking authority aggregator to finalize transaction" + ); + tokio::time::timeout( + self.finalization_timeout, + self.agg + .execute_transaction_block(tx.into_unsigned().inner(), None), + ) + .await??; + self.metrics.finalization_succeeded(start_time); + Ok(true) + } +} + +#[cfg(test)] +mod tests { + use crate::authority::test_authority_builder::TestAuthorityBuilder; + use crate::authority::AuthorityState; + use crate::authority_aggregator::AuthorityAggregator; + use crate::authority_client::AuthorityAPI; + use crate::validator_tx_finalizer::ValidatorTxFinalizer; + use async_trait::async_trait; + use prometheus::default_registry; + use std::collections::{BTreeMap, HashMap}; + use std::iter; + use std::net::SocketAddr; + use std::num::NonZeroUsize; + use std::sync::atomic::AtomicBool; + use std::sync::atomic::Ordering::Relaxed; + use std::sync::Arc; + use sui_macros::sim_test; + use sui_swarm_config::network_config_builder::ConfigBuilder; + use sui_test_transaction_builder::TestTransactionBuilder; + use sui_types::base_types::{AuthorityName, ObjectID, SuiAddress, TransactionDigest}; + use sui_types::committee::{CommitteeTrait, StakeUnit}; + use sui_types::crypto::{get_account_key_pair, AccountKeyPair}; + use sui_types::effects::{TransactionEffectsAPI, TransactionEvents}; + use sui_types::error::SuiError; + use sui_types::executable_transaction::VerifiedExecutableTransaction; + use sui_types::messages_checkpoint::{ + CheckpointRequest, CheckpointRequestV2, CheckpointResponse, CheckpointResponseV2, + }; + use sui_types::messages_grpc::{ + HandleCertificateRequestV3, HandleCertificateResponseV2, HandleCertificateResponseV3, + HandleSoftBundleCertificatesRequestV3, HandleSoftBundleCertificatesResponseV3, + HandleTransactionResponse, ObjectInfoRequest, ObjectInfoResponse, SystemStateRequest, + TransactionInfoRequest, TransactionInfoResponse, + }; + use sui_types::object::Object; + use sui_types::sui_system_state::SuiSystemState; + use sui_types::transaction::{ + CertifiedTransaction, SignedTransaction, Transaction, VerifiedCertificate, + VerifiedSignedTransaction, VerifiedTransaction, + }; + use sui_types::utils::to_sender_signed_transaction; + + #[derive(Clone)] + struct MockAuthorityClient { + authority: Arc, + inject_fault: Arc, + } + + #[async_trait] + impl AuthorityAPI for MockAuthorityClient { + async fn handle_transaction( + &self, + transaction: Transaction, + _client_addr: Option, + ) -> Result { + if self.inject_fault.load(Relaxed) { + return Err(SuiError::TimeoutError); + } + let epoch_store = self.authority.epoch_store_for_testing(); + self.authority + .handle_transaction( + &epoch_store, + VerifiedTransaction::new_unchecked(transaction), + ) + .await + } + + async fn handle_certificate_v2( + &self, + certificate: CertifiedTransaction, + _client_addr: Option, + ) -> Result { + let epoch_store = self.authority.epoch_store_for_testing(); + let (effects, _) = self + .authority + .try_execute_immediately( + &VerifiedExecutableTransaction::new_from_certificate( + VerifiedCertificate::new_unchecked(certificate), + ), + None, + &epoch_store, + ) + .await?; + let events = match effects.events_digest() { + None => TransactionEvents::default(), + Some(digest) => self.authority.get_transaction_events(digest)?, + }; + let signed_effects = self + .authority + .sign_effects(effects, &epoch_store)? + .into_inner(); + Ok(HandleCertificateResponseV2 { + signed_effects, + events, + fastpath_input_objects: vec![], + }) + } + + async fn handle_certificate_v3( + &self, + _request: HandleCertificateRequestV3, + _client_addr: Option, + ) -> Result { + unimplemented!() + } + + async fn handle_soft_bundle_certificates_v3( + &self, + _request: HandleSoftBundleCertificatesRequestV3, + _client_addr: Option, + ) -> Result { + unimplemented!() + } + + async fn handle_object_info_request( + &self, + _request: ObjectInfoRequest, + ) -> Result { + unimplemented!() + } + + async fn handle_transaction_info_request( + &self, + _request: TransactionInfoRequest, + ) -> Result { + unimplemented!() + } + + async fn handle_checkpoint( + &self, + _request: CheckpointRequest, + ) -> Result { + unimplemented!() + } + + async fn handle_checkpoint_v2( + &self, + _request: CheckpointRequestV2, + ) -> Result { + unimplemented!() + } + + async fn handle_system_state_object( + &self, + _request: SystemStateRequest, + ) -> Result { + unimplemented!() + } + } + + #[sim_test] + async fn test_validator_tx_finalizer_basic_flow() { + telemetry_subscribers::init_for_testing(); + let (sender, keypair) = get_account_key_pair(); + let gas_object = Object::with_owner_for_testing(sender); + let gas_object_id = gas_object.id(); + let (states, auth_agg, clients) = create_validators(gas_object).await; + let finalizer1 = ValidatorTxFinalizer::new_for_testing( + auth_agg.clone(), + std::time::Duration::from_secs(1), + std::time::Duration::from_secs(60), + ); + let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; + let tx_digest = *signed_tx.digest(); + let cache_read = states[0].get_transaction_cache_reader().clone(); + let metrics = finalizer1.metrics.clone(); + let handle = tokio::spawn(async move { + finalizer1.track_signed_tx(cache_read, signed_tx).await; + }); + handle.await.unwrap(); + check_quorum_execution(&auth_agg, &clients, &tx_digest, true); + assert_eq!( + metrics.num_finalization_attempts_for_testing.load(Relaxed), + 1 + ); + assert_eq!( + metrics + .num_successful_finalizations_for_testing + .load(Relaxed), + 1 + ); + } + + #[tokio::test] + async fn test_validator_tx_finalizer_new_epoch() { + let (sender, keypair) = get_account_key_pair(); + let gas_object = Object::with_owner_for_testing(sender); + let gas_object_id = gas_object.id(); + let (states, auth_agg, clients) = create_validators(gas_object).await; + let finalizer1 = ValidatorTxFinalizer::new_for_testing( + auth_agg.clone(), + std::time::Duration::from_secs(10), + std::time::Duration::from_secs(60), + ); + let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; + let tx_digest = *signed_tx.digest(); + let epoch_store = states[0].epoch_store_for_testing(); + let cache_read = states[0].get_transaction_cache_reader().clone(); + + let metrics = finalizer1.metrics.clone(); + let handle = tokio::spawn(async move { + let _ = epoch_store + .within_alive_epoch(finalizer1.track_signed_tx(cache_read, signed_tx)) + .await; + }); + states[0].reconfigure_for_testing().await; + handle.await.unwrap(); + check_quorum_execution(&auth_agg, &clients, &tx_digest, false); + assert_eq!( + metrics.num_finalization_attempts_for_testing.load(Relaxed), + 0 + ); + assert_eq!( + metrics + .num_successful_finalizations_for_testing + .load(Relaxed), + 0 + ); + } + + #[tokio::test] + async fn test_validator_tx_finalizer_already_executed() { + telemetry_subscribers::init_for_testing(); + let (sender, keypair) = get_account_key_pair(); + let gas_object = Object::with_owner_for_testing(sender); + let gas_object_id = gas_object.id(); + let (states, auth_agg, clients) = create_validators(gas_object).await; + let finalizer1 = ValidatorTxFinalizer::new_for_testing( + auth_agg.clone(), + std::time::Duration::from_secs(20), + std::time::Duration::from_secs(60), + ); + let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; + let tx_digest = *signed_tx.digest(); + let cache_read = states[0].get_transaction_cache_reader().clone(); + + let metrics = finalizer1.metrics.clone(); + let signed_tx_clone = signed_tx.clone(); + let handle = tokio::spawn(async move { + finalizer1 + .track_signed_tx(cache_read, signed_tx_clone) + .await; + }); + auth_agg + .execute_transaction_block(&signed_tx.into_inner().into_unsigned(), None) + .await + .unwrap(); + handle.await.unwrap(); + check_quorum_execution(&auth_agg, &clients, &tx_digest, true); + assert_eq!( + metrics.num_finalization_attempts_for_testing.load(Relaxed), + 0 + ); + assert_eq!( + metrics + .num_successful_finalizations_for_testing + .load(Relaxed), + 0 + ); + } + + #[tokio::test] + async fn test_validator_tx_finalizer_timeout() { + telemetry_subscribers::init_for_testing(); + let (sender, keypair) = get_account_key_pair(); + let gas_object = Object::with_owner_for_testing(sender); + let gas_object_id = gas_object.id(); + let (states, auth_agg, clients) = create_validators(gas_object).await; + let finalizer1 = ValidatorTxFinalizer::new_for_testing( + auth_agg.clone(), + std::time::Duration::from_secs(10), + std::time::Duration::from_secs(30), + ); + let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; + let tx_digest = *signed_tx.digest(); + let cache_read = states[0].get_transaction_cache_reader().clone(); + for client in clients.values() { + client.inject_fault.store(true, Relaxed); + } + + let metrics = finalizer1.metrics.clone(); + let signed_tx_clone = signed_tx.clone(); + let handle = tokio::spawn(async move { + finalizer1 + .track_signed_tx(cache_read, signed_tx_clone) + .await; + }); + handle.await.unwrap(); + check_quorum_execution(&auth_agg, &clients, &tx_digest, false); + assert_eq!( + metrics.num_finalization_attempts_for_testing.load(Relaxed), + 1 + ); + assert_eq!( + metrics + .num_successful_finalizations_for_testing + .load(Relaxed), + 0 + ); + } + + async fn create_validators( + gas_object: Object, + ) -> ( + Vec>, + Arc>, + BTreeMap, + ) { + let network_config = ConfigBuilder::new_with_temp_dir() + .committee_size(NonZeroUsize::new(4).unwrap()) + .with_objects(iter::once(gas_object)) + .build(); + let mut authority_states = vec![]; + for idx in 0..4 { + let state = TestAuthorityBuilder::new() + .with_network_config(&network_config, idx) + .build() + .await; + authority_states.push(state); + } + let clients: BTreeMap<_, _> = authority_states + .iter() + .map(|state| { + ( + state.name, + MockAuthorityClient { + authority: state.clone(), + inject_fault: Arc::new(AtomicBool::new(false)), + }, + ) + }) + .collect(); + let auth_agg = AuthorityAggregator::new( + network_config.committee_with_network().committee, + authority_states[0].clone_committee_store(), + clients.clone(), + default_registry(), + Arc::new(HashMap::new()), + ); + (authority_states, Arc::new(auth_agg), clients) + } + + async fn create_tx( + clients: &BTreeMap, + state: &Arc, + sender: SuiAddress, + keypair: &AccountKeyPair, + gas_object_id: ObjectID, + ) -> VerifiedSignedTransaction { + let gas_object_ref = state + .get_object(&gas_object_id) + .await + .unwrap() + .unwrap() + .compute_object_reference(); + let tx_data = TestTransactionBuilder::new( + sender, + gas_object_ref, + state.reference_gas_price_for_testing().unwrap(), + ) + .transfer_sui(None, sender) + .build(); + let tx = to_sender_signed_transaction(tx_data, keypair); + let response = clients + .get(&state.name) + .unwrap() + .handle_transaction(tx.clone(), None) + .await + .unwrap(); + VerifiedSignedTransaction::new_unchecked(SignedTransaction::new_from_data_and_sig( + tx.into_data(), + response.status.into_signed_for_testing(), + )) + } + + fn check_quorum_execution( + auth_agg: &Arc>, + clients: &BTreeMap, + tx_digest: &TransactionDigest, + expected: bool, + ) { + let quorum = auth_agg.committee.quorum_threshold(); + let executed_weight: StakeUnit = clients + .iter() + .filter_map(|(name, client)| { + client + .authority + .is_tx_already_executed(tx_digest) + .unwrap() + .then_some(auth_agg.committee.weight(name)) + }) + .sum(); + assert_eq!(executed_weight >= quorum, expected); + } +} From 260f1c867bbedee3fb51b1ad3b223f340be8aa26 Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:11:15 -0700 Subject: [PATCH 016/163] Move SupportedProtocolVersions to sui-types, rename AuthorityCapabilities -> AuthorityCapabilitiesV1 (#18583) Quick refactoring to prepare for adding AuthorityCapabilitiesV2, which will include the digest of ProtocolConfig for each supported version. --- crates/sui-benchmark/tests/simtest.rs | 5 +-- crates/sui-config/src/node.rs | 2 +- crates/sui-core/src/authority.rs | 8 ++-- .../authority/authority_per_epoch_store.rs | 10 ++--- .../src/authority/test_authority_builder.rs | 3 +- .../checkpoints/checkpoint_executor/tests.rs | 2 +- crates/sui-core/src/consensus_handler.rs | 7 ++-- .../src/unit_tests/authority_tests.rs | 8 ++-- .../tests/protocol_version_tests.rs | 5 ++- crates/sui-node/src/lib.rs | 12 +++--- crates/sui-node/src/main.rs | 2 +- crates/sui-protocol-config/src/lib.rs | 34 ---------------- .../src/network_config_builder.rs | 2 +- .../src/node_config_builder.rs | 2 +- crates/sui-swarm/src/memory/swarm.rs | 3 +- crates/sui-types/src/lib.rs | 1 + crates/sui-types/src/messages_consensus.rs | 12 +++--- .../src/supported_protocol_versions.rs | 39 +++++++++++++++++++ crates/test-cluster/src/lib.rs | 3 +- 19 files changed, 85 insertions(+), 75 deletions(-) create mode 100644 crates/sui-types/src/supported_protocol_versions.rs diff --git a/crates/sui-benchmark/tests/simtest.rs b/crates/sui-benchmark/tests/simtest.rs index f41d8b6f9f3d7..6c9f4ce80a904 100644 --- a/crates/sui-benchmark/tests/simtest.rs +++ b/crates/sui-benchmark/tests/simtest.rs @@ -30,9 +30,7 @@ mod test { clear_fail_point, nondeterministic, register_fail_point_arg, register_fail_point_async, register_fail_point_if, register_fail_points, sim_test, }; - use sui_protocol_config::{ - PerObjectCongestionControlMode, ProtocolConfig, ProtocolVersion, SupportedProtocolVersions, - }; + use sui_protocol_config::{PerObjectCongestionControlMode, ProtocolConfig, ProtocolVersion}; use sui_simulator::tempfile::TempDir; use sui_simulator::{configs::*, SimConfig}; use sui_storage::blob::Blob; @@ -41,6 +39,7 @@ mod test { use sui_types::digests::TransactionDigest; use sui_types::full_checkpoint_content::CheckpointData; use sui_types::messages_checkpoint::VerifiedCheckpoint; + use sui_types::supported_protocol_versions::SupportedProtocolVersions; use sui_types::transaction::{ DEFAULT_VALIDATOR_GAS_PRICE, TEST_ONLY_GAS_UNIT_FOR_HEAVY_COMPUTATION_STORAGE, }; diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index 5cdca44aba62e..c1749e10b5e24 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -20,7 +20,6 @@ use std::sync::Arc; use std::time::Duration; use std::usize; use sui_keys::keypair_file::{read_authority_keypair_from_file, read_keypair_from_file}; -use sui_protocol_config::{Chain, SupportedProtocolVersions}; use sui_types::base_types::{ObjectID, SuiAddress}; use sui_types::committee::EpochId; use sui_types::crypto::AuthorityPublicKeyBytes; @@ -28,6 +27,7 @@ use sui_types::crypto::KeypairTraits; use sui_types::crypto::NetworkKeyPair; use sui_types::crypto::SuiKeyPair; use sui_types::messages_checkpoint::CheckpointSequenceNumber; +use sui_types::supported_protocol_versions::{Chain, SupportedProtocolVersions}; use sui_types::traffic_control::{PolicyConfig, RemoteFirewallConfig}; use sui_types::crypto::{get_key_pair_from_rng, AccountKeyPair, AuthorityKeyPair}; diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index f4dd9624a7383..23198ff30a6e0 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -72,7 +72,6 @@ use sui_json_rpc_types::{ SuiTransactionBlockEvents, TransactionFilter, }; use sui_macros::{fail_point, fail_point_async, fail_point_if}; -use sui_protocol_config::{ProtocolConfig, SupportedProtocolVersions}; use sui_storage::indexes::{CoinInfo, ObjectIndexChanges}; use sui_storage::key_value_store::{TransactionKeyValueStore, TransactionKeyValueStoreTrait}; use sui_storage::key_value_store_metrics::KeyValueStoreMetrics; @@ -102,7 +101,7 @@ use sui_types::messages_checkpoint::{ CheckpointResponseV2, CheckpointSequenceNumber, CheckpointSummary, CheckpointSummaryResponse, CheckpointTimestamp, ECMHLiveObjectSetDigest, VerifiedCheckpoint, }; -use sui_types::messages_consensus::AuthorityCapabilities; +use sui_types::messages_consensus::AuthorityCapabilitiesV1; use sui_types::messages_grpc::{ HandleTransactionResponse, LayoutGenerationOption, ObjectInfoRequest, ObjectInfoRequestKind, ObjectInfoResponse, TransactionInfoRequest, TransactionInfoResponse, TransactionStatus, @@ -115,6 +114,7 @@ use sui_types::storage::{ use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait; use sui_types::sui_system_state::SuiSystemStateTrait; use sui_types::sui_system_state::{get_sui_system_state, SuiSystemState}; +use sui_types::supported_protocol_versions::{ProtocolConfig, SupportedProtocolVersions}; use sui_types::{ base_types::*, committee::Committee, @@ -4292,7 +4292,7 @@ impl AuthorityState { proposed_protocol_version: ProtocolVersion, protocol_config: &ProtocolConfig, committee: &Committee, - capabilities: Vec, + capabilities: Vec, mut buffer_stake_bps: u64, ) -> Option<(ProtocolVersion, Vec)> { if proposed_protocol_version > current_protocol_version + 1 @@ -4378,7 +4378,7 @@ impl AuthorityState { current_protocol_version: ProtocolVersion, protocol_config: &ProtocolConfig, committee: &Committee, - capabilities: Vec, + capabilities: Vec, buffer_stake_bps: u64, ) -> (ProtocolVersion, Vec) { let mut next_protocol_version = current_protocol_version; 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 06d0a407defb5..c7c2be043f482 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -97,7 +97,7 @@ use sui_types::messages_checkpoint::{ CheckpointContents, CheckpointSequenceNumber, CheckpointSignatureMessage, CheckpointSummary, }; use sui_types::messages_consensus::{ - check_total_jwk_size, AuthorityCapabilities, ConsensusTransaction, ConsensusTransactionKey, + check_total_jwk_size, AuthorityCapabilitiesV1, ConsensusTransaction, ConsensusTransactionKey, ConsensusTransactionKind, }; use sui_types::messages_consensus::{VersionedDkgConfimation, VersionedDkgMessage}; @@ -486,7 +486,7 @@ pub struct AuthorityEpochTables { pub running_root_accumulators: DBMap, /// Record of the capabilities advertised by each authority. - authority_capabilities: DBMap, + authority_capabilities: DBMap, /// Contains a single key, which overrides the value of /// ProtocolConfig::buffer_stake_for_protocol_upgrade_bps @@ -2123,7 +2123,7 @@ impl AuthorityPerEpochStore { } /// Record most recently advertised capabilities of all authorities - pub fn record_capabilities(&self, capabilities: &AuthorityCapabilities) -> SuiResult { + pub fn record_capabilities(&self, capabilities: &AuthorityCapabilitiesV1) -> SuiResult { info!("received capabilities {:?}", capabilities); let authority = &capabilities.authority; @@ -2143,8 +2143,8 @@ impl AuthorityPerEpochStore { Ok(()) } - pub fn get_capabilities(&self) -> SuiResult> { - let result: Result, TypedStoreError> = self + pub fn get_capabilities(&self) -> SuiResult> { + let result: Result, TypedStoreError> = self .tables()? .authority_capabilities .values() diff --git a/crates/sui-core/src/authority/test_authority_builder.rs b/crates/sui-core/src/authority/test_authority_builder.rs index c5ad03a4bf679..15c293baee9ca 100644 --- a/crates/sui-core/src/authority/test_authority_builder.rs +++ b/crates/sui-core/src/authority/test_authority_builder.rs @@ -29,7 +29,7 @@ use sui_config::transaction_deny_config::TransactionDenyConfig; use sui_config::ExecutionCacheConfig; use sui_macros::nondeterministic; use sui_network::randomness; -use sui_protocol_config::{ProtocolConfig, SupportedProtocolVersions}; +use sui_protocol_config::ProtocolConfig; use sui_storage::IndexStore; use sui_swarm_config::genesis_config::AccountConfig; use sui_swarm_config::network_config::NetworkConfig; @@ -39,6 +39,7 @@ use sui_types::digests::ChainIdentifier; use sui_types::executable_transaction::VerifiedExecutableTransaction; use sui_types::object::Object; use sui_types::sui_system_state::SuiSystemStateTrait; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use sui_types::transaction::VerifiedTransaction; use super::epoch_start_configuration::EpochFlag; diff --git a/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs b/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs index 440aa599f3d1d..544d08d11e778 100644 --- a/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs +++ b/crates/sui-core/src/checkpoints/checkpoint_executor/tests.rs @@ -10,9 +10,9 @@ use std::{sync::Arc, time::Duration}; use crate::authority::epoch_start_configuration::{EpochFlag, EpochStartConfiguration}; use broadcast::{Receiver, Sender}; -use sui_protocol_config::SupportedProtocolVersions; use sui_types::committee::ProtocolVersion; use sui_types::messages_checkpoint::{ECMHLiveObjectSetDigest, EndOfEpochData, VerifiedCheckpoint}; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use tokio::{sync::broadcast, time::timeout}; use crate::authority::test_authority_builder::TestAuthorityBuilder; diff --git a/crates/sui-core/src/consensus_handler.rs b/crates/sui-core/src/consensus_handler.rs index 6d9b588765cad..d3c839f7a4e79 100644 --- a/crates/sui-core/src/consensus_handler.rs +++ b/crates/sui-core/src/consensus_handler.rs @@ -872,15 +872,16 @@ mod tests { use narwhal_test_utils::latest_protocol_version; use narwhal_types::{Batch, Certificate, CommittedSubDag, HeaderV1Builder, ReputationScores}; use prometheus::Registry; - use sui_protocol_config::{ConsensusTransactionOrdering, SupportedProtocolVersions}; + use sui_protocol_config::ConsensusTransactionOrdering; use sui_types::{ base_types::{random_object_ref, AuthorityName, SuiAddress}, committee::Committee, messages_consensus::{ - AuthorityCapabilities, ConsensusTransaction, ConsensusTransactionKind, + AuthorityCapabilitiesV1, ConsensusTransaction, ConsensusTransactionKind, }, object::Object, sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait, + supported_protocol_versions::SupportedProtocolVersions, transaction::{ CertifiedTransaction, SenderSignedData, TransactionData, TransactionDataAPI, }, @@ -1135,7 +1136,7 @@ mod tests { fn cap_txn(generation: u64) -> VerifiedSequencedConsensusTransaction { txn(ConsensusTransactionKind::CapabilityNotification( - AuthorityCapabilities { + AuthorityCapabilitiesV1 { authority: Default::default(), generation, supported_protocol_versions: SupportedProtocolVersions::SYSTEM_DEFAULT, diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index 59157da08e309..4fb7d5280bda4 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -30,10 +30,7 @@ use sui_json_rpc_types::{ SuiArgument, SuiExecutionResult, SuiExecutionStatus, SuiTransactionBlockEffectsAPI, SuiTypeTag, }; use sui_macros::sim_test; -use sui_protocol_config::{ - Chain, PerObjectCongestionControlMode, ProtocolConfig, ProtocolVersion, - SupportedProtocolVersions, -}; +use sui_protocol_config::{Chain, PerObjectCongestionControlMode, ProtocolConfig, ProtocolVersion}; use sui_types::dynamic_field::DynamicFieldType; use sui_types::effects::TransactionEffects; use sui_types::epoch_data::EpochData; @@ -47,6 +44,7 @@ use sui_types::programmable_transaction_builder::ProgrammableTransactionBuilder; use sui_types::randomness_state::get_randomness_state_obj_initial_shared_version; use sui_types::storage::GetSharedLocks; use sui_types::sui_system_state::SuiSystemStateWrapper; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use sui_types::utils::{ to_sender_signed_transaction, to_sender_signed_transaction_with_multi_signers, }; @@ -4959,7 +4957,7 @@ fn test_choose_next_system_packages() { macro_rules! make_capabilities { ($v: expr, $name: expr, $packages: expr) => { - AuthorityCapabilities::new( + AuthorityCapabilitiesV1::new( $name, SupportedProtocolVersions::new_for_testing(1, $v), $packages, diff --git a/crates/sui-e2e-tests/tests/protocol_version_tests.rs b/crates/sui-e2e-tests/tests/protocol_version_tests.rs index 9a437184e5cb1..84e713089b83d 100644 --- a/crates/sui-e2e-tests/tests/protocol_version_tests.rs +++ b/crates/sui-e2e-tests/tests/protocol_version_tests.rs @@ -1,7 +1,8 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use sui_protocol_config::{ProtocolConfig, ProtocolVersion, SupportedProtocolVersions}; +use sui_protocol_config::{ProtocolConfig, ProtocolVersion}; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use test_cluster::TestClusterBuilder; #[tokio::test] @@ -66,7 +67,6 @@ mod sim_only_tests { use sui_json_rpc_types::{SuiTransactionBlockEffects, SuiTransactionBlockEffectsAPI}; use sui_macros::*; use sui_move_build::{BuildConfig, CompiledPackage}; - use sui_protocol_config::SupportedProtocolVersions; use sui_types::base_types::ConciseableName; use sui_types::base_types::{ObjectID, ObjectRef}; use sui_types::effects::{TransactionEffects, TransactionEffectsAPI}; @@ -77,6 +77,7 @@ mod sim_only_tests { SuiSystemState, SuiSystemStateTrait, SUI_SYSTEM_STATE_SIM_TEST_DEEP_V2, SUI_SYSTEM_STATE_SIM_TEST_SHALLOW_V2, SUI_SYSTEM_STATE_SIM_TEST_V1, }; + use sui_types::supported_protocol_versions::SupportedProtocolVersions; use sui_types::transaction::{ CallArg, Command, ObjectArg, ProgrammableMoveCall, ProgrammableTransaction, TransactionData, TEST_ONLY_GAS_UNIT_FOR_GENERIC, diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index f398c28793d6c..e7dbd4c9dc4b3 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -112,7 +112,7 @@ use sui_network::api::ValidatorServer; use sui_network::discovery; use sui_network::discovery::TrustedPeerChangeEvent; use sui_network::state_sync; -use sui_protocol_config::{Chain, ProtocolConfig, SupportedProtocolVersions}; +use sui_protocol_config::{Chain, ProtocolConfig}; use sui_snapshot::uploader::StateSnapshotUploader; use sui_storage::{ http_key_value_store::HttpKVStore, @@ -125,12 +125,13 @@ use sui_types::committee::Committee; use sui_types::crypto::KeypairTraits; use sui_types::error::{SuiError, SuiResult}; use sui_types::messages_consensus::{ - check_total_jwk_size, AuthorityCapabilities, ConsensusTransaction, + check_total_jwk_size, AuthorityCapabilitiesV1, ConsensusTransaction, }; use sui_types::quorum_driver_types::QuorumDriverEffectsQueueResult; use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemState; use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait; use sui_types::sui_system_state::SuiSystemStateTrait; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use typed_store::rocks::default_db_options; use typed_store::DBMetrics; @@ -1487,8 +1488,8 @@ impl SuiNode { let config = cur_epoch_store.protocol_config(); let binary_config = to_binary_config(config); - let transaction = - ConsensusTransaction::new_capability_notification(AuthorityCapabilities::new( + let transaction = ConsensusTransaction::new_capability_notification( + AuthorityCapabilitiesV1::new( self.state.name, self.config .supported_protocol_versions @@ -1496,7 +1497,8 @@ impl SuiNode { self.state .get_available_system_packages(&binary_config) .await, - )); + ), + ); info!(?transaction, "submitting capabilities to consensus"); components .consensus_adapter diff --git a/crates/sui-node/src/main.rs b/crates/sui-node/src/main.rs index c6e442d3621be..167d08ddbf3b7 100644 --- a/crates/sui-node/src/main.rs +++ b/crates/sui-node/src/main.rs @@ -14,11 +14,11 @@ use sui_config::node::RunWithRange; use sui_config::{Config, NodeConfig}; use sui_core::runtime::SuiRuntimes; use sui_node::metrics; -use sui_protocol_config::SupportedProtocolVersions; use sui_telemetry::send_telemetry_event; use sui_types::committee::EpochId; use sui_types::messages_checkpoint::CheckpointSequenceNumber; use sui_types::multiaddr::Multiaddr; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; // Define the `GIT_REVISION` and `VERSION` consts bin_version::bin_version!(); diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 933a0ff4ead6d..f5a528c30efbe 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -217,40 +217,6 @@ impl std::ops::Add for ProtocolVersion { } } -/// Models the set of protocol versions supported by a validator. -/// The `sui-node` binary will always use the SYSTEM_DEFAULT constant, but for testing we need -/// to be able to inject arbitrary versions into SuiNode. -#[derive(Serialize, Deserialize, Debug, Clone, Copy, Hash, PartialEq, Eq)] -pub struct SupportedProtocolVersions { - pub min: ProtocolVersion, - pub max: ProtocolVersion, -} - -impl SupportedProtocolVersions { - pub const SYSTEM_DEFAULT: Self = Self { - min: ProtocolVersion::MIN, - max: ProtocolVersion::MAX, - }; - - /// Use by VersionedProtocolMessage implementors to describe in which range of versions a - /// message variant is supported. - pub fn new_for_message(min: u64, max: u64) -> Self { - let min = ProtocolVersion::new(min); - let max = ProtocolVersion::new(max); - Self { min, max } - } - - pub fn new_for_testing(min: u64, max: u64) -> Self { - let min = min.into(); - let max = max.into(); - Self { min, max } - } - - pub fn is_version_supported(&self, v: ProtocolVersion) -> bool { - v.0 >= self.min.0 && v.0 <= self.max.0 - } -} - #[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Copy, PartialOrd, Ord, Eq, ValueEnum)] pub enum Chain { Mainnet, diff --git a/crates/sui-swarm-config/src/network_config_builder.rs b/crates/sui-swarm-config/src/network_config_builder.rs index ad6e941570802..a1ca29d1391a8 100644 --- a/crates/sui-swarm-config/src/network_config_builder.rs +++ b/crates/sui-swarm-config/src/network_config_builder.rs @@ -9,11 +9,11 @@ use rand::rngs::OsRng; use sui_config::genesis::{TokenAllocation, TokenDistributionScheduleBuilder}; use sui_config::node::AuthorityOverloadConfig; use sui_macros::nondeterministic; -use sui_protocol_config::SupportedProtocolVersions; use sui_types::base_types::{AuthorityName, SuiAddress}; use sui_types::committee::{Committee, ProtocolVersion}; use sui_types::crypto::{get_key_pair_from_rng, AccountKeyPair, KeypairTraits, PublicKey}; use sui_types::object::Object; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use sui_types::traffic_control::{PolicyConfig, RemoteFirewallConfig}; use crate::genesis_config::{AccountConfig, ValidatorGenesisConfigBuilder, DEFAULT_GAS_AMOUNT}; diff --git a/crates/sui-swarm-config/src/node_config_builder.rs b/crates/sui-swarm-config/src/node_config_builder.rs index e39eeab0dc0c9..da9324869bf02 100644 --- a/crates/sui-swarm-config/src/node_config_builder.rs +++ b/crates/sui-swarm-config/src/node_config_builder.rs @@ -22,9 +22,9 @@ use sui_config::{ local_ip_utils, ConsensusConfig, NodeConfig, AUTHORITIES_DB_NAME, CONSENSUS_DB_NAME, FULL_NODE_DB_PATH, }; -use sui_protocol_config::SupportedProtocolVersions; use sui_types::crypto::{AuthorityKeyPair, AuthorityPublicKeyBytes, NetworkKeyPair, SuiKeyPair}; use sui_types::multiaddr::Multiaddr; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use sui_types::traffic_control::{PolicyConfig, RemoteFirewallConfig}; /// This builder contains information that's not included in ValidatorGenesisConfig for building diff --git a/crates/sui-swarm/src/memory/swarm.rs b/crates/sui-swarm/src/memory/swarm.rs index b03cf664312fb..d6a4cb2c7911b 100644 --- a/crates/sui-swarm/src/memory/swarm.rs +++ b/crates/sui-swarm/src/memory/swarm.rs @@ -19,7 +19,7 @@ use sui_config::node::{AuthorityOverloadConfig, DBCheckpointConfig, RunWithRange use sui_config::NodeConfig; use sui_macros::nondeterministic; use sui_node::SuiNodeHandle; -use sui_protocol_config::{ProtocolVersion, SupportedProtocolVersions}; +use sui_protocol_config::ProtocolVersion; use sui_swarm_config::genesis_config::{AccountConfig, GenesisConfig, ValidatorGenesisConfig}; use sui_swarm_config::network_config::NetworkConfig; use sui_swarm_config::network_config_builder::{ @@ -29,6 +29,7 @@ use sui_swarm_config::network_config_builder::{ use sui_swarm_config::node_config_builder::FullnodeConfigBuilder; use sui_types::base_types::AuthorityName; use sui_types::object::Object; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use tempfile::TempDir; use tracing::info; diff --git a/crates/sui-types/src/lib.rs b/crates/sui-types/src/lib.rs index c5116aebe10ba..48541658aa146 100644 --- a/crates/sui-types/src/lib.rs +++ b/crates/sui-types/src/lib.rs @@ -79,6 +79,7 @@ pub mod storage; pub mod sui_sdk2_conversions; pub mod sui_serde; pub mod sui_system_state; +pub mod supported_protocol_versions; pub mod traffic_control; pub mod transaction; pub mod transfer; diff --git a/crates/sui-types/src/messages_consensus.rs b/crates/sui-types/src/messages_consensus.rs index a6c6357582132..2f251723fd112 100644 --- a/crates/sui-types/src/messages_consensus.rs +++ b/crates/sui-types/src/messages_consensus.rs @@ -7,6 +7,7 @@ use crate::digests::ConsensusCommitDigest; use crate::messages_checkpoint::{ CheckpointSequenceNumber, CheckpointSignatureMessage, CheckpointTimestamp, }; +use crate::supported_protocol_versions::SupportedProtocolVersions; use crate::transaction::CertifiedTransaction; use byteorder::{BigEndian, ReadBytesExt}; use fastcrypto::error::FastCryptoResult; @@ -20,7 +21,6 @@ use std::fmt::{Debug, Formatter}; use std::hash::{Hash, Hasher}; use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; -use sui_protocol_config::SupportedProtocolVersions; /// Only commit_timestamp_ms is passed to the move call currently. /// However we include epoch and round to make sure each ConsensusCommitPrologue has a unique tx digest. @@ -137,7 +137,7 @@ impl Debug for ConsensusTransactionKey { /// Used to advertise capabilities of each authority via narwhal. This allows validators to /// negotiate the creation of the ChangeEpoch transaction. #[derive(Serialize, Deserialize, Clone, Hash)] -pub struct AuthorityCapabilities { +pub struct AuthorityCapabilitiesV1 { /// Originating authority - must match narwhal transaction source. pub authority: AuthorityName, /// Generation number set by sending authority. Used to determine which of multiple @@ -155,7 +155,7 @@ pub struct AuthorityCapabilities { pub available_system_packages: Vec, } -impl Debug for AuthorityCapabilities { +impl Debug for AuthorityCapabilitiesV1 { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_struct("AuthorityCapabilities") .field("authority", &self.authority.concise()) @@ -169,7 +169,7 @@ impl Debug for AuthorityCapabilities { } } -impl AuthorityCapabilities { +impl AuthorityCapabilitiesV1 { pub fn new( authority: AuthorityName, supported_protocol_versions: SupportedProtocolVersions, @@ -195,7 +195,7 @@ pub enum ConsensusTransactionKind { UserTransaction(Box), CheckpointSignature(Box), EndOfPublish(AuthorityName), - CapabilityNotification(AuthorityCapabilities), + CapabilityNotification(AuthorityCapabilitiesV1), NewJWKFetched(AuthorityName, JwkId, JWK), RandomnessStateUpdate(u64, Vec), // deprecated // DKG is used to generate keys for use in the random beacon protocol. @@ -365,7 +365,7 @@ impl ConsensusTransaction { } } - pub fn new_capability_notification(capabilities: AuthorityCapabilities) -> Self { + pub fn new_capability_notification(capabilities: AuthorityCapabilitiesV1) -> Self { let mut hasher = DefaultHasher::new(); capabilities.hash(&mut hasher); let tracking_id = hasher.finish().to_le_bytes(); diff --git a/crates/sui-types/src/supported_protocol_versions.rs b/crates/sui-types/src/supported_protocol_versions.rs new file mode 100644 index 0000000000000..57d18040fad39 --- /dev/null +++ b/crates/sui-types/src/supported_protocol_versions.rs @@ -0,0 +1,39 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use serde::{Deserialize, Serialize}; +pub use sui_protocol_config::{Chain, ProtocolConfig, ProtocolVersion}; + +/// Models the set of protocol versions supported by a validator. +/// The `sui-node` binary will always use the SYSTEM_DEFAULT constant, but for testing we need +/// to be able to inject arbitrary versions into SuiNode. +#[derive(Serialize, Deserialize, Debug, Clone, Copy, Hash, PartialEq, Eq)] +pub struct SupportedProtocolVersions { + pub min: ProtocolVersion, + pub max: ProtocolVersion, +} + +impl SupportedProtocolVersions { + pub const SYSTEM_DEFAULT: Self = Self { + min: ProtocolVersion::MIN, + max: ProtocolVersion::MAX, + }; + + /// Use by VersionedProtocolMessage implementors to describe in which range of versions a + /// message variant is supported. + pub fn new_for_message(min: u64, max: u64) -> Self { + let min = ProtocolVersion::new(min); + let max = ProtocolVersion::new(max); + Self { min, max } + } + + pub fn new_for_testing(min: u64, max: u64) -> Self { + let min = min.into(); + let max = max.into(); + Self { min, max } + } + + pub fn is_version_supported(&self, v: ProtocolVersion) -> bool { + v.as_u64() >= self.min.as_u64() && v.as_u64() <= self.max.as_u64() + } +} diff --git a/crates/test-cluster/src/lib.rs b/crates/test-cluster/src/lib.rs index 78f7d65a077cd..8740c39577349 100644 --- a/crates/test-cluster/src/lib.rs +++ b/crates/test-cluster/src/lib.rs @@ -38,7 +38,7 @@ use sui_json_rpc_types::{ }; use sui_keys::keystore::{AccountKeystore, FileBasedKeystore, Keystore}; use sui_node::SuiNodeHandle; -use sui_protocol_config::{ProtocolVersion, SupportedProtocolVersions}; +use sui_protocol_config::ProtocolVersion; use sui_sdk::apis::QuorumDriverApi; use sui_sdk::sui_client_config::{SuiClientConfig, SuiEnv}; use sui_sdk::wallet_context::WalletContext; @@ -70,6 +70,7 @@ use sui_types::object::Object; use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait; use sui_types::sui_system_state::SuiSystemState; use sui_types::sui_system_state::SuiSystemStateTrait; +use sui_types::supported_protocol_versions::SupportedProtocolVersions; use sui_types::traffic_control::{PolicyConfig, RemoteFirewallConfig}; use sui_types::transaction::{ CertifiedTransaction, ObjectArg, Transaction, TransactionData, TransactionDataAPI, From 389c3dc450f89fa2feea063dd6e0c7fc870bc498 Mon Sep 17 00:00:00 2001 From: stefan-mysten <135084671+stefan-mysten@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:48:31 -0700 Subject: [PATCH 017/163] [codecov-ci] Disable debug symbols (#18641) ## Description Disable debug symbols when running `cargo llvm-cov` as it seems the CI run is OOM-ing when building `sui-e2e-tests`. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .github/workflows/cargo-llvm-cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 58fd8b8c1cdcc..73f6cb5057650 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -54,7 +54,7 @@ jobs: swap-size-gb: 256 - name: Run code coverage for nextest - run: SUI_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest -vv + run: RUSTFLAGS="-C debuginfo=0" SUI_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest -vv - name: Upload report to Codecov for nextest uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1 From b6feedeb8a71e118498e8e9626073912f7c8b282 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Fri, 12 Jul 2024 21:53:18 +0100 Subject: [PATCH 018/163] [Examples/Docs] Tic-tac-toe (#18558) ## Description A README for the tic-tac-toe app example, derived from: https://github.com/MystenLabs/multisig_tic-tac-toe/blob/main/README.md And updates to the docs for the tic-tac-toe app example to reflect changes to modernise the guide and bring all its source code into the `sui` mono-repo. This is the last major example that lived in the `sui_programmability` directory. ## Test plan :eyes: ## Stack - #18525 - #18526 - #18557 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: Ronny Roland --- .../developer/app-examples/tic-tac-toe.mdx | 485 ++++++------------ docs/site/src/css/custom.css | 8 +- examples/tic-tac-toe/README.md | 134 +++++ 3 files changed, 308 insertions(+), 319 deletions(-) create mode 100644 examples/tic-tac-toe/README.md diff --git a/docs/content/guides/developer/app-examples/tic-tac-toe.mdx b/docs/content/guides/developer/app-examples/tic-tac-toe.mdx index 135ec5f425e91..83f8affc4026c 100644 --- a/docs/content/guides/developer/app-examples/tic-tac-toe.mdx +++ b/docs/content/guides/developer/app-examples/tic-tac-toe.mdx @@ -2,354 +2,209 @@ title: Tic-Tac-Toe --- -This guide covers three different implementations of the game tic-tac-toe on Sui. The first example utilizes a centralized admin that marks the board on the users’ behalf. The second example utilizes a shared object that both users can mutate. And the third example utilizes a multisig, where instead of sharing the game board, it's in a 1-of-2 multisig of both users’ accounts. This guide compares and contrasts the design philosophies behind the three different games, as well as the pros and cons of each. +This guide covers three different implementations of the game tic-tac-toe on Sui. The first example utilizes a centralized admin that marks the board on the users’ behalf. The second example utilizes a shared object that both users can mutate. And the third example utilizes a multisig, where instead of sharing the game board, it's in a 1-of-2 multisig of both users’ accounts. -## tic_tac_toe.move +## owned.move ([source](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/move/sources/owned.move)) In this first example of tic-tac-toe, the game object, including the game board, is controlled by a game admin. -```move -public struct TicTacToe has key { - id: UID, - gameboard: vector>>, - cur_turn: u8, - game_status: u8, - x_address: address, - o_address: address, -} -``` +{@inject: examples/tic-tac-toe/move/sources/owned.move#struct=Game noComments} -Because the players don’t own the game board, they cannot directly mutate it. Instead, they indicate their move by creating a marker object with their intended placement and send it to the admin. +Because the players don’t own the game board, they cannot directly mutate it. Instead, they indicate their move by creating a `Mark` object with their intended placement and send it to the game object using transfer to object: -```move -public struct Mark has key, store { - id: UID, - player: address, - row: u64, - col: u64, -} -``` -The main logic of the game is in the following `create_game` function. - -```move -/// `x_address` and `o_address` are the account address of the two players. -public entry fun create_game(x_address: address, o_address: address, ctx: &mut TxContext) { - // TODO: Validate sender address, only GameAdmin can create games. - - let id = object::new(ctx); - let game_id = id.to_inner(); - let gameboard = vector[ - vector[option::none(), option::none(), option::none()], - vector[option::none(), option::none(), option::none()], - vector[option::none(), option::none(), option::none()], - ]; - let game = TicTacToe { - id, - gameboard, - cur_turn: 0, - game_status: IN_PROGRESS, - x_address: x_address, - o_address: o_address, - }; - transfer::transfer(game, ctx.sender()); - let cap = MarkMintCap { - id: object::new(ctx), - game_id, - remaining_supply: 5, - }; - transfer::transfer(cap, x_address); - let cap = MarkMintCap { - id: object::new(ctx), - game_id, - remaining_supply: 5, - }; - transfer::transfer(cap, o_address); -} -``` +{@inject: examples/tic-tac-toe/move/sources/owned.move#struct=Mark noComments} + +Games are created with the `new` function: + +{@inject: examples/tic-tac-toe/move/sources/owned.move#fun=new noComments} Some things to note: -- The game exists as an owned object in the game admin’s account. -- The board is initialized as a 3x3 vector of vectors, instantiated via `option::none()`. -- Both players get five `MarkMintCap`s each, giving them the capability to place a maximum of five marks each. - -When playing the game, the admin operates a service that keeps track of these placement requests. When a request is received (`send_mark_to_game`), the admin tries to place the marker on the board (`place_mark`). Each move requires two steps (thus two transactions): one from the player and one from the admin. This setup relies on the admin's service to keep the game moving. - -```move -/// Generate a new mark intended for location (row, col). -/// This new mark is not yet placed, just transferred to the game. -public entry fun send_mark_to_game( - cap: &mut MarkMintCap, - game_address: address, - row: u64, - col: u64, - ctx: &mut TxContext, -) { - if (row > 2 || col > 2) { - abort EInvalidLocation - }; - let mark = mint_mark(cap, row, col, ctx); - // Once an event is emitted, it should be observed by a game server. - // The game server will then call `place_mark` to place this mark. - event::emit(MarkSentEvent { - game_id: *&cap.game_id, - mark_id: object::id(&mark), - }); - transfer::public_transfer(mark, game_address); -} +- The game is created and returned by this function, it is up to its creator to send it to the game admin to own. +- There is an `admin` field, we can ignore this for now, as it is only relevant for the multisig approach. +- The first player is sent a `TurnCap` which gives them permission to take the next turn, they consume it to make their `Mark`, and the admin mints and sends a new `TurnCap` to the next player if the game has not ended. -public entry fun place_mark(game: &mut TicTacToe, mark: Mark, ctx: &mut TxContext) { - // If we are placing the mark at the wrong turn, or if game has ended, - // destroy the mark. - let addr = game.get_cur_turn_address(); - if (game.game_status != IN_PROGRESS || &addr != &mark.player) { - mark.delete(); - return - }; - let cell = get_cell_mut_ref(game, mark.row, mark.col); - if (cell.is_some()) { - // There is already a mark in the desired location. - // Destroy the mark. - mark.delete(); - return - }; - cell.fill(mark); - game.update_winner(); - game.cur_turn = game.cur_turn + 1; - - if (game.game_status != IN_PROGRESS) { - // Notify the server that the game ended so that it can delete the game. - event::emit(GameEndEvent { game_id: object::id(game) }); - if (game.game_status == X_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, *&game.x_address); - } else if (game.game_status == O_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, *&game.o_address); - } - } -} -``` +When playing the game, the admin operates a service that keeps track of marks using events. When a request is received (`send_mark`), the admin tries to place the marker on the board (`place_mark`). Each move requires two steps (thus two transactions): one from the player and one from the admin. This setup relies on the admin's service to keep the game moving. + +{@inject: examples/tic-tac-toe/move/sources/owned.move#fun=send_mark,place_mark noComments} -To view the entire source code, see the [tic_tac_toe.move source file](https://github.com/MystenLabs/sui/blob/main/sui_programmability/examples/games/sources/tic_tac_toe.move). You can find the rest of the logic, including how to check for a winner, as well as deleting the gameboard after the game concludes there. +To view the entire source code, see the [owned.move source file](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/move/sources/owned.move). You can find the rest of the logic, including how to check for a winner, as well as deleting the gameboard after the game concludes there. -An alternative version of this game, shared tic-tac-toe, uses shared objects for a more straightforward implementation that doesn't use a centralized service. This comes at a slightly increased cost, as using shared objects is more expensive than transactions involving wholly owned objects. +An alternative version of this game, shared tic-tac-toe, uses shared objects for a more straightforward implementation that doesn't use a centralized service. This comes at a slightly increased cost, as using shared objects is more expensive than transactions involving wholly owned objects. -## shared_tic_tac_toe.move +
+ +Toggle full source code + +{@inject: examples/tic-tac-toe/move/sources/owned.move} +
+ +## shared.move ([source](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/move/sources/shared.move)) In the previous version, the admin owned the game object, preventing players from directly changing the gameboard, as well as requiring two transactions for each marker placement. In this version, the game object is a shared object, allowing both players to access and modify it directly, enabling them to place markers in just one transaction. However, using a shared object generally incurs extra costs because Sui needs to sequence the operations from different transactions. In the context of this game, where players are expected to take turns, this shouldn't significantly impact performance. Overall, this shared object approach simplifies the implementation compared to the previous method. -As the following code demonstrates, the `TicTacToe` object in this example is almost identical to the one before it. The only difference is that the `gameboard` is represented as `vector>` instead of `vector>>`. The reason for this approach is explained following the code. +As the following code demonstrates, the `Game` object in this example is almost identical to the one before it. The only differences are that it does not include an `admin` field, which is only relevant for the multisig version of the game, and it does not have `store`, because it only ever exists as a shared object (so it cannot be transferred or wrapped). -```move -public struct TicTacToe has key { - id: UID, - gameboard: vector>, - cur_turn: u8, - game_status: u8, - x_address: address, - o_address: address, -} -``` +{@inject: examples/tic-tac-toe/move/sources/shared.move#struct=Game noComments} -Take a look at the `create_game` function: - -```move -/// `x_address` and `o_address` are the account address of the two players. -public entry fun create_game(x_address: address, o_address: address, ctx: &mut TxContext) { - // TODO: Validate sender address, only GameAdmin can create games. - - let id = object::new(ctx); - let gameboard = vector[ - vector[MARK_EMPTY, MARK_EMPTY, MARK_EMPTY], - vector[MARK_EMPTY, MARK_EMPTY, MARK_EMPTY], - vector[MARK_EMPTY, MARK_EMPTY, MARK_EMPTY], - ]; - let game = TicTacToe { - id, - gameboard, - cur_turn: 0, - game_status: IN_PROGRESS, - x_address: x_address, - o_address: o_address, - }; - // Make the game a shared object so that both players can mutate it. - transfer::share_object(game); -} -``` +Take a look at the `new` function: -As the code demonstrates, each position on the board is replaced with `MARK_EMPTY` instead of `option::none()`. Instead of the game being sent to the game admin, it is instantiated as a shared object. The other notable difference is that there is no need to mint `MarkMintCap`s to the two players anymore, because the only two addresses that can play this game are `x_address` and `o_address`, and this is checked in the next function, `place_mark`: - -```move -public entry fun place_mark(game: &mut TicTacToe, row: u8, col: u8, ctx: &mut TxContext) { - assert!(row < 3 && col < 3, EInvalidLocation); - assert!(game.game_status == IN_PROGRESS, EGameEnded); - let addr = game.get_cur_turn_address(); - assert!(addr == ctx.sender(), EInvalidTurn); - - let cell = &mut game.gameboard[row as u64][col as u64]; - assert!(*cell == MARK_EMPTY, ECellOccupied); - - *cell = game.cur_turn % 2; - game.update_winner(); - game.cur_turn = game.cur_turn + 1; - - if (game.game_status != IN_PROGRESS) { - // Notify the server that the game ended so that it can delete the game. - event::emit(GameEndEvent { game_id: object::id(game) }); - if (game.game_status == X_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, game.x_address); - } else if (game.game_status == O_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, game.o_address); - } - } -} -``` +{@inject: examples/tic-tac-toe/move/sources/shared.move#fun=new noComments} + +Instead of the game being sent to the game admin, it is instantiated as a shared object. The other notable difference is that there is no need to mint a `TurnCap` because the only two addresses that can play this game are `x` and `o`, and this is checked in the next function, `place_mark`: + +{@inject: examples/tic-tac-toe/move/sources/shared.move#fun=place_mark noComments} -You can find the full source code in [shared_tic_tac_toe.move](https://github.com/MystenLabs/sui/blob/main/sui_programmability/examples/games/sources/shared_tic_tac_toe.move) +
+ +Toggle full source code + +{@inject: examples/tic-tac-toe/move/sources/shared.move} +
-## multisig_tic_tac_toe.move +## Multisig + +Multisig tic-tac-toe uses the same Move code as the owned version of the game, but interacts with it differently. Instead of transferring the game to a third party admin account, the players create a 1-of-2 multisig account to act as the game admin, so that either player can sign on behalf of the "admin". This pattern offers a way to share a resource between up to ten accounts without relying on consensus. In this implementation of the game, the game is in a 1-of-2 multisig account that acts as the game admin. In this particular case, because there are only two players, the previous example is a more convenient use case. However, this example illustrates that in some cases, a multisig can replace shared objects, thus allowing transactions to bypass consensus when using such an implementation. -Examine the two main objects in this game, `TicTacToe`, and `Mark`: - -```move -/// TicTacToe struct should be owned by the game-admin. -/// This should be the multisig 1-out-of-2 account for both players to make moves. -public struct TicTacToe has key { - id: UID, - /// Column major 3x3 game board - gameboard: vector, - /// Index of current turn - cur_turn: u8, - x_addr: address, - o_addr: address, - /// 0 not finished, 1 X Winner, 2 O Winner, 3 Draw - finished: u8 -} +### Creating a multisig account ([source](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/ui/src/MultiSig.ts)) -/// Mark is passed between game-admin (Multisig 1-out-of-2), x-player and o-player. -public struct Mark has key { - id: UID, - /// Column major 3x3 placement - placement: Option, - /// Flag that sets when the Mark is owned by a player - during_turn: bool, - /// Multi-sig account to place the mark - game_owners: address, - /// TicTacToe object this mark is part of - game_id: ID -} -``` - -The biggest difference in this `TicTacToe` object is that gameboard is a `vector`, but otherwise the main functionality of the gameboard is the same. The `Mark` object makes a reappearance in this version, as we need a way to identify the current player’s turn (this was accomplished in the shared version of the game in the `TicTacToe` object itself). - -The `create_game` function is fairly similar to one in the previous two versions: - -```move -/// This should be called by a multisig (1 out of 2) address. -/// x_addr and o_addr should be the two addresses part-taking in the multisig. -public fun create_game(x_addr: address, o_addr: address, ctx: &mut TxContext) { - let id = object::new(ctx); - let game_id = id.to_inner(); - - let tic_tac_toe = TicTacToe { - id, - gameboard: vector[MARK_EMPTY, MARK_EMPTY, MARK_EMPTY, - MARK_EMPTY, MARK_EMPTY, MARK_EMPTY, - MARK_EMPTY, MARK_EMPTY, MARK_EMPTY], - cur_turn: 0, - x_addr, - o_addr, - finished: 0 - }; - let mark = Mark { - id: object::new(ctx), - placement: option::none(), - during_turn: true, // Mark is passed to x_addr - game_owners: ctx.sender(), - game_id - }; - - transfer::transfer(tic_tac_toe, ctx.sender()); - transfer::transfer(mark, x_addr); +A multisig account is defined by the public keys of its constituent keypairs, their relative weights, and the threshold -- a signature is valid if the sum of weights of constituent keys having signed the signature exceeds the threshold. In our case, there are at most two constituent keypairs, they each have a weight of 1 and the threshold is also 1. A multisig cannot mention the same public key twice, so keys are deduplicated before the multisig is formed to deal with the case where a player is playing themselves: + +```typescript title="examples/tic-tac-toe/ui/src/MultiSig.ts" +export function multiSigPublicKey(keys: PublicKey[]): MultiSigPublicKey { + const deduplicated: { [key: string]: PublicKey } = {}; + for (const key of keys) { + deduplicated[key.toSuiAddress()] = key; + } + + return MultiSigPublicKey.fromPublicKeys({ + threshold: 1, + publicKeys: Object.values(deduplicated).map((publicKey) => { + return { publicKey, weight: 1 }; + }), + }); } ``` -Now take a look at `send_mark_to_game` and `place_mark`: +
+ +Toggle full source code + +{@inject: examples/tic-tac-toe/ui/src/MultiSig.ts} +
+ +Note that an address on Sui can be derived from a public key (this fact is used in the previous example to deduplicate public keys based on their accompanying address), but the opposite is not true. This means that to start a game of multisig tic-tac-toe, players must exchange public keys, instead of addresses. + +### Building a multisig transaction ([source](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/ui/src/hooks/useTransactions.ts)) -```move -/// This is called by the one of the two addresses participating in the multisig, but not from -/// the multisig itself. -/// row: [0 - 2], col: [0 - 2] -public fun send_mark_to_game(mark: Mark, row: u8, col: u8) { - // Mark.during_turn prevents multisig-acc from editing mark.placement after it has been sent to it. - assert!(mark.during_turn, ETriedToCheat); +When creating a multisig game, we make use of `owned::Game`'s `admin` field to store the multisig public key for the admin account. Later, it will be used to form the signature for the second transaction in the move. This does not need to be stored on-chain, but we are doing so for convenience so that when we fetch the `Game`'s contents, we get the public key as well: - mark.placement.fill(get_index(row, col)); - mark.during_turn = false; - let game_owners = mark.game_owners; - transfer::transfer(mark, game_owners); +```typescript title="examples/tic-tac-toe/ui/src/hooks/useTransactions.ts" +newMultiSigGame(player: PublicKey, opponent: PublicKey): Transaction { + const admin = multiSigPublicKey([player, opponent]); + const tx = new Transaction(); + + const game = tx.moveCall({ + target: `${this.packageId}::owned::new`, + arguments: [ + tx.pure.address(player.toSuiAddress()), + tx.pure.address(opponent.toSuiAddress()), + tx.pure(bcs.vector(bcs.u8()).serialize(admin.toRawBytes()).toBytes()), + ], + }); + + tx.transferObjects([game], admin.toSuiAddress()); + + return tx; } +``` -/// This is called by the multisig account to execute the last move by the player who used -/// `send_mark_to_game`. -public fun place_mark(game: &mut TicTacToe, mark: Mark, ctx: &mut TxContext) { - assert!(mark.game_id == game.id.to_inner(), EMarkIsFromDifferentGame); - - let addr = get_cur_turn_address(game); - // Note here we empty the option - let placement: u8 = mark.placement.extract(); - if (game.gameboard.get_cell_by_index(placement) != MARK_EMPTY) { - mark.during_turn = true; - transfer::transfer(mark, addr); - return - }; - - // Apply turn - let mark_symbol = if (addr == game.x_addr) { - MARK_X - } else { - MARK_O - }; - * &mut game.gameboard[placement as u64] = mark_symbol; - - // Check for winner - let winner = game.get_winner(); - - // Game ended! - if (winner.is_some()) { - let played_as = winner.extract(); - let (winner, loser, finished) = if (played_as == MARK_X) { - (game.x_addr, game.o_addr, 1) - } else { - (game.o_addr, game.x_addr, 2) - }; - - transfer::transfer( - TicTacToeTrophy { - id: object::new(ctx), - winner, - loser, - played_as, - game_id: game.id.to_inner() - }, - winner +
+ +Toggle full source code + +{@inject: examples/tic-tac-toe/ui/src/hooks/useTransactions.ts} +
+ +### Placing a mark ([source](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/ui/src/pages/Game.tsx)) + +Placing a mark requires two transactions, just like the owned example, but they are both driven by one of the players. The first transaction is executed by the player as themselves, to send the mark to the game, and the second is executed by the player acting as the admin to place the mark they just sent. In the React frontend, this is performed as follows: + +```typescript title="examples/tic-tac-toe/ui/src/pages/Game.tsx" +function OwnedGame({ + game, + trophy, + invalidateGame, + invalidateTrophy, +}: { + game: GameData; + trophy: Trophy; + invalidateGame: InvalidateGameQuery; + invalidateTrophy: InvalidateTrophyQuery; +}): ReactElement { + const adminKey = game.admin ? new MultiSigPublicKey(new Uint8Array(game.admin)) : null; + + const client = useSuiClient(); + const signAndExecute = useExecutor(); + const multiSignAndExecute = useExecutor({ + execute: ({ bytes, signature }) => { + const multiSig = adminKey!!.combinePartialSignatures([signature]); + return client.executeTransactionBlock({ + transactionBlock: bytes, + signature: [multiSig, signature], + options: { + showRawEffects: true, + }, + }); + }, + }); + + const [turnCap, invalidateTurnCap] = useTurnCapQuery(game.id); + const account = useCurrentAccount(); + const tx = useTransactions()!!; + + // ... + + const onMove = (row: number, col: number) => { + signAndExecute( + { + tx: tx.sendMark(turnCap?.data!!, row, col), + options: { showObjectChanges: true }, + }, + ({ objectChanges }) => { + const mark = objectChanges?.find( + (c) => c.type === 'created' && c.objectType.endsWith('::Mark'), ); - mark.delete(); - * &mut game.finished = finished; - return - } else if (game.cur_turn >= 8) { // Draw - make.delete(); - * &mut game.finished = 3; - return - }; - - // Next turn - * &mut game.cur_turn = game.cur_turn + 1; - addr = game.get_cur_turn_address(); - mark.during_turn = true; - transfer::transfer(mark, addr); + if (mark && mark.type === 'created') { + const recv = tx.receiveMark(game, mark); + recv.setSender(adminKey!!.toSuiAddress()); + recv.setGasOwner(account?.address!!); + + multiSignAndExecute({ tx: recv }, () => { + invalidateGame(); + invalidateTrophy(); + invalidateTurnCap(); + }); + } + }, + ); + }; + + // ... } ``` -The first function is straightforward. The player sends the location of the mark to the multisig account. Then in the next function, the multisig actually places down the mark the player requested, as well as all the logic to check to see if there is a winner, end the game, and award a player a trophy if so, or to advance to the next player’s turn if not. See the [multisig_tic-tac-toe repo](https://github.com/MystenLabs/multisig_tic-tac-toe) for the full source code on this version of the game. +
+ +Toggle full source code + +{@inject: examples/tic-tac-toe/ui/src/pages/Game.tsx} +
+ +The first step is to get the multisig public key, which was written to `Game.admin` earlier. Then two executor hooks are created: The first is to sign and execute as the current player, and the second is to sign and execute as the multisig/admin account. After the wallet has serialized and signed the transaction the second executor creates a multisig from the wallet signature and executes the transaction with two signatures: Authorizing on behalf of the multisig and the wallet. + +The reason for the two signatures is clearer when looking at the construction of the `recv` transaction: The multisig authorizes access to the `Game`, and the wallet authorizes access to the gas object. This is because the multisig account does not hold any coins of its own, so it relies on the player account to sponsor the transaction. + +You can find an example React front-end supporting both the multi-sig and shared variants of the game in the [ui directory](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/ui), and a CLI written in Rust in the [cli directory](https://github.com/MystenLabs/sui/blob/main/examples/tic-tac-toe/cli). diff --git a/docs/site/src/css/custom.css b/docs/site/src/css/custom.css index 165ed525273b2..c0495d0e3399b 100644 --- a/docs/site/src/css/custom.css +++ b/docs/site/src/css/custom.css @@ -113,7 +113,7 @@ [data-theme='dark'] img.balance-coin-token { filter: invert(1); } - + /** navbar overrides */ .navbar-sidebar .menu__link { color: var(--ifm-navbar-sidebar-link-color); @@ -138,8 +138,9 @@ html[data-theme=light] .navbar-sidebar button.clean-btn.menu__caret { /** setup global style overrides */ -body { +body { font-family: var(--primaryFont); + tab-size: 2; } h1 { @@ -148,7 +149,6 @@ h1 { font-family: var(--primaryFont); font-weight: 500; letter-spacing: -0.04em; - } .h1 { @@ -369,4 +369,4 @@ h4 { .text-gray { color: var(--sui-gray); -} \ No newline at end of file +} diff --git a/examples/tic-tac-toe/README.md b/examples/tic-tac-toe/README.md new file mode 100644 index 0000000000000..4f70705d9b466 --- /dev/null +++ b/examples/tic-tac-toe/README.md @@ -0,0 +1,134 @@ +# Tic tac toe + +This is an end-to-end example for on-chain tic-tac-toe. It includes: + +- A [Move package](./move), containing two protocols for running a game of + tic-tac-toe. One that uses shared objects and consensus and another + that uses owned objects, and the fast path (no consensus). +- A [React front-end](./ui), in TypeScript built on top of + `create-react-dapp`, using the TS SDK and `dapp-kit`. +- A [Rust CLI](./cli), using the Rust SDK. +- [Scripts](./scripts) to publish packages and update configs used + while building the front-end and CLI. + +## Shared tic tac toe + +In the shared protocol, player X creates the `Game` as a shared object +and players take turns to place marks. Once the final move is made, a +`Trophy` is sent to any winning player (if there is one). After the +game has ended, anyone can `burn` the finished game to reclaim the +storage rebate (either of the players, or a third party). + +Validation rules in the Move package ensure that the sender of each +move corresponds to the address of the next player, and the game can +only be `burn`-ed if it has ended. + +``` mermaid +sequenceDiagram + Player X->>Game: new + Player X->>Game: place_mark + Player O->>Game: place_mark + Player X->>Game: ... + Player O->>+Game: ... + Game->>-Player O: [Trophy] + Player X->>Game: burn +``` + +## Owned tic tac toe + +In the owned protocol, player X creates the `Game` and sends it to an +impartial third party -- the Admin -- who manages players' access to +the game. + +Marks are placed in two steps: In the first step, the player creates a +`Mark` which describes the move they want to make and sends it to the +`Game` (using transfer to object). In the second step, the Admin +receives the `Mark` on the game and places it. + +Control of who makes the next move is decided using a `TurnCap`. +Initially Player X has the `TurnCap`. This capability must be consumed +to create a `Mark`, and when the admin places the mark, a new +`TurnCap` is created and sent to the next player, if the game has not +ended yet. + +As in the shared protocol, once the game has ended, a `Trophy` is sent +to any winning player. Unlike the shared protocol, only the admin can +clean-up the Game once it has finished, because only they have access +to it. + +``` mermaid +sequenceDiagram + activate Player X + Player X->>Admin: new: Game + Player X->>Player X: [TurnCap] + deactivate Player X + Player X->>Game: send_mark: Mark + activate Admin + Admin->>Game: place_mark + Admin->>Player O: [TurnCap] + deactivate Admin + Player O->>Game: send_mark: Mark + activate Admin + Admin->>Game: place_mark + Admin->>Player X: [TurnCap] + deactivate Admin + Player X->>Game: ... + Admin->>Game: ... + Player O->>Game: ... + activate Admin + Admin->>Game: place_mark + Admin->>Player O: [Trophy] + deactivate Admin + Admin->>Game: burn +``` + +## Multisig tic-tac-toe + +The owned protocol avoids consensus, but it requires trusting a third +party for liveness (The third party cannot make a false move, but it +can choose not to place a move, or simply forget to). That third party +may also need to run a service that keeps track of marks sent to games +in order to apply them promptly, which adds complexity. + +There is an alternative approach, which leverages Sui's support for +**multisigs** and **sponsored transactions**. Instead of entrusting +the Game to a third party, it is sent to an address owned by a 1-of-2 +multisig, signed for by Player X and Player O. + +Play proceeds as in the owned protocol, except that the Admin is the +multisig account. On each turn, the current player runs a transaction +as themselves to send the mark, and then runs a transaction on behalf +of the multisig to place it. + +Once play has finished, either player can run a transaction on behalf +of the multisig account to `burn` the game. As the player is the +sponsor, they will receive the storage rebate for performing the +clean-up. + +The multisig account does not own anything other than the game object +(it does not have any gas coins of its own), so the player sponsors +the transaction, using one of its own gas coins. + +Sharing a resource while avoiding consensus by transfering it to a +multisig account can be generalized from two accounts to a max of ten +(the limit being the number of keys that can be associated with one +multisig). + +In order to create a multisig, the public keys of all the signers +needs to be known. Each account address on Sui is the hash of a public +key, but this operation cannot be reversed, so in order to start a +multisig game, players must exchange public keys instead of addresses. + +## Pros and cons + +The shared protocol's main benefit is that its on-chain logic and +client integration are straightforward, and its main downside is that +it relies on consensus for ordering. + +In contrast, the owned protocol uses only fast-path transactions, but +its on-chain logic is more complicated because it needs to manage the +`TurnCap`, and its off-chain logic is complicated either by a third +party service to act as an Admin, or a multisig and sponsored +transaction setup. When using multisig, care also needs to be taken to +avoid equivocation, where the two players both try to execute a +transaction involving the `Game`. From aae6f5c37672095fb6e7ddc59683a52a92ff4f98 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Fri, 12 Jul 2024 22:16:30 +0100 Subject: [PATCH 019/163] [Examples] Remove references to `sui_programmability` in codebase (#18595) ## Description Replace all references to Move packages in `sui_programmability` with equivalents in `./examples/move`, in preparation for deleting the programmability directory. In the process, I also: - removed the tic-tac-toe example from the Sui SDK, as it has been replaced by a more full-featured E2E example. - ported some modernised versions of the `basics` packages into the new `examples/move/basics` for use in tests. ## Test plan CI and, ``` sui$ cargo simtest ``` ## Stack - #18525 - #18526 - #18557 - #18558 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: Ronny Roland --- crates/sui-core/src/test_utils.rs | 2 +- crates/sui-e2e-tests/tests/full_node_tests.rs | 13 +- .../src/metered_verifier.rs | 9 +- crates/sui-framework-tests/src/unit_tests.rs | 26 -- .../tests/rpc_server_tests.rs | 5 +- crates/sui-json/src/tests.rs | 285 ++++---------- crates/sui-proc-macros/src/lib.rs | 2 +- .../unit_tests/balance_changing_tx_tests.rs | 33 +- crates/sui-sdk/Cargo.toml | 5 - crates/sui-sdk/README.md | 34 +- crates/sui-sdk/examples/tic_tac_toe.rs | 368 ------------------ .../sui-test-transaction-builder/src/lib.rs | 14 +- docker/stress/Dockerfile | 2 +- examples/move/basics/sources/counter.move | 116 ++++++ .../move/basics/sources/object_basics.move | 63 +++ examples/move/basics/sources/random.move | 18 + .../move/basics/sources/resolve_args.move | 21 + 17 files changed, 340 insertions(+), 676 deletions(-) delete mode 100644 crates/sui-sdk/examples/tic_tac_toe.rs create mode 100644 examples/move/basics/sources/counter.move create mode 100644 examples/move/basics/sources/object_basics.move create mode 100644 examples/move/basics/sources/random.move create mode 100644 examples/move/basics/sources/resolve_args.move diff --git a/crates/sui-core/src/test_utils.rs b/crates/sui-core/src/test_utils.rs index bf5ef51b994e2..8786023364a24 100644 --- a/crates/sui-core/src/test_utils.rs +++ b/crates/sui-core/src/test_utils.rs @@ -191,7 +191,7 @@ pub fn create_fake_cert_and_effect_digest<'a>( } pub fn compile_basics_package() -> CompiledPackage { - compile_example_package("../../sui_programmability/examples/basics") + compile_example_package("../../examples/move/basics") } pub fn compile_managed_coin_package() -> CompiledPackage { diff --git a/crates/sui-e2e-tests/tests/full_node_tests.rs b/crates/sui-e2e-tests/tests/full_node_tests.rs index 43d7fc3becb15..841d149c8d4ae 100644 --- a/crates/sui-e2e-tests/tests/full_node_tests.rs +++ b/crates/sui-e2e-tests/tests/full_node_tests.rs @@ -22,7 +22,7 @@ use sui_sdk::wallet_context::WalletContext; use sui_storage::key_value_store::TransactionKeyValueStore; use sui_storage::key_value_store_metrics::KeyValueStoreMetrics; use sui_test_transaction_builder::{ - batch_make_transfer_transactions, create_devnet_nft, delete_devnet_nft, increment_counter, + batch_make_transfer_transactions, create_nft, delete_nft, increment_counter, publish_basics_package, publish_basics_package_and_make_counter, publish_nfts_package, TestTransactionBuilder, }; @@ -672,7 +672,7 @@ async fn test_full_node_event_read_api_ok() { // This is a poor substitute for the post processing taking some time sleep(Duration::from_millis(1000)).await; - let (_sender, _object_id, digest2) = create_devnet_nft(context, package_id).await; + let (_sender, _object_id, digest2) = create_nft(context, package_id).await; // Add a delay to ensure event processing is done after transaction commits. sleep(Duration::from_secs(5)).await; @@ -702,7 +702,7 @@ async fn test_full_node_event_query_by_module_ok() { // This is a poor substitute for the post processing taking some time sleep(Duration::from_millis(1000)).await; - let (_sender, _object_id, digest2) = create_devnet_nft(context, package_id).await; + let (_sender, _object_id, digest2) = create_nft(context, package_id).await; // Add a delay to ensure event processing is done after transaction commits. sleep(Duration::from_secs(5)).await; @@ -710,7 +710,7 @@ async fn test_full_node_event_query_by_module_ok() { // query by move event module let params = rpc_params![EventFilter::MoveEventModule { package: package_id, - module: ident_str!("devnet_nft").into() + module: ident_str!("testnet_nft").into() }]; let page: EventPage = jsonrpc_client .request("suix_queryEvents", params) @@ -980,7 +980,7 @@ async fn test_get_objects_read() -> Result<(), anyhow::Error> { let package_id = publish_nfts_package(&test_cluster.wallet).await.0; // Create the object - let (sender, object_id, _) = create_devnet_nft(&test_cluster.wallet, package_id).await; + let (sender, object_id, _) = create_nft(&test_cluster.wallet, package_id).await; let recipient = test_cluster.get_address_1(); assert_ne!(sender, recipient); @@ -1011,8 +1011,7 @@ async fn test_get_objects_read() -> Result<(), anyhow::Error> { .expect("Failed to transfer coins to recipient"); // Delete the object - let response = - delete_devnet_nft(&test_cluster.wallet, recipient, package_id, object_ref_v2).await; + let response = delete_nft(&test_cluster.wallet, recipient, package_id, object_ref_v2).await; assert_eq!( *response.effects.unwrap().status(), SuiExecutionStatus::Success diff --git a/crates/sui-framework-tests/src/metered_verifier.rs b/crates/sui-framework-tests/src/metered_verifier.rs index 9b276cd093341..0d30fe4febfbe 100644 --- a/crates/sui-framework-tests/src/metered_verifier.rs +++ b/crates/sui-framework-tests/src/metered_verifier.rs @@ -191,14 +191,12 @@ fn test_metered_move_bytecode_verifier() { // Check shared meter logic works across all publish in PT let mut packages = vec![]; let with_unpublished_deps = false; - let path = - PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../sui_programmability/examples/basics"); + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../examples/move/basics"); let package = build(&path).unwrap(); packages.push(package.get_dependency_sorted_modules(with_unpublished_deps)); packages.push(package.get_dependency_sorted_modules(with_unpublished_deps)); - let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("../../sui_programmability/examples/fungible_tokens"); + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../examples/move/coin"); let package = build(&path).unwrap(); packages.push(package.get_dependency_sorted_modules(with_unpublished_deps)); @@ -288,8 +286,7 @@ fn test_build_and_verify_programmability_examples() { let meter_config = protocol_config.meter_config(); let registry = &Registry::new(); let bytecode_verifier_metrics = Arc::new(BytecodeVerifierMetrics::new(registry)); - let examples = - PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../sui_programmability/examples"); + let examples = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../examples"); for example in std::fs::read_dir(examples).unwrap() { let Ok(example) = example else { continue }; diff --git a/crates/sui-framework-tests/src/unit_tests.rs b/crates/sui-framework-tests/src/unit_tests.rs index 928d30dd75168..c02aad95a77ee 100644 --- a/crates/sui-framework-tests/src/unit_tests.rs +++ b/crates/sui-framework-tests/src/unit_tests.rs @@ -52,32 +52,6 @@ fn run_bridge_tests() { check_move_unit_tests(&buf); } -#[test] -#[cfg_attr(msim, ignore)] -fn run_sui_programmability_examples_move_unit_tests() { - let examples_dir = Path::new(env!("CARGO_MANIFEST_DIR")) - .join("..") - .join("..") - .join("sui_programmability") - .join("examples"); - - for example in [ - "basics", - "capy", - "crypto", - "defi", - "fungible_tokens", - "games", - "move_tutorial", - "nfts", - "objects_tutorial", - ] { - let path = examples_dir.join(example); - check_package_builds(&path); - check_move_unit_tests(&path); - } -} - fn check_packages_recursively(path: &Path) -> io::Result<()> { for entry in fs::read_dir(path).unwrap() { let entry = entry?; diff --git a/crates/sui-json-rpc-tests/tests/rpc_server_tests.rs b/crates/sui-json-rpc-tests/tests/rpc_server_tests.rs index 4bbe6f20feace..e566183954a94 100644 --- a/crates/sui-json-rpc-tests/tests/rpc_server_tests.rs +++ b/crates/sui-json-rpc-tests/tests/rpc_server_tests.rs @@ -188,9 +188,8 @@ async fn test_publish() -> Result<(), anyhow::Error> { .await?; let gas = objects.data.first().unwrap().object().unwrap(); - let compiled_package = BuildConfig::new_for_testing().build(Path::new( - "../../sui_programmability/examples/fungible_tokens", - ))?; + let compiled_package = + BuildConfig::new_for_testing().build(Path::new("../../examples/move/basics"))?; let compiled_modules_bytes = compiled_package.get_package_base64(/* with_unpublished_deps */ false); let dependencies = compiled_package.get_dependency_original_package_ids(); diff --git a/crates/sui-json/src/tests.rs b/crates/sui-json/src/tests.rs index ee23f210d2d2c..a73e51e8cecfc 100644 --- a/crates/sui-json/src/tests.rs +++ b/crates/sui-json/src/tests.rs @@ -9,6 +9,7 @@ use move_core_types::annotated_value::{MoveFieldLayout, MoveStructLayout, MoveTy use move_core_types::language_storage::StructTag; use move_core_types::u256::U256; use move_core_types::{account_address::AccountAddress, ident_str, identifier::Identifier}; +use serde::Serialize; use serde_json::{json, Value}; use test_fuzz::runtime::num_traits::ToPrimitive; @@ -417,8 +418,7 @@ fn test_basic_args_linter_pure_args_good() { #[test] fn test_basic_args_linter_top_level() { - let path = - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../sui_programmability/examples/nfts"); + let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../examples/move/basics"); let compiled_modules = BuildConfig::new_for_testing() .build(&path) .unwrap() @@ -429,236 +429,81 @@ fn test_basic_args_linter_top_level() { BuiltInFramework::genesis_move_packages(), ) .unwrap(); - let example_package = example_package.data.try_as_package().unwrap(); - - let module = Identifier::new("geniteam").unwrap(); - let function = Identifier::new("create_monster").unwrap(); - - /* - Function signature: - public fun create_monster( - _player: &mut Player, - farm: &mut Farm, - pet_monsters: &mut Collection, - monster_name: vector, - monster_img_index: u64, - breed: u8, - monster_affinity: u8, - monster_description: vector, - display: vector, - ctx: &mut TxContext - ) - */ - - let monster_name_raw = "MonsterName"; - let monster_img_id_raw = "12345678"; - let breed_raw = 89; - let monster_affinity_raw = 200; - let monster_description_raw = "MonsterDescription"; - let display_raw = "DisplayUrl"; - - let player_id = json!(format!("0x{}", ObjectID::random())); - // This is okay since not starting with 0x - let monster_name = json!(monster_name_raw); - // Well within U64 bounds - let monster_img_id = json!(monster_img_id_raw); - // Well within U8 bounds - let breed = json!(breed_raw); - // Well within U8 bounds - let monster_affinity = json!(monster_affinity_raw); - // This is okay since not starting with 0x - let monster_description = json!(monster_description_raw); - // This is okay since not starting with 0x - let display = json!(display_raw); - - // They have to be ordered - let args = vec![ - player_id, - monster_name.clone(), - monster_img_id.clone(), - breed, - monster_affinity.clone(), - monster_description.clone(), - display.clone(), + let package = example_package.data.try_as_package().unwrap(); + + let module = Identifier::new("resolve_args").unwrap(); + let function = Identifier::new("foo").unwrap(); + + // Function signature: + // foo( + // _foo: &mut Foo, + // _bar: vector, + // _name: vector, + // _index: u64, + // _flag: u8, + // _recipient: address, + // _ctx: &mut TxContext, + // ) + + let foo_id = ObjectID::random(); + let bar_id = ObjectID::random(); + let baz_id = ObjectID::random(); + let recipient_addr = SuiAddress::random_for_testing_only(); + + let foo = json!(foo_id.to_canonical_string(/* with_prefix */ true)); + let bar = json!([ + bar_id.to_canonical_string(/* with_prefix */ true), + baz_id.to_canonical_string(/* with_prefix */ true), + ]); + + let name = json!("Name"); + let index = json!("12345678"); + let flag = json!(89); + let recipient = json!(recipient_addr.to_string()); + + let args: Vec<_> = [ + foo.clone(), + bar.clone(), + name.clone(), + index.clone(), + flag, + recipient.clone(), ] - .iter() + .into_iter() .map(|q| SuiJsonValue::new(q.clone()).unwrap()) .collect(); - let json_args = - resolve_move_function_args(example_package, module.clone(), function.clone(), &[], args) - .unwrap(); - - assert!(!json_args.is_empty()); - - assert_eq!( - json_args[1].0, - ResolvedCallArg::Pure(bcs::to_bytes(&monster_name_raw.as_bytes().to_vec()).unwrap()) - ); - assert_eq!( - json_args[2].0, - ResolvedCallArg::Pure( - bcs::to_bytes(&(monster_img_id_raw.parse::().unwrap())).unwrap() - ), - ); - assert_eq!( - json_args[3].0, - ResolvedCallArg::Pure(bcs::to_bytes(&(breed_raw as u8)).unwrap()) - ); - assert_eq!( - json_args[4].0, - ResolvedCallArg::Pure(bcs::to_bytes(&(monster_affinity_raw as u8)).unwrap()), - ); - assert_eq!( - json_args[5].0, - ResolvedCallArg::Pure(bcs::to_bytes(&monster_description_raw.as_bytes().to_vec()).unwrap()), - ); - - // Breed is u8 so too large - let args = vec![ - monster_name, - monster_img_id, - json!(10000u64), - monster_affinity, - monster_description, - display, - ] - .iter() - .map(|q| SuiJsonValue::new(q.clone()).unwrap()) - .collect(); - assert!(resolve_move_function_args(example_package, module, function, &[], args,).is_err()); - - // Test with vecu8 as address - let path = - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../sui_programmability/examples/basics"); - let compiled_modules = BuildConfig::new_for_testing() - .build(&path) - .unwrap() - .into_modules(); - let example_package = Object::new_package_for_testing( - &compiled_modules, - TransactionDigest::genesis_marker(), - BuiltInFramework::genesis_move_packages(), - ) - .unwrap(); - let framework_pkg = example_package.data.try_as_package().unwrap(); - - let module = Identifier::new("object_basics").unwrap(); - let function = Identifier::new("create").unwrap(); - - /* - Function signature: - public fun create(value: u64, recipient: vector, ctx: &mut TxContext) - */ - let value_raw = "29897"; - let address = SuiAddress::random_for_testing_only(); - - let value = json!(value_raw); - // Encode as hex string - let addr = json!(format!("{address}")); - - // They have to be ordered - let args = [value, addr] - .iter() - .map(|q| SuiJsonValue::new(q.clone()).unwrap()) - .collect(); - - let args = resolve_move_function_args(framework_pkg, module, function, &[], args).unwrap(); + let json_args: Vec<_> = + resolve_move_function_args(package, module.clone(), function.clone(), &[], args) + .unwrap() + .into_iter() + .map(|(arg, _)| arg) + .collect(); - assert_eq!( - args[0].0, - ResolvedCallArg::Pure(bcs::to_bytes(&(value_raw.parse::().unwrap())).unwrap()) - ); + use ResolvedCallArg as RCA; + fn pure(t: &T) -> RCA { + RCA::Pure(bcs::to_bytes(t).unwrap()) + } - // Need to verify this specially - // BCS serialzes addresses like vectors so there's a length prefix, which makes the vec longer by 1 assert_eq!( - args[1].0, - ResolvedCallArg::Pure(bcs::to_bytes(&AccountAddress::from(address)).unwrap()), + json_args, + vec![ + RCA::Object(foo_id), + RCA::ObjVec(vec![bar_id, baz_id]), + pure(&"Name"), + pure(&12345678u64), + pure(&89u8), + pure(&recipient_addr), + ], ); - // Test with object args - - let module = Identifier::new("object_basics").unwrap(); - let function = Identifier::new("transfer").unwrap(); - - /* - Function signature: - public fun transfer(o: Object, recipient: vector, _ctx: &mut TxContext) - */ - let object_id_raw = ObjectID::random(); - let address = SuiAddress::random_for_testing_only(); - - let object_id = json!(format!("{object_id_raw}")); - // Encode as hex string - let addr = json!(format!("{address}")); - - // They have to be ordered - let args = [object_id, addr] - .iter() + // Flag is u8 so too large + let args: Vec<_> = [foo, bar, name, index, json!(10000u64), recipient] + .into_iter() .map(|q| SuiJsonValue::new(q.clone()).unwrap()) .collect(); - let args = resolve_move_function_args(framework_pkg, module, function, &[], args).unwrap(); - - assert_eq!( - args[0].0, - ResolvedCallArg::Object( - ObjectID::from_hex_literal(&format!("0x{}", object_id_raw)).unwrap() - ) - ); - - // Need to verify this specially - // BCS serialzes addresses like vectors so there's a length prefix, which makes the vec longer by 1 - assert_eq!( - args[1].0, - ResolvedCallArg::Pure(bcs::to_bytes(&AccountAddress::from(address)).unwrap()) - ); - - // Test with object vector args - let path = Path::new(env!("CARGO_MANIFEST_DIR")) - .join("../sui-core/src/unit_tests/data/entry_point_vector"); - let compiled_modules = BuildConfig::new_for_testing() - .build(&path) - .unwrap() - .into_modules(); - let example_package = Object::new_package_for_testing( - &compiled_modules, - TransactionDigest::genesis_marker(), - BuiltInFramework::genesis_move_packages(), - ) - .unwrap(); - let example_package = example_package.data.try_as_package().unwrap(); - - let module = Identifier::new("entry_point_vector").unwrap(); - let function = Identifier::new("two_obj_vec_destroy").unwrap(); - - /* - Function signature: - public entry fun two_obj_vec_destroy(v: vector, _: &mut TxContext) - */ - let object_id_raw1 = ObjectID::random(); - let object_id_raw2 = ObjectID::random(); - let object_id1 = json!(format!("0x{}", object_id_raw1)); - let object_id2 = json!(format!("0x{}", object_id_raw2)); - - let args = vec![SuiJsonValue::new(Value::Array(vec![object_id1, object_id2])).unwrap()]; - - let args = resolve_move_function_args(example_package, module, function, &[], args).unwrap(); - - assert!(matches!(args[0].0, ResolvedCallArg::ObjVec { .. })); - - if let ResolvedCallArg::ObjVec(vec) = &args[0].0 { - assert_eq!(vec.len(), 2); - assert_eq!( - vec[0], - ObjectID::from_hex_literal(&format!("0x{}", object_id_raw1)).unwrap() - ); - assert_eq!( - vec[1], - ObjectID::from_hex_literal(&format!("0x{}", object_id_raw2)).unwrap() - ); - } + assert!(resolve_move_function_args(package, module, function, &[], args,).is_err()); } #[test] diff --git a/crates/sui-proc-macros/src/lib.rs b/crates/sui-proc-macros/src/lib.rs index d3844a7b195cf..ab0fca56a7f46 100644 --- a/crates/sui-proc-macros/src/lib.rs +++ b/crates/sui-proc-macros/src/lib.rs @@ -58,7 +58,7 @@ pub fn init_static_initializers(_args: TokenStream, item: TokenStream) -> TokenS register_package_hooks(Box::new(SuiPackageHooks {})); let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.extend(["..", "..", "sui_programmability", "examples", "basics"]); + path.extend(["..", "..", "examples", "move", "basics"]); let mut build_config = BuildConfig::default(); build_config.config.install_dir = Some(TempDir::new().unwrap().into_path()); diff --git a/crates/sui-rosetta/src/unit_tests/balance_changing_tx_tests.rs b/crates/sui-rosetta/src/unit_tests/balance_changing_tx_tests.rs index 2a548ee28336d..b0dba64531281 100644 --- a/crates/sui-rosetta/src/unit_tests/balance_changing_tx_tests.rs +++ b/crates/sui-rosetta/src/unit_tests/balance_changing_tx_tests.rs @@ -5,6 +5,7 @@ use crate::operations::Operations; use crate::types::{ConstructionMetadata, OperationStatus, OperationType}; use anyhow::anyhow; use move_core_types::identifier::Identifier; +use move_core_types::language_storage::StructTag; use rand::seq::{IteratorRandom, SliceRandom}; use serde_json::json; use shared_crypto::intent::Intent; @@ -34,6 +35,7 @@ use sui_types::transaction::{ TEST_ONLY_GAS_UNIT_FOR_HEAVY_COMPUTATION_STORAGE, TEST_ONLY_GAS_UNIT_FOR_SPLIT_COIN, TEST_ONLY_GAS_UNIT_FOR_STAKING, TEST_ONLY_GAS_UNIT_FOR_TRANSFER, }; +use sui_types::TypeTag; use test_cluster::TestClusterBuilder; #[tokio::test] @@ -138,13 +140,7 @@ async fn test_publish_and_move_call() { let addresses = network.get_addresses(); let sender = get_random_address(&addresses, vec![]); let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.extend([ - "..", - "..", - "sui_programmability", - "examples", - "fungible_tokens", - ]); + path.extend(["..", "..", "examples", "move", "coin"]); let compiled_package = BuildConfig::new_for_testing().build(&path).unwrap(); let compiled_modules_bytes = compiled_package.get_package_bytes(/* with_unpublished_deps */ false); @@ -181,8 +177,18 @@ async fn test_publish_and_move_call() { }) .unwrap(); - // TODO: Improve tx response to make it easier to find objects. - let treasury = find_module_object(&object_changes, "::TreasuryCap"); + let treasury = find_module_object(&object_changes, |type_| { + if type_.name.as_str() != "TreasuryCap" { + return false; + } + + let Some(TypeTag::Struct(otw)) = type_.type_params.first() else { + return false; + }; + + otw.name.as_str() == "MY_COIN" + }); + let treasury = treasury.clone().reference.to_object_ref(); let recipient = *addresses.choose(&mut OsRng).unwrap(); let pt = { @@ -190,7 +196,7 @@ async fn test_publish_and_move_call() { builder .move_call( *package, - Identifier::from_str("managed").unwrap(), + Identifier::from_str("my_coin").unwrap(), Identifier::from_str("mint").unwrap(), vec![], vec![ @@ -630,7 +636,10 @@ async fn test_delegation_parsing() -> Result<(), anyhow::Error> { Ok(()) } -fn find_module_object(changes: &[ObjectChange], object_type_name: &str) -> OwnedObjectRef { +fn find_module_object( + changes: &[ObjectChange], + type_pred: impl Fn(&StructTag) -> bool, +) -> OwnedObjectRef { let mut results: Vec<_> = changes .iter() .filter_map(|change| { @@ -643,7 +652,7 @@ fn find_module_object(changes: &[ObjectChange], object_type_name: &str) -> Owned .. } = change { - if object_type.to_string().contains(object_type_name) { + if type_pred(object_type) { return Some(OwnedObjectRef { owner: *owner, reference: SuiObjectRef { diff --git a/crates/sui-sdk/Cargo.toml b/crates/sui-sdk/Cargo.toml index 8203edde38044..f6126c5f09344 100644 --- a/crates/sui-sdk/Cargo.toml +++ b/crates/sui-sdk/Cargo.toml @@ -48,11 +48,6 @@ futures-core.workspace = true futures.workspace = true rand.workspace = true -[[example]] -name = "tic_tac_toe" -path = "examples/tic_tac_toe.rs" -test = false - [[example]] name = "coin_read_api" path = "examples/coin_read_api.rs" diff --git a/crates/sui-sdk/README.md b/crates/sui-sdk/README.md index 7ffd0273b2ea0..fc33635a66140 100644 --- a/crates/sui-sdk/README.md +++ b/crates/sui-sdk/README.md @@ -10,7 +10,7 @@ tokio = { version = "1.2", features = ["full"] } anyhow = "1.0" ``` -The main building block for the Sui Rust SDK is the `SuiClientBuilder`, which provides a simple and straightforward way of connecting to a Sui network and having access to the different available APIs. +The main building block for the Sui Rust SDK is the `SuiClientBuilder`, which provides a simple and straightforward way of connecting to a Sui network and having access to the different available APIs. In the following example, the application connects to the Sui `testnet` and `devnet` networks and prints out their respective RPC API versions. @@ -54,7 +54,7 @@ There are serveral files ending in `_api.rs` which provide code examples of the ### Prerequisites -Unless otherwise specified, most of these examples assume `Rust` and `cargo` are installed, and that there is an available internet connection. The examples connect to the Sui testnet (`https://fullnode.testnet.sui.io:443`) and execute different APIs using the active address from the local wallet. If there is no local wallet, it will create one, generate two addresses, set one of them to be active, and it will request 1 SUI from the testnet faucet for the active address. +Unless otherwise specified, most of these examples assume `Rust` and `cargo` are installed, and that there is an available internet connection. The examples connect to the Sui testnet (`https://fullnode.testnet.sui.io:443`) and execute different APIs using the active address from the local wallet. If there is no local wallet, it will create one, generate two addresses, set one of them to be active, and it will request 1 SUI from the testnet faucet for the active address. ### Running the existing examples @@ -78,9 +78,9 @@ The `SuiClientBuilder` struct provides a connection to the JSON-RPC server that - Testnet: https://fullnode.testnet.sui.io:443 - Mainnet: https://fullnode.mainnet.sui.io:443 -For all available servers, see [here](https://sui.io/networkinfo). +For all available servers, see [here](https://sui.io/networkinfo). -For running a local Sui network, please follow [this guide](https://docs.sui.io/build/sui-local-network) for installing Sui and [this guide](https://docs.sui.io/build/sui-local-network#start-the-local-network) for starting the local Sui network. +For running a local Sui network, please follow [this guide](https://docs.sui.io/build/sui-local-network) for installing Sui and [this guide](https://docs.sui.io/build/sui-local-network#start-the-local-network) for starting the local Sui network. ```rust @@ -121,7 +121,7 @@ async fn main() -> Result<(), anyhow::Error> { println!("Sui local network version: {}", sui_local.api_version()); let active_address = SuiAddress::from_str("")?; // change to your Sui address - + let total_balance = sui_local .coin_read_api() .get_all_balances(active_address) @@ -139,7 +139,7 @@ See the programmable transactions [example](https://github.com/MystenLabs/sui/bl ### Tic Tac Toe quick start -1. Prepare the environment +1. Prepare the environment 1. Install `sui` binary following the [Sui installation](https://github.com/MystenLabs/sui/blob/main/docs/content/guides/developer/getting-started/sui-install.mdx) docs. 1. [Connect to Sui Devnet](https://github.com/MystenLabs/sui/blob/main/docs/content/guides/developer/getting-started/connect.mdx). 1. [Make sure you have two addresses with gas](https://github.com/MystenLabs/sui/blob/main/docs/content/guides/developer/getting-started/get-address.mdx) by using the `new-address` command to create new addresses: @@ -152,32 +152,28 @@ See the programmable transactions [example](https://github.com/MystenLabs/sui/bl 2. Publish the move contract 1. [Download the Sui source code](https://github.com/MystenLabs/sui/blob/main/docs/content/guides/developer/getting-started/sui-install.mdx). - 1. Publish the [`games` package](https://github.com/MystenLabs/sui/tree/main/sui_programmability/examples/games) + 1. Publish the [`tic-tac-toe` package](https://github.com/MystenLabs/sui/tree/main/examples/tic-tac-toe/move) using the Sui client: ```shell - sui client publish --path /path-to-sui-source-code/sui_programmability/examples/games --gas-budget 10000 + sui client publish --path /path-to-sui-source-code/examples/tic-tac-toe/move ``` 1. Record the package object ID. 3. Create a new tic-tac-toe game - 1. Run the following command in the Sui source code directory to start a new game, replacing the game package objects ID with the one you recorded: - ```shell - cargo run --example tic-tac-toe -- --game-package-id <> new-game - ``` - This will create a game for the first two addresses in your keystore by default. If you want to specify the identity of each player, - use the following command and replace the variables with the actual player's addresses: + 1. Run the following command in the [`tic-tac-toe/cli` directory](https://github.com/MystenLabs/sui/tree/main/examples/tic-tac-toe/cli) to start a new game, replacing the game package objects ID with the one you recorded: ```shell - cargo run --example tic-tac-toe -- --game-package-id <> new-game --player-x <> --player-o <> + cargo run -- new --package-id <> <> ``` + This will create a game between the active address in the keystore, and the specified Player O. 1. Copy the game ID and pass it to your friend to join the game. -4. Joining the game +4. Making a move - Run the following command in the Sui source code directory to join the game, replacing the game ID and address accordingly: + Run the following command in the [`tic-tac-toe/cli` directory](https://github.com/MystenLabs/sui/tree/main/examples/tic-tac-toe/cli) to make a move in an existing game, as the active address in the CLI, replacing the game ID and address accordingly: ```shell - cargo run --example tic-tac-toe -- --game-package-id <> join-game --my-identity <
> --game-id <> + cargo run -- move --package-id <> --row $R --col $C <> ``` ## License -[SPDX-License-Identifier: Apache-2.0](https://github.com/MystenLabs/sui/blob/main/LICENSE) +[SPDX-License-Identifier: Apache-2.0](https://github.com/MystenLabs/sui/blob/main/LICENSE) diff --git a/crates/sui-sdk/examples/tic_tac_toe.rs b/crates/sui-sdk/examples/tic_tac_toe.rs deleted file mode 100644 index aa8d327d24917..0000000000000 --- a/crates/sui-sdk/examples/tic_tac_toe.rs +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -use std::io::{stdin, stdout, Write}; -use std::path::PathBuf; -use std::str::FromStr; -use std::thread; -use std::time::Duration; - -use anyhow::anyhow; -use async_recursion::async_recursion; -use clap::Parser; -use clap::Subcommand; -use serde::Deserialize; - -use shared_crypto::intent::Intent; -use sui_json_rpc_types::{SuiObjectDataOptions, SuiTransactionBlockResponseOptions}; -use sui_keys::keystore::{AccountKeystore, FileBasedKeystore, Keystore}; -use sui_sdk::{ - json::SuiJsonValue, - rpc_types::{SuiData, SuiTransactionBlockEffectsAPI}, - types::{ - base_types::{ObjectID, SuiAddress}, - id::UID, - transaction::Transaction, - }, - SuiClient, SuiClientBuilder, -}; -use sui_types::quorum_driver_types::ExecuteTransactionRequestType; - -#[tokio::main] -async fn main() -> Result<(), anyhow::Error> { - let opts: TicTacToeOpts = TicTacToeOpts::parse(); - let keystore_path = opts.keystore_path.unwrap_or_else(default_keystore_path); - let keystore = Keystore::File(FileBasedKeystore::new(&keystore_path)?); - - let game = TicTacToe { - game_package_id: opts.game_package_id, - client: SuiClientBuilder::default() - .build(opts.rpc_server_url) - .await?, - keystore, - }; - - match opts.subcommand { - TicTacToeCommand::NewGame { player_x, player_o } => { - game.create_game(player_x, player_o).await?; - } - TicTacToeCommand::JoinGame { - my_identity, - game_id, - } => { - game.join_game(game_id, my_identity).await?; - } - } - - Ok(()) -} - -struct TicTacToe { - game_package_id: ObjectID, - client: SuiClient, - keystore: Keystore, -} - -impl TicTacToe { - async fn create_game( - &self, - player_x: Option, - player_o: Option, - ) -> Result<(), anyhow::Error> { - // Default player identity to first and second keys in the keystore if not provided. - let player_x = player_x.unwrap_or_else(|| self.keystore.addresses()[0]); - let player_o = player_o.unwrap_or_else(|| self.keystore.addresses()[1]); - - // Create a move call transaction using the TransactionBuilder API. - let create_game_call = self - .client - .transaction_builder() - .move_call( - player_x, - self.game_package_id, - "shared_tic_tac_toe", - "create_game", - vec![], - vec![ - SuiJsonValue::from_str(&player_x.to_string())?, - SuiJsonValue::from_str(&player_o.to_string())?, - ], - None, // The node will pick a gas object belong to the signer if not provided. - 1000, - None, - ) - .await?; - - // Sign transaction. - let signature = - self.keystore - .sign_secure(&player_x, &create_game_call, Intent::sui_transaction())?; - - // Execute the transaction. - - let response = self - .client - .quorum_driver_api() - .execute_transaction_block( - Transaction::from_data(create_game_call, vec![signature]), - SuiTransactionBlockResponseOptions::full_content(), - Some(ExecuteTransactionRequestType::WaitForLocalExecution), - ) - .await?; - - assert!(response.confirmed_local_execution.unwrap()); - - // We know `create_game` move function will create 1 object. - let game_id = response - .effects - .as_ref() - .unwrap() - .created() - .first() - .unwrap() - .reference - .object_id; - - println!("Created new game, game id : [{}]", game_id); - println!("Player X : {}", player_x); - println!("Player O : {}", player_o); - - self.join_game(game_id, player_x).await?; - Ok(()) - } - - async fn join_game( - &self, - game_id: ObjectID, - my_identity: SuiAddress, - ) -> Result<(), anyhow::Error> { - let game_state = self.fetch_game_state(game_id).await?; - if game_state.o_address == my_identity { - println!("You are player O") - } else if game_state.x_address == my_identity { - println!("You are player X") - } else { - return Err(anyhow!("You are not invited to the game.")); - } - self.next_turn(my_identity, game_state).await - } - - #[async_recursion] - async fn next_turn( - &self, - my_identity: SuiAddress, - game_state: TicTacToeState, - ) -> Result<(), anyhow::Error> { - game_state.print_game_board(); - - // return if game ended. - if game_state.game_status != 0 { - println!("Game ended."); - match game_state.game_status { - 1 => println!("Player X won!"), - 2 => println!("Player O won!"), - 3 => println!("It's a draw!"), - _ => {} - } - return Ok(()); - } - - if game_state.is_my_turn(my_identity) { - println!("It's your turn!"); - let row = get_row_col_input(true) - 1; - let col = get_row_col_input(false) - 1; - - // Create a move call transaction using the TransactionBuilder API. - let place_mark_call = self - .client - .transaction_builder() - .move_call( - my_identity, - self.game_package_id, - "shared_tic_tac_toe", - "place_mark", - vec![], - vec![ - SuiJsonValue::from_str(&game_state.info.object_id().to_hex_literal())?, - SuiJsonValue::from_str(&row.to_string())?, - SuiJsonValue::from_str(&col.to_string())?, - ], - None, - 1000, - None, - ) - .await?; - - // Sign transaction. - let signature = self.keystore.sign_secure( - &my_identity, - &place_mark_call, - Intent::sui_transaction(), - )?; - - // Execute the transaction. - let response = self - .client - .quorum_driver_api() - .execute_transaction_block( - Transaction::from_data(place_mark_call, vec![signature]), - SuiTransactionBlockResponseOptions::new().with_effects(), - Some(ExecuteTransactionRequestType::WaitForLocalExecution), - ) - .await?; - - assert!(response.confirmed_local_execution.unwrap()); - - // Print any execution error. - let status = response.effects.as_ref().unwrap().status(); - if status.is_err() { - eprintln!("{:?}", status); - } - // Proceed to next turn. - self.next_turn( - my_identity, - self.fetch_game_state(*game_state.info.object_id()).await?, - ) - .await?; - } else { - println!("Waiting for opponent..."); - // Sleep until my turn. - while !self - .fetch_game_state(*game_state.info.object_id()) - .await? - .is_my_turn(my_identity) - { - thread::sleep(Duration::from_secs(1)); - } - self.next_turn( - my_identity, - self.fetch_game_state(*game_state.info.object_id()).await?, - ) - .await?; - }; - Ok(()) - } - - // Retrieve the latest game state from the server. - async fn fetch_game_state(&self, game_id: ObjectID) -> Result { - // Get the raw BCS serialised move object data - let current_game = self - .client - .read_api() - .get_object_with_options(game_id, SuiObjectDataOptions::new().with_bcs()) - .await?; - current_game - .object()? - .bcs - .as_ref() - .unwrap() - .try_as_move() - .unwrap() - .deserialize() - } -} - -// Helper function for getting console input -fn get_row_col_input(is_row: bool) -> u8 { - let r_c = if is_row { "row" } else { "column" }; - print!("Enter {} number (1-3) : ", r_c); - let _ = stdout().flush(); - let mut s = String::new(); - stdin() - .read_line(&mut s) - .expect("Did not enter a correct string"); - - if let Ok(number) = s.trim().parse() { - if number > 0 && number < 4 { - return number; - } - } - get_row_col_input(is_row) -} - -// Clap command line args parser -#[derive(Parser)] -#[clap( - name = "tic-tac-toe", - about = "A Byzantine fault tolerant Tic-Tac-Toe with low-latency finality and high throughput", - rename_all = "kebab-case" -)] -struct TicTacToeOpts { - #[clap(long)] - game_package_id: ObjectID, - #[clap(long)] - keystore_path: Option, - #[clap(long, default_value = "https://fullnode.devnet.sui.io:443")] - rpc_server_url: String, - #[clap(subcommand)] - subcommand: TicTacToeCommand, -} - -fn default_keystore_path() -> PathBuf { - match dirs::home_dir() { - Some(v) => v.join(".sui").join("sui_config").join("sui.keystore"), - None => panic!("Cannot obtain home directory path"), - } -} - -#[derive(Subcommand)] -#[clap(rename_all = "kebab-case")] -enum TicTacToeCommand { - NewGame { - #[clap(long)] - player_x: Option, - #[clap(long)] - player_o: Option, - }, - JoinGame { - #[clap(long)] - my_identity: SuiAddress, - #[clap(long)] - game_id: ObjectID, - }, -} - -// Data structure mirroring move object `games::shared_tic_tac_toe::TicTacToe` for deserialization. -#[derive(Deserialize, Debug)] -struct TicTacToeState { - info: UID, - gameboard: Vec>, - cur_turn: u8, - game_status: u8, - x_address: SuiAddress, - o_address: SuiAddress, -} - -impl TicTacToeState { - fn print_game_board(&self) { - println!(" 1 2 3"); - print!(" ┌-----┬-----┬-----┐"); - let mut row_num = 1; - for row in &self.gameboard { - println!(); - print!("{} ", row_num); - for cell in row { - let mark = match cell { - 0 => "X", - 1 => "O", - _ => " ", - }; - print!("| {} ", mark) - } - println!("|"); - print!(" ├-----┼-----┼-----┤"); - row_num += 1; - } - print!("\r"); - println!(" └-----┴-----┴-----┘"); - } - - fn is_my_turn(&self, my_identity: SuiAddress) -> bool { - let current_player = if self.cur_turn % 2 == 0 { - self.x_address - } else { - self.o_address - }; - current_player == my_identity - } -} diff --git a/crates/sui-test-transaction-builder/src/lib.rs b/crates/sui-test-transaction-builder/src/lib.rs index ff230b4208279..95a27462e3508 100644 --- a/crates/sui-test-transaction-builder/src/lib.rs +++ b/crates/sui-test-transaction-builder/src/lib.rs @@ -149,8 +149,8 @@ impl TestTransactionBuilder { pub fn call_nft_create(self, package_id: ObjectID) -> Self { self.move_call( package_id, - "devnet_nft", - "mint", + "testnet_nft", + "mint_to_sender", vec![ CallArg::Pure(bcs::to_bytes("example_nft_name").unwrap()), CallArg::Pure(bcs::to_bytes("example_nft_description").unwrap()), @@ -164,7 +164,7 @@ impl TestTransactionBuilder { pub fn call_nft_delete(self, package_id: ObjectID, nft_to_delete: ObjectRef) -> Self { self.move_call( package_id, - "devnet_nft", + "testnet_nft", "burn", vec![CallArg::Object(ObjectArg::ImmOrOwnedObject(nft_to_delete))], ) @@ -264,7 +264,7 @@ impl TestTransactionBuilder { path } else { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.extend(["..", "..", "sui_programmability", "examples", subpath]); + path.extend(["..", "..", "examples", "move", subpath]); path }; self.publish(path) @@ -661,7 +661,7 @@ pub async fn publish_nfts_package( let gas_price = context.get_reference_gas_price().await.unwrap(); let txn = context.sign_transaction( &TestTransactionBuilder::new(sender, gas_object, gas_price) - .publish_examples("nfts") + .publish_examples("nft") .build(), ); let resp = context.execute_transaction_must_succeed(txn).await; @@ -672,7 +672,7 @@ pub async fn publish_nfts_package( /// Pre-requisite: `publish_nfts_package` must be called before this function. Executes a /// transaction to create an NFT and returns the sender address, the object id of the NFT, and the /// digest of the transaction. -pub async fn create_devnet_nft( +pub async fn create_nft( context: &WalletContext, package_id: ObjectID, ) -> (SuiAddress, ObjectID, TransactionDigest) { @@ -700,7 +700,7 @@ pub async fn create_devnet_nft( } /// Executes a transaction to delete the given NFT. -pub async fn delete_devnet_nft( +pub async fn delete_nft( context: &WalletContext, sender: SuiAddress, package_id: ObjectID, diff --git a/docker/stress/Dockerfile b/docker/stress/Dockerfile index 71d7f09b53be3..e5202c0ba0657 100644 --- a/docker/stress/Dockerfile +++ b/docker/stress/Dockerfile @@ -7,7 +7,7 @@ ARG SUI_TOOLS_IMAGE_TAG RUN apt-get update && apt-get -y --no-install-recommends install wget=1.21-1+deb11u1 \ iputils-ping netcat procps bind9-host bind9-dnsutils curl iproute2 git ca-certificates awscli -# stress needs access to sui_programmability/examples/basics +# stress needs access to examples/move/basics RUN git clone https://github.com/MystenLabs/sui.git ; \ cd sui ; \ git checkout $SUI_TOOLS_IMAGE_TAG ; \ diff --git a/examples/move/basics/sources/counter.move b/examples/move/basics/sources/counter.move new file mode 100644 index 0000000000000..60521cbddbdf0 --- /dev/null +++ b/examples/move/basics/sources/counter.move @@ -0,0 +1,116 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// This example demonstrates a basic use of a shared object. +/// Rules: +/// - anyone can create and share a counter +/// - everyone can increment a counter by 1 +/// - the owner of the counter can reset it to any value +module basics::counter { + /// A shared counter. + public struct Counter has key { + id: UID, + owner: address, + value: u64 + } + + public fun owner(counter: &Counter): address { + counter.owner + } + + public fun value(counter: &Counter): u64 { + counter.value + } + + /// Create and share a Counter object. + public fun create(ctx: &mut TxContext) { + transfer::share_object(Counter { + id: object::new(ctx), + owner: tx_context::sender(ctx), + value: 0 + }) + } + + /// Increment a counter by 1. + public fun increment(counter: &mut Counter) { + counter.value = counter.value + 1; + } + + /// Set value (only runnable by the Counter owner) + public fun set_value(counter: &mut Counter, value: u64, ctx: &TxContext) { + assert!(counter.owner == ctx.sender(), 0); + counter.value = value; + } + + /// Assert a value for the counter. + public fun assert_value(counter: &Counter, value: u64) { + assert!(counter.value == value, 0) + } + + /// Delete counter (only runnable by the Counter owner) + public fun delete(counter: Counter, ctx: &TxContext) { + assert!(counter.owner == ctx.sender(), 0); + let Counter {id, owner:_, value:_} = counter; + id.delete(); + } +} + +#[test_only] +module basics::counter_test { + use sui::test_scenario as ts; + use basics::counter::{Self, Counter}; + + #[test] + fun test_counter() { + let owner = @0xC0FFEE; + let user1 = @0xA1; + + let mut ts = ts::begin(user1); + + { + ts.next_tx(owner); + counter::create(ts.ctx()); + }; + + { + ts.next_tx(user1); + let mut counter: Counter = ts.take_shared(); + + assert!(counter.owner() == owner); + assert!(counter.value() == 0); + + counter.increment(); + counter.increment(); + counter.increment(); + + ts::return_shared(counter); + }; + + { + ts.next_tx(owner); + let mut counter: Counter = ts.take_shared(); + + assert!(counter.owner() == owner); + assert!(counter.value() == 3); + + counter.set_value(100, ts.ctx()); + + ts::return_shared(counter); + }; + + { + ts.next_tx(user1); + let mut counter: Counter = ts.take_shared(); + + assert!(counter.owner() == owner); + assert!(counter.value() == 100); + + counter.increment(); + assert!(counter.value() == 101); + + ts::return_shared(counter); + }; + + ts.end(); + } +} diff --git a/examples/move/basics/sources/object_basics.move b/examples/move/basics/sources/object_basics.move new file mode 100644 index 0000000000000..b7e7a8aa59cda --- /dev/null +++ b/examples/move/basics/sources/object_basics.move @@ -0,0 +1,63 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// Test CTURD object basics (create, transfer, update, read, delete) +module basics::object_basics { + use sui::event; + + public struct Object has key, store { + id: UID, + value: u64, + } + + public struct Wrapper has key { + id: UID, + o: Object + } + + public struct NewValueEvent has copy, drop { + new_value: u64 + } + + public fun create(value: u64, recipient: address, ctx: &mut TxContext) { + transfer::public_transfer( + Object { id: object::new(ctx), value }, + recipient + ) + } + + public fun transfer(o: Object, recipient: address) { + transfer::public_transfer(o, recipient) + } + + public fun freeze_object(o: Object) { + transfer::public_freeze_object(o) + } + + public fun set_value(o: &mut Object, value: u64) { + o.value = value; + } + + // test that reading o2 and updating o1 works + public fun update(o1: &mut Object, o2: &Object) { + o1.value = o2.value; + // emit an event so the world can see the new value + event::emit(NewValueEvent { new_value: o2.value }) + } + + public fun delete(o: Object) { + let Object { id, value: _ } = o; + id.delete(); + } + + public fun wrap(o: Object, ctx: &mut TxContext) { + transfer::transfer(Wrapper { id: object::new(ctx), o }, ctx.sender()); + } + + #[lint_allow(self_transfer)] + public fun unwrap(w: Wrapper, ctx: &TxContext) { + let Wrapper { id, o } = w; + id.delete(); + transfer::public_transfer(o, ctx.sender()); + } +} diff --git a/examples/move/basics/sources/random.move b/examples/move/basics/sources/random.move new file mode 100644 index 0000000000000..f4dd9b88070a5 --- /dev/null +++ b/examples/move/basics/sources/random.move @@ -0,0 +1,18 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// This example demonstrates emitting a random u128 (e.g., for an offchain lottery) +module basics::random { + use sui::event; + use sui::random::Random; + + public struct RandomU128Event has copy, drop { + value: u128, + } + + entry fun new(r: &Random, ctx: &mut TxContext) { + let mut gen = r.new_generator(ctx); + let value = gen.generate_u128(); + event::emit(RandomU128Event { value }); + } +} diff --git a/examples/move/basics/sources/resolve_args.move b/examples/move/basics/sources/resolve_args.move new file mode 100644 index 0000000000000..786547820e21c --- /dev/null +++ b/examples/move/basics/sources/resolve_args.move @@ -0,0 +1,21 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// Functions and types to test argument resolution in JSON-RPC. +module basics::resolve_args { + public struct Foo has key { + id: UID, + } + + public fun foo( + _foo: &mut Foo, + _bar: vector, + _name: vector, + _index: u64, + _flag: u8, + _recipient: address, + _ctx: &mut TxContext, + ) { + abort 0 + } +} From d43a7addde2f2f538bd2558361fa0e1aad5de7e8 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Fri, 12 Jul 2024 22:16:39 +0100 Subject: [PATCH 020/163] [Examples/Move] Port remaining Crypto Sui Programmability Examples (#18609) ## Description Port over the following examples from sui_programmability/examples: - crypto/sources/ecdsa.move - crypto/sources/groth16.move - ~games/sources/drand_lib.move~ - ~games/sources/drand_based_lottery.move~ - ~games/sources/drand_based_scratch_card.move~ - games/sources/vdf_based_lottery.move Modernising and cleaning them up in the process: - Applying wrapping consistently at 100 characters, and cleaning up comments. - Removing unnecessary use of `entry` functions, including returning values instead of transfering to sender in some cases. - Using receiver functions where possible. - Standardising file order and adding titles for sections. - Standardising use of doc comments vs regular comments. - Using clever errors. This marks the final set of examples to be moved out of sui-programmability, which will then be deleted. ## Test plan ``` sui-framework-tests$ cargo nextest run -- run_examples_move_unit_tests ``` ## Stack - #18525 - #18526 - #18557 - #18558 - #18595 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: Ronny Roland --- examples/move/crypto/ecdsa_k1/Move.toml | 10 + .../move/crypto/ecdsa_k1/sources/example.move | 119 +++++++++ examples/move/crypto/groth16/Move.toml | 10 + .../move/crypto/groth16/sources/example.move | 108 ++++++++ .../crypto/groth16/tests/example_tests.move | 34 +++ examples/move/vdf/Move.toml | 10 + examples/move/vdf/sources/lottery.move | 231 ++++++++++++++++++ examples/move/vdf/tests/lottery_tests.move | 155 ++++++++++++ 8 files changed, 677 insertions(+) create mode 100644 examples/move/crypto/ecdsa_k1/Move.toml create mode 100644 examples/move/crypto/ecdsa_k1/sources/example.move create mode 100644 examples/move/crypto/groth16/Move.toml create mode 100644 examples/move/crypto/groth16/sources/example.move create mode 100644 examples/move/crypto/groth16/tests/example_tests.move create mode 100644 examples/move/vdf/Move.toml create mode 100644 examples/move/vdf/sources/lottery.move create mode 100644 examples/move/vdf/tests/lottery_tests.move diff --git a/examples/move/crypto/ecdsa_k1/Move.toml b/examples/move/crypto/ecdsa_k1/Move.toml new file mode 100644 index 0000000000000..8ebda25a8188a --- /dev/null +++ b/examples/move/crypto/ecdsa_k1/Move.toml @@ -0,0 +1,10 @@ +[package] +name = "ecdsa_k1" +version = "0.0.1" +edition = "2024.beta" + +[dependencies] +Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } + +[addresses] +ecdsa_k1 = "0x0" diff --git a/examples/move/crypto/ecdsa_k1/sources/example.move b/examples/move/crypto/ecdsa_k1/sources/example.move new file mode 100644 index 0000000000000..293012d61a9e0 --- /dev/null +++ b/examples/move/crypto/ecdsa_k1/sources/example.move @@ -0,0 +1,119 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// A basic ECDSA utility contract to do the following: +/// +/// 1) Hash a piece of data using Keccak256, output an object with hashed data. +/// 2) Recover a Secp256k1 signature to its public key, output an +/// object with the public key. +/// 3) Verify a Secp256k1 signature, produce an event for whether it is verified. +module ecdsa_k1::example { + use sui::ecdsa_k1; + use sui::event; + + // === Object Types === + + /// Object that holds the output data + public struct Output has key, store { + id: UID, + value: vector + } + + // == Event Types === + + /// Event on whether the signature is verified + public struct VerifiedEvent has copy, drop { + is_verified: bool, + } + + // === Public Functions === + + /// Hash the data using Keccak256, output an object with the hash to recipient. + public fun keccak256( + data: vector, + recipient: address, + ctx: &mut TxContext, + ) { + let hashed = Output { + id: object::new(ctx), + value: sui::hash::keccak256(&data), + }; + // Transfer an output data object holding the hashed data to the recipient. + transfer::public_transfer(hashed, recipient) + } + + /// Recover the public key using the signature and message, assuming the signature was produced + /// over the Keccak256 hash of the message. Output an object with the recovered pubkey to + /// recipient. + public fun ecrecover( + signature: vector, + msg: vector, + recipient: address, + ctx: &mut TxContext, + ) { + let pubkey = Output { + id: object::new(ctx), + value: ecdsa_k1::secp256k1_ecrecover(&signature, &msg, 0), + }; + // Transfer an output data object holding the pubkey to the recipient. + transfer::public_transfer(pubkey, recipient) + } + + /// Recover the Ethereum address using the signature and message, assuming the signature was + /// produced over the Keccak256 hash of the message. Output an object with the recovered address + /// to recipient. + public fun ecrecover_to_eth_address( + mut signature: vector, + msg: vector, + recipient: address, + ctx: &mut TxContext, + ) { + // Normalize the last byte of the signature to be 0 or 1. + let v = &mut signature[64]; + if (*v == 27) { + *v = 0; + } else if (*v == 28) { + *v = 1; + } else if (*v > 35) { + *v = (*v - 1) % 2; + }; + + // Ethereum signature is produced with Keccak256 hash of the message, so the last param is + // 0. + let pubkey = ecdsa_k1::secp256k1_ecrecover(&signature, &msg, 0); + let uncompressed = ecdsa_k1::decompress_pubkey(&pubkey); + + // Take the last 64 bytes of the uncompressed pubkey. + let mut uncompressed_64 = vector[]; + let mut i = 1; + while (i < 65) { + uncompressed_64.push_back(uncompressed[i]); + i = i + 1; + }; + + // Take the last 20 bytes of the hash of the 64-bytes uncompressed pubkey. + let hashed = sui::hash::keccak256(&uncompressed_64); + let mut addr = vector[]; + let mut i = 12; + while (i < 32) { + addr.push_back(hashed[i]); + i = i + 1; + }; + + let addr_object = Output { + id: object::new(ctx), + value: addr, + }; + + // Transfer an output data object holding the address to the recipient. + transfer::public_transfer(addr_object, recipient) + } + + /// Verified the secp256k1 signature using public key and message assuming Keccak was using when + /// signing. Emit an is_verified event of the verification result. + public fun secp256k1_verify(signature: vector, public_key: vector, msg: vector) { + event::emit(VerifiedEvent { + is_verified: ecdsa_k1::secp256k1_verify(&signature, &public_key, &msg, 0) + }); + } +} diff --git a/examples/move/crypto/groth16/Move.toml b/examples/move/crypto/groth16/Move.toml new file mode 100644 index 0000000000000..28c7c3286680b --- /dev/null +++ b/examples/move/crypto/groth16/Move.toml @@ -0,0 +1,10 @@ +[package] +name = "groth16" +version = "0.0.1" +edition = "2024.beta" + +[dependencies] +Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } + +[addresses] +groth16 = "0x0" diff --git a/examples/move/crypto/groth16/sources/example.move b/examples/move/crypto/groth16/sources/example.move new file mode 100644 index 0000000000000..86bb49d844e11 --- /dev/null +++ b/examples/move/crypto/groth16/sources/example.move @@ -0,0 +1,108 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// A verifier for the Groth16 zk-SNARK over the BLS12-381 construction. +/// See https://eprint.iacr.org/2016/260.pdf for details. +module groth16::example { + use sui::bls12381; + use sui::group_ops::Element; + + // === Types === + + /// A Groth16 proof. + public struct Proof has drop { + a: Element, + b: Element, + c: Element, + } + + /// A Groth16 verifying key used to verify a zero-knowledge proof. + public struct VerifyingKey has store, drop { + alpha: Element, + beta: Element, + gamma: Element, + gamma_abc: vector>, + delta: Element, + } + + /// A prepared verifying key. This makes verification faster than using the verifying key directly. + public struct PreparedVerifyingKey has store, drop { + alpha_beta: Element, + gamma_neg: Element, + gamma_abc: vector>, + delta_neg: Element, + } + + // === Errors === + + #[error] + const EInvalidNumberOfPublicInputs: vector = + b"There must be one more public input than gamma_abc entries in the verifying key."; + + // === Public Functions === + + /// Create a new `Proof`. + public fun create_proof( + a: Element, + b: Element, + c: Element, + ): Proof { + Proof { a, b, c } + } + + /// Create a new `VerifyingKey`. + public fun create_verifying_key( + alpha: Element, + beta: Element, + gamma: Element, + gamma_abc: vector>, + delta: Element, + ): VerifyingKey { + VerifyingKey { alpha, beta, gamma, gamma_abc, delta } + } + + /// Create a PreparedVerifyingKey from a VerifyingKey. This only have to be + /// done once. + public fun prepare(vk: VerifyingKey): PreparedVerifyingKey { + PreparedVerifyingKey { + alpha_beta: bls12381::pairing(&vk.alpha, &vk.beta), + gamma_neg: bls12381::g2_neg(&vk.gamma), + gamma_abc: vk.gamma_abc, + delta_neg: bls12381::g2_neg(&vk.delta), + } + } + + /// Verify a Groth16 proof with some public inputs and a verifying key. + public fun verify( + pvk: &PreparedVerifyingKey, + proof: &Proof, + public_inputs: &vector>, + ): bool { + let prepared_inputs = prepare_inputs(&pvk.gamma_abc, public_inputs); + let mut lhs = bls12381::pairing(&proof.a, &proof.b); + lhs = bls12381::gt_add(&lhs, &bls12381::pairing(&prepared_inputs, &pvk.gamma_neg)); + lhs = bls12381::gt_add(&lhs, &bls12381::pairing(&proof.c, &pvk.delta_neg)); + lhs == pvk.alpha_beta + } + + // === Helpers === + + fun prepare_inputs( + vk_gamma_abc: &vector>, + public_inputs: &vector>, + ): Element { + let length = public_inputs.length(); + assert!(length + 1 == vk_gamma_abc.length(), EInvalidNumberOfPublicInputs); + + let mut output = vk_gamma_abc[0]; + let mut i = 0; + while (i < length) { + output = bls12381::g1_add( + &output, + &bls12381::g1_mul(&public_inputs[i], &vk_gamma_abc[i + 1]), + ); + i = i + 1; + }; + output + } +} diff --git a/examples/move/crypto/groth16/tests/example_tests.move b/examples/move/crypto/groth16/tests/example_tests.move new file mode 100644 index 0000000000000..95e31adc898a2 --- /dev/null +++ b/examples/move/crypto/groth16/tests/example_tests.move @@ -0,0 +1,34 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module groth16::example_tests { + use sui::bls12381; + use groth16::example::{create_verifying_key, create_proof, verify}; + + #[test] + fun test_verification() { + let vk = create_verifying_key( + bls12381::g1_from_bytes(&x"b58cfc3b0f43d98e7dbe865af692577d52813cb62ef3c355215ec3be2a0355a1ae5da76dd3e626f8a60de1f4a8138dee"), + bls12381::g2_from_bytes(&x"9047b42915b32ef9dffe3acc0121a1450416e7f9791159f165ab0729d744da3ed82cd4822ca1d7fef35147cfd620b59b0ca09db7dff43aab6c71635ba8f86a83f058e9922e5cdacbe21d0e5e855cf1e776a61b272c12272fe526f5ba3b48d579"), + bls12381::g2_from_bytes(&x"ad7c5a6cefcae53a3fbae72662c7c04a2f8e1892cb83615a02b32c31247172b7f317489b84e72f14acaf4f3e9ed18141157c6c1464bf15d957227f75a3c550d6d27f295b41a753340c6eec47b471b2cb8664c84f3e9b725325d3fb8afc6b56d0"), + vector[ + bls12381::g1_from_bytes(&x"b2c9c61ccc28e913284a47c34e60d487869ff423dd574db080d35844f9eddd2b2967141b588a35fa82a278ce39ae6b1a"), + bls12381::g1_from_bytes(&x"9026ae12d58d203b4fc5dfad4968cbf51e43632ed1a05afdcb2e380ee552b036fbefc7780afe9675bcb60201a2421b2c") + ], + bls12381::g2_from_bytes(&x"b1294927d02f8e86ac57c3b832f4ecf5e03230445a9a785ac8d25cf968f48cca8881d0c439c7e8870b66567cf611da0c1734316632f39d3125c8cecca76a8661db91cbfae217547ea1fc078a24a1a31555a46765011411094ec649d42914e2f5"), + ); + + let public_inputs = vector[ + bls12381::scalar_from_bytes(&x"46722abc81a82d01ac89c138aa01a8223cb239ceb1f02cdaad7e1815eb997ca6") + ]; + + let proof = create_proof( + bls12381::g1_from_bytes(&x"9913bdcabdff2cf1e7dea1673c5edba5ed6435df2f2a58d6d9e624609922bfa3976a98d991db333812bf6290a590afaa"), + bls12381::g2_from_bytes(&x"b0265b35af5069593ee88626cf3ba9a0f07699510a25aec3a27048792ab83b3467d6b814d1c09c412c4dcd7656582e6607b72915081c82794ccedf643c27abace5b23a442079d8dcbd0d68dd697b8e0b699a1925a5f2c77f5237efbbbeda3bd0"), + bls12381::g1_from_bytes(&x"b1237cf48ca7aa98507e826aac336b9e24f14133de1923fffac602a1203b795b3037c4c94e7246bacee7b2757ae912e5"), + ); + + assert!(vk.prepare().verify(&proof, &public_inputs)); + } +} diff --git a/examples/move/vdf/Move.toml b/examples/move/vdf/Move.toml new file mode 100644 index 0000000000000..3f835c6add095 --- /dev/null +++ b/examples/move/vdf/Move.toml @@ -0,0 +1,10 @@ +[package] +name = "VDF" +version = "0.0.1" +edition = "2024.beta" + +[dependencies] +Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } + +[addresses] +vdf = "0x0" diff --git a/examples/move/vdf/sources/lottery.move b/examples/move/vdf/sources/lottery.move new file mode 100644 index 0000000000000..f61525f6b8159 --- /dev/null +++ b/examples/move/vdf/sources/lottery.move @@ -0,0 +1,231 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// A basic lottery game that depends on user-provided randomness which is processed by a verifiable +/// delay function (VDF) to make sure that it is unbiasable. +/// +/// During the submission phase, players can buy tickets. When buying a ticket, a user must provide +/// some randomness `r`. This randomness is added to the combined randomness of the lottery, `h`, as +/// `h = Sha2_256(h, r)`. +/// +/// After the submission phase has ended, the combined randomness is used to generate an input to +/// the VDF. Anyone may now compute the output and submit it along with a proof of correctness to +/// the `complete` function. If the output and proof verifies, the game ends, and the hash of the +/// output is used to pick a winner. +/// +/// The outcome is guaranteed to be fair if: +/// +/// 1) At least one player contributes true randomness, +/// +/// 2) The number of iterations is defined such that it takes at least `submission_phase_length` to +/// compute the VDF. +module vdf::lottery { + use sui::clock::Clock; + use std::hash::sha2_256; + use sui::vdf::{hash_to_input, vdf_verify}; + + // === Receiver Functions === + + public use fun delete_ticket as Ticket.delete; + public use fun delete_game_winner as GameWinner.delete; + public use fun ticket_game_id as Ticket.game_id; + public use fun game_winner_game_id as GameWinner.game_id; + + // === Object Types === + + /// Game represents a set of parameters of a single game. + /// This game can be extended to require ticket purchase, reward winners, etc. + public struct Game has key { + id: UID, + iterations: u64, + status: u8, + timestamp_start: u64, + submission_phase_length: u64, + participants: u64, + vdf_input_seed: vector, + winner: Option, + } + + /// Ticket represents a participant in a single game. + /// Can be deconstructed only by the owner. + public struct Ticket has key, store { + id: UID, + game_id: ID, + participant_index: u64, + } + + /// GameWinner represents a participant that won in a specific game. + /// Can be deconstructed only by the owner. + public struct GameWinner has key, store { + id: UID, + game_id: ID, + } + + // === Error Codes === + + #[error] + const EGameNotInProgress: vector = + b"Lottery not in progress, cannot participate."; + + #[error] + const EGameAlreadyCompleted: vector = + b"Lottery winner has already been selected"; + + #[error] + const EInvalidTicket: vector = + b"Ticket does not match lottery"; + + #[error] + const ENotWinner: vector = + b"Not the winning ticket"; + + #[error] + const ESubmissionPhaseInProgress: vector = + b"Cannot call winner or redeem funds until submission phase has completed."; + + #[error] + const EInvalidVdfProof: vector = + b"Invalid VDF Proof"; + + #[error] + const ESubmissionPhaseFinished: vector = + b"Cannot participate in a finished lottery."; + + #[error] + const EInvalidRandomness: vector = + b"Randomness length is not correct"; + + // === Constants === + + // Game status + const IN_PROGRESS: u8 = 0; + const COMPLETED: u8 = 1; + + const RANDOMNESS_LENGTH: u64 = 16; + + // === Public Functions === + + /// Create a shared-object Game. + public fun create(iterations: u64, submission_phase_length: u64, clock: &Clock, ctx: &mut TxContext) { + transfer::share_object(Game { + id: object::new(ctx), + iterations, + status: IN_PROGRESS, + timestamp_start: clock.timestamp_ms(), + submission_phase_length, + vdf_input_seed: vector::empty(), + participants: 0, + winner: option::none(), + }); + } + + /// Anyone can participate in the game and receive a ticket. + public fun participate( + self: &mut Game, + my_randomness: vector, + clock: &Clock, + ctx: &mut TxContext, + ): Ticket { + assert!(self.status == IN_PROGRESS, EGameNotInProgress); + assert!( + clock.timestamp_ms() - self.timestamp_start < self.submission_phase_length, + ESubmissionPhaseFinished, + ); + + // Update combined randomness by concatenating the provided randomness and hashing it + assert!(my_randomness.length() == RANDOMNESS_LENGTH, EInvalidRandomness); + self.vdf_input_seed.append(my_randomness); + self.vdf_input_seed = sha2_256(self.vdf_input_seed); + + // Assign index to this participant + let participant_index = self.participants; + self.participants = self.participants + 1; + + Ticket { + id: object::new(ctx), + game_id: object::id(self), + participant_index, + } + } + + /// Complete this lottery by sending VDF output and proof for the seed created from the + /// contributed randomness. Anyone can call this. + public fun complete( + self: &mut Game, + vdf_output: vector, + vdf_proof: vector, + clock: &Clock, + ) { + assert!(self.status != COMPLETED, EGameAlreadyCompleted); + assert!( + clock.timestamp_ms() - self.timestamp_start >= self.submission_phase_length, + ESubmissionPhaseInProgress, + ); + + // Hash combined randomness to vdf input + let vdf_input = hash_to_input(&self.vdf_input_seed); + + // Verify output and proof + assert!(vdf_verify(&vdf_input, &vdf_output, &vdf_proof, self.iterations), EInvalidVdfProof); + + // The randomness is derived from the VDF output by passing it through a hash function with + // uniformly distributed output to make it uniform. Any hash function with uniformly + // distributed output can be used. + let randomness = sha2_256(vdf_output); + + // Set winner and mark lottery completed + self.winner = option::some(safe_selection(self.participants, &randomness)); + self.status = COMPLETED; + } + + /// The winner can redeem its ticket. + public fun redeem(self: &Game, ticket: &Ticket, ctx: &mut TxContext): GameWinner { + assert!(self.status == COMPLETED, ESubmissionPhaseInProgress); + assert!(object::id(self) == ticket.game_id, EInvalidTicket); + assert!(self.winner.contains(&ticket.participant_index), ENotWinner); + + GameWinner { + id: object::new(ctx), + game_id: ticket.game_id, + } + } + + // Note that a ticket can be deleted before the game was completed. + public fun delete_ticket(ticket: Ticket) { + let Ticket { id, game_id: _, participant_index: _} = ticket; + object::delete(id); + } + + public fun delete_game_winner(ticket: GameWinner) { + let GameWinner { id, game_id: _} = ticket; + object::delete(id); + } + + public fun ticket_game_id(ticket: &Ticket): &ID { + &ticket.game_id + } + + public fun game_winner_game_id(ticket: &GameWinner): &ID { + &ticket.game_id + } + + // === Private Helpers === + + // Converts the first 16 bytes of rnd to a u128 number and outputs its modulo with input n. + // Since n is u64, the output is at most 2^{-64} biased assuming rnd is uniformly random. + fun safe_selection(n: u64, rnd: &vector): u64 { + assert!(rnd.length() >= 16, EInvalidRandomness); + let mut m: u128 = 0; + let mut i = 0; + while (i < 16) { + m = m << 8; + let curr_byte = rnd[i]; + m = m + (curr_byte as u128); + i = i + 1; + }; + let n_128 = (n as u128); + let module_128 = m % n_128; + let res = (module_128 as u64); + res + } +} diff --git a/examples/move/vdf/tests/lottery_tests.move b/examples/move/vdf/tests/lottery_tests.move new file mode 100644 index 0000000000000..850af7e49091e --- /dev/null +++ b/examples/move/vdf/tests/lottery_tests.move @@ -0,0 +1,155 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module vdf::lottery_tests { + use sui::test_scenario as ts; + use sui::clock; + use vdf::lottery::{Self, Game, GameWinner}; + + const OUTPUT: vector = + x"c0014d00b5e624fe10d1cc1e593c0ffb8c3084e49bb70efc4337640a73990bb29dfb430b55710475bcc7524c77627d8067415fffa63e0e84b1204225520fea384999719c66dbdc6e91863d99c64674af971631b56e22b7cc780765bf12d53edea1dadf566f80a62769e287a1e195596d4894b2e1360e451cbf06864762275b4d5063871d45627dea2e42ab93d5345bf172b9724216627abbf295b35a8e64e13e585bca54848a90212c9f7a3adffc25c3b87eefa7d4ab1660b523bf6410b9a9ea0e00c001327d73bebc768d150beb2a1b0de9e80c69ed594ae7787d548af44eb1e0a03616100133146c9c1202ea3a35c331864f3bfe59ffa3c88d6acb8af7a4b1b5ea842c4c4c88d415539389e614876d738d80217a3ad16d001f2de60f62b04a9d8de7ccb4716c3368f0d42e3e719dbb07bdb4355f0e5569714fbcc130f30ac7b49a5b207a444c7e00a0c27edae10c28b05f87545f337283f90c4e4ed69639683154d6a89e6589db4d18702d3a29705b434dc32e10fcbd3c62d1da20b45dba511bcecdf7c101009db7911c39f3937785dd8bd0e9db56c94777bdd867897493f82e0931e0e5facb730c3aa400f815f3d2f61de94373209dcbf9210c5e1f179b675adce2be7159238cb5f89c568004ccfc75d1b3de99a060255bcd6c9dd9a674844251ec27c48119b870f4ce63cac2081541c4269bbfa60148f9dbf2c60c76099a6538a33e88c24ce092e6aad9bdfff330470ffb87b01b666dd98e44843b41896f2be688361fe062692b441b4dd8f8ecfa96948d13daf486259bb8934cab7e9d9788da0eac7edf56"; + + const PROOF: vector = + x"c0010f1ea16b16f3fc46eb0b00a516092a6ab389e259a3013eee5e39e130702de85954b8aac435e724ad0bfd210ab7789fb91b54ac4352154f3251e0a87ccfd2c9a57d26468a384f527e129fc82b33c04b3ebbec3a99967798a95b39820c35ea015fdf4c81e143004b34b99e63462cf350689b2abdd6c3903adcbe55781d3a89c89dc571c312f9a80911a9d64884747319574b3a4ded25478e6d64b9cfb25d9c67366bc25d9ac99bcdba16665158da50a2ba179893292c4b7e76502ecaba1337d693c001fb3867669e0d4e45aa43d959dbe33c3d35b00e8414d1cf1bb9552726bb95bafa0a2c12a014a3b8fb0bd5ab9a40430ff59364b19d58d80665fee0bfee272a38c45413a3688832bf9bcacf7b5723436c120878f85ce084e72b13246ecfec7cd6a5d79e13296bbb51af785c10afe6c4f07f43a5bc711dc398271185d700b1695310d8e428ad3bc6b81a4faac2f5009b723460dbd260c940dfac06e34854d204dc779f94ab3f67847a7b90855dadc3962871c022e172e96b39a08648e045e14dad87c10102f976797f14be801a441f19771a4835640a74cf7c6ad216f18d9cdaf461bb56a897b804e053cd6cc68d659bd9f0ed985f094932d306c1bd76450bd349db3a81008d7591bc826a36583c3c361add7a8f245d18007d79704d79ae27eb08b52a44af17e2f23b441919049f061d69bac3a09c3e15074e4d75cf82f42dbff1c62ddc94fe6167ccb7265e7eab0def7d30d97be441ad763705dd30d4040815996e34643bf6d7a4f06c22aa5d6d5dd30253ea8aa59607724bb71f5425a5e7fee03b7e9fe8"; + + const BAD_PROOF: vector = + x"0101010180032cf35709e1301d02b40a0dbe3dadfe6ec1eeba8fb8060a1decd0c7a126ea3f27fadcad81435601b0e0abca5c89173ef639e5a88043aa29801e6799e430b509e479b57af981f9ddd48d3a8d5919f99258081557a08270bb441233c78030a01e03ec199b5e3eef5ccc9b1a3d4841cbe4ff529c22a8cd1b1b0075338d864e3890942df6b007d2c3e3a8ef1ce7490c6bbec5372adfcbf8704a1ffc9a69db8d9cdc54762f019036e450e457325eef74b794f3f16ff327d68079a5b9de49163d7323937374f8a785a8f9afe84d6a71b336e4de00f239ee3af1d7604a3985e610e1603bd0e1a4998e19fa0c8920ffd8d61b0a87eeee50ac7c03ff7c4708a34f3bc92fd0103758c954ee34032cee2c78ad8cdc79a35dbc810196b7bf6833e1c45c83b09c0d1b78bc6f8753e10770e7045b08d50b4aa16a75b27a096d5ec1331f1fd0a44e95a8737c20240c90307b5497d3470393c2a00da0649e86d13e820591296c644fc1eef9e7c6ca4967c5e19df3153cd7fbd598c271e11c10397349ddc8cc8452ec"; + + #[test] + #[expected_failure(abort_code = vdf::lottery::ESubmissionPhaseInProgress)] + fun test_complete_too_early() { + let user1 = @0x0; + + let mut ts = ts::begin(user1); + let mut clock = clock::create_for_testing(ts.ctx()); + + lottery::create(1000, 1000, &clock, ts.ctx()); + ts.next_tx(user1); + let mut game: Game = ts.take_shared(); + + // User 1 buys a ticket. + ts.next_tx(user1); + let _t1 = game.participate(b"user1 randomness", &clock, ts.ctx()); + + // Increment time but still in submission phase + clock.increment_for_testing(500); + + // User1 tries to complete the lottery too early. + ts.next_tx(user1); + game.complete(OUTPUT, PROOF, &clock); + abort 0 + } + + #[test] + fun test_play_vdf_lottery() { + let user1 = @0x0; + let user2 = @0x1; + let user3 = @0x2; + let user4 = @0x3; + + let mut ts = ts::begin(user1); + let mut clock = clock::create_for_testing(ts.ctx()); + + lottery::create(1000, 1000, &clock, ts.ctx()); + ts.next_tx(user1); + let mut game: Game = ts.take_shared(); + + // User 1 buys a ticket. + ts.next_tx(user1); + let t1 = game.participate(b"user1 randomness", &clock, ts.ctx()); + + // User 2 buys a ticket. + ts.next_tx(user2); + let t2 = game.participate(b"user2 randomness", &clock, ts.ctx()); + + // User 3 buys a ticket + ts.next_tx(user3); + let t3 = game.participate(b"user3 randomness", &clock, ts.ctx()); + + // User 4 buys a ticket + ts.next_tx(user4); + let t4 = game.participate(b"user4 randomness", &clock, ts.ctx()); + + // Increment time to after submission phase has ended + clock.increment_for_testing(1000); + + // User 3 completes by submitting output and proof of the VDF + ts.next_tx(user3); + game.complete(OUTPUT, PROOF, &clock); + + // User 1 is the winner since the mod of the hash results in 0. + ts.next_tx(user1); + assert!(!ts::has_most_recent_for_address(user1), 1); + let winner = game.redeem(&t1, ts.ctx()); + + // Make sure User1 now has a winner ticket for the right game id. + ts.next_tx(user1); + assert!(winner.game_id() == t1.game_id(), 1); + + t1.delete(); + t2.delete(); + t3.delete(); + t4.delete(); + winner.delete(); + + clock.destroy_for_testing(); + ts::return_shared(game); + ts.end(); + } + + #[test] + #[expected_failure(abort_code = vdf::lottery::EInvalidVdfProof)] + fun test_invalid_vdf_output() { + let user1 = @0x0; + let user2 = @0x1; + let user3 = @0x2; + let user4 = @0x3; + + let mut ts = ts::begin(user1); + let mut clock = clock::create_for_testing(ts.ctx()); + + lottery::create(1000, 1000, &clock, ts.ctx()); + ts.next_tx(user1); + let mut game: Game = ts.take_shared(); + + // User1 buys a ticket. + ts.next_tx(user1); + let _t1 = game.participate(b"user1 randomness", &clock, ts.ctx()); + // User2 buys a ticket. + ts.next_tx(user2); + let _t2 = game.participate(b"user2 randomness", &clock, ts.ctx()); + // User3 buys a ticket + ts.next_tx(user3); + let _t3 = game.participate(b"user3 randomness", &clock, ts.ctx()); + // User4 buys a ticket + ts.next_tx(user4); + let _t4 = game.participate(b"user4 randomness", &clock, ts.ctx()); + + // Increment time to after submission phase has ended + clock.increment_for_testing(1000); + + // User3 completes by submitting output and proof of the VDF + ts.next_tx(user3); + game.complete(OUTPUT, BAD_PROOF, &clock); + abort 0 + } + + #[test] + #[expected_failure(abort_code = vdf::lottery::EInvalidRandomness)] + fun test_empty_randomness() { + let user1 = @0x0; + + let mut ts = ts::begin(user1); + let clock = clock::create_for_testing(ts.ctx()); + + lottery::create(1000, 1000, &clock, ts.ctx()); + ts.next_tx(user1); + let mut game: Game = ts.take_shared(); + + // User1 buys a ticket, but with wrong randomness length. + ts.next_tx(user1); + let _t = game.participate(b"abcd", &clock, ts.ctx()); + abort 0 + } +} From 2f71d9d79b78627901cafe51dfaffbecafab3dce Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Fri, 12 Jul 2024 22:20:13 +0100 Subject: [PATCH 021/163] [Examples/Move] Delete `sui_programmability` (#18612) ## Description Remove the `sui_programmability` folder as all examples have been ported and modernised to `examples/move`, or elsewhere. ## Test plan CI ## Stack - #18525 - #18526 - #18557 - #18558 - #18595 - #18609 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: Ronny Roland --- sui_programmability/examples/README.md | 15 +- sui_programmability/examples/basics/Move.toml | 10 - sui_programmability/examples/basics/README.md | 7 - .../examples/basics/sources/clock.move | 17 - .../examples/basics/sources/counter.move | 119 ---- .../examples/basics/sources/lock.move | 134 ---- .../examples/basics/sources/object.move | 105 ---- .../basics/sources/object_basics.move | 62 -- .../examples/basics/sources/random.move | 18 - .../examples/basics/sources/sandwich.move | 172 ------ sui_programmability/examples/capy/Move.toml | 11 - .../examples/capy/sources/capy.move | 486 --------------- .../examples/capy/sources/capy_admin.move | 31 - .../examples/capy/sources/capy_item.move | 174 ------ .../examples/capy/sources/capy_market.move | 269 -------- .../examples/capy/sources/capy_winter.move | 227 ------- .../examples/capy/sources/eden.move | 60 -- sui_programmability/examples/crypto/Move.toml | 10 - sui_programmability/examples/crypto/README.md | 8 - .../examples/crypto/sources/ec_ops.move | 439 ------------- .../examples/crypto/sources/ecdsa.move | 95 --- .../examples/crypto/sources/groth16.move | 117 ---- sui_programmability/examples/defi/Move.toml | 10 - sui_programmability/examples/defi/README.md | 5 - .../examples/defi/sources/escrow.move | 91 --- .../examples/defi/sources/flash_lender.move | 175 ------ .../examples/defi/sources/pool.move | 579 ------------------ .../examples/defi/sources/shared_escrow.move | 70 --- .../examples/defi/sources/subscription.move | 164 ----- .../examples/defi/tests/escrow_tests.move | 167 ----- .../defi/tests/flash_lender_tests.move | 64 -- .../defi/tests/shared_escrow_test.move | 186 ------ .../examples/ecommerce/Move.toml | 10 - .../examples/ecommerce/README.md | 9 - .../examples/ecommerce/sources/.gitkeep | 0 .../examples/ecommerce/tests/.gitkeep | 0 .../examples/fungible_tokens/Move.toml | 12 - .../examples/fungible_tokens/README.md | 9 - .../fungible_tokens/sources/basket.move | 95 --- .../fungible_tokens/sources/managed.move | 42 -- .../sources/regulated_coin.move | 491 --------------- .../sources/treasury_lock.move | 441 ------------- .../fungible_tokens/tests/basket_tests.move | 48 -- sui_programmability/examples/games/Move.toml | 10 - sui_programmability/examples/games/README.md | 12 - .../games/sources/drand_based_lottery.move | 157 ----- .../sources/drand_based_scratch_card.move | 186 ------ .../examples/games/sources/drand_lib.move | 81 --- .../examples/games/sources/hero.move | 401 ------------ .../games/sources/rock_paper_scissors.move | 253 -------- .../examples/games/sources/sea_hero.move | 116 ---- .../games/sources/sea_hero_helper.move | 95 --- .../games/sources/shared_tic_tac_toe.move | 168 ----- .../examples/games/sources/tic_tac_toe.move | 288 --------- .../games/sources/vdf_based_lottery.move | 160 ----- .../tests/drand_based_lottery_tests.move | 98 --- .../tests/drand_based_scratch_card_tests.move | 110 ---- .../tests/rock_paper_scissors_tests.move | 109 ---- .../games/tests/shared_tic_tac_toe_tests.move | 223 ------- .../games/tests/tic_tac_toe_tests.move | 236 ------- .../games/tests/vdf_based_lottery_tests.move | 173 ------ .../examples/move_tutorial/Move.toml | 10 - .../move_tutorial/sources/my_module.move | 168 ----- .../examples/multi_package/README.md | 5 - .../multi_package/dep_package/Move.toml | 10 - .../dep_package/sources/dep_module.move | 10 - .../multi_package/main_package/Move.toml | 11 - .../main_package/sources/main_module.move | 12 - sui_programmability/examples/nfts/Move.toml | 10 - sui_programmability/examples/nfts/README.md | 8 - .../examples/nfts/sources/auction.move | 109 ---- .../examples/nfts/sources/auction_lib.move | 159 ----- .../examples/nfts/sources/chat.move | 82 --- .../nfts/sources/cross_chain_airdrop.move | 185 ------ .../examples/nfts/sources/devnet_nft.move | 122 ---- .../nfts/sources/discount_coupon.move | 62 -- .../examples/nfts/sources/geniteam.move | 377 ------------ .../examples/nfts/sources/marketplace.move | 346 ----------- .../examples/nfts/sources/num.move | 57 -- .../examples/nfts/sources/shared_auction.move | 75 --- .../examples/nfts/tests/auction_tests.move | 118 ---- .../examples/nfts/tests/chat_tests.move | 36 -- .../nfts/tests/cross_chain_airdrop_tests.move | 82 --- .../nfts/tests/discount_coupon_tests.move | 54 -- .../nfts/tests/shared_auction_tests.move | 126 ---- .../examples/objects_tutorial/Move.toml | 11 - .../sources/color_object.move | 227 ------- .../sources/simple_warrior.move | 61 -- .../sources/trusted_swap.move | 81 --- sui_programmability/examples/utils/Move.toml | 10 - .../utils/sources/epoch_time_lock.move | 34 - .../sources/immutable_external_resource.move | 47 -- .../examples/utils/sources/locked_coin.move | 51 -- .../examples/utils/sources/safe.move | 167 ----- .../examples/utils/sources/typed_id.move | 45 -- .../immutable_external_resource_tests.move | 34 - .../examples/utils/tests/safe_tests.move | 174 ------ 97 files changed, 1 insertion(+), 11305 deletions(-) delete mode 100644 sui_programmability/examples/basics/Move.toml delete mode 100644 sui_programmability/examples/basics/README.md delete mode 100644 sui_programmability/examples/basics/sources/clock.move delete mode 100644 sui_programmability/examples/basics/sources/counter.move delete mode 100644 sui_programmability/examples/basics/sources/lock.move delete mode 100644 sui_programmability/examples/basics/sources/object.move delete mode 100644 sui_programmability/examples/basics/sources/object_basics.move delete mode 100644 sui_programmability/examples/basics/sources/random.move delete mode 100644 sui_programmability/examples/basics/sources/sandwich.move delete mode 100644 sui_programmability/examples/capy/Move.toml delete mode 100644 sui_programmability/examples/capy/sources/capy.move delete mode 100644 sui_programmability/examples/capy/sources/capy_admin.move delete mode 100644 sui_programmability/examples/capy/sources/capy_item.move delete mode 100644 sui_programmability/examples/capy/sources/capy_market.move delete mode 100644 sui_programmability/examples/capy/sources/capy_winter.move delete mode 100644 sui_programmability/examples/capy/sources/eden.move delete mode 100644 sui_programmability/examples/crypto/Move.toml delete mode 100644 sui_programmability/examples/crypto/README.md delete mode 100644 sui_programmability/examples/crypto/sources/ec_ops.move delete mode 100644 sui_programmability/examples/crypto/sources/ecdsa.move delete mode 100644 sui_programmability/examples/crypto/sources/groth16.move delete mode 100644 sui_programmability/examples/defi/Move.toml delete mode 100644 sui_programmability/examples/defi/README.md delete mode 100644 sui_programmability/examples/defi/sources/escrow.move delete mode 100644 sui_programmability/examples/defi/sources/flash_lender.move delete mode 100644 sui_programmability/examples/defi/sources/pool.move delete mode 100644 sui_programmability/examples/defi/sources/shared_escrow.move delete mode 100644 sui_programmability/examples/defi/sources/subscription.move delete mode 100644 sui_programmability/examples/defi/tests/escrow_tests.move delete mode 100644 sui_programmability/examples/defi/tests/flash_lender_tests.move delete mode 100644 sui_programmability/examples/defi/tests/shared_escrow_test.move delete mode 100644 sui_programmability/examples/ecommerce/Move.toml delete mode 100644 sui_programmability/examples/ecommerce/README.md delete mode 100644 sui_programmability/examples/ecommerce/sources/.gitkeep delete mode 100644 sui_programmability/examples/ecommerce/tests/.gitkeep delete mode 100644 sui_programmability/examples/fungible_tokens/Move.toml delete mode 100644 sui_programmability/examples/fungible_tokens/README.md delete mode 100644 sui_programmability/examples/fungible_tokens/sources/basket.move delete mode 100644 sui_programmability/examples/fungible_tokens/sources/managed.move delete mode 100644 sui_programmability/examples/fungible_tokens/sources/regulated_coin.move delete mode 100644 sui_programmability/examples/fungible_tokens/sources/treasury_lock.move delete mode 100644 sui_programmability/examples/fungible_tokens/tests/basket_tests.move delete mode 100644 sui_programmability/examples/games/Move.toml delete mode 100644 sui_programmability/examples/games/README.md delete mode 100644 sui_programmability/examples/games/sources/drand_based_lottery.move delete mode 100644 sui_programmability/examples/games/sources/drand_based_scratch_card.move delete mode 100644 sui_programmability/examples/games/sources/drand_lib.move delete mode 100644 sui_programmability/examples/games/sources/hero.move delete mode 100644 sui_programmability/examples/games/sources/rock_paper_scissors.move delete mode 100644 sui_programmability/examples/games/sources/sea_hero.move delete mode 100644 sui_programmability/examples/games/sources/sea_hero_helper.move delete mode 100644 sui_programmability/examples/games/sources/shared_tic_tac_toe.move delete mode 100644 sui_programmability/examples/games/sources/tic_tac_toe.move delete mode 100644 sui_programmability/examples/games/sources/vdf_based_lottery.move delete mode 100644 sui_programmability/examples/games/tests/drand_based_lottery_tests.move delete mode 100644 sui_programmability/examples/games/tests/drand_based_scratch_card_tests.move delete mode 100644 sui_programmability/examples/games/tests/rock_paper_scissors_tests.move delete mode 100644 sui_programmability/examples/games/tests/shared_tic_tac_toe_tests.move delete mode 100644 sui_programmability/examples/games/tests/tic_tac_toe_tests.move delete mode 100644 sui_programmability/examples/games/tests/vdf_based_lottery_tests.move delete mode 100644 sui_programmability/examples/move_tutorial/Move.toml delete mode 100644 sui_programmability/examples/move_tutorial/sources/my_module.move delete mode 100644 sui_programmability/examples/multi_package/README.md delete mode 100644 sui_programmability/examples/multi_package/dep_package/Move.toml delete mode 100644 sui_programmability/examples/multi_package/dep_package/sources/dep_module.move delete mode 100644 sui_programmability/examples/multi_package/main_package/Move.toml delete mode 100644 sui_programmability/examples/multi_package/main_package/sources/main_module.move delete mode 100644 sui_programmability/examples/nfts/Move.toml delete mode 100644 sui_programmability/examples/nfts/README.md delete mode 100644 sui_programmability/examples/nfts/sources/auction.move delete mode 100644 sui_programmability/examples/nfts/sources/auction_lib.move delete mode 100644 sui_programmability/examples/nfts/sources/chat.move delete mode 100644 sui_programmability/examples/nfts/sources/cross_chain_airdrop.move delete mode 100644 sui_programmability/examples/nfts/sources/devnet_nft.move delete mode 100644 sui_programmability/examples/nfts/sources/discount_coupon.move delete mode 100644 sui_programmability/examples/nfts/sources/geniteam.move delete mode 100644 sui_programmability/examples/nfts/sources/marketplace.move delete mode 100644 sui_programmability/examples/nfts/sources/num.move delete mode 100644 sui_programmability/examples/nfts/sources/shared_auction.move delete mode 100644 sui_programmability/examples/nfts/tests/auction_tests.move delete mode 100644 sui_programmability/examples/nfts/tests/chat_tests.move delete mode 100644 sui_programmability/examples/nfts/tests/cross_chain_airdrop_tests.move delete mode 100644 sui_programmability/examples/nfts/tests/discount_coupon_tests.move delete mode 100644 sui_programmability/examples/nfts/tests/shared_auction_tests.move delete mode 100644 sui_programmability/examples/objects_tutorial/Move.toml delete mode 100644 sui_programmability/examples/objects_tutorial/sources/color_object.move delete mode 100644 sui_programmability/examples/objects_tutorial/sources/simple_warrior.move delete mode 100644 sui_programmability/examples/objects_tutorial/sources/trusted_swap.move delete mode 100644 sui_programmability/examples/utils/Move.toml delete mode 100644 sui_programmability/examples/utils/sources/epoch_time_lock.move delete mode 100644 sui_programmability/examples/utils/sources/immutable_external_resource.move delete mode 100644 sui_programmability/examples/utils/sources/locked_coin.move delete mode 100644 sui_programmability/examples/utils/sources/safe.move delete mode 100644 sui_programmability/examples/utils/sources/typed_id.move delete mode 100644 sui_programmability/examples/utils/tests/immutable_external_resource_tests.move delete mode 100644 sui_programmability/examples/utils/tests/safe_tests.move diff --git a/sui_programmability/examples/README.md b/sui_programmability/examples/README.md index 7aec5e9887136..b2601469571c6 100644 --- a/sui_programmability/examples/README.md +++ b/sui_programmability/examples/README.md @@ -1,15 +1,2 @@ >[!IMPORTANT] -> These examples are out-of-date and have been retained as an archive, please **find the latest versions in the [examples](../../examples) directory** which contains up-to-date [Move](../../examples/move) and end-to-end examples! - -Lots of Move code examples, partitioned by category: - -* basics: The very simplest examples of Sui programming. -* crypto: A simple contract to perform ECDSA secp256k1 signature verification and ecrecover (derive the public key from a signature). -* defi: DeFi primitives like escrows, atomic swaps, flash loans, DEXes. -* fungible_tokens: Implementations of fungible tokens with different minting and burning policies. -* games: Various classic and not-so-classic on-chain games. -* nfts: Example NFT implementations and related functionality like auctions and marketplaces. - -We welcome third-party examples--please just submit a pull request! - -DISCLAIMER: This is example code provided for demonstration purposes only. These examples have not been thoroughly tested, verified, or audited. Please do not use the example code or derivatives in production without proper diligence. +> These examples have moved! **Find the latest versions in the [examples](../../examples) directory** which contains up-to-date [Move](../../examples/move) and end-to-end examples! diff --git a/sui_programmability/examples/basics/Move.toml b/sui_programmability/examples/basics/Move.toml deleted file mode 100644 index 71fda07567b2d..0000000000000 --- a/sui_programmability/examples/basics/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "Basics" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -basics = "0x0" diff --git a/sui_programmability/examples/basics/README.md b/sui_programmability/examples/basics/README.md deleted file mode 100644 index 3be04d1cb971d..0000000000000 --- a/sui_programmability/examples/basics/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Basics - -Very basic examples to illustrate the nuts and bolts of programming in Sui. - -* Object: a heavily commented example of a custom object. -* Sandwich: example of object exchange logic--combining ham and bread objects to produce a sandwich. -* Lock: example of a shared object which can be accessed if someone has a key. diff --git a/sui_programmability/examples/basics/sources/clock.move b/sui_programmability/examples/basics/sources/clock.move deleted file mode 100644 index be369d095122f..0000000000000 --- a/sui_programmability/examples/basics/sources/clock.move +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This example demonstrates reading a clock object. -/// Current time is emitted as an event in the get_time transaction -module basics::clock { - use sui::{clock::Clock, event}; - - public struct TimeEvent has copy, drop { - timestamp_ms: u64, - } - - /// Emit event with current time. - entry fun access(clock: &Clock) { - event::emit(TimeEvent { timestamp_ms: clock.timestamp_ms() }); - } -} diff --git a/sui_programmability/examples/basics/sources/counter.move b/sui_programmability/examples/basics/sources/counter.move deleted file mode 100644 index d79cb457d2959..0000000000000 --- a/sui_programmability/examples/basics/sources/counter.move +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This example demonstrates a basic use of a shared object. -/// Rules: -/// - anyone can create and share a counter -/// - everyone can increment a counter by 1 -/// - the owner of the counter can reset it to any value -module basics::counter { - /// A shared counter. - public struct Counter has key { - id: UID, - owner: address, - value: u64 - } - - public fun owner(counter: &Counter): address { - counter.owner - } - - public fun value(counter: &Counter): u64 { - counter.value - } - - /// Create and share a Counter object. - public entry fun create(ctx: &mut TxContext) { - transfer::share_object(Counter { - id: object::new(ctx), - owner: tx_context::sender(ctx), - value: 0 - }) - } - - /// Increment a counter by 1. - public entry fun increment(counter: &mut Counter) { - counter.value = counter.value + 1; - } - - /// Set value (only runnable by the Counter owner) - public entry fun set_value(counter: &mut Counter, value: u64, ctx: &TxContext) { - assert!(counter.owner == tx_context::sender(ctx), 0); - counter.value = value; - } - - /// Assert a value for the counter. - public entry fun assert_value(counter: &Counter, value: u64) { - assert!(counter.value == value, 0) - } - - /// Delete counter (only runnable by the Counter owner) - public entry fun delete(counter: Counter, ctx: &TxContext) { - assert!(counter.owner == tx_context::sender(ctx), 0); - let Counter {id, owner:_, value:_} = counter; - object::delete(id); - } -} - -#[test_only] -module basics::counter_test { - use sui::test_scenario; - use basics::counter; - - #[test] - fun test_counter() { - let owner = @0xC0FFEE; - let user1 = @0xA1; - - let mut scenario_val = test_scenario::begin(user1); - let scenario = &mut scenario_val; - - test_scenario::next_tx(scenario, owner); - { - counter::create(test_scenario::ctx(scenario)); - }; - - test_scenario::next_tx(scenario, user1); - { - let mut counter_val = test_scenario::take_shared(scenario); - let counter = &mut counter_val; - - assert!(counter::owner(counter) == owner, 0); - assert!(counter::value(counter) == 0, 1); - - counter::increment(counter); - counter::increment(counter); - counter::increment(counter); - test_scenario::return_shared(counter_val); - }; - - test_scenario::next_tx(scenario, owner); - { - let mut counter_val = test_scenario::take_shared(scenario); - let counter = &mut counter_val; - - assert!(counter::owner(counter) == owner, 0); - assert!(counter::value(counter) == 3, 1); - - counter::set_value(counter, 100, test_scenario::ctx(scenario)); - - test_scenario::return_shared(counter_val); - }; - - test_scenario::next_tx(scenario, user1); - { - let mut counter_val = test_scenario::take_shared(scenario); - let counter = &mut counter_val; - - assert!(counter::owner(counter) == owner, 0); - assert!(counter::value(counter) == 100, 1); - - counter::increment(counter); - - assert!(counter::value(counter) == 101, 2); - - test_scenario::return_shared(counter_val); - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/basics/sources/lock.move b/sui_programmability/examples/basics/sources/lock.move deleted file mode 100644 index 6c58d125f9ebc..0000000000000 --- a/sui_programmability/examples/basics/sources/lock.move +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// An example of a module that uses Shared Objects and ID linking/access. -/// -/// This module allows any content to be locked inside a 'virtual chest' and later -/// be accessed by putting a 'key' into the 'lock'. Lock is shared and is visible -/// and discoverable by the key owner. -module basics::lock { - /// Lock is empty, nothing to take. - const ELockIsEmpty: u64 = 0; - - /// Key does not match the Lock. - const EKeyMismatch: u64 = 1; - - /// Lock already contains something. - const ELockIsFull: u64 = 2; - - /// Lock that stores any content inside it. - public struct Lock has key, store { - id: UID, - locked: Option - } - - /// A key that is created with a Lock; is transferable - /// and contains all the needed information to open the Lock. - public struct Key has key, store { - id: UID, - `for`: ID, - } - - /// Returns an ID of a Lock for a given Key. - public fun key_for(key: &Key): ID { - key.`for` - } - - /// Lock some content inside a shared object. A Key is created and is - /// sent to the transaction sender. - public fun create(obj: T, ctx: &mut TxContext): Key { - let id = object::new(ctx); - let `for` = object::uid_to_inner(&id); - - transfer::public_share_object(Lock { - id, - locked: option::some(obj), - }); - - Key { - `for`, - id: object::new(ctx) - } - } - - /// Lock something inside a shared object using a Key. Aborts if - /// lock is not empty or if key doesn't match the lock. - public fun lock( - obj: T, - lock: &mut Lock, - key: &Key, - ) { - assert!(option::is_none(&lock.locked), ELockIsFull); - assert!(&key.`for` == object::borrow_id(lock), EKeyMismatch); - - option::fill(&mut lock.locked, obj); - } - - /// Unlock the Lock with a Key and access its contents. - /// Can only be called if both conditions are met: - /// - key matches the lock - /// - lock is not empty - public fun unlock( - lock: &mut Lock, - key: &Key, - ): T { - assert!(option::is_some(&lock.locked), ELockIsEmpty); - assert!(&key.`for` == object::borrow_id(lock), EKeyMismatch); - - option::extract(&mut lock.locked) - } -} - -#[test_only] -module basics::lockTest { - use sui::test_scenario; - use basics::lock::{Self, Lock, Key}; - - /// Custom structure which we will store inside a Lock. - public struct Treasure has store, key { - id: UID - } - - #[test] - fun test_lock() { - let user1 = @0x1; - let user2 = @0x2; - - let mut scenario_val = test_scenario::begin(user1); - let scenario = &mut scenario_val; - - // User1 creates a lock and places his treasure inside. - test_scenario::next_tx(scenario, user1); - { - let ctx = test_scenario::ctx(scenario); - let id = object::new(ctx); - - let l = lock::create(Treasure { id }, ctx); - transfer::public_transfer(l, tx_context::sender(ctx)) - }; - - // Now User1 owns a key from the lock. He decides to send this - // key to User2, so that he can have access to the stored treasure. - test_scenario::next_tx(scenario, user1); - { - let key = test_scenario::take_from_sender>(scenario); - transfer::public_transfer(key, user2); - }; - - // User2 is impatient and he decides to take the treasure. - test_scenario::next_tx(scenario, user2); - { - let mut lock_val = test_scenario::take_shared>(scenario); - let lock = &mut lock_val; - let key = test_scenario::take_from_sender>(scenario); - let ctx = test_scenario::ctx(scenario); - - let l = lock::unlock(lock, &key); - transfer::public_transfer(l, tx_context::sender(ctx)); - - test_scenario::return_shared(lock_val); - test_scenario::return_to_sender(scenario, key); - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/basics/sources/object.move b/sui_programmability/examples/basics/sources/object.move deleted file mode 100644 index 4ca7f764f76a3..0000000000000 --- a/sui_programmability/examples/basics/sources/object.move +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// An example of a custom object with comments explaining the relevant bits -module basics::object { - /// A custom sui object. Every object must have the `key` attribute - /// (indicating that it is allowed to be a key in the sui global object - /// pool), and must have a field `id: UID` corresponding to its sui ObjId. - /// Other object attributes present at the protocol level (authenticator, - /// sequence number, TxDigest, ...) are intentionally not exposed here. - public struct Object has key { - id: UID, - /// Custom objects can have fields of arbitrary type... - custom_field: u64, - /// ... including other objects - child_obj: ChildObject, - /// ... and other global objects - nested_obj: AnotherObject, - } - - /// An object that can be stored inside global objects or other child - /// objects, but cannot be placed in the global object pool on its own. - /// Note that it doesn't need an ID field. - public struct ChildObject has store { - a_field: bool, - } - - /// An object that can live either in the global object pool or as a nested - /// object. - public struct AnotherObject has key, store { - id: UID, - } - - /// Example of updating an object. All Move fields are private, so the - /// fields of `Object` can only be (directly) updated by code in this - /// module. - public fun write_field(o: &mut Object, v: u64) { - if (some_conditional_logic()) { - o.custom_field = v - } - } - - /// Example of transferring an object to a a new owner. A struct can only - /// be transferred by the module that declares it. - public fun transfer(o: Object, recipient: address) { - assert!(some_conditional_logic(), 0); - transfer::transfer(o, recipient) - } - - /// Simple getter - public fun read_field(o: &Object): u64 { - o.custom_field - } - - /// Example of creating a object by deriving a unique ID from the current - /// transaction and returning it to the caller (who may call functions - /// from this module to read/write it, package it into another object, ...) - public fun create(tx: &mut TxContext): Object { - Object { - id: object::new(tx), - custom_field: 0, - child_obj: ChildObject { a_field: false }, - nested_obj: AnotherObject { id: object::new(tx) } - } - } - - /// Example of an entrypoint function to be embedded in a Sui - /// transaction. A possible argument of an entrypoint function is a - /// `TxContext` created by the runtime that is useful for deriving - /// new id's or determining the sender of the transaction. - /// Next to the `TxContext`, entrypoints can take struct types with the `key` - /// attribute as input, as well as primitive types like ints, bools, ... - /// - /// A Sui transaction must declare the ID's of each object it will - /// access + any primitive inputs. The runtime that processes the - /// transaction fetches the values associated with the ID's, type-checks - /// the values + primitive inputs against the function signature - /// , then calls the `main` function with these values. - /// - /// If the script terminates successfully, the runtime collects changes to - /// input objects + created objects + emitted events, increments the - /// sequence number of each object, creates a hash that commits to the - /// outputs, etc. - public entry fun main( - to_read: &Object, // The argument of type Object is passed as a read-only reference - to_write: &mut Object, // The argument is passed as a mutable reference - to_consume: Object, // The argument is passed as a value - // ... end objects, begin primitive type inputs - int_input: u64, - recipient: address, - ctx: &mut TxContext, - ) { - let v = read_field(to_read); - write_field(to_write, v + int_input); - transfer(to_consume, recipient); - // demonstrate creating a new object for the sender - let sender = tx_context::sender(ctx); - transfer::transfer(create(ctx), sender) - } - - fun some_conditional_logic(): bool { - // placeholder for checks implemented in arbitrary Move code - true - } -} diff --git a/sui_programmability/examples/basics/sources/object_basics.move b/sui_programmability/examples/basics/sources/object_basics.move deleted file mode 100644 index a39d099298efc..0000000000000 --- a/sui_programmability/examples/basics/sources/object_basics.move +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Test CTURD object basics (create, transfer, update, read, delete) -module basics::object_basics { - use sui::event; - - public struct Object has key, store { - id: UID, - value: u64, - } - - public struct Wrapper has key { - id: UID, - o: Object - } - - public struct NewValueEvent has copy, drop { - new_value: u64 - } - - public entry fun create(value: u64, recipient: address, ctx: &mut TxContext) { - transfer::public_transfer( - Object { id: object::new(ctx), value }, - recipient - ) - } - - public entry fun transfer(o: Object, recipient: address) { - transfer::public_transfer(o, recipient) - } - - public entry fun freeze_object(o: Object) { - transfer::public_freeze_object(o) - } - - public entry fun set_value(o: &mut Object, value: u64) { - o.value = value; - } - - // test that reading o2 and updating o1 works - public entry fun update(o1: &mut Object, o2: &Object) { - o1.value = o2.value; - // emit an event so the world can see the new value - event::emit(NewValueEvent { new_value: o2.value }) - } - - public entry fun delete(o: Object) { - let Object { id, value: _ } = o; - object::delete(id); - } - - public entry fun wrap(o: Object, ctx: &mut TxContext) { - transfer::transfer(Wrapper { id: object::new(ctx), o }, tx_context::sender(ctx)) - } - - public entry fun unwrap(w: Wrapper, ctx: &TxContext) { - let Wrapper { id, o } = w; - object::delete(id); - transfer::public_transfer(o, tx_context::sender(ctx)) - } -} diff --git a/sui_programmability/examples/basics/sources/random.move b/sui_programmability/examples/basics/sources/random.move deleted file mode 100644 index f4dd9b88070a5..0000000000000 --- a/sui_programmability/examples/basics/sources/random.move +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This example demonstrates emitting a random u128 (e.g., for an offchain lottery) -module basics::random { - use sui::event; - use sui::random::Random; - - public struct RandomU128Event has copy, drop { - value: u128, - } - - entry fun new(r: &Random, ctx: &mut TxContext) { - let mut gen = r.new_generator(ctx); - let value = gen.generate_u128(); - event::emit(RandomU128Event { value }); - } -} diff --git a/sui_programmability/examples/basics/sources/sandwich.move b/sui_programmability/examples/basics/sources/sandwich.move deleted file mode 100644 index 18ecc13eec2b3..0000000000000 --- a/sui_programmability/examples/basics/sources/sandwich.move +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Example of objects that can be combined to create -/// new objects -module basics::sandwich { - use sui::balance::{Self, Balance}; - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - - public struct Ham has key, store { - id: UID - } - - public struct Bread has key, store { - id: UID - } - - public struct Sandwich has key, store { - id: UID, - } - - // This Capability allows the owner to withdraw profits - public struct GroceryOwnerCapability has key { - id: UID - } - - // Grocery is created on module init - public struct Grocery has key { - id: UID, - profits: Balance - } - - /// Price for ham - const HAM_PRICE: u64 = 10; - /// Price for bread - const BREAD_PRICE: u64 = 2; - - /// Not enough funds to pay for the good in question - const EInsufficientFunds: u64 = 0; - /// Nothing to withdraw - const ENoProfits: u64 = 1; - - #[allow(unused_function)] - /// On module init, create a grocery - fun init(ctx: &mut TxContext) { - transfer::share_object(Grocery { - id: object::new(ctx), - profits: balance::zero() - }); - - transfer::transfer(GroceryOwnerCapability { - id: object::new(ctx) - }, tx_context::sender(ctx)); - } - - /// Exchange `c` for some ham - public fun buy_ham( - grocery: &mut Grocery, - c: Coin, - ctx: &mut TxContext - ): Ham { - let b = coin::into_balance(c); - assert!(balance::value(&b) == HAM_PRICE, EInsufficientFunds); - balance::join(&mut grocery.profits, b); - Ham { id: object::new(ctx) } - } - - /// Exchange `c` for some bread - public fun buy_bread( - grocery: &mut Grocery, - c: Coin, - ctx: &mut TxContext - ): Bread { - let b = coin::into_balance(c); - assert!(balance::value(&b) == BREAD_PRICE, EInsufficientFunds); - balance::join(&mut grocery.profits, b); - Bread { id: object::new(ctx) } - } - - /// Combine the `ham` and `bread` into a delicious sandwich - public fun make_sandwich( - ham: Ham, bread: Bread, ctx: &mut TxContext - ): Sandwich { - let Ham { id: ham_id } = ham; - let Bread { id: bread_id } = bread; - object::delete(ham_id); - object::delete(bread_id); - Sandwich { id: object::new(ctx) } - } - - /// See the profits of a grocery - public fun profits(grocery: &Grocery): u64 { - balance::value(&grocery.profits) - } - - /// Owner of the grocery can collect profits by passing his capability - public fun collect_profits(_cap: &GroceryOwnerCapability, grocery: &mut Grocery, ctx: &mut TxContext): Coin { - let amount = balance::value(&grocery.profits); - - assert!(amount > 0, ENoProfits); - - // Take a transferable `Coin` from a `Balance` - coin::take(&mut grocery.profits, amount, ctx) - } - - #[test_only] - public fun init_for_testing(ctx: &mut TxContext) { - init(ctx); - } -} - -#[test_only] -module basics::test_sandwich { - use basics::sandwich::{Self, Grocery, GroceryOwnerCapability}; - use sui::test_scenario; - use sui::coin::{Self}; - use sui::sui::SUI; - use sui::test_utils; - - #[test] - fun test_make_sandwich() { - let owner = @0x1; - let the_guy = @0x2; - - let mut scenario_val = test_scenario::begin(owner); - let scenario = &mut scenario_val; - test_scenario::next_tx(scenario, owner); - { - sandwich::init_for_testing(test_scenario::ctx(scenario)); - }; - - test_scenario::next_tx(scenario, the_guy); - { - let mut grocery_val = test_scenario::take_shared(scenario); - let grocery = &mut grocery_val; - let ctx = test_scenario::ctx(scenario); - - let ham = sandwich::buy_ham( - grocery, - coin::mint_for_testing(10, ctx), - ctx - ); - - let bread = sandwich::buy_bread( - grocery, - coin::mint_for_testing(2, ctx), - ctx - ); - let sandwich = sandwich::make_sandwich(ham, bread, ctx); - - test_scenario::return_shared( grocery_val); - transfer::public_transfer(sandwich, tx_context::sender(ctx)) - }; - - test_scenario::next_tx(scenario, owner); - { - let mut grocery_val = test_scenario::take_shared(scenario); - let grocery = &mut grocery_val; - let capability = test_scenario::take_from_sender(scenario); - - assert!(sandwich::profits(grocery) == 12, 0); - let profits = sandwich::collect_profits(&capability, grocery, test_scenario::ctx(scenario)); - assert!(sandwich::profits(grocery) == 0, 0); - - test_scenario::return_to_sender(scenario, capability); - test_scenario::return_shared(grocery_val); - test_utils::destroy(profits) - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/capy/Move.toml b/sui_programmability/examples/capy/Move.toml deleted file mode 100644 index 809e0c09915ec..0000000000000 --- a/sui_programmability/examples/capy/Move.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "sui-capybaras" -version = "0.1.0" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -capy = "0x0" -me = "0x0" diff --git a/sui_programmability/examples/capy/sources/capy.move b/sui_programmability/examples/capy/sources/capy.move deleted file mode 100644 index c97d1e733aad1..0000000000000 --- a/sui_programmability/examples/capy/sources/capy.move +++ /dev/null @@ -1,486 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// The Capy module. Defines the Capy type and its functions. -module capy::capy { - use std::string::{Self, String}; - use sui::url::{Self, Url}; - use sui::event::emit; - use sui::dynamic_object_field as dof; - - use std::hash::sha3_256 as hash; - - /// Number of meaningful genes. Also marks the length - /// of the hash used in the application: sha3_256. - const GENES: u64 = 32; - - /// There's a chance to apply mutation on each gene. - /// For testing reasons mutation chance is relatively high: 5/255. - const MUTATION_CHANCE: u8 = 250; - - /// Base path for `Capy.url` attribute. Is temporary and improves - /// explorer / wallet display. Always points to the dev/testnet server. - const IMAGE_URL: vector = b"https://api.capy.art/capys/"; - - /// Link to the capy on the capy.art. - const MAIN_URL: vector = b"https://capy.art/capy/"; - - // ======== Types ========= - - /// Internal representation of a Gene Sequence. Each Gene - /// corresponds to an attribute. Max number of genes is `GENES`. - public struct Genes has store, copy, drop { sequence: vector } - - /// Defines a Capy attribute. Eg: `pattern: 'panda'` - public struct Attribute has store, copy, drop { - name: String, - value: String, - } - - /// One of the possible values defined in GeneDefinition. - /// `selector` field corresponds to the u8 value of the gene in a sequence. - /// - /// See `breed` function for details on usage. - public struct Value has store, drop, copy { - selector: u8, - name: String - } - - /// Holds the definitions for each gene. They are then assigned to - /// Capys. Newborn will receive attributes available at the time. - public struct GeneDefinition has store { - name: String, - values: vector - } - - /// The Capy itself. Every Capy has its unique set of genes, - /// as well as generation and parents. Ownable, tradeable. - public struct Capy has key, store { - id: UID, - gen: u32, - url: Url, - link: Url, - genes: Genes, - dev_genes: Genes, - item_count: u8, - attributes: vector, - } - - /// Belongs to the creator of the game. Has store, which - /// allows building something on top of it (ie shared object with - /// multi-access policy for managers). - public struct CapyManagerCap has key, store { id: UID } - - /// Every capybara is registered here. Acts as a source of randomness - /// as well as the storage for the main information about the gamestate. - public struct CapyRegistry has key { - id: UID, - capy_born: u64, - capy_hash: vector, - genes: vector - } - - - // ======== Events ========= - - /// Event. When a new registry has been created. - /// Marks the start of the game. - public struct RegistryCreated has copy, drop { id: ID } - - /// Event. Emitted when a new Gene definition was added. - /// Helps announcing new features. - public struct GeneDefinitionAdded has copy, drop { - name: String, - values: vector - } - - /// Event. When new Capy is born. - public struct CapyBorn has copy, drop { - id: ID, - gen: u32, - genes: Genes, - dev_genes: Genes, - attributes: vector, - parent_one: Option, - parent_two: Option, - bred_by: address - } - - /// Event. Emitted when a new item is added to a capy. - public struct ItemAdded has copy, drop { - capy_id: ID, - item_id: ID - } - - /// Event. Emitted when an item is taken off. - public struct ItemRemoved has copy, drop { - capy_id: ID, - item_id: ID, - } - - // ======== View Functions ======== - - /// Read extra gene sequence of a Capy as `vector`. - public fun dev_genes(self: &Capy): &vector { - &self.dev_genes.sequence - } - - // ======== Functions ========= - - #[allow(unused_function)] - /// Create a shared CapyRegistry and give its creator the capability - /// to manage the game. - fun init(ctx: &mut TxContext) { - let id = object::new(ctx); - let capy_hash = hash(object::uid_to_bytes(&id)); - - emit(RegistryCreated { id: object::uid_to_inner(&id) }); - - transfer::public_transfer(CapyManagerCap { id: object::new(ctx) }, tx_context::sender(ctx)); - transfer::share_object(CapyRegistry { - id, - capy_hash, - capy_born: 0, - genes: vector[], - }) - } - - - // ======= Admin Functions ======= - - /// This method is rather complicated. - /// To define a new set of attributes, Admin must send it in a format: - /// ``` - /// name = b"name of the attribute" - /// definitions = [ - /// [selector_u8, ...name_bytes], - /// [selector_u8, ...name_bytes] - /// ] - /// ``` - public entry fun add_gene( - _: &CapyManagerCap, - reg: &mut CapyRegistry, - name: vector, - definitions: vector>, - _ctx: &mut TxContext - ) { - let name = string::utf8(name); - let values = raw_vec_to_values(definitions); - - // emit an event confirming gene addition - emit(GeneDefinitionAdded { name: *&name, values: *&values }); - - // lastly add new gene definition to the registry - reg.genes.push_back(GeneDefinition { name, values }); - } - - /// Batch-add new Capys with predefined gene sequences. - public fun batch(_: &CapyManagerCap, reg: &mut CapyRegistry, mut genes: vector>, ctx: &mut TxContext): vector { - let mut capys = vector[]; - while (genes.length() > 0) { - let sequence = genes.pop_back(); - let capy = create_capy(reg, sequence, vector[], ctx); - - capys.push_back(capy); - }; - - capys - } - - /// Creates an attribute with the given name and a value. Should only be used for - /// events. Is currently a friend-only feature but will be put behind a capability - /// authorization later. - public(package) fun create_attribute(name: vector, value: vector): Attribute { - Attribute { - name: string::utf8(name), - value: string::utf8(value) - } - } - - /// Create a Capy with a specified gene sequence. - /// Also allows assigning custom attributes if an App is authorized to do it. - public(package) fun create_capy( - reg: &mut CapyRegistry, sequence: vector, custom_attributes: vector, ctx: &mut TxContext - ): Capy { - let id = object::new(ctx); - let genes = Genes { sequence }; - let dev_genes = Genes { sequence: hash(sequence) }; - - reg.capy_born = reg.capy_born + 1; - - reg.capy_hash.append(object::uid_to_bytes(&id)); - reg.capy_hash = hash(reg.capy_hash); - - let sender = tx_context::sender(ctx); - let mut attributes = get_attributes(®.genes, &genes); - - attributes.append(custom_attributes); - - emit(CapyBorn { - id: object::uid_to_inner(&id), - gen: 0, - attributes: *&attributes, - genes: *&genes, - dev_genes: *&dev_genes, - parent_one: option::none(), - parent_two: option::none(), - bred_by: sender - }); - - Capy { - url: img_url(&id), - link: link_url(&id), - id, - genes, - dev_genes, - attributes, - gen: 0, - item_count: 0, - } - } - - // ======= User facing functions ======= - - /// Attach an Item to a Capy. Function is generic and allows any app to attach items to - /// Capys but the total count of items has to be lower than 255. - public entry fun add_item(capy: &mut Capy, item: T) { - emit(ItemAdded { - capy_id: object::id(capy), - item_id: object::id(&item) - }); - - dof::add(&mut capy.id, object::id(&item), item); - } - - /// Remove item from the Capy. - public entry fun remove_item(capy: &mut Capy, item_id: ID, ctx: &TxContext) { - emit(ItemRemoved { - capy_id: object::id(capy), - item_id: *&item_id - }); - - transfer::public_transfer(dof::remove(&mut capy.id, item_id), tx_context::sender(ctx)); - } - - /// Breed capys and keep the newborn at sender's address. - public entry fun breed_and_keep( - reg: &mut CapyRegistry, - c1: &mut Capy, - c2: &mut Capy, - ctx: &mut TxContext - ) { - transfer::public_transfer(breed(reg, c1, c2, ctx), tx_context::sender(ctx)) - } - - /// Breed two Capys together. Perform a gene science algorithm and select - /// genes for the newborn based on the parents' genes. - public fun breed( - reg: &mut CapyRegistry, - c1: &mut Capy, - c2: &mut Capy, - ctx: &mut TxContext - ): Capy { - let id = object::new(ctx); - - // Update capy hash in the registry - reg.capy_hash.append(object::uid_to_bytes(&id)); - - // compute genes - reg.capy_hash = hash(reg.capy_hash); - let genes = compute_genes(®.capy_hash, &c1.genes, &c2.genes, GENES); - - // compute dev-genes - reg.capy_hash = hash(reg.capy_hash); - let dev_genes = compute_genes(®.capy_hash, &c1.genes, &c2.genes, GENES); - - let gen = if (c1.gen > c2.gen) { c1.gen } else { c2.gen } + 1; - let attributes = get_attributes(®.genes, &genes); - let sender = tx_context::sender(ctx); - - emit(CapyBorn { - id: object::uid_to_inner(&id), - gen, - genes: *&genes, - attributes: *&attributes, - dev_genes: *&dev_genes, - parent_one: option::some(object::id(c1)), - parent_two: option::some(object::id(c2)), - bred_by: sender - }); - - // Send newborn to parents. - Capy { - url: img_url(&id), - link: link_url(&id), - id, - gen, - genes, - dev_genes, - attributes, - item_count: 0, - } - } - - // ======= Private and Utility functions ======= - - /// Get Capy attributes from the gene sequence. - fun get_attributes(definitions: &vector, genes: &Genes): vector { - let mut attributes = vector[]; - let (mut i, len) = (0u64, definitions.length()); - while (i < len) { - let gene_def = &definitions[i]; - let capy_gene = &genes.sequence[i]; - - let (mut j, num_options) = (0u64, gene_def.values.length()); - while (j < num_options) { - let value = &gene_def.values[j]; - if (*capy_gene <= value.selector) { - attributes.push_back(Attribute { - name: *&gene_def.name, - value: *&value.name - }); - break - }; - j = j + 1; - }; - i = i + 1; - }; - - attributes - } - - /// Computes genes for the newborn based on the random seed r0, and parents genes - /// The `max` parameter affects how many genes should be changed (if there are no - /// attributes yet for the) - fun compute_genes(r0: &vector, g1: &Genes, g2: &Genes, max: u64): Genes { - let mut i = 0; - - let s1 = &g1.sequence; - let s2 = &g2.sequence; - let mut s3 = vector[]; - - let r1 = derive(r0, 1); // for parent gene selection - let r2 = derive(r0, 2); // chance of random mutation - let r3 = derive(r0, 3); // value selector for random mutation - - while (i < max) { - let rng = r1[i]; - let mut gene = if (lor(rng, 127)) { - s1[i] - } else { - s2[i] - }; - - // There's a tiny chance that a mutation will happen. - if (lor(r2[i], MUTATION_CHANCE)) { - gene = r3[i]; - }; - - s3.push_back(gene); - i = i + 1; - }; - - Genes { sequence: s3 } - } - - /// Give true or false based on the number. - /// Used for selecting mother/father genes. - fun lor(rng: u8, cmp: u8): bool { - (rng > cmp) - } - - /// Derive something from the seed. Add a derivation path as u8, and - /// hash the result. - fun derive(r0: &vector, path: u8): vector { - let mut r1 = *r0; - r1.push_back(path); - hash(r1) - } - - - // ==== Utilities ====== - - /// Transforms a vector of raw definitions: - /// [ - /// [127, b"red"], - /// [255, b"blue"], - /// ] - /// Into a vector of `Value`s (in order!): - /// [ - /// Value { selector: 127, name: String("red") }, - /// Value { selector: 255, name: String("blue") }, - /// ] - fun raw_vec_to_values(mut definitions: vector>): vector { - let mut result = vector[]; - definitions.reverse(); - while (definitions.length() > 0) { - // [selector, name] - let mut value_def = definitions.pop_back(); - // [eman, selector] - value_def.reverse(); - let selector = value_def.pop_back(); - let mut name = vector[]; - while (value_def.length() > 0) { - name.push_back(value_def.pop_back()); - }; - - result.push_back(Value { - selector, - name: string::utf8(name) - }); - }; - - result - } - - /// Construct an image URL for the capy. - fun img_url(c: &UID): Url { - let mut capy_url = IMAGE_URL; - capy_url.append(sui::hex::encode(object::uid_to_bytes(c))); - capy_url.append(b"/svg"); - - url::new_unsafe_from_bytes(capy_url) - } - - /// Construct a Url to the capy.art. - fun link_url(c: &UID): Url { - let mut capy_url = MAIN_URL; - capy_url.append(sui::hex::encode(object::uid_to_bytes(c))); - url::new_unsafe_from_bytes(capy_url) - } - - #[test] - fun test_raw_vec_to_values() { - let mut definitions: vector> = vector[]; - - /* push [127, "red"] */ { - let mut def = vector[]; - def.push_back(127); - def.append(b"red"); - definitions.push_back(def); - }; - - /* push [255, "blue"] */ { - let mut def = vector[]; - def.push_back(255); - def.append(b"blue"); - definitions.push_back(def); - }; - - let mut values: vector = raw_vec_to_values(definitions); - - /* expect [255, blue] */ { - let Value { selector, name } = values.pop_back(); - assert!(selector == 255, 0); - assert!(name.as_bytes() == &b"blue", 0); - }; - - /* expect [127, red] */ { - let Value { selector, name } = values.pop_back(); - assert!(selector == 127, 0); - assert!(name.as_bytes() == &b"red", 0); - }; - - values.destroy_empty(); - } -} diff --git a/sui_programmability/examples/capy/sources/capy_admin.move b/sui_programmability/examples/capy/sources/capy_admin.move deleted file mode 100644 index 153003a16f688..0000000000000 --- a/sui_programmability/examples/capy/sources/capy_admin.move +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Encapsulates CapyAdmin functionality allowing for faster -/// txs and lower gas fees for new capy / item batches. -module capy::capy_admin { - use capy::capy::{Self, CapyManagerCap, CapyRegistry, Capy}; - use capy::capy_market::{Self, CapyMarket}; - - entry fun add_gene( - cap: &CapyManagerCap, - reg: &mut CapyRegistry, - name: vector, - definitions: vector>, - ctx: &mut TxContext - ) { - capy::add_gene(cap, reg, name, definitions, ctx); - } - - entry fun batch_sell_capys( - cap: &CapyManagerCap, - reg: &mut CapyRegistry, - market: &mut CapyMarket, - genes: vector>, - price: u64, - ctx: &mut TxContext - ) { - let capys = capy::batch(cap, reg, genes, ctx); - capy_market::batch_list(market, capys, price, ctx); - } -} diff --git a/sui_programmability/examples/capy/sources/capy_item.move b/sui_programmability/examples/capy/sources/capy_item.move deleted file mode 100644 index 53a55fdb4b9a4..0000000000000 --- a/sui_programmability/examples/capy/sources/capy_item.move +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Store for Capys. Unlike Marketplace, Store sells identical items -/// in the limit specified quantity or, if quantity is not set, unlimited. -/// -/// Gives the Store Owner full access over the Listings and their quantity -/// as well as allows collecting profits in a single call. -module capy::capy_item { - use sui::url::{Self, Url}; - use std::string::{Self, String}; - use sui::sui::SUI; - use sui::balance::{Self, Balance}; - use sui::dynamic_object_field as dof; - use sui::coin::{Self, Coin}; - use sui::event::emit; - use sui::pay; - - /// Base path for `CapyItem.url` attribute. Is temporary and improves - /// explorer / wallet display. Always points to the dev/testnet server. - const IMAGE_URL: vector = b"https://api.capy.art/items/"; - - /// Store for any type T. Collects profits from all sold listings - /// to be later acquirable by the Capy Admin. - public struct ItemStore has key { - id: UID, - balance: Balance - } - - /// A Capy item, that is being purchased from the `ItemStore`. - public struct CapyItem has key, store { - id: UID, - name: String, - /// Urls and other meta information should - /// always go last as it allows for partial - /// deserialization of data on the frontend - url: Url, - } - - /// A Capability granting the bearer full control over the `ItemStore`. - public struct StoreOwnerCap has key, store { id: UID } - - /// A listing for an Item. Supply is either finite or infinite. - public struct ListedItem has key, store { - id: UID, - url: Url, - name: String, - `type`: String, - price: u64, - quantity: Option, - } - - /// Emitted when new item is purchased. - /// Off-chain we only need to know which ID - /// corresponds to which name to serve the data. - public struct ItemCreated has copy, drop { - id: ID, - name: String, - } - - #[allow(unused_function)] - /// Create a `ItemStore` and a `StoreOwnerCap` for this store. - fun init(ctx: &mut TxContext) { - transfer::share_object(ItemStore { - id: object::new(ctx), - balance: balance::zero() - }); - - transfer::public_transfer(StoreOwnerCap { - id: object::new(ctx) - }, ctx.sender()) - } - - /// Admin action - collect Profits from the `ItemStore`. - public entry fun collect_profits( - _: &StoreOwnerCap, s: &mut ItemStore, ctx: &mut TxContext - ) { - let a = balance::value(&s.balance); - let b = balance::split(&mut s.balance, a); - - transfer::public_transfer(coin::from_balance(b, ctx), ctx.sender()) - } - - /// Change the quantity value for the listing in the `ItemStore`. - public entry fun set_quantity( - _: &StoreOwnerCap, s: &mut ItemStore, name: vector, quantity: u64 - ) { - let listing_mut = dof::borrow_mut, ListedItem>(&mut s.id, name); - option::swap(&mut listing_mut.quantity, quantity); - } - - /// List an item in the `ItemStore` to be freely purchasable - /// within the set quantity (if set). - public entry fun sell( - _: &StoreOwnerCap, - s: &mut ItemStore, - name: vector, - `type`: vector, - price: u64, - // quantity: Option, - ctx: &mut TxContext - ) { - dof::add(&mut s.id, name, ListedItem { - id: object::new(ctx), - url: img_url(name), - price, - quantity: option::none(), // temporarily only infinite quantity - name: string::utf8(name), - `type`: string::utf8(`type`) - }); - } - - /// Buy an Item from the `ItemStore`. Pay `Coin` and - /// receive a `CapyItem`. - public entry fun buy_and_take( - s: &mut ItemStore, name: vector, payment: Coin, ctx: &mut TxContext - ) { - let listing_mut = dof::borrow_mut, ListedItem>(&mut s.id, name); - - // check that the Coin amount matches the price; then add it to the balance - assert!(coin::value(&payment) == listing_mut.price, 0); - coin::put(&mut s.balance, payment); - - // if quantity is set, make sure that it's not 0; then decrement - if (option::is_some(&listing_mut.quantity)) { - let q = option::borrow(&listing_mut.quantity); - assert!(*q > 0, 0); - option::swap(&mut listing_mut.quantity, *q - 1); - }; - - let id = object::new(ctx); - - emit(ItemCreated { - id: object::uid_to_inner(&id), - name: listing_mut.name - }); - - transfer::public_transfer(CapyItem { - id, - url: listing_mut.url, - name: listing_mut.name, - }, ctx.sender()) - } - - /// Buy a CapyItem with a single Coin which may be bigger than the - /// price of the listing. - public entry fun buy_mut( - s: &mut ItemStore, name: vector, payment: &mut Coin, ctx: &mut TxContext - ) { - let listing = dof::borrow, ListedItem>(&s.id, name); - let paid = coin::split(payment, listing.price, ctx); - buy_and_take(s, name, paid, ctx) - } - - /// Buy a CapyItem with multiple Coins by joining them first and then - /// calling the `buy_mut` function. - public entry fun buy_mul_coin( - s: &mut ItemStore, name: vector, mut coins: vector>, ctx: &mut TxContext - ) { - let mut paid = coins.pop_back(); - pay::join_vec(&mut paid, coins); - buy_mut(s, name, &mut paid, ctx); - transfer::public_transfer(paid, ctx.sender()) - } - - /// Construct an image URL for the `CapyItem`. - fun img_url(name: vector): Url { - let mut capy_url = IMAGE_URL; - capy_url.append(name); - capy_url.append(b"/svg"); - - url::new_unsafe_from_bytes(capy_url) - } -} diff --git a/sui_programmability/examples/capy/sources/capy_market.move b/sui_programmability/examples/capy/sources/capy_market.move deleted file mode 100644 index bbe8ff5f049ad..0000000000000 --- a/sui_programmability/examples/capy/sources/capy_market.move +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// CapyMarket for Capy-related objects. -/// Allows selling and accessories. -/// -/// TODO: refactor usage of events - many of the parameters are redundant -/// and can be linked off-chain with additional tooling. Kept for usability -/// and development speed purposes. -module capy::capy_market { - use sui::pay; - use sui::sui::SUI; - use sui::event::emit; - use sui::coin::{Self, Coin}; - use sui::dynamic_object_field as dof; - - // The Capy Manager gains all control over admin actions - // of the capy_marketplace. Modules must be published together - // to achieve consistency over types. - use capy::capy::{Capy, CapyManagerCap}; - - /// For when someone tries to delist without ownership. - const ENotOwner: u64 = 0; - - /// For when amount paid does not match the expected. - const EAmountIncorrect: u64 = 1; - - /// For when there's nothing to claim from the marketplace. - const ENoProfits: u64 = 2; - - // ======= Types ======= - - /// A generic marketplace for anything. - public struct CapyMarket has key { - id: UID, - } - - /// A listing for the marketplace. Intermediary object which owns an Item. - public struct Listing has key, store { - id: UID, - price: u64, - owner: address, - } - - // ======= Events ======= - - /// Emitted when a new CapyMarket is created. - public struct MarketCreated has copy, drop { - market_id: ID, - } - - /// Emitted when someone lists a new item on the CapyMarket. - public struct ItemListed has copy, drop { - listing_id: ID, - item_id: ID, - price: u64, - owner: address, - } - - /// Emitted when owner delists an item from the CapyMarket. - public struct ItemDelisted has copy, drop { - listing_id: ID, - item_id: ID, - } - - /// Emitted when someone makes a purchase. `new_owner` shows - /// who's a happy new owner of the purchased item. - public struct ItemPurchased has copy, drop { - listing_id: ID, - item_id: ID, - new_owner: address, - } - - /// For when someone collects profits from the market. Helps - /// indexer show who has how much. - public struct ProfitsCollected has copy, drop { - owner: address, - amount: u64 - } - - // ======= Publishing ======= - - #[allow(unused_function)] - /// By default create two Markets - fun init(ctx: &mut TxContext) { - publish(ctx); - } - - /// Admin-only method which allows creating a new marketplace. - public entry fun create_marketplace( - _: &CapyManagerCap, ctx: &mut TxContext - ) { - publish(ctx) - } - - /// Publish a new CapyMarket for any type T. Method is private and - /// can only be called in a module initializer or in an admin-only - /// method `create_marketplace` - fun publish(ctx: &mut TxContext) { - let id = object::new(ctx); - emit(MarketCreated { market_id: object::uid_to_inner(&id) }); - transfer::share_object(CapyMarket { id }); - } - - // ======= CapyMarket Actions ======= - - /// List a batch of T at once. - public fun batch_list( - market: &mut CapyMarket, - mut items: vector, - price: u64, - ctx: &mut TxContext - ) { - while (items.length() > 0) { - list(market, items.pop_back(), price, ctx) - }; - - items.destroy_empty(); - } - - /// List a new item on the CapyMarket. - public entry fun list( - market: &mut CapyMarket, - item: T, - price: u64, - ctx: &mut TxContext - ) { - let id = object::new(ctx); - let owner = tx_context::sender(ctx); - let mut listing = Listing { id, price, owner }; - - emit(ItemListed { - item_id: object::id(&item), - listing_id: object::id(&listing), - price, - owner - }); - - // Attach Item to the Listing through listing.id; - // Then attach listing to the marketplace through item_id; - dof::add(&mut listing.id, true, item); - dof::add(&mut market.id, object::id(&listing), listing); - } - - /// Remove listing and get an item back. Only owner can do that. - public fun delist( - market: &mut CapyMarket, - listing_id: ID, - ctx: &TxContext - ): T { - let Listing { mut id, price: _, owner } = dof::remove(&mut market.id, listing_id); - let item = dof::remove(&mut id, true); - - assert!(tx_context::sender(ctx) == owner, ENotOwner); - - emit(ItemDelisted { - listing_id, - item_id: object::id(&item), - }); - - object::delete(id); - item - } - - /// Call [`delist`] and transfer item to the sender. - entry fun delist_and_take( - market: &mut CapyMarket, - listing_id: ID, - ctx: &TxContext - ) { - transfer::public_transfer( - delist(market, listing_id, ctx), - tx_context::sender(ctx) - ) - } - - /// Withdraw profits from the marketplace as a single Coin (accumulated as a DOF). - /// Uses sender of transaction to determine storage and control access. - entry fun take_profits( - market: &mut CapyMarket, - ctx: &TxContext - ) { - let sender = tx_context::sender(ctx); - assert!(dof::exists_(&market.id, sender), ENoProfits); - let profit = dof::remove>(&mut market.id, sender); - - emit(ProfitsCollected { - owner: sender, - amount: coin::value(&profit) - }); - - transfer::public_transfer(profit, sender) - } - - /// Purchase an item using a known Listing. Payment is done in Coin. - /// Amount paid must match the requested amount. If conditions are met, - /// owner of the item gets the payment and buyer receives their item. - public fun purchase( - market: &mut CapyMarket, - listing_id: ID, - paid: Coin, - ctx: &TxContext - ): T { - let Listing { mut id, price, owner } = dof::remove(&mut market.id, listing_id); - let item = dof::remove(&mut id, true); - let new_owner = tx_context::sender(ctx); - - assert!(price == coin::value(&paid), EAmountIncorrect); - - emit(ItemPurchased { - item_id: object::id(&item), - listing_id, - new_owner - }); - - // if there's a balance attached to the marketplace - merge it with paid. - // if not -> leave a Coin hanging as a dynamic field of the marketplace. - if (dof::exists_(&market.id, owner)) { - coin::join(dof::borrow_mut>(&mut market.id, owner), paid) - } else { - dof::add(&mut market.id, owner, paid) - }; - - object::delete(id); - item - } - - /// Call [`buy`] and transfer item to the sender. - entry fun purchase_and_take( - market: &mut CapyMarket, - listing_id: ID, - paid: Coin, - ctx: &TxContext - ) { - transfer::public_transfer( - purchase(market, listing_id, paid, ctx), - tx_context::sender(ctx) - ) - } - - /// Use `&mut Coin` to purchase `T` from marketplace. - entry fun purchase_and_take_mut( - market: &mut CapyMarket, - listing_id: ID, - paid: &mut Coin, - ctx: &mut TxContext - ) { - let listing = dof::borrow(&market.id, *&listing_id); - let coin = coin::split(paid, listing.price, ctx); - purchase_and_take(market, listing_id, coin, ctx) - } - - /// Send multiple Coins in order to merge them and afford pricy Capy. - entry fun purchase_and_take_mul_coins( - market: &mut CapyMarket, - listing_id: ID, - mut coins: vector>, - ctx: &mut TxContext - ) { - let listing = dof::borrow(&market.id, *&listing_id); - let mut coin = coins.pop_back(); - - pay::join_vec(&mut coin, coins); - - let paid = coin::split(&mut coin, listing.price, ctx); - transfer::public_transfer(coin, tx_context::sender(ctx)); - purchase_and_take(market, listing_id, paid, ctx) - } -} diff --git a/sui_programmability/examples/capy/sources/capy_winter.move b/sui_programmability/examples/capy/sources/capy_winter.move deleted file mode 100644 index 9e49857d1b51a..0000000000000 --- a/sui_programmability/examples/capy/sources/capy_winter.move +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This module enables Capy Winter Event - the result of a -/// unique collaboration between Capy Labs and Capy Post. -/// -/// Once a year, two giants of the Capy world unite their -/// forces to deliver the best Winter Holiday experience to -/// support kindness, generosity and the holiday mood. -/// -/// Capy Post takes zero commission for gift parcels. -module capy::capy_winter { - use sui::sui::SUI; - use sui::coin::{Self, Coin}; - use sui::balance::{Self, Balance}; - use std::hash::sha3_256 as hash; - use sui::dynamic_field as df; - use sui::url::{Self, Url}; - use sui::event::emit; - use sui::pay; - use sui::bcs; - - use capy::capy::{Self, Attribute, CapyRegistry}; - - /// The name for custom attributes. - const ATTRIBUTE_NAME: vector = b"special"; - - /// Custom attributes assigned randomly when a box is opened. - const ATTRIBUTE_VALUES: vector> = vector[ - b"snow globe", - b"antlers", - b"garland", - b"beard", - ]; - - /// Value for the premium attribute. - const PREMIUM_ATTRIBUTE: vector = b"winter environment"; - - /// Total number of different GiftBoxes available for - /// sale from the CapyPost. - const GIFT_TYPES: u8 = 8; - - /// A single price for every GiftBox available this year. - const GIFT_PRICE: u64 = 2023_0000; - - /// Position of the '0' symbol in ASCII - const ASCII_OFFSET: u8 = 48; - - /// A gift box; what's inside? - public struct GiftBox has key { - id: UID, - `type`: u8, - url: Url, - link: Url, - } - - /// A ticket granting the permission to buy a premium box. - public struct PremiumTicket has key { id: UID } - - /// A Premium box - can only be purchased by the most genereous givers. - public struct PremiumBox has key { - id: UID, - url: Url, - } - - /// Every parcel must go through here! - public struct CapyPost has key { id: UID, balance: Balance } - - // ========= Events ========= - - /// Emitted when a box was purchased of a gift box. - public struct GiftPurchased has copy, drop { id: ID, `type`: u8 } - - /// Emitted when a gift has been sent - public struct GiftSent has copy, drop { id: ID } - - /// Emitted when a gift was opened! - public struct GiftOpened has copy, drop { id: ID } - - /// Emitted when a premium gift was received. - public struct PremiumTicketReceived has copy, drop { id: ID } - - /// Emitted when a premium box was purchased. - public struct PremiumPurchased has copy, drop { id: ID } - - /// Emitted when a premium gift was opened. - public struct PremiumOpened has copy, drop { id: ID } - - // ========= Dynamic Parameters Keys ========= - - public struct SentKey has store, copy, drop { sender: address } - - #[allow(unused_function)] - /// Build a CapyPost office and offer gifts to send and buy. - fun init(ctx: &mut TxContext) { - transfer::share_object(CapyPost { id: object::new(ctx), balance: balance::zero() }); - } - - /// Buy a single `GiftBox` and keep it at the sender's address. - entry fun buy_gift(post: &mut CapyPost, `type`: u8, payment: vector>, ctx: &mut TxContext) { - assert!(`type` < GIFT_TYPES, 0); - - let (paid, remainder) = merge_and_split(payment, GIFT_PRICE, ctx); - coin::put(&mut post.balance, paid); - let id = object::new(ctx); - let url = get_img_url(`type`); - let link = get_link_url(&id, `type`); - - emit(GiftPurchased { id: object::uid_to_inner(&id), `type` }); - transfer::transfer(GiftBox { id, `type`, url, link }, ctx.sender()); - transfer::public_transfer(remainder, ctx.sender()) - } - - /// Send a GiftBox to a friend or a stranger through CapyPost. - /// Kindness and generosity will be rewarded! - entry fun send_gift(post: &mut CapyPost, box: GiftBox, receiver: address, ctx: &mut TxContext) { - let sender = ctx.sender(); - - // Can't send gifts to yourself... - assert!(receiver != sender, 0); - - // If there's already a gift-tracking field, we increment the counter; - // Once it reaches 2 (the third send), we reset the counter and send a PremiumBox; - let sent = if (df::exists_with_type(&post.id, SentKey { sender })) { - let sent = df::remove(&mut post.id, SentKey { sender }); - if (sent == 1) { - let id = object::new(ctx); - emit(PremiumTicketReceived { id: object::uid_to_inner(&id) }); - transfer::transfer(PremiumTicket { id }, ctx.sender()); - 0 - } else { sent + 1 } - } else { 0 }; - - // update the counter with the resulting value - df::add(&mut post.id, SentKey { sender }, sent); - - emit(GiftSent { id: object::id(&box) }); - transfer::transfer(box, receiver) - } - - /// Open a box and expect a surprise! - entry fun open_box(reg: &mut CapyRegistry, box: GiftBox, ctx: &mut TxContext) { - let GiftBox { id, `type`: _, url: _, link: _ } = box; - let sequence = std::hash::sha3_256(object::uid_to_bytes(&id)); - let attribute = get_attribute(&sequence); - - emit(GiftOpened { id: object::uid_to_inner(&id) }); - transfer::public_transfer(capy::create_capy(reg, sequence, vector[ attribute ], ctx), ctx.sender()); - object::delete(id) - } - - /// Buy a premium box using a ticket! - entry fun buy_premium( - post: &mut CapyPost, ticket: PremiumTicket, payment: vector>, ctx: &mut TxContext - ) { - let PremiumTicket { id: ticket_id } = ticket; - let (paid, remainder) = merge_and_split(payment, GIFT_PRICE, ctx); - coin::put(&mut post.balance, paid); - let id = object::new(ctx); - - emit(PremiumPurchased { id: object::uid_to_inner(&id) }); - transfer::transfer(PremiumBox { id, url: get_img_url(99) }, ctx.sender()); - transfer::public_transfer(remainder, ctx.sender()); - object::delete(ticket_id) - } - - /// Open a premium box! - entry fun open_premium(reg: &mut CapyRegistry, box: PremiumBox, ctx: &mut TxContext) { - let PremiumBox { id, url: _ } = box; - let sequence = std::hash::sha3_256(object::uid_to_bytes(&id)); - let premium = capy::create_attribute(ATTRIBUTE_NAME, PREMIUM_ATTRIBUTE); - - emit(PremiumOpened { id: object::uid_to_inner(&id) }); - transfer::public_transfer(capy::create_capy(reg, sequence, vector[ premium ], ctx), ctx.sender()); - object::delete(id) - } - - /// Merges a vector of Coin then splits the `amount` from it, returns the - /// Coin with the amount and the remainder. - fun merge_and_split( - mut coins: vector>, amount: u64, ctx: &mut TxContext - ): (Coin, Coin) { - let mut base = coins.pop_back(); - pay::join_vec(&mut base, coins); - assert!(coin::value(&base) > amount, 0); - (coin::split(&mut base, amount, ctx), base) - } - - /// Get a 'random' attribute based on a seed. - /// - /// For fun and exploration we get the number from the BCS bytes. - /// This function demonstrates the way of getting a `u64` number - /// from a vector of bytes. - fun get_attribute(seed: &vector): Attribute { - let attr_values = ATTRIBUTE_VALUES; - let mut bcs_bytes = bcs::new(hash(*seed)); - let attr_idx = bcs::peel_u64(&mut bcs_bytes) % attr_values.length(); // get the index of the attribute - let attr_value = attr_values[attr_idx]; - - capy::create_attribute(ATTRIBUTE_NAME, attr_value) - } - - /// Get a URL for the box image. - /// TODO: specify capy.art here!!! - fun get_img_url(`type`: u8): Url { - let mut res = b"http://api.capy.art/box_"; - if (`type` == 99) { - res.append(b"premium"); - } else { - res.push_back(ASCII_OFFSET + `type`); - }; - - res.append(b".svg"); - - url::new_unsafe_from_bytes(res) - } - - /// Get a link to the gift on the capy.art. - fun get_link_url(id: &UID, `type`: u8): Url { - let mut res = b"http://capy.art/gifts/"; - res.append(sui::hex::encode(object::uid_to_bytes(id))); - res.append(b"?type="); - res.push_back(ASCII_OFFSET + `type`); - - url::new_unsafe_from_bytes(res) - } -} diff --git a/sui_programmability/examples/capy/sources/eden.move b/sui_programmability/examples/capy/sources/eden.move deleted file mode 100644 index 66e2caf14db3d..0000000000000 --- a/sui_programmability/examples/capy/sources/eden.move +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Simple permissionless application that stores two capys and -/// breeds them on request. -/// -/// Enables "get free capy" functionality. A single account can request -/// up to 2 capys; then it aborts. -module capy::eden { - use sui::dynamic_field as dfield; - - use capy::capy::{Self, Capy, CapyRegistry}; - - /// For when someone tries to breed more than 2 `Capy`s. - const EMaxBred: u64 = 0; - - /// A shared object containing 2 Capys for free breeding. - public struct Eden has key { - id: UID, - capy_one: Option, - capy_two: Option, - } - - #[allow(unused_function)] - fun init(ctx: &mut TxContext) { - sui::transfer::share_object(Eden { - id: object::new(ctx), - capy_one: option::none(), - capy_two: option::none() - }) - } - - /// Admin-only action to set 2 capys for breeding in the `Eden` object. - entry fun set(eden: &mut Eden, capy_one: Capy, capy_two: Capy) { - option::fill(&mut eden.capy_one, capy_one); - option::fill(&mut eden.capy_two, capy_two) - } - - #[allow(unused_function)] - /// Breed a "free" Capy using capys set in the `Eden` object. Can only be performed - /// twice. Aborts when trying to breed more than 2 times. - fun get_capy(eden: &mut Eden, reg: &mut CapyRegistry, ctx: &mut TxContext) { - let sender = tx_context::sender(ctx); - let total = if (dfield::exists_with_type(&eden.id, sender)) { - let total = dfield::remove(&mut eden.id, sender); - assert!(total != 2, EMaxBred); - total - } else { - 0 - }; - - dfield::add(&mut eden.id, sender, total + 1); - capy::breed_and_keep( - reg, - option::borrow_mut(&mut eden.capy_one), - option::borrow_mut(&mut eden.capy_two), - ctx - ) - } -} diff --git a/sui_programmability/examples/crypto/Move.toml b/sui_programmability/examples/crypto/Move.toml deleted file mode 100644 index 064d065078844..0000000000000 --- a/sui_programmability/examples/crypto/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "Crypto" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -crypto = "0x0" diff --git a/sui_programmability/examples/crypto/README.md b/sui_programmability/examples/crypto/README.md deleted file mode 100644 index 31d196a867032..0000000000000 --- a/sui_programmability/examples/crypto/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Crypto - -* ECDSA: A simple contract to do the following: -1) Hash a piece of data using keccak256, output an object with hashed data. -2) Recover a Secp256k1 signature to its public key, output an object with the public key. -3) Verify a Secp256k1 signature, produce an event for whether it is verified. - -* EC OPS: Examples for EC operations. diff --git a/sui_programmability/examples/crypto/sources/ec_ops.move b/sui_programmability/examples/crypto/sources/ec_ops.move deleted file mode 100644 index 9c5f1e30444ed..0000000000000 --- a/sui_programmability/examples/crypto/sources/ec_ops.move +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// Examples of cryptographic primitives that can be implemented in Move using group operations. -// -// Functions with the prefix "insecure" are here for testing, but should be called off-chain (probably implemented in -// other languages) to avoid leaking secrets. -module crypto::ec_ops { - - use sui::bls12381; - use sui::group_ops::Element; - use sui::group_ops; - use sui::hash::blake2b256; - #[test_only] - use std::hash::sha2_256; - #[test_only] - use sui::bcs; - #[test_only] - use sui::test_utils::assert_eq; - - const EInvalidLength: u64 = 0; - - const BLS12381_ORDER: vector = x"73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"; - - //////////////////////////////////////// - ////// BLS signature verification ////// - - public fun bls_min_sig_verify(msg: &vector, pk: &Element, sig: &Element): bool { - let hashed_msg = bls12381::hash_to_g1(msg); - let lhs = bls12381::pairing(&hashed_msg, pk); - let rhs = bls12381::pairing(sig, &bls12381::g2_generator()); - group_ops::equal(&lhs, &rhs) - } - - #[test] - fun test_bls_min_sig_verify() { - let msg = x"0101010101"; - let pk = x"8df101606f91f3cad7f54b8aff0f0f64c41c482d9b9f9fe81d2b607bc5f611bdfa8017cf04b47b44b222c356ef555fbd11058c52c077f5a7ec6a15ccfd639fdc9bd47d005a111dd6cdb8c02fe49608df55a3c9822986ad0b86bdea3abfdfe464"; - let sig = x"908e345f2e2803cd941ae88c218c96194233c9053fa1bca52124787d3cca141c36429d7652435a820c72992d5eee6317"; - - let pk = bls12381::g2_from_bytes(&pk); - let sig= bls12381::g1_from_bytes(&sig); - assert!(bls_min_sig_verify(&msg, &pk, &sig), 0); - } - - - //////////////////////////////////////////////////////////////// - ////// Proof of plaintext equality of ElGamal encryptions ////// - - // An encryption of group element m under pk is (r*G, r*pk + m) for random r. - public struct ElGamalEncryption has drop, store { - ephemeral: Element, - ciphertext: Element, - } - - // The following is insecure since the secret key is small, but in practice it should be a random scalar. - #[test_only] - fun insecure_elgamal_key_gen(sk: u64): (Element, Element) { - let sk = bls12381::scalar_from_u64(sk); - let pk = bls12381::g1_mul(&sk, &bls12381::g1_generator()); - (sk, pk) - } - - // The following is insecure since the nonce is small, but in practice it should be a random scalar. - #[test_only] - fun insecure_elgamal_encrypt( - pk: &Element, - r: u64, - m: &Element - ): ElGamalEncryption { - let r = bls12381::scalar_from_u64(r); - let ephemeral = bls12381::g1_mul(&r, &bls12381::g1_generator()); - let pk_r = bls12381::g1_mul(&r, pk); - let ciphertext = bls12381::g1_add(m, &pk_r); - ElGamalEncryption { ephemeral, ciphertext } - } - - public fun elgamal_decrypt(sk: &Element, enc: &ElGamalEncryption): Element { - let pk_r = bls12381::g1_mul(sk, &enc.ephemeral); - bls12381::g1_sub(&enc.ciphertext, &pk_r) - } - - // Basic sigma protocol for proving equality of two ElGamal encryptions. - // See https://crypto.stackexchange.com/questions/30010/is-there-a-way-to-prove-equality-of-plaintext-that-was-encrypted-using-different - public struct EqualityProof has drop, store { - a1: Element, - a2: Element, - a3: Element, - z1: Element, - z2: Element, - } - - public fun fiat_shamir_challenge( - pk1: &Element, - pk2: &Element, - enc1: &ElGamalEncryption, - enc2: &ElGamalEncryption, - a1: &Element, - a2: &Element, - a3: &Element, - ): Element { - let mut to_hash = vector::empty(); - vector::append(&mut to_hash, *group_ops::bytes(pk1)); - vector::append(&mut to_hash, *group_ops::bytes(pk2)); - vector::append(&mut to_hash, *group_ops::bytes(&enc1.ephemeral)); - vector::append(&mut to_hash, *group_ops::bytes(&enc1.ciphertext)); - vector::append(&mut to_hash, *group_ops::bytes(&enc2.ephemeral)); - vector::append(&mut to_hash, *group_ops::bytes(&enc2.ciphertext)); - vector::append(&mut to_hash, *group_ops::bytes(a1)); - vector::append(&mut to_hash, *group_ops::bytes(a2)); - vector::append(&mut to_hash, *group_ops::bytes(a3)); - let mut hash = blake2b256(&to_hash); - // Make sure we are in the right field. Note that for security we only need the lower 128 bits. - *vector::borrow_mut(&mut hash, 0) = 0; - bls12381::scalar_from_bytes(&hash) - } - - // The following is insecure since the nonces are small, but in practice they should be random scalars. - #[test_only] - fun insecure_equility_prove( - pk1: &Element, - pk2: &Element, - enc1: &ElGamalEncryption, - enc2: &ElGamalEncryption, - sk1: &Element, - r1: u64, - r2: u64, - ): EqualityProof { - let b1 = bls12381::scalar_from_u64(r1); - let b2 = bls12381::scalar_from_u64(r1+123); - let r2 = bls12381::scalar_from_u64(r2); - - // a1 = b1*G (for proving knowledge of sk1) - let a1 = bls12381::g1_mul(&b1, &bls12381::g1_generator()); - // a2 = b2*g (for proving knowledge of r2) - let a2 = bls12381::g1_mul(&b2, &bls12381::g1_generator()); - let mut scalars = vector::singleton(b1); - vector::push_back(&mut scalars, bls12381::scalar_neg(&b2)); - let mut points = vector::singleton(enc1.ephemeral); - vector::push_back(&mut points, *pk2); - let a3 = bls12381::g1_multi_scalar_multiplication(&scalars, &points); - // RO challenge - let c = fiat_shamir_challenge(pk1, pk2, enc1, enc2, &a1, &a2, &a3); - // z1 = b1 + c*sk1 - let z1 = bls12381::scalar_add(&bls12381::scalar_mul(&c, sk1), &b1); - // z2 = b2 + c*r2 - let z2 = bls12381::scalar_add(&bls12381::scalar_mul(&c, &r2), &b2); - - EqualityProof { a1, a2, a3, z1, z2 } - } - - public fun equility_verify( - pk1: &Element, - pk2: &Element, - enc1: &ElGamalEncryption, - enc2: &ElGamalEncryption, - proof: &EqualityProof - ): bool { - let c = fiat_shamir_challenge(pk1, pk2, enc1, enc2, &proof.a1, &proof.a2, &proof.a3); - // Check if z1*G = a1 + c*pk1 - let lhs = bls12381::g1_mul(&proof.z1, &bls12381::g1_generator()); - let pk1_c = bls12381::g1_mul(&c, pk1); - let rhs = bls12381::g1_add(&proof.a1, &pk1_c); - if (!group_ops::equal(&lhs, &rhs)) { - return false - }; - // Check if z2*G = a2 + c*eph2 - let lhs = bls12381::g1_mul(&proof.z2, &bls12381::g1_generator()); - let eph2_c = bls12381::g1_mul(&c, &enc2.ephemeral); - let rhs = bls12381::g1_add(&proof.a2, &eph2_c); - if (!group_ops::equal(&lhs, &rhs)) { - return false - }; - // Check if a3 = c*(ct2 - ct1) + z1*eph1 - z2*pk2 - let mut scalars = vector::singleton(c); - vector::push_back(&mut scalars, bls12381::scalar_neg(&c)); - vector::push_back(&mut scalars, proof.z1); - vector::push_back(&mut scalars, bls12381::scalar_neg(&proof.z2)); - let mut points = vector::singleton(enc2.ciphertext); - vector::push_back(&mut points, enc1.ciphertext); - vector::push_back(&mut points, enc1.ephemeral); - vector::push_back(&mut points, *pk2); - let lhs = bls12381::g1_multi_scalar_multiplication(&scalars, &points); - if (!group_ops::equal(&lhs, &proof.a3)) { - return false - }; - - return true - } - - #[test] - fun test_elgamal_ops() { - // We have two parties. - let (sk1, pk1) = insecure_elgamal_key_gen(2110); - let (_, pk2) = insecure_elgamal_key_gen(1021); - // A sender wishes to send an encrypted message to pk1. - let m = bls12381::g1_mul(&bls12381::scalar_from_u64(5555), &bls12381::g1_generator()); - let enc1 = insecure_elgamal_encrypt(&pk1, 1234, &m); - // The first party decrypts the message. - let m1 = elgamal_decrypt(&sk1, &enc1); - assert_eq(m, m1); - // Now, the first party wishes to send an encrypted message to pk2. - let r2 = 4321; - let enc2 = insecure_elgamal_encrypt(&pk2, r2, &m); - // And to prove equality of the two encrypted messages. - let proof = insecure_equility_prove(&pk1, &pk2, &enc1, &enc2, &sk1, 8888, r2); - // Anyone can verify it. - assert!(equility_verify(&pk1, &pk2, &enc1, &enc2, &proof), 0); - - // Proving with an invalid witness should result in a failed verification. - let bad_r2 = 1111; - let proof = insecure_equility_prove(&pk1, &pk2, &enc1, &enc2, &sk1, 8888, bad_r2); - assert!(!equility_verify(&pk1, &pk2, &enc1, &enc2, &proof), 0); - } - - /////////////////////////////////////// - ////// tlock (an IBE decryption) ////// - - /// An encryption of 32 bytes message following https://eprint.iacr.org/2023/189.pdf. - public struct IbeEncryption has store, drop, copy { - u: Element, - v: vector, - w: vector, - } - - public fun ibe_encryption_from_bytes(bytes: &vector): IbeEncryption { - assert!(vector::length(bytes) == 96 + 32 + 32, 0); - let mut buffer = vector::empty(); - let mut i = 0; - while (i < 96) { - vector::push_back(&mut buffer, *vector::borrow(bytes, i)); - i = i + 1; - }; - let u = bls12381::g2_from_bytes(&buffer); - - let mut v = vector::empty(); - while (i < 96 + 32) { - vector::push_back(&mut v, *vector::borrow(bytes, i)); - i = i + 1; - }; - - let mut w = vector::empty(); - while (i < 96 + 32 + 32) { - vector::push_back(&mut w, *vector::borrow(bytes, i)); - i = i + 1; - }; - - IbeEncryption { u, v, w } - } - - // Encrypt a message 'm' for 'target'. Follows the algorithms of https://eprint.iacr.org/2023/189.pdf. - // Note that the algorithms in that paper use G2 for signatures, where the actual chain uses G1, thus - // the operations below are slightly different. - #[test_only] - fun insecure_ibe_encrypt(pk: &Element, target: &vector, m: &vector, sigma: &vector): IbeEncryption { - assert!(vector::length(sigma) == 32, 0); - - // pk_rho = e(H1(target), pk) - let target_hash = bls12381::hash_to_g1(target); - let pk_rho = bls12381::pairing(&target_hash, pk); - - // r = H3(sigma | m) as a scalar - assert!(vector::length(m) == vector::length(sigma), 0); - let mut to_hash = b"HASH3 - "; - vector::append(&mut to_hash, *sigma); - vector::append(&mut to_hash, *m); - let r = modulo_order(&blake2b256(&to_hash)); - let r = bls12381::scalar_from_bytes(&r); - - // U = r*g2 - let u = bls12381::g2_mul(&r, &bls12381::g2_generator()); - - // V = sigma xor H2(pk_rho^r) - let pk_rho_r = bls12381::gt_mul(&r, &pk_rho); - let mut to_hash = b"HASH2 - "; - vector::append(&mut to_hash, *group_ops::bytes(&pk_rho_r)); - let hash_pk_rho_r = blake2b256(&to_hash); - let mut v = vector::empty(); - let mut i = 0; - while (i < vector::length(sigma)) { - vector::push_back(&mut v, *vector::borrow(sigma, i) ^ *vector::borrow(&hash_pk_rho_r, i)); - i = i + 1; - }; - - // W = m xor H4(sigma) - let mut to_hash = b"HASH4 - "; - vector::append(&mut to_hash, *sigma); - let hash = blake2b256(&to_hash); - let mut w = vector::empty(); - let mut i = 0; - while (i < vector::length(m)) { - vector::push_back(&mut w, *vector::borrow(m, i) ^ *vector::borrow(&hash, i)); - i = i + 1; - }; - - IbeEncryption { u, v, w } - } - - // Decrypt an IBE encryption using a 'target_key'. - public fun ibe_decrypt(enc: IbeEncryption, target_key: &Element): Option> { - // sigma_prime = V xor H2(e(target_key, u)) - let e = bls12381::pairing(target_key, &enc.u); - let mut to_hash = b"HASH2 - "; - vector::append(&mut to_hash, *group_ops::bytes(&e)); - let hash = blake2b256(&to_hash); - let mut sigma_prime = vector::empty(); - let mut i = 0; - while (i < vector::length(&enc.v)) { - vector::push_back(&mut sigma_prime, *vector::borrow(&hash, i) ^ *vector::borrow(&enc.v, i)); - i = i + 1; - }; - - // m_prime = W xor H4(sigma_prime) - let mut to_hash = b"HASH4 - "; - vector::append(&mut to_hash, sigma_prime); - let hash = blake2b256(&to_hash); - let mut m_prime = vector::empty(); - let mut i = 0; - while (i < vector::length(&enc.w)) { - vector::push_back(&mut m_prime, *vector::borrow(&hash, i) ^ *vector::borrow(&enc.w, i)); - i = i + 1; - }; - - // r = H3(sigma_prime | m_prime) as a scalar (the paper has a typo) - let mut to_hash = b"HASH3 - "; - vector::append(&mut to_hash, sigma_prime); - vector::append(&mut to_hash, m_prime); - // If the encryption is generated correctly, this should always be a valid scalar (before the modulo). - // However since in the tests we create it insecurely, we make sure it is in the right range. - let r = modulo_order(&blake2b256(&to_hash)); - let r = bls12381::scalar_from_bytes(&r); - - // U ?= r*g2 - let g2r = bls12381::g2_mul(&r, &bls12381::g2_generator()); - if (group_ops::equal(&enc.u, &g2r)) { - option::some(m_prime) - } else { - option::none() - } - } - - // This test emulates drand based timelock encryption (using quicknet). - #[test] - fun test_ibe_decrypt_drand() { - // Retrieved using 'curl https://api.drand.sh/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/info' - let round = 1234; - let pk_bytes = x"83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a"; - let pk = bls12381::g2_from_bytes(&pk_bytes); - let msg = x"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"; - - // Derive the 'target' for the specific round (see drand_lib.move). - let mut round_bytes = bcs::to_bytes(&round); - vector::reverse(&mut round_bytes); - let target = sha2_256(round_bytes); - - // Retrieved with 'curl https://api.drand.sh/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/1234'. - let sig_bytes = x"a81d4aad15461a0a02b43da857be1d782a2232a3c7bb370a2763e95ce1f2628460b24de2cee7453cd12e43c197ea2f23"; - let target_key = bls12381::g1_from_bytes(&sig_bytes); - assert!(bls12381::bls12381_min_sig_verify(&sig_bytes, &pk_bytes, &target), 0); - - let enc = insecure_ibe_encrypt(&pk, &target, &msg, &x"A123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"); - let mut decrypted_msg = ibe_decrypt(enc, &target_key); - assert!(option::extract(&mut decrypted_msg) == msg, 0); - - // Test an example output that was generated by the Rust CLI. - let enc = x"b598e92e55ac1a2e78b61ce4a223c3c6b17db2dc4e5c807965649d882c71f05e1a7eac110e40c7b7faae4d556d6b418c03521e351504b371e91c1e7637292e4fb9f7ad4a8b6a1fecebd2b3208e18cab594b081d11cbfb1f15b7b18b4af6876fd796026a67def0b05222aadabcf86eaace0e708f469f491483f681e184f9178236f4e749635de4478f3bf44fb9264d35d6e83d58b3e5e686414b0953e99142a62"; - let enc = ibe_encryption_from_bytes(&enc); - let mut decrypted_msg = ibe_decrypt(enc, &target_key); - assert!(option::extract(&mut decrypted_msg) == msg, 0); - } - - /////////////////////////////////////////////////////////////////////////////////// - ////// Helper functions for converting 32 byte vectors to BLS12-381's order ////// - - // Returns x-ORDER if x >= ORDER, otherwise none. - fun try_substract(x: &vector): Option> { - assert!(vector::length(x) == 32, EInvalidLength); - let order = BLS12381_ORDER; - let mut c = vector::empty(); - let mut i = 0; - let mut carry: u8 = 0; - while (i < 32) { - let curr = 31 - i; - let b1 = *vector::borrow(x, curr); - let b2 = *vector::borrow(&order, curr); - let sum: u16 = (b2 as u16) + (carry as u16); - if (sum > (b1 as u16)) { - carry = 1; - let res = 0x100 + (b1 as u16) - sum; - vector::push_back(&mut c, (res as u8)); - } else { - carry = 0; - let res = (b1 as u16) - sum; - vector::push_back(&mut c, (res as u8)); - }; - i = i + 1; - }; - if (carry != 0) { - option::none() - } else { - vector::reverse(&mut c); - option::some(c) - } - } - - fun modulo_order(x: &vector): vector { - let mut res = *x; - // Since 2^256 < 3*ORDER, this loop won't run many times. - while (true) { - let minus_order = try_substract(&res); - if (option::is_none(&minus_order)) { - return res - }; - res = *option::borrow(&minus_order); - }; - res - } - - #[test] - fun test_try_substract_and_modulo() { - let smaller: vector = x"73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000"; - let res = try_substract(&smaller); - assert!(option::is_none(&res), 0); - - let bigger: vector = x"8c1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000fffffff5"; - let res = try_substract(&bigger); - assert!(option::is_some(&res), 0); - let bigger_minus_order = *option::borrow(&res); - let expected: vector = x"1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffff4"; - assert_eq(bigger_minus_order, expected); - - let larger: vector = x"fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6"; - let expected: vector = x"1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffff4"; - let modulo = modulo_order(&larger); - assert!(modulo == expected, 0); - } - - // TODO: Groth16 proof verification -} diff --git a/sui_programmability/examples/crypto/sources/ecdsa.move b/sui_programmability/examples/crypto/sources/ecdsa.move deleted file mode 100644 index 9fdec34840e33..0000000000000 --- a/sui_programmability/examples/crypto/sources/ecdsa.move +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// A basic ECDSA utility contract to do the following: -// 1) Hash a piece of data using Keccak256, output an object with hashed data. -// 2) Recover a Secp256k1 signature to its public key, output an object with the public key. -// 3) Verify a Secp256k1 signature, produce an event for whether it is verified. -module crypto::ecdsa_k1 { - use sui::ecdsa_k1; - use sui::event; - - /// Event on whether the signature is verified - public struct VerifiedEvent has copy, drop { - is_verified: bool, - } - - /// Object that holds the output data - public struct Output has key, store { - id: UID, - value: vector - } - - /// Hash the data using Keccak256, output an object with the hash to recipient. - public entry fun keccak256(data: vector, recipient: address, ctx: &mut TxContext) { - let hashed = Output { - id: object::new(ctx), - value: sui::hash::keccak256(&data), - }; - // Transfer an output data object holding the hashed data to the recipient. - transfer::public_transfer(hashed, recipient) - } - - /// Recover the public key using the signature and message, assuming the signature was produced over the - /// Keccak256 hash of the message. Output an object with the recovered pubkey to recipient. - public entry fun ecrecover(signature: vector, msg: vector, recipient: address, ctx: &mut TxContext) { - let pubkey = Output { - id: object::new(ctx), - value: ecdsa_k1::secp256k1_ecrecover(&signature, &msg, 0), - }; - // Transfer an output data object holding the pubkey to the recipient. - transfer::public_transfer(pubkey, recipient) - } - - /// Recover the Ethereum address using the signature and message, assuming - /// the signature was produced over the Keccak256 hash of the message. - /// Output an object with the recovered address to recipient. - public entry fun ecrecover_to_eth_address(mut signature: vector, msg: vector, recipient: address, ctx: &mut TxContext) { - // Normalize the last byte of the signature to be 0 or 1. - let v = vector::borrow_mut(&mut signature, 64); - if (*v == 27) { - *v = 0; - } else if (*v == 28) { - *v = 1; - } else if (*v > 35) { - *v = (*v - 1) % 2; - }; - - // Ethereum signature is produced with Keccak256 hash of the message, so the last param is 0. - let pubkey = ecdsa_k1::secp256k1_ecrecover(&signature, &msg, 0); - let uncompressed = ecdsa_k1::decompress_pubkey(&pubkey); - - // Take the last 64 bytes of the uncompressed pubkey. - let mut uncompressed_64 = vector::empty(); - let mut i = 1; - while (i < 65) { - let value = vector::borrow(&uncompressed, i); - vector::push_back(&mut uncompressed_64, *value); - i = i + 1; - }; - - // Take the last 20 bytes of the hash of the 64-bytes uncompressed pubkey. - let hashed = sui::hash::keccak256(&uncompressed_64); - let mut addr = vector::empty(); - let mut i = 12; - while (i < 32) { - let value = vector::borrow(&hashed, i); - vector::push_back(&mut addr, *value); - i = i + 1; - }; - - let addr_object = Output { - id: object::new(ctx), - value: addr, - }; - - // Transfer an output data object holding the address to the recipient. - transfer::public_transfer(addr_object, recipient) - } - - /// Verified the secp256k1 signature using public key and message assuming Keccak was using when - /// signing. Emit an is_verified event of the verification result. - public entry fun secp256k1_verify(signature: vector, public_key: vector, msg: vector) { - event::emit(VerifiedEvent {is_verified: ecdsa_k1::secp256k1_verify(&signature, &public_key, &msg, 0)}); - } -} diff --git a/sui_programmability/examples/crypto/sources/groth16.move b/sui_programmability/examples/crypto/sources/groth16.move deleted file mode 100644 index 60ca08d0b5c66..0000000000000 --- a/sui_programmability/examples/crypto/sources/groth16.move +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// A verifier for the Groth16 zk-SNARK over the BLS12-381 construction. -// See https://eprint.iacr.org/2016/260.pdf for details. -module crypto::groth16 { - - use sui::bls12381; - use sui::group_ops::Element; - - const EInvalidNumberOfPublicInputs: u64 = 0; - - /// A Groth16 proof. - public struct Proof has drop { - a: Element, - b: Element, - c: Element, - } - - /// Create a new `Proof`. - public fun create_proof(a: Element, b: Element, c: Element): Proof { - Proof { - a, - b, - c, - } - } - - /// A Groth16 verifying key used to verify a zero-knowledge proof. - public struct VerifyingKey has store, drop { - alpha: Element, - beta: Element, - gamma: Element, - gamma_abc: vector>, - delta: Element, - } - - /// Create a new `VerifyingKey`. - public fun create_verifying_key( - alpha: Element, - beta: Element, - gamma: Element, - gamma_abc: vector>, - delta: Element): VerifyingKey { - VerifyingKey { - alpha, - beta, - gamma, - gamma_abc, - delta, - } - } - - /// A prepared verifying key. This makes verification faster than using the verifying key directly. - public struct PreparedVerifyingKey has store, drop { - alpha_beta: Element, - gamma_neg: Element, - gamma_abc: vector>, - delta_neg: Element, - } - - /// Create a PreparedVerifyingKey from a VerifyingKey. This only have to be done once. - public fun prepare(vk: VerifyingKey): PreparedVerifyingKey { - PreparedVerifyingKey { - alpha_beta: bls12381::pairing(&vk.alpha, &vk.beta), - gamma_neg: bls12381::g2_neg(&vk.gamma), - gamma_abc: vk.gamma_abc, - delta_neg: bls12381::g2_neg(&vk.delta), - } - } - - fun prepare_inputs(vk_gamma_abc: &vector>, public_inputs: &vector>): Element { - let length = public_inputs.length(); - assert!(length + 1 == vk_gamma_abc.length(), EInvalidNumberOfPublicInputs); - - let mut output = vk_gamma_abc[0]; - let mut i = 0; - while (i < length) { - output = bls12381::g1_add(&output, &bls12381::g1_mul(&public_inputs[i], &vk_gamma_abc[i + 1])); - i = i + 1; - }; - output - } - - /// Verify a Groth16 proof with some public inputs and a verifying key. - public fun verify(pvk: &PreparedVerifyingKey, proof: &Proof, public_inputs: &vector>): bool { - let prepared_inputs = prepare_inputs(&pvk.gamma_abc, public_inputs); - let mut lhs = bls12381::pairing(&proof.a, &proof.b); - lhs = bls12381::gt_add(&lhs, &bls12381::pairing(&prepared_inputs, &pvk.gamma_neg)); - lhs = bls12381::gt_add(&lhs, &bls12381::pairing(&proof.c, &pvk.delta_neg)); - lhs == pvk.alpha_beta - } - - #[test] - fun test_verification() { - let vk = create_verifying_key( - bls12381::g1_from_bytes(&x"b58cfc3b0f43d98e7dbe865af692577d52813cb62ef3c355215ec3be2a0355a1ae5da76dd3e626f8a60de1f4a8138dee"), - bls12381::g2_from_bytes(&x"9047b42915b32ef9dffe3acc0121a1450416e7f9791159f165ab0729d744da3ed82cd4822ca1d7fef35147cfd620b59b0ca09db7dff43aab6c71635ba8f86a83f058e9922e5cdacbe21d0e5e855cf1e776a61b272c12272fe526f5ba3b48d579"), - bls12381::g2_from_bytes(&x"ad7c5a6cefcae53a3fbae72662c7c04a2f8e1892cb83615a02b32c31247172b7f317489b84e72f14acaf4f3e9ed18141157c6c1464bf15d957227f75a3c550d6d27f295b41a753340c6eec47b471b2cb8664c84f3e9b725325d3fb8afc6b56d0"), - vector[ - bls12381::g1_from_bytes(&x"b2c9c61ccc28e913284a47c34e60d487869ff423dd574db080d35844f9eddd2b2967141b588a35fa82a278ce39ae6b1a"), - bls12381::g1_from_bytes(&x"9026ae12d58d203b4fc5dfad4968cbf51e43632ed1a05afdcb2e380ee552b036fbefc7780afe9675bcb60201a2421b2c") - ], - bls12381::g2_from_bytes(&x"b1294927d02f8e86ac57c3b832f4ecf5e03230445a9a785ac8d25cf968f48cca8881d0c439c7e8870b66567cf611da0c1734316632f39d3125c8cecca76a8661db91cbfae217547ea1fc078a24a1a31555a46765011411094ec649d42914e2f5"), - ); - - let public_inputs = vector[bls12381::scalar_from_bytes(&x"46722abc81a82d01ac89c138aa01a8223cb239ceb1f02cdaad7e1815eb997ca6")]; - - let proof = create_proof( - bls12381::g1_from_bytes(&x"9913bdcabdff2cf1e7dea1673c5edba5ed6435df2f2a58d6d9e624609922bfa3976a98d991db333812bf6290a590afaa"), - bls12381::g2_from_bytes(&x"b0265b35af5069593ee88626cf3ba9a0f07699510a25aec3a27048792ab83b3467d6b814d1c09c412c4dcd7656582e6607b72915081c82794ccedf643c27abace5b23a442079d8dcbd0d68dd697b8e0b699a1925a5f2c77f5237efbbbeda3bd0"), - bls12381::g1_from_bytes(&x"b1237cf48ca7aa98507e826aac336b9e24f14133de1923fffac602a1203b795b3037c4c94e7246bacee7b2757ae912e5"), - ); - - assert!(verify(&vk.prepare(), &proof, &public_inputs), 0); - } -} diff --git a/sui_programmability/examples/defi/Move.toml b/sui_programmability/examples/defi/Move.toml deleted file mode 100644 index f30bf2bfbb1e6..0000000000000 --- a/sui_programmability/examples/defi/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "DeFi" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -defi = "0x0" diff --git a/sui_programmability/examples/defi/README.md b/sui_programmability/examples/defi/README.md deleted file mode 100644 index b0a2a3121a9c4..0000000000000 --- a/sui_programmability/examples/defi/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# DeFi - -* FlashLoan: a flash loan is a loan that must be initiated and repaid during the same transaction. This implementation works for any currency type, and is a good illustration of the power of Move [abilities](https://move-language.github.io/move/abilities.html) and the "hot potato" design pattern. -* Escrow: an atomic swap leveraging an escrow agent that is trusted for liveness, but not safety (i.e., the agent cannot steal the goods being swapped). -* Uniswap 1.0-style DEX (coming in future). diff --git a/sui_programmability/examples/defi/sources/escrow.move b/sui_programmability/examples/defi/sources/escrow.move deleted file mode 100644 index fb709b8f0b175..0000000000000 --- a/sui_programmability/examples/defi/sources/escrow.move +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// An escrow for atomic swap of objects that trusts a third party for liveness, but not safety. -module defi::escrow { - /// An object held in escrow - public struct EscrowedObj has key, store { - id: UID, - /// owner of the escrowed object - sender: address, - /// intended recipient of the escrowed object - recipient: address, - /// ID of the object `sender` wants in exchange - // TODO: this is probably a bad idea if the object is mutable. - // that can be fixed by asking for an additional approval - // from `sender`, but let's keep it simple for now. - exchange_for: ID, - /// the escrowed object - escrowed: T, - } - - // Error codes - /// The `sender` and `recipient` of the two escrowed objects do not match - const EMismatchedSenderRecipient: u64 = 0; - /// The `exchange_for` fields of the two escrowed objects do not match - const EMismatchedExchangeObject: u64 = 1; - - /// Create an escrow for exchanging goods with - /// `counterparty`, mediated by a `third_party` - /// that is trusted for liveness - public fun create( - recipient: address, - third_party: address, - exchange_for: ID, - escrowed: T, - ctx: &mut TxContext - ) { - let sender = ctx.sender(); - let id = object::new(ctx); - // escrow the object with the trusted third party - transfer::public_transfer( - EscrowedObj { - id, sender, recipient, exchange_for, escrowed - }, - third_party - ); - } - - /// Trusted third party can swap compatible objects - public entry fun swap( - obj1: EscrowedObj, - obj2: EscrowedObj, - ) { - let EscrowedObj { - id: id1, - sender: sender1, - recipient: recipient1, - exchange_for: exchange_for1, - escrowed: escrowed1, - } = obj1; - let EscrowedObj { - id: id2, - sender: sender2, - recipient: recipient2, - exchange_for: exchange_for2, - escrowed: escrowed2, - } = obj2; - id1.delete(); - id2.delete(); - // check sender/recipient compatibility - assert!(&sender1 == &recipient2, EMismatchedSenderRecipient); - assert!(&sender2 == &recipient1, EMismatchedSenderRecipient); - // check object ID compatibility - assert!(object::id(&escrowed1) == exchange_for2, EMismatchedExchangeObject); - assert!(object::id(&escrowed2) == exchange_for1, EMismatchedExchangeObject); - // everything matches. do the swap! - transfer::public_transfer(escrowed1, sender2); - transfer::public_transfer(escrowed2, sender1) - } - - /// Trusted third party can always return an escrowed object to its original owner - public entry fun return_to_sender( - obj: EscrowedObj, - ) { - let EscrowedObj { - id, sender, recipient: _, exchange_for: _, escrowed - } = obj; - id.delete(); - transfer::public_transfer(escrowed, sender) - } -} diff --git a/sui_programmability/examples/defi/sources/flash_lender.move b/sui_programmability/examples/defi/sources/flash_lender.move deleted file mode 100644 index 8f4aa2b4e5e54..0000000000000 --- a/sui_programmability/examples/defi/sources/flash_lender.move +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// A flash loan that works for any Coin type -module defi::flash_lender { - use sui::{coin::{Self, Coin}, balance::Balance}; - - - /// A shared object offering flash loans to any buyer willing to pay `fee`. - public struct FlashLender has key { - id: UID, - /// Coins available to be lent to prospective borrowers - to_lend: Balance, - /// Number of `Coin`'s that will be charged for the loan. - /// In practice, this would probably be a percentage, but - /// we use a flat fee here for simplicity. - fee: u64, - } - - /// A "hot potato" struct recording the number of `Coin`'s that - /// were borrowed. Because this struct does not have the `key` or - /// `store` ability, it cannot be transferred or otherwise placed in - /// persistent storage. Because it does not have the `drop` ability, - /// it cannot be discarded. Thus, the only way to get rid of this - /// struct is to call `repay` sometime during the transaction that created it, - /// which is exactly what we want from a flash loan. - public struct Receipt { - /// ID of the flash lender object the debt holder borrowed from - flash_lender_id: ID, - /// Total amount of funds the borrower must repay: amount borrowed + the fee - repay_amount: u64 - } - - /// An object conveying the privilege to withdraw funds from and deposit funds to the - /// `FlashLender` instance with ID `flash_lender_id`. Initially granted to the creator - /// of the `FlashLender`, and only one `AdminCap` per lender exists. - public struct AdminCap has key, store { - id: UID, - flash_lender_id: ID, - } - - /// Attempted to borrow more than the `FlashLender` has. - /// Try borrowing a smaller amount. - const ELoanTooLarge: u64 = 0; - - /// Tried to repay an amount other than `repay_amount` (i.e., the amount borrowed + the fee). - /// Try repaying the proper amount. - const EInvalidRepaymentAmount: u64 = 1; - - /// Attempted to repay a `FlashLender` that was not the source of this particular debt. - /// Try repaying the correct lender. - const ERepayToWrongLender: u64 = 2; - - /// Attempted to perform an admin-only operation without valid permissions - /// Try using the correct `AdminCap` - const EAdminOnly: u64 = 3; - - /// Attempted to withdraw more than the `FlashLender` has. - /// Try withdrawing a smaller amount. - const EWithdrawTooLarge: u64 = 4; - - // === Creating a flash lender === - - /// Create a shared `FlashLender` object that makes `to_lend` available for borrowing. - /// Any borrower will need to repay the borrowed amount and `fee` by the end of the - /// current transaction. - public fun new(to_lend: Balance, fee: u64, ctx: &mut TxContext): AdminCap { - let id = object::new(ctx); - let flash_lender_id = id.to_inner(); - let flash_lender = FlashLender { id, to_lend, fee }; - // make the `FlashLender` a shared object so anyone can request loans - transfer::share_object(flash_lender); - - // give the creator admin permissions - AdminCap { id: object::new(ctx), flash_lender_id } - } - - /// Same as `new`, but transfer `AdminCap` to the transaction sender - public entry fun create(to_lend: Coin, fee: u64, ctx: &mut TxContext) { - let balance = to_lend.into_balance(); - let admin_cap = new(balance, fee, ctx); - - transfer::public_transfer(admin_cap, ctx.sender()) - } - - // === Core functionality: requesting a loan and repaying it === - - /// Request a loan of `amount` from `lender`. The returned `Receipt` "hot potato" ensures - /// that the borrower will call `repay(lender, ...)` later on in this tx. - /// Aborts if `amount` is greater that the amount that `lender` has available for lending. - public fun loan( - self: &mut FlashLender, amount: u64, ctx: &mut TxContext - ): (Coin, Receipt) { - let to_lend = &mut self.to_lend; - assert!(to_lend.value() >= amount, ELoanTooLarge); - let loan = coin::take(to_lend, amount, ctx); - let repay_amount = amount + self.fee; - let receipt = Receipt { flash_lender_id: object::id(self), repay_amount }; - - (loan, receipt) - } - - /// Repay the loan recorded by `receipt` to `lender` with `payment`. - /// Aborts if the repayment amount is incorrect or `lender` is not the `FlashLender` - /// that issued the original loan. - public fun repay(self: &mut FlashLender, payment: Coin, receipt: Receipt) { - let Receipt { flash_lender_id, repay_amount } = receipt; - assert!(object::id(self) == flash_lender_id, ERepayToWrongLender); - assert!(payment.value() == repay_amount, EInvalidRepaymentAmount); - - coin::put(&mut self.to_lend, payment) - } - - // === Admin-only functionality === - - /// Allow admin for `self` to withdraw funds. - public fun withdraw( - self: &mut FlashLender, - admin_cap: &AdminCap, - amount: u64, - ctx: &mut TxContext - ): Coin { - // only the holder of the `AdminCap` for `self` can withdraw funds - check_admin(self, admin_cap); - - let to_lend = &mut self.to_lend; - assert!(to_lend.value() >= amount, EWithdrawTooLarge); - coin::take(to_lend, amount, ctx) - } - - /// Allow admin to add more funds to `self` - public entry fun deposit( - self: &mut FlashLender, admin_cap: &AdminCap, coin: Coin - ) { - // only the holder of the `AdminCap` for `self` can deposit funds - check_admin(self, admin_cap); - coin::put(&mut self.to_lend, coin); - } - - /// Allow admin to update the fee for `self` - public entry fun update_fee( - self: &mut FlashLender, admin_cap: &AdminCap, new_fee: u64 - ) { - // only the holder of the `AdminCap` for `self` can update the fee - check_admin(self, admin_cap); - - self.fee = new_fee - } - - fun check_admin(self: &FlashLender, admin_cap: &AdminCap) { - assert!(object::borrow_id(self) == &admin_cap.flash_lender_id, EAdminOnly); - } - - // === Reads === - - /// Return the current fee for `self` - public fun fee(self: &FlashLender): u64 { - self.fee - } - - /// Return the maximum amount available for borrowing - public fun max_loan(self: &FlashLender): u64 { - self.to_lend.value() - } - - /// Return the amount that the holder of `self` must repay - public fun repay_amount(self: &Receipt): u64 { - self.repay_amount - } - - /// Return the amount that the holder of `self` must repay - public fun flash_lender_id(self: &Receipt): ID { - self.flash_lender_id - } -} diff --git a/sui_programmability/examples/defi/sources/pool.move b/sui_programmability/examples/defi/sources/pool.move deleted file mode 100644 index 0991dacedeaaf..0000000000000 --- a/sui_programmability/examples/defi/sources/pool.move +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Example implementation of a liquidity Pool for Sui. -/// -/// - Only module publisher can create new Pools. -/// - For simplicity's sake all swaps are done with SUI coin. -/// Generalizing to swaps between non-SUI coin types requires a few more generics, but is otherwise straightforward -/// - Fees are customizable per Pool. -/// - Max stored value for both tokens is: U64_MAX / 10_000 -/// -/// To publish a new pool, a type is required. Eg: -/// ``` -/// module me::my_pool { -/// use defi::pool; -/// use sui::coin::Coin; -/// use sui::sui::SUI; -/// use sui::tx_context::TxContext; -/// -/// struct POOL_TEAM has drop {} -/// -/// entry fun create_pool( -/// token: Coin, -/// sui: Coin, -/// fee_percent: u64, -/// ctx: &mut TxContext -/// ) { -/// pool::create_pool(POOL_TEAM {}, token, sui, fee_percent, ctx) -/// } -/// } -/// ``` -/// -/// This solution is rather simple and is based on the example from the Move repo: -/// https://github.com/move-language/move/blob/main/language/documentation/examples/experimental/coin-swap/sources/CoinSwap.move -module defi::pool { - use sui::coin::{Self, Coin}; - use sui::balance::{Self, Supply, Balance}; - use sui::sui::SUI; - - /// For when supplied Coin is zero. - const EZeroAmount: u64 = 0; - - /// For when pool fee is set incorrectly. - /// Allowed values are: [0-10000). - const EWrongFee: u64 = 1; - - /// For when someone tries to swap in an empty pool. - const EReservesEmpty: u64 = 2; - - /// For when someone attempts to add more liquidity than u128 Math allows. - const EPoolFull: u64 = 4; - - /// The integer scaling setting for fees calculation. - const FEE_SCALING: u128 = 10000; - - /// The max value that can be held in one of the Balances of - /// a Pool. U64 MAX / FEE_SCALING - const MAX_POOL_VALUE: u64 = { - 18446744073709551615 / 10000 - }; - - /// The Pool token that will be used to mark the pool share - /// of a liquidity provider. The first type parameter stands - /// for the witness type of a pool. The seconds is for the - /// coin held in the pool. - public struct LSP has drop {} - - /// The pool with exchange. - /// - /// - `fee_percent` should be in the range: [0-10000), meaning - /// that 10000 is 100% and 1 is 0.1% - public struct Pool has key { - id: UID, - sui: Balance, - token: Balance, - lsp_supply: Supply>, - /// Fee Percent is denominated in basis points. - fee_percent: u64 - } - - #[allow(unused_function)] - /// Module initializer is empty - to publish a new Pool one has - /// to create a type which will mark LSPs. - fun init(_: &mut TxContext) {} - - /// Create new `Pool` for token `T`. Each Pool holds a `Coin` - /// and a `Coin`. Swaps are available in both directions. - /// - /// Share is calculated based on Uniswap's constant product formula: - /// liquidity = sqrt( X * Y ) - public fun create_pool( - _: P, - token: Coin, - sui: Coin, - fee_percent: u64, - ctx: &mut TxContext - ): Coin> { - let sui_amt = sui.value(); - let tok_amt = token.value(); - - assert!(sui_amt > 0 && tok_amt > 0, EZeroAmount); - assert!(sui_amt < MAX_POOL_VALUE && tok_amt < MAX_POOL_VALUE, EPoolFull); - assert!(fee_percent >= 0 && fee_percent < 10000, EWrongFee); - - // Initial share of LSP is the sqrt(a) * sqrt(b) - let share = sui_amt.sqrt() * tok_amt.sqrt(); - let mut lsp_supply = balance::create_supply(LSP {}); - let lsp = lsp_supply.increase_supply(share); - - transfer::share_object(Pool { - id: object::new(ctx), - token: token.into_balance(), - sui: sui.into_balance(), - lsp_supply, - fee_percent - }); - - coin::from_balance(lsp, ctx) - } - - - /// Entrypoint for the `swap_sui` method. Sends swapped token - /// to sender. - entry fun swap_sui_( - pool: &mut Pool, sui: Coin, ctx: &mut TxContext - ) { - transfer::public_transfer( - swap_sui(pool, sui, ctx), - ctx.sender() - ) - } - - /// Swap `Coin` for the `Coin`. - /// Returns Coin. - public fun swap_sui( - pool: &mut Pool, sui: Coin, ctx: &mut TxContext - ): Coin { - assert!(sui.value() > 0, EZeroAmount); - - let sui_balance = sui.into_balance(); - - // Calculate the output amount - fee - let (sui_reserve, token_reserve, _) = get_amounts(pool); - - assert!(sui_reserve > 0 && token_reserve > 0, EReservesEmpty); - - let output_amount = get_input_price( - sui_balance.value(), - sui_reserve, - token_reserve, - pool.fee_percent - ); - - pool.sui.join(sui_balance); - coin::take(&mut pool.token, output_amount, ctx) - } - - /// Entry point for the `swap_token` method. Sends swapped SUI - /// to the sender. - entry fun swap_token_( - pool: &mut Pool, token: Coin, ctx: &mut TxContext - ) { - transfer::public_transfer( - swap_token(pool, token, ctx), - ctx.sender() - ) - } - - /// Swap `Coin` for the `Coin`. - /// Returns the swapped `Coin`. - public fun swap_token( - pool: &mut Pool, token: Coin, ctx: &mut TxContext - ): Coin { - assert!(token.value() > 0, EZeroAmount); - - let tok_balance = token.into_balance(); - let (sui_reserve, token_reserve, _) = get_amounts(pool); - - assert!(sui_reserve > 0 && token_reserve > 0, EReservesEmpty); - - let output_amount = get_input_price( - tok_balance.value(), - token_reserve, - sui_reserve, - pool.fee_percent - ); - - pool.token.join(tok_balance); - coin::take(&mut pool.sui, output_amount, ctx) - } - - /// Entrypoint for the `add_liquidity` method. Sends `Coin` to - /// the transaction sender. - entry fun add_liquidity_( - pool: &mut Pool, sui: Coin, token: Coin, ctx: &mut TxContext - ) { - transfer::public_transfer( - add_liquidity(pool, sui, token, ctx), - ctx.sender() - ); - } - - /// Add liquidity to the `Pool`. Sender needs to provide both - /// `Coin` and `Coin`, and in exchange he gets `Coin` - - /// liquidity provider tokens. - public fun add_liquidity( - pool: &mut Pool, sui: Coin, token: Coin, ctx: &mut TxContext - ): Coin> { - assert!(sui.value() > 0, EZeroAmount); - assert!(sui.value() > 0, EZeroAmount); - - let sui_balance = sui.into_balance(); - let tok_balance = token.into_balance(); - - let (sui_amount, tok_amount, lsp_supply) = get_amounts(pool); - - let sui_added = sui_balance.value(); - let tok_added = tok_balance.value(); - let share_minted = - ((sui_added * lsp_supply) / sui_amount).min((tok_added * lsp_supply) / tok_amount); - - let sui_amt = pool.sui.join(sui_balance); - let tok_amt = pool.token.join(tok_balance); - - assert!(sui_amt < MAX_POOL_VALUE, EPoolFull); - assert!(tok_amt < MAX_POOL_VALUE, EPoolFull); - - let balance = pool.lsp_supply.increase_supply(share_minted); - coin::from_balance(balance, ctx) - } - - /// Entrypoint for the `remove_liquidity` method. Transfers - /// withdrawn assets to the sender. - entry fun remove_liquidity_( - pool: &mut Pool, - lsp: Coin>, - ctx: &mut TxContext - ) { - let (sui, token) = remove_liquidity(pool, lsp, ctx); - let sender = ctx.sender(); - - transfer::public_transfer(sui, sender); - transfer::public_transfer(token, sender); - } - - /// Remove liquidity from the `Pool` by burning `Coin`. - /// Returns `Coin` and `Coin`. - public fun remove_liquidity( - pool: &mut Pool, - lsp: Coin>, - ctx: &mut TxContext - ): (Coin, Coin) { - let lsp_amount = lsp.value(); - - // If there's a non-empty LSP, we can - assert!(lsp_amount > 0, EZeroAmount); - - let (sui_amt, tok_amt, lsp_supply) = get_amounts(pool); - let sui_removed = (sui_amt * lsp_amount) / lsp_supply; - let tok_removed = (tok_amt * lsp_amount) / lsp_supply; - - pool.lsp_supply.decrease_supply(lsp.into_balance()); - - ( - coin::take(&mut pool.sui, sui_removed, ctx), - coin::take(&mut pool.token, tok_removed, ctx) - ) - } - - /// Public getter for the price of SUI in token T. - /// - How much SUI one will get if they send `to_sell` amount of T; - public fun sui_price(pool: &Pool, to_sell: u64): u64 { - let (sui_amt, tok_amt, _) = get_amounts(pool); - get_input_price(to_sell, tok_amt, sui_amt, pool.fee_percent) - } - - /// Public getter for the price of token T in SUI. - /// - How much T one will get if they send `to_sell` amount of SUI; - public fun token_price(pool: &Pool, to_sell: u64): u64 { - let (sui_amt, tok_amt, _) = get_amounts(pool); - get_input_price(to_sell, sui_amt, tok_amt, pool.fee_percent) - } - - - /// Get most used values in a handy way: - /// - amount of SUI - /// - amount of token - /// - total supply of LSP - public fun get_amounts(pool: &Pool): (u64, u64, u64) { - ( - pool.sui.value(), - pool.token.value(), - pool.lsp_supply.supply_value() - ) - } - - /// Calculate the output amount minus the fee - 0.3% - public fun get_input_price( - input_amount: u64, input_reserve: u64, output_reserve: u64, fee_percent: u64 - ): u64 { - // up casts - let ( - input_amount, - input_reserve, - output_reserve, - fee_percent - ) = ( - (input_amount as u128), - (input_reserve as u128), - (output_reserve as u128), - (fee_percent as u128) - ); - - let input_amount_with_fee = input_amount * (FEE_SCALING - fee_percent); - let numerator = input_amount_with_fee * output_reserve; - let denominator = (input_reserve * FEE_SCALING) + input_amount_with_fee; - - (numerator / denominator as u64) - } - - #[test_only] - public fun init_for_testing(ctx: &mut TxContext) { - init(ctx) - } -} - -#[test_only] -/// Tests for the pool module. -/// They are sequential and based on top of each other. -/// ``` -/// * - test_init_pool -/// | +-- test_creation -/// | +-- test_swap_sui -/// | +-- test_swap_tok -/// | +-- test_withdraw_almost_all -/// | +-- test_withdraw_all -/// ``` -module defi::pool_tests { - use sui::sui::SUI; - use sui::coin::{Coin, mint_for_testing as mint}; - use sui::test_scenario::{Self as test, Scenario, next_tx, ctx}; - use defi::pool::{Self, Pool, LSP}; - use sui::test_utils; - - /// Gonna be our test token. - public struct BEEP {} - - /// A witness type for the pool creation; - /// The pool provider's identifier. - public struct POOLEY has drop {} - - const SUI_AMT: u64 = 1000000000; - const BEEP_AMT: u64 = 1000000; - - // Tests section - #[test] fun test_init_pool() { - let mut scenario = scenario(); - test_init_pool_(&mut scenario); - scenario.end(); - } - #[test] fun test_add_liquidity() { - let mut scenario = scenario(); - test_add_liquidity_(&mut scenario); - scenario.end(); - } - #[test] fun test_swap_sui() { - let mut scenario = scenario(); - test_swap_sui_(&mut scenario); - scenario.end(); - } - #[test] fun test_swap_tok() { - let mut scenario = scenario(); - test_swap_tok_(&mut scenario); - scenario.end(); - } - #[test] fun test_withdraw_almost_all() { - let mut scenario = scenario(); - test_withdraw_almost_all_(&mut scenario); - scenario.end(); - } - #[test] fun test_withdraw_all() { - let mut scenario = scenario(); - test_withdraw_all_(&mut scenario); - scenario.end(); - } - - // Non-sequential tests - #[test] fun test_math() { - let mut scenario = scenario(); - test_math_(&mut scenario); - scenario.end(); - } - - #[test_only] - fun burn(x: Coin): u64 { - let value = x.value(); - test_utils::destroy(x); - value - } - - /// Init a Pool with a 1_000_000 BEEP and 1_000_000_000 SUI; - /// Set the ratio BEEP : SUI = 1 : 1000. - /// Set LSP token amount to 1000; - fun test_init_pool_(test: &mut Scenario) { - let (owner, _) = people(); - - test.next_tx(owner); - { - pool::init_for_testing(ctx(test)); - }; - - test.next_tx(owner); - { - let lsp = pool::create_pool( - POOLEY {}, - mint(BEEP_AMT, ctx(test)), - mint(SUI_AMT, ctx(test)), - 3, - ctx(test) - ); - - assert!(burn(lsp) == 31622000, 0); - }; - - test.next_tx(owner); - { - let pool = test.take_shared>(); - let (amt_sui, amt_tok, lsp_supply) = pool::get_amounts(&pool); - - assert!(lsp_supply == 31622000, 0); - assert!(amt_sui == SUI_AMT, 0); - assert!(amt_tok == BEEP_AMT, 0); - - test::return_shared(pool) - }; - } - - /// Expect LP tokens to double in supply when the same values passed - fun test_add_liquidity_(test: &mut Scenario) { - test_init_pool_(test); - - let (_, theguy) = people(); - - test.next_tx(theguy); - { - let mut pool = test.take_shared>(); - let pool_mut = &mut pool; - let (amt_sui, amt_tok, lsp_supply) = pool::get_amounts(pool_mut); - - let lsp_tokens = pool::add_liquidity( - pool_mut, - mint(amt_sui, ctx(test)), - mint(amt_tok, ctx(test)), - ctx(test) - ); - - assert!(burn(lsp_tokens) == lsp_supply, 1); - - test::return_shared(pool) - }; - } - - /// The other guy tries to exchange 5_000_000 sui for ~ 5000 BEEP, - /// minus the commission that is paid to the pool. - fun test_swap_sui_(test: &mut Scenario) { - test_init_pool_(test); - - let (_, the_guy) = people(); - - test.next_tx(the_guy); - { - let mut pool = test.take_shared>(); - let pool_mut = &mut pool; - - let token = pool::swap_sui(pool_mut, mint(5000000, ctx(test)), ctx(test)); - - // Check the value of the coin received by the guy. - // Due to rounding problem the value is not precise - // (works better on larger numbers). - assert!(burn(token) > 4950, 1); - - test::return_shared(pool); - }; - } - - /// The owner swaps back BEEP for SUI and expects an increase in price. - /// The sent amount of BEEP is 1000, initial price was 1 BEEP : 1000 SUI; - fun test_swap_tok_(test: &mut Scenario) { - test_swap_sui_(test); - - let (owner, _) = people(); - - test.next_tx(owner); - { - let mut pool = test.take_shared>(); - let pool_mut = &mut pool; - - let sui = pool::swap_token(pool_mut, mint(1000, ctx(test)), ctx(test)); - - // Actual win is 1005971, which is ~ 0.6% profit - assert!(burn(sui) > 1000000u64, 2); - - test::return_shared(pool); - }; - } - - /// Withdraw (MAX_LIQUIDITY - 1) from the pool - fun test_withdraw_almost_all_(test: &mut Scenario) { - test_swap_tok_(test); - - let (owner, _) = people(); - - // someone tries to pass (MINTED_LSP - 1) and hopes there will be just 1 BEEP - test.next_tx(owner); - { - let lsp = mint>(31622000 - 1, ctx(test)); - let mut pool = test.take_shared>(); - let pool_mut = &mut pool; - - let (sui, tok) = pool::remove_liquidity(pool_mut, lsp, ctx(test)); - let (sui_reserve, tok_reserve, lsp_supply) = pool::get_amounts(pool_mut); - - assert!(lsp_supply == 1, 3); - assert!(tok_reserve > 0, 3); // actually 1 BEEP is left - assert!(sui_reserve > 0, 3); - - burn(sui); - burn(tok); - - test::return_shared(pool); - } - } - - /// The owner tries to withdraw all liquidity from the pool. - fun test_withdraw_all_(test: &mut Scenario) { - test_swap_tok_(test); - - let (owner, _) = people(); - - next_tx(test, owner); - { - let lsp = mint>(31622000, ctx(test)); - let mut pool = test.take_shared>(); - let pool_mut = &mut pool; - - let (sui, tok) = pool::remove_liquidity(pool_mut, lsp, ctx(test)); - let (sui_reserve, tok_reserve, lsp_supply) = pool::get_amounts(pool_mut); - - assert!(sui_reserve == 0, 3); - assert!(tok_reserve == 0, 3); - assert!(lsp_supply == 0, 3); - - // make sure that withdrawn assets - assert!(burn(sui) > 1000000000, 3); - assert!(burn(tok) < 1000000, 3); - - test::return_shared(pool); - }; - } - - /// This just tests the math. - fun test_math_(_: &mut Scenario) { - let u64_max = 18446744073709551615; - let max_val = u64_max / 10000; - - // Try small values - assert!(pool::get_input_price(10, 1000, 1000, 0) == 9, 0); - - // Even with 0 commission there's this small loss of 1 - assert!(pool::get_input_price(10000, max_val, max_val, 0) == 9999, 0); - assert!(pool::get_input_price(1000, max_val, max_val, 0) == 999, 0); - assert!(pool::get_input_price(100, max_val, max_val, 0) == 99, 0); - } - - // utilities - fun scenario(): Scenario { test::begin(@0x1) } - - fun people(): (address, address) { (@0xBEEF, @0x1337) } -} diff --git a/sui_programmability/examples/defi/sources/shared_escrow.move b/sui_programmability/examples/defi/sources/shared_escrow.move deleted file mode 100644 index e2548e3834221..0000000000000 --- a/sui_programmability/examples/defi/sources/shared_escrow.move +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// An escrow for atomic swap of objects without a trusted third party -module defi::shared_escrow { - /// An object held in escrow - public struct EscrowedObj has key, store { - id: UID, - /// owner of the escrowed object - creator: address, - /// intended recipient of the escrowed object - recipient: address, - /// ID of the object `creator` wants in exchange - exchange_for: ID, - /// the escrowed object - escrowed: Option, - } - - // Error codes - /// An attempt to cancel escrow by a different user than the owner - const EWrongOwner: u64 = 0; - /// Exchange by a different user than the `recipient` of the escrowed object - const EWrongRecipient: u64 = 1; - /// Exchange with a different item than the `exchange_for` field - const EWrongExchangeObject: u64 = 2; - /// The escrow has already been exchanged or cancelled - const EAlreadyExchangedOrCancelled: u64 = 3; - - /// Create an escrow for exchanging goods with counterparty - public fun create( - recipient: address, - exchange_for: ID, - escrowed_item: T, - ctx: &mut TxContext - ) { - let creator = ctx.sender(); - let id = object::new(ctx); - let escrowed = option::some(escrowed_item); - transfer::public_share_object( - EscrowedObj { - id, creator, recipient, exchange_for, escrowed - } - ); - } - - /// The `recipient` of the escrow can exchange `obj` with the escrowed item - public entry fun exchange( - obj: ExchangeForT, - escrow: &mut EscrowedObj, - ctx: &TxContext - ) { - assert!(option::is_some(&escrow.escrowed), EAlreadyExchangedOrCancelled); - let escrowed_item = option::extract(&mut escrow.escrowed); - assert!(&ctx.sender() == &escrow.recipient, EWrongRecipient); - assert!(object::borrow_id(&obj) == &escrow.exchange_for, EWrongExchangeObject); - // everything matches. do the swap! - transfer::public_transfer(escrowed_item, ctx.sender()); - transfer::public_transfer(obj, escrow.creator); - } - - /// The `creator` can cancel the escrow and get back the escrowed item - public entry fun cancel( - escrow: &mut EscrowedObj, - ctx: &TxContext - ) { - assert!(&ctx.sender() == &escrow.creator, EWrongOwner); - assert!(option::is_some(&escrow.escrowed), EAlreadyExchangedOrCancelled); - transfer::public_transfer(option::extract(&mut escrow.escrowed), escrow.creator); - } -} diff --git a/sui_programmability/examples/defi/sources/subscription.move b/sui_programmability/examples/defi/sources/subscription.move deleted file mode 100644 index b27bc376f86ae..0000000000000 --- a/sui_programmability/examples/defi/sources/subscription.move +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This example introduces a `Subscription` type - a `Capability`-like object -/// with a limited number of uses. Once all of them are used, the subscription can -/// be renewed or destroyed. -/// -/// Design of this module implies that an application will implement the subscription -/// interface using a `Witness` pattern, while some features are given by default -/// and do not require implementation. -/// -/// -/// The problem that illustrates usage of this module might be common in Sui. To -/// get to it, we need to provide some background: -/// -/// - Shared object transactions in Sui require consensus; and for each shared -/// object there's a sequence of transactions which use / reference it. -/// -/// - Mixing multiple shared objects within the same transaction potentially leads -/// to all objects being slowed down depending on how loaded they are. -/// -/// - The only way to effectively use multiple shared objects is to be able to call -/// a function in Move which makes use of them. And these actions require `public` -/// function visibility. -/// -/// Case in this example is a mocked up liquidity pool implementation with two -/// functions: `swap` - available only directly because of the `entry` visibility -/// and a `dev_swap` - doing the same thing but can be used on chain (ie for -/// cross-chain swaps), and can be used in a function with other shared objects. -/// -/// The former is free because this functionality is meant to be available to -/// everyone. While the latter gives additional profits to the liquidity pool by -/// charging extensive (and potentially slowing) usage. -/// -module defi::dev_pass { - /// For when Subscription object no longer has uses. - const ENoUses: u64 = 0; - - /// Owned object from which SingleUses are spawn. - public struct Subscription has key { - id: UID, - uses: u64 - } - - /// A single use potato to authorize actions. - public struct SingleUse {} - - // ======== Default Functions ======== - - /// Public view for the `Subscription`.`uses` field. - public fun uses(s: &Subscription): u64 { s.uses } - - /// If `Subscription` is owned, create `SingleUse` (hot potato) to use in the service. - public fun use_pass(s: &mut Subscription): SingleUse { - assert!(s.uses != 0, ENoUses); - s.uses = s.uses - 1; - SingleUse {} - } - - /// Burn a subscription without checking for number of uses. Allows Sui storage refunds - /// when subscription is no longer needed. - entry public fun destroy(s: Subscription) { - let Subscription { id, uses: _ } = s; - id.delete(); - } - - // ======== Implementable Functions ======== - - /// Function to issue new `Subscription` with a specified number of uses. - /// Implementable by an external module with a witness parameter T. Number of - /// uses is determined by the actual implementation. - public fun issue_subscription(_w: T, uses: u64, ctx: &mut TxContext): Subscription { - Subscription { - id: object::new(ctx), - uses - } - } - - /// Increase number of uses in the subscription. - /// Implementable by an external module with a witness parameter T. - public fun add_uses(_w: T, s: &mut Subscription, uses: u64) { - s.uses = s.uses + uses; - } - - /// Confirm a use of a pass. Verified by the module that implements "Subscription API". - /// Implementable by an external module with a witness parameter T. Confirmation is only - /// available if the third party implements it and recognizes the use. - public fun confirm_use(_w: T, pass: SingleUse) { - let SingleUse { } = pass; - } - - /// Allow applications customize transferability of the `Subscription`. - /// Implementable by an external module with a witness parameter T. Module can define whether - /// a `Subscription` can be transferred to another account or not. Omitting this implementation - /// will mean that the `Subscription` can not be transferred. - public fun transfer(_w: T, s: Subscription, to: address) { - transfer::transfer(s, to) - } -} - -/// Rough outline of an AMM. -/// For simplicity pool implementation details are omitted but marked as comments to -/// show correlation with the `defi/pool.move` example. -module defi::some_amm { - use defi::dev_pass::{Self, Subscription, SingleUse}; - - /// A type to Mark subscription - public struct DEVPASS has drop {} - /* Can be customized to: DEVPASS to make one subscription per pool */ - /* And the price could be determined based on amount LP tokens issued or trade volume */ - - /// Entry function that uses a shared pool object. - /// Can only be accessed from outside of the chain - can't be called from another module. - entry fun swap(/* &mut Pool, Coin ... */) { /* ... */ } - - /// Function similar to the `swap` but can be called from other Move modules. - /// Opens up tooling; potentially slows down the AMM if multiple shared objects - /// used in the same tx! And for that developers have to pay. - public fun dev_swap(p: SingleUse, /* &mut Pool, Coin */): bool /* Coin */ { - dev_pass::confirm_use(DEVPASS {}, p); - /* ... */ - true - } - - /// Lastly there should a logic to purchase subscription. This AMM disallows transfers and - /// issues Subscription object to the sender address. - public fun purchase_pass(/* Coin , */ ctx: &mut TxContext) { - dev_pass::transfer( - DEVPASS {}, - dev_pass::issue_subscription(DEVPASS {}, 100, ctx), - ctx.sender() - ) - } - - /// Adds more uses to the `Subscription` object. - public fun topup_pass(s: &mut Subscription /* Coin */) { - dev_pass::add_uses(DEVPASS {}, s, 10) - } -} - -/// Sketch for an application that uses multiple pools. -/// Shows how subscriptions are used in `some_amm` module. -module defi::smart_swapper { - use defi::some_amm::{Self, DEVPASS}; - use defi::dev_pass::{Self, Subscription}; - - // just some types to use as generics for pools - public struct ETH {} public struct BTC {} public struct KTS {} - - /// Some function that allows cross-pool operations with some additional - /// logic. The most important part here is the use of subscription to "pay" - /// for each pool's access. - entry fun cross_pool_swap( - s: &mut Subscription - /* assuming a lot of arguments */ - ) { - - let _a = some_amm::dev_swap(dev_pass::use_pass(s) /*, Coin */); - let _b = some_amm::dev_swap(dev_pass::use_pass(s) /*, _a */); - - // do something with swapped values ? - // transfer::public_transfer( ... ) - } -} diff --git a/sui_programmability/examples/defi/tests/escrow_tests.move b/sui_programmability/examples/defi/tests/escrow_tests.move deleted file mode 100644 index b5d9873ec9a7a..0000000000000 --- a/sui_programmability/examples/defi/tests/escrow_tests.move +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module defi::escrow_tests { - use sui::test_scenario::{Self, Scenario}; - - use defi::escrow::{Self, EscrowedObj}; - - const ALICE_ADDRESS: address = @0xACE; - const BOB_ADDRESS: address = @0xACEB; - const THIRD_PARTY_ADDRESS: address = @0xFACE; - const RANDOM_ADDRESS: address = @123; - - // Error codes. - const ESwapTransferFailed: u64 = 0; - const EReturnTransferFailed: u64 = 0; - - // Example of an object type used for exchange - public struct ItemA has key, store { - id: UID - } - - // Example of the other object type used for exchange - public struct ItemB has key, store { - id: UID - } - - #[test] - fun test_escrow_flow() { - // Both Alice and Bob send items to the third party - let mut scenario_val = send_to_escrow(ALICE_ADDRESS, BOB_ADDRESS); - let scenario = &mut scenario_val; - - swap(scenario, THIRD_PARTY_ADDRESS); - - // Alice now owns item B, and Bob now owns item A - assert!(owns_object(ALICE_ADDRESS), ESwapTransferFailed); - assert!(owns_object(BOB_ADDRESS), ESwapTransferFailed); - - test_scenario::end(scenario_val); - } - - #[test] - fun test_return_to_sender() { - // Both Alice and Bob send items to the third party - let mut scenario_val = send_to_escrow(ALICE_ADDRESS, BOB_ADDRESS); - let scenario = &mut scenario_val; - - // The third party returns item A to Alice, item B to Bob - scenario.next_tx(THIRD_PARTY_ADDRESS); - { - let item_a = scenario.take_from_sender>(); - escrow::return_to_sender(item_a); - - let item_b = scenario.take_from_sender>(); - escrow::return_to_sender(item_b); - }; - scenario.next_tx(THIRD_PARTY_ADDRESS); - // Alice now owns item A, and Bob now owns item B - assert!(owns_object(ALICE_ADDRESS), EReturnTransferFailed); - assert!(owns_object(BOB_ADDRESS), EReturnTransferFailed); - - scenario_val.end(); - } - - #[test] - #[expected_failure(abort_code = escrow::EMismatchedExchangeObject)] - fun test_swap_wrong_objects() { - // Both Alice and Bob send items to the third party except that Alice wants to exchange - // for a different object than Bob's - let mut scenario = send_to_escrow_with_overrides(ALICE_ADDRESS, BOB_ADDRESS, true, false); - swap(&mut scenario, THIRD_PARTY_ADDRESS); - scenario.end(); - } - - #[test] - #[expected_failure(abort_code = escrow::EMismatchedSenderRecipient)] - fun test_swap_wrong_recipient() { - // Both Alice and Bob send items to the third party except that Alice put a different - // recipient than Bob - let mut scenario = send_to_escrow_with_overrides(ALICE_ADDRESS, BOB_ADDRESS, false, true); - swap(&mut scenario, THIRD_PARTY_ADDRESS); - scenario.end(); - } - - fun swap(scenario: &mut Scenario, third_party: address) { - scenario.next_tx(third_party); - { - let item_a = test_scenario::take_from_sender>(scenario); - let item_b = test_scenario::take_from_sender>(scenario); - escrow::swap(item_a, item_b); - }; - scenario.next_tx(third_party); - } - - fun send_to_escrow( - alice: address, - bob: address, - ): Scenario { - send_to_escrow_with_overrides(alice, bob, false, false) - } - - fun send_to_escrow_with_overrides( - alice: address, - bob: address, - override_exchange_for: bool, - override_recipient: bool, - ): Scenario { - let mut new_scenario = test_scenario::begin(alice); - let scenario = &mut new_scenario; - let ctx = scenario.ctx(); - let item_a_versioned_id = object::new(ctx); - - scenario.next_tx(bob); - let ctx = scenario.ctx(); - let item_b_versioned_id = object::new(ctx); - - let item_a_id = item_a_versioned_id.uid_to_inner(); - let mut item_b_id = item_b_versioned_id.uid_to_inner(); - if (override_exchange_for) { - item_b_id = object::id_from_address(RANDOM_ADDRESS); - }; - - // Alice sends item A to the third party - scenario.next_tx(alice); - { - let ctx = scenario.ctx(); - let escrowed = ItemA { - id: item_a_versioned_id - }; - let mut recipient = bob; - if (override_recipient) { - recipient = RANDOM_ADDRESS; - }; - escrow::create( - recipient, - THIRD_PARTY_ADDRESS, - item_b_id, - escrowed, - ctx - ); - }; - - // Bob sends item B to the third party - scenario.next_tx(BOB_ADDRESS); - { - let ctx = scenario.ctx(); - let escrowed = ItemB { - id: item_b_versioned_id - }; - escrow::create( - alice, - THIRD_PARTY_ADDRESS, - item_a_id, - escrowed, - ctx - ); - }; - scenario.next_tx(BOB_ADDRESS); - new_scenario - } - - fun owns_object(owner: address): bool { - test_scenario::has_most_recent_for_address(owner) - } -} diff --git a/sui_programmability/examples/defi/tests/flash_lender_tests.move b/sui_programmability/examples/defi/tests/flash_lender_tests.move deleted file mode 100644 index ab0e84f7842ce..0000000000000 --- a/sui_programmability/examples/defi/tests/flash_lender_tests.move +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module defi::flash_lender_tests { - use defi::flash_lender::{Self, AdminCap, FlashLender}; - use sui::pay; - use sui::coin; - use sui::sui::SUI; - use sui::test_scenario; - - #[test] - fun flash_loan_example() { - let admin = @0x1; - let borrower = @0x2; - - // admin creates a flash lender with 100 coins and a fee of 1 coin - let mut scenario_val = test_scenario::begin(admin); - let scenario = &mut scenario_val; - { - let ctx = scenario.ctx(); - let coin = coin::mint_for_testing(100, ctx); - flash_lender::create(coin, 1, ctx); - }; - // borrower requests and repays a loan of 10 coins + the fee - test_scenario::next_tx(scenario, borrower); - { - let mut lender_val = scenario.take_shared>(); - let lender = &mut lender_val; - let ctx = scenario.ctx(); - - let (loan, receipt) = flash_lender::loan(lender, 10, ctx); - // in practice, borrower does something (e.g., arbitrage) to make a profit from the loan. - // simulate this by minting the borrower 5 coins. - let mut profit = coin::mint_for_testing(5, ctx); - coin::join(&mut profit, loan); - let to_keep = coin::take(profit.balance_mut(), 4, ctx); - pay::keep(to_keep, ctx); - flash_lender::repay(lender, profit, receipt); - - test_scenario::return_shared(lender_val); - }; - // admin withdraws the 1 coin profit from lending - scenario.next_tx( admin); - { - let mut lender_val = scenario.take_shared>(); - let lender = &mut lender_val; - let admin_cap = scenario.take_from_sender(); - let ctx = scenario.ctx(); - - // max loan size should have increased because of the fee payment - assert!(flash_lender::max_loan(lender) == 101, 0); - // withdraw 1 coin from the pool available for lending - let coin = flash_lender::withdraw(lender, &admin_cap, 1, ctx); - // max loan size should decrease accordingly - assert!(flash_lender::max_loan(lender) == 100, 0); - pay::keep(coin, ctx); - - test_scenario::return_shared(lender_val); - scenario.return_to_sender(admin_cap); - }; - scenario_val.end(); - } -} diff --git a/sui_programmability/examples/defi/tests/shared_escrow_test.move b/sui_programmability/examples/defi/tests/shared_escrow_test.move deleted file mode 100644 index 0c733a3d98e04..0000000000000 --- a/sui_programmability/examples/defi/tests/shared_escrow_test.move +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module defi::shared_escrow_tests { - use sui::test_scenario::{Self, Scenario}; - - use defi::shared_escrow::{Self, EscrowedObj}; - - const ALICE_ADDRESS: address = @0xACE; - const BOB_ADDRESS: address = @0xACEB; - const RANDOM_ADDRESS: address = @123; - - // Error codes. - const ESwapTransferFailed: u64 = 0; - const EReturnTransferFailed: u64 = 0; - - // Example of an object type used for exchange - public struct ItemA has key, store { - id: UID - } - - // Example of the other object type used for exchange - public struct ItemB has key, store { - id: UID - } - - #[test] - fun test_escrow_flow() { - // Alice creates the escrow - let (mut scenario_val, item_b) = create_escrow(ALICE_ADDRESS, BOB_ADDRESS); - - // Bob exchanges item B for the escrowed item A - exchange(&mut scenario_val, BOB_ADDRESS, item_b); - - // Alice now owns item B, and Bob now owns item A - assert!(owns_object(ALICE_ADDRESS), ESwapTransferFailed); - assert!(owns_object(BOB_ADDRESS), ESwapTransferFailed); - - scenario_val.end(); - } - - #[test] - fun test_cancel() { - // Alice creates the escrow - let (mut scenario_val, ItemB { id }) = create_escrow(ALICE_ADDRESS, BOB_ADDRESS); - id.delete(); - let scenario = &mut scenario_val; - // Alice does not own item A - assert!(!owns_object(ALICE_ADDRESS), EReturnTransferFailed); - - // Alice cancels the escrow - cancel(scenario, ALICE_ADDRESS); - - // Alice now owns item A - assert!(owns_object(ALICE_ADDRESS), EReturnTransferFailed); - - scenario_val.end(); - } - - #[test] - #[expected_failure(abort_code = shared_escrow::EWrongOwner)] - fun test_cancel_with_wrong_owner() { - // Alice creates the escrow - let (mut scenario_val, ItemB { id }) = create_escrow(ALICE_ADDRESS, BOB_ADDRESS); - id.delete(); - let scenario = &mut scenario_val; - - // Bob tries to cancel the escrow that Alice owns and expects failure - cancel(scenario, BOB_ADDRESS); - - scenario_val.end(); - } - - #[test] - #[expected_failure(abort_code = shared_escrow::EWrongExchangeObject)] - fun test_swap_wrong_objects() { - // Alice creates the escrow in exchange for item b - let (mut scenario_val, ItemB { id }) = create_escrow(ALICE_ADDRESS, BOB_ADDRESS); - id.delete(); - let scenario = &mut scenario_val; - - // Bob tries to exchange item C for the escrowed item A and expects failure - scenario.next_tx(BOB_ADDRESS); - let ctx = scenario.ctx(); - let item_c = ItemB { id: object::new(ctx) }; - exchange(scenario, BOB_ADDRESS, item_c); - - scenario_val.end(); - } - - #[test] - #[expected_failure(abort_code = shared_escrow::EWrongRecipient)] - fun test_swap_wrong_recipient() { - // Alice creates the escrow in exchange for item b - let (mut scenario_val, item_b) = create_escrow(ALICE_ADDRESS, BOB_ADDRESS); - let scenario = &mut scenario_val; - - // Random address tries to exchange item B for the escrowed item A and expects failure - exchange(scenario, RANDOM_ADDRESS, item_b); - - scenario_val.end(); - } - - #[test] - #[expected_failure(abort_code = shared_escrow::EAlreadyExchangedOrCancelled)] - fun test_cancel_twice() { - // Alice creates the escrow - let (mut scenario_val, ItemB { id }) = create_escrow(ALICE_ADDRESS, BOB_ADDRESS); - id.delete(); - let scenario = &mut scenario_val; - // Alice does not own item A - assert!(!owns_object(ALICE_ADDRESS), EReturnTransferFailed); - - // Alice cancels the escrow - cancel(scenario, ALICE_ADDRESS); - - // Alice now owns item A - assert!(owns_object(ALICE_ADDRESS), EReturnTransferFailed); - - // Alice tries to cancel the escrow again - cancel(scenario, ALICE_ADDRESS); - - scenario_val.end(); - } - - fun cancel(scenario: &mut Scenario, initiator: address) { - scenario.next_tx(initiator); - { - let mut escrow_val = scenario.take_shared>(); - let escrow = &mut escrow_val; - let ctx = scenario.ctx(); - shared_escrow::cancel(escrow, ctx); - test_scenario::return_shared(escrow_val); - }; - scenario.next_tx(initiator); - } - - fun exchange(scenario: &mut Scenario, bob: address, item_b: ItemB) { - scenario.next_tx(bob); - { - let mut escrow_val = scenario.take_shared>(); - let escrow = &mut escrow_val; - let ctx = scenario.ctx(); - shared_escrow::exchange(item_b, escrow, ctx); - test_scenario::return_shared(escrow_val); - }; - scenario.next_tx(bob); - } - - fun create_escrow( - alice: address, - bob: address, - ): (Scenario, ItemB) { - let mut new_scenario = test_scenario::begin(alice); - let scenario = &mut new_scenario; - let ctx = scenario.ctx(); - let item_a_versioned_id = object::new(ctx); - - scenario.next_tx(bob); - let ctx = scenario.ctx(); - let item_b = ItemB { id: object::new(ctx) }; - let item_b_id = object::id(&item_b); - - // Alice creates the escrow - scenario.next_tx(alice); - { - let ctx = scenario.ctx(); - let escrowed = ItemA { - id: item_a_versioned_id - }; - shared_escrow::create( - bob, - item_b_id, - escrowed, - ctx - ); - }; - scenario.next_tx(alice); - (new_scenario, item_b) - } - - fun owns_object(owner: address): bool { - test_scenario::has_most_recent_for_address(owner) - } -} diff --git a/sui_programmability/examples/ecommerce/Move.toml b/sui_programmability/examples/ecommerce/Move.toml deleted file mode 100644 index 5d5ecc5566b7d..0000000000000 --- a/sui_programmability/examples/ecommerce/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "ecommerce" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -ecommerce = "0x0" diff --git a/sui_programmability/examples/ecommerce/README.md b/sui_programmability/examples/ecommerce/README.md deleted file mode 100644 index 78db0f21b82e8..0000000000000 --- a/sui_programmability/examples/ecommerce/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# E-Commerce Platform - -This application aims to implement a simple generic ecommerce platform with the following set of features: - -1. Allow anyone create their shop with a set of listings; -2. Shop should support listing customization + selling both digital (simple flow) and "physical" items; -3. Create a list-purchase-deliver flow with the use of Sui Objects; -4. Support platform economy by taking a fee from every purchase; -5. Implement a simple bonus points acquirable on purchase which then can be used to get a discount or special offer; diff --git a/sui_programmability/examples/ecommerce/sources/.gitkeep b/sui_programmability/examples/ecommerce/sources/.gitkeep deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sui_programmability/examples/ecommerce/tests/.gitkeep b/sui_programmability/examples/ecommerce/tests/.gitkeep deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sui_programmability/examples/fungible_tokens/Move.toml b/sui_programmability/examples/fungible_tokens/Move.toml deleted file mode 100644 index 51dc93ddd9d7e..0000000000000 --- a/sui_programmability/examples/fungible_tokens/Move.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "FungibleTokens" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -fungible_tokens = "0x0" -abc = "0x0" -rc = "0x0" diff --git a/sui_programmability/examples/fungible_tokens/README.md b/sui_programmability/examples/fungible_tokens/README.md deleted file mode 100644 index 5ae0f2358c79b..0000000000000 --- a/sui_programmability/examples/fungible_tokens/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Fungible Tokens - -* MANAGED: a token managed by a treasurer trusted for minting and burning. This is how (e.g.) a fiat-backed stablecoin or an in-game virtual currency would work. -* BASKET: a synthetic token backed by a basket of other assets. This how (e.g.) a [Special Drawing Rights (SDR)](https://www.imf.org/en/About/Factsheets/Sheets/2016/08/01/14/51/Special-Drawing-Right-SDR)-like asset would work. -* REGULATED_COIN: a coin managed by a central authority which can freeze accounts -* PRIVATE_COIN: a coin which has the option of hiding the amount that you transact -* PRIVATE_BALANCE: a balance which has the option of hiding the amount that it stores. -* FIXED: a token with a fixed supply (coming in future). -* ALGO: a token with an algorithmic issuance policy (coming in future). diff --git a/sui_programmability/examples/fungible_tokens/sources/basket.move b/sui_programmability/examples/fungible_tokens/sources/basket.move deleted file mode 100644 index 91cbdeb29e200..0000000000000 --- a/sui_programmability/examples/fungible_tokens/sources/basket.move +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// A synthetic fungible token backed by a basket of other tokens. -/// Here, we use a basket that is 1:1 SUI and MANAGED, -/// but this approach would work for a basket with arbitrary assets/ratios. -/// E.g., [SDR](https://www.imf.org/en/About/Factsheets/Sheets/2016/08/01/14/51/Special-Drawing-Right-SDR) -/// could be implemented this way. -module fungible_tokens::basket { - use fungible_tokens::managed::MANAGED; - use sui::coin::{Self, Coin}; - use sui::balance::{Self, Balance, Supply}; - use sui::sui::SUI; - - /// Name of the coin. By convention, this type has the same name as its parent module - /// and has no fields. The full type of the coin defined by this module will be `COIN`. - public struct BASKET has drop { } - - /// Singleton shared object holding the reserve assets and the capability. - public struct Reserve has key { - id: UID, - /// capability allowing the reserve to mint and burn BASKET - total_supply: Supply, - /// SUI coins held in the reserve - sui: Balance, - /// MANAGED coins held in the reserve - managed: Balance, - } - - /// Needed to deposit a 1:1 ratio of SUI and MANAGED for minting, but deposited a different ratio - const EBadDepositRatio: u64 = 0; - - #[allow(unused_function)] - fun init(witness: BASKET, ctx: &mut TxContext) { - // Get a treasury cap for the coin put it in the reserve - let total_supply = balance::create_supply(witness); - - transfer::share_object(Reserve { - id: object::new(ctx), - total_supply, - sui: balance::zero(), - managed: balance::zero(), - }) - } - - /// === Writes === - - /// Mint BASKET coins by accepting an equal number of SUI and MANAGED coins - public fun mint( - reserve: &mut Reserve, sui: Coin, managed: Coin, ctx: &mut TxContext - ): Coin { - let num_sui = coin::value(&sui); - assert!(num_sui == coin::value(&managed), EBadDepositRatio); - - coin::put(&mut reserve.sui, sui); - coin::put(&mut reserve.managed, managed); - - let minted_balance = balance::increase_supply(&mut reserve.total_supply, num_sui); - - coin::from_balance(minted_balance, ctx) - } - - /// Burn BASKET coins and return the underlying reserve assets - public fun burn( - reserve: &mut Reserve, basket: Coin, ctx: &mut TxContext - ): (Coin, Coin) { - let num_basket = balance::decrease_supply(&mut reserve.total_supply, coin::into_balance(basket)); - let sui = coin::take(&mut reserve.sui, num_basket, ctx); - let managed = coin::take(&mut reserve.managed, num_basket, ctx); - - (sui, managed) - } - - // === Reads === - - /// Return the number of `MANAGED` coins in circulation - public fun total_supply(reserve: &Reserve): u64 { - balance::supply_value(&reserve.total_supply) - } - - /// Return the number of SUI in the reserve - public fun sui_supply(reserve: &Reserve): u64 { - balance::value(&reserve.sui) - } - - /// Return the number of MANAGED in the reserve - public fun managed_supply(reserve: &Reserve): u64 { - balance::value(&reserve.managed) - } - - #[test_only] - public fun init_for_testing(ctx: &mut TxContext) { - init(BASKET {}, ctx) - } -} diff --git a/sui_programmability/examples/fungible_tokens/sources/managed.move b/sui_programmability/examples/fungible_tokens/sources/managed.move deleted file mode 100644 index e41ca15766f5a..0000000000000 --- a/sui_programmability/examples/fungible_tokens/sources/managed.move +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Example coin with a trusted manager responsible for minting/burning (e.g., a stablecoin) -/// By convention, modules defining custom coin types use upper case names, in contrast to -/// ordinary modules, which use camel case. -module fungible_tokens::managed { - use sui::coin::{Self, Coin, TreasuryCap}; - - /// Name of the coin. By convention, this type has the same name as its parent module - /// and has no fields. The full type of the coin defined by this module will be `COIN`. - public struct MANAGED has drop {} - - #[allow(unused_function)] - /// Register the managed currency to acquire its `TreasuryCap`. Because - /// this is a module initializer, it ensures the currency only gets - /// registered once. - fun init(witness: MANAGED, ctx: &mut TxContext) { - // Get a treasury cap for the coin and give it to the transaction sender - let (treasury_cap, metadata) = coin::create_currency(witness, 2, b"MANAGED", b"", b"", option::none(), ctx); - transfer::public_freeze_object(metadata); - transfer::public_transfer(treasury_cap, tx_context::sender(ctx)) - } - - /// Manager can mint new coins - public entry fun mint( - treasury_cap: &mut TreasuryCap, amount: u64, recipient: address, ctx: &mut TxContext - ) { - coin::mint_and_transfer(treasury_cap, amount, recipient, ctx) - } - - /// Manager can burn coins - public entry fun burn(treasury_cap: &mut TreasuryCap, coin: Coin) { - coin::burn(treasury_cap, coin); - } - - #[test_only] - /// Wrapper of module initializer for testing - public fun test_init(ctx: &mut TxContext) { - init(MANAGED {}, ctx) - } -} diff --git a/sui_programmability/examples/fungible_tokens/sources/regulated_coin.move b/sui_programmability/examples/fungible_tokens/sources/regulated_coin.move deleted file mode 100644 index 657943fe86291..0000000000000 --- a/sui_programmability/examples/fungible_tokens/sources/regulated_coin.move +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Module representing a common type for regulated coins. Features balance -/// accessors which can be used to implement a RegulatedCoin interface. -/// -/// To implement any of the methods, module defining the type for the currency -/// is expected to implement the main set of methods such as `borrow()`, -/// `borrow_mut()` and `zero()`. -/// -/// Each of the methods of this module requires a Witness struct to be sent. -module rc::regulated_coin { - use sui::balance::{Self, Balance}; - - /// The RegulatedCoin struct; holds a common `Balance` which is compatible - /// with all the other Coins and methods, as well as the `creator` field, which - /// can be used for additional security/regulation implementations. - public struct RegulatedCoin has key, store { - id: UID, - balance: Balance, - creator: address - } - - /// Get the `RegulatedCoin.balance.value` field; - public fun value(c: &RegulatedCoin): u64 { - balance::value(&c.balance) - } - - /// Get the `RegulatedCoin.creator` field; - public fun creator(c: &RegulatedCoin): address { - c.creator - } - - // === Necessary set of Methods (provide security guarantees and balance access) === - - /// Get an immutable reference to the Balance of a RegulatedCoin; - public fun borrow(_: T, coin: &RegulatedCoin): &Balance { - &coin.balance - } - - /// Get a mutable reference to the Balance of a RegulatedCoin; - public fun borrow_mut(_: T, coin: &mut RegulatedCoin): &mut Balance { - &mut coin.balance - } - - /// Author of the currency can restrict who is allowed to create new balances; - public fun zero(_: T, creator: address, ctx: &mut TxContext): RegulatedCoin { - RegulatedCoin { id: object::new(ctx), balance: balance::zero(), creator } - } - - /// Build a transferable `RegulatedCoin` from a `Balance`; - public fun from_balance( - _: T, balance: Balance, creator: address, ctx: &mut TxContext - ): RegulatedCoin { - RegulatedCoin { id: object::new(ctx), balance, creator } - } - - /// Destroy `RegulatedCoin` and return its `Balance`; - public fun into_balance(_: T, coin: RegulatedCoin): Balance { - let RegulatedCoin { balance, creator: _, id } = coin; - sui::object::delete(id); - balance - } - - // === Optional Methods (can be used for simpler implementation of basic operations) === - - /// Join Balances of a `RegulatedCoin` c1 and `RegulatedCoin` c2. - public fun join(witness: T, c1: &mut RegulatedCoin, c2: RegulatedCoin) { - balance::join(&mut c1.balance, into_balance(witness, c2)); - } - - /// Subtract `RegulatedCoin` with `value` from `RegulatedCoin`. - /// - /// This method does not provide any checks by default and can possibly lead to mocking - /// behavior of `Regulatedcoin::zero()` when a value is 0. So in case empty balances - /// should not be allowed, this method should be additionally protected against zero value. - public fun split( - witness: T, c1: &mut RegulatedCoin, creator: address, value: u64, ctx: &mut TxContext - ): RegulatedCoin { - let balance = balance::split(&mut c1.balance, value); - from_balance(witness, balance, creator, ctx) - } -} - -/// Abc is a RegulatedCoin which: -/// -/// - is managed account creation (only admins can create a new balance) -/// - has a denylist for addresses managed by the coin admins -/// - has restricted transfers which can not be taken by anyone except the recipient -module abc::abc { - use rc::regulated_coin::{Self as rcoin, RegulatedCoin as RCoin}; - use sui::balance::{Self, Supply, Balance}; - use sui::coin::{Self, Coin}; - - /// The ticker of Abc regulated token - public struct Abc has drop {} - - /// A restricted transfer of Abc to another account. - public struct Transfer has key { - id: UID, - balance: Balance, - to: address, - } - - /// A registry of addresses banned from using the coin. - public struct Registry has key { - id: UID, - banned: vector
, - swapped_amount: u64, - } - - /// A AbcTreasuryCap for the balance::Supply. - public struct AbcTreasuryCap has key, store { - id: UID, - supply: Supply - } - - /// For when an attempting to interact with another account's RegulatedCoin. - const ENotOwner: u64 = 1; - - /// For when address has been banned and someone is trying to access the balance - const EAddressBanned: u64 = 2; - - #[allow(unused_function)] - /// Create the Abc currency and send the AbcTreasuryCap to the creator - /// as well as the first (and empty) balance of the RegulatedCoin. - /// - /// Also creates a shared Registry which holds banned addresses. - fun init(ctx: &mut TxContext) { - let sender = tx_context::sender(ctx); - let treasury_cap = AbcTreasuryCap { - id: object::new(ctx), - supply: balance::create_supply(Abc {}) - }; - - transfer::public_transfer(zero(sender, ctx), sender); - transfer::public_transfer(treasury_cap, sender); - - transfer::share_object(Registry { - id: object::new(ctx), - banned: vector::empty(), - swapped_amount: 0, - }); - } - - // === Getters section: Registry === - - /// Get total amount of `Coin` from the `Registry`. - public fun swapped_amount(r: &Registry): u64 { - r.swapped_amount - } - - /// Get vector of banned addresses from `Registry`. - public fun banned(r: &Registry): &vector
{ - &r.banned - } - - // === Admin actions: creating balances, minting coins and banning addresses === - - /// Create an empty `RCoin` instance for account `for`. AbcTreasuryCap is passed for - /// authentication purposes - only admin can create new accounts. - public entry fun create(_: &AbcTreasuryCap, `for`: address, ctx: &mut TxContext) { - transfer::public_transfer(zero(`for`, ctx), `for`) - } - - /// Mint more Abc. Requires AbcTreasuryCap for authorization, so can only be done by admins. - public entry fun mint(treasury: &mut AbcTreasuryCap, owned: &mut RCoin, value: u64) { - balance::join(borrow_mut(owned), balance::increase_supply(&mut treasury.supply, value)); - } - - /// Burn `value` amount of `RCoin`. Requires AbcTreasuryCap for authorization, so can only be done by admins. - /// - /// TODO: Make AbcTreasuryCap a part of Balance module instead of Coin. - public entry fun burn(treasury: &mut AbcTreasuryCap, owned: &mut RCoin, value: u64) { - balance::decrease_supply( - &mut treasury.supply, - balance::split(borrow_mut(owned), value) - ); - } - - /// Ban some address and forbid making any transactions from or to this address. - /// Only owner of the AbcTreasuryCap can perform this action. - public entry fun ban(_cap: &AbcTreasuryCap, registry: &mut Registry, to_ban: address) { - vector::push_back(&mut registry.banned, to_ban) - } - - // === Public: Regulated transfers === - - /// Transfer entrypoint - create a restricted `Transfer` instance and transfer it to the - /// `to` account for being accepted later. - /// Fails if sender is not an creator of the `RegulatedCoin` or if any of the parties is in - /// the ban list in Registry. - public entry fun transfer(r: &Registry, coin: &mut RCoin, value: u64, to: address, ctx: &mut TxContext) { - let sender = tx_context::sender(ctx); - - assert!(rcoin::creator(coin) == sender, ENotOwner); - assert!(vector::contains(&r.banned, &to) == false, EAddressBanned); - assert!(vector::contains(&r.banned, &sender) == false, EAddressBanned); - - transfer::transfer(Transfer { - to, - id: object::new(ctx), - balance: balance::split(borrow_mut(coin), value), - }, to) - } - - /// Accept an incoming transfer by joining an incoming balance with an owned one. - /// - /// Fails if: - /// 1. the `RegulatedCoin.creator` does not match `Transfer.to`; - /// 2. the address of the creator/recipient is banned; - public entry fun accept_transfer(r: &Registry, coin: &mut RCoin, transfer: Transfer) { - let Transfer { id, balance, to } = transfer; - - assert!(rcoin::creator(coin) == to, ENotOwner); - assert!(vector::contains(&r.banned, &to) == false, EAddressBanned); - - balance::join(borrow_mut(coin), balance); - object::delete(id) - } - - // === Public: Swap RegulatedCoin <-> Coin === - - /// Take `value` amount of `RegulatedCoin` and make it freely transferable by wrapping it into - /// a `Coin`. Update `Registry` to keep track of the swapped amount. - /// - /// Fails if: - /// 1. `RegulatedCoin.creator` was banned; - /// 2. `RegulatedCoin` is not owned by the tx sender; - public entry fun take(r: &mut Registry, coin: &mut RCoin, value: u64, ctx: &mut TxContext) { - let sender = tx_context::sender(ctx); - - assert!(rcoin::creator(coin) == sender, ENotOwner); - assert!(vector::contains(&r.banned, &sender) == false, EAddressBanned); - - // Update swapped amount for Registry to keep track of non-regulated amounts. - r.swapped_amount = r.swapped_amount + value; - - transfer::public_transfer(coin::take(borrow_mut(coin), value, ctx), sender); - } - - /// Take `Coin` and put to the `RegulatedCoin`'s balance. - /// - /// Fails if: - /// 1. `RegulatedCoin.creator` was banned; - /// 2. `RegulatedCoin` is not owned by the tx sender; - public entry fun put_back(r: &mut Registry, rc_coin: &mut RCoin, coin: Coin, ctx: &TxContext) { - let balance = coin::into_balance(coin); - let sender = tx_context::sender(ctx); - - assert!(rcoin::creator(rc_coin) == sender, ENotOwner); - assert!(vector::contains(&r.banned, &sender) == false, EAddressBanned); - - // Update swapped amount as in `swap_regulated`. - r.swapped_amount = r.swapped_amount - balance::value(&balance); - - balance::join(borrow_mut(rc_coin), balance); - } - - // === Private implementations accessors and type morphing === - - #[allow(unused_function)] - fun borrow(coin: &RCoin): &Balance { rcoin::borrow(Abc {}, coin) } - fun borrow_mut(coin: &mut RCoin): &mut Balance { rcoin::borrow_mut(Abc {}, coin) } - fun zero(creator: address, ctx: &mut TxContext): RCoin { rcoin::zero(Abc {}, creator, ctx) } - - // === Testing utilities === - - #[test_only] public fun init_for_testing(ctx: &mut TxContext) { init(ctx) } - #[test_only] public fun borrow_for_testing(coin: &RCoin): &Balance { borrow(coin) } - #[test_only] public fun borrow_mut_for_testing(coin: &mut RCoin): &Balance { borrow_mut(coin) } -} - -#[test_only] -/// Tests for the abc module. They are sequential and based on top of each other. -/// ``` -/// * - test_minting -/// | +-- test_creation -/// | +-- test_transfer -/// | +-- test_burn -/// | +-- test_take -/// | +-- test_put_back -/// | +-- test_ban -/// | +-- test_address_banned_fail -/// | +-- test_different_account_fail -/// | +-- test_not_owned_balance_fail -/// ``` -module abc::tests { - use abc::abc::{Self, Abc, AbcTreasuryCap, Registry}; - use rc::regulated_coin::{Self as rcoin, RegulatedCoin as RCoin}; - - use sui::test_scenario::{Self, Scenario, next_tx, ctx}; - - // === Test handlers; this trick helps reusing scenarios == - - #[test] - #[expected_failure(abort_code = ::abc::abc::EAddressBanned)] - fun test_address_banned_fail() { - let mut scenario = scenario(); - test_address_banned_fail_(&mut scenario); - test_scenario::end(scenario); - } - - #[test] - #[expected_failure(abort_code = ::abc::abc::EAddressBanned)] - fun test_different_account_fail() { - let mut scenario = scenario(); - test_different_account_fail_(&mut scenario); - test_scenario::end(scenario); - } - - #[test] - #[expected_failure(abort_code = ::abc::abc::ENotOwner)] - fun test_not_owned_balance_fail() { - let mut scenario = scenario(); - test_not_owned_balance_fail_(&mut scenario); - test_scenario::end(scenario); - } - - // === Helpers and basic test organization === - - fun scenario(): Scenario { test_scenario::begin(@0xAbc) } - fun people(): (address, address, address) { (@0xAbc, @0xE05, @0xFACE) } - - // Admin creates a regulated coin Abc and mints 1,000,000 of it. - fun test_minting_(test: &mut Scenario) { - let (admin, _, _) = people(); - - next_tx(test, admin); - { - abc::init_for_testing(ctx(test)) - }; - - next_tx(test, admin); - { - let mut cap = test_scenario::take_from_sender(test); - let mut coin = test_scenario::take_from_sender>(test); - - abc::mint(&mut cap, &mut coin, 1000000); - - assert!(rcoin::value(&coin) == 1000000, 0); - - test_scenario::return_to_sender(test, cap); - test_scenario::return_to_sender(test, coin); - } - } - - // Admin creates an empty balance for the `user1`. - fun test_creation_(test: &mut Scenario) { - let (admin, user1, _) = people(); - - test_minting_(test); - - next_tx(test, admin); - { - let cap = test_scenario::take_from_sender(test); - - abc::create(&cap, user1, ctx(test)); - - test_scenario::return_to_sender(test, cap); - }; - - next_tx(test, user1); - { - let coin = test_scenario::take_from_sender>(test); - - assert!(rcoin::creator(&coin) == user1, 1); - assert!(rcoin::value(&coin) == 0, 2); - - test_scenario::return_to_sender(test, coin); - }; - } - - // Admin transfers 500,000 coins to `user1`. - // User1 accepts the transfer and checks his balance. - fun test_transfer_(test: &mut Scenario) { - let (admin, user1, _) = people(); - - test_creation_(test); - - next_tx(test, admin); - { - let mut coin = test_scenario::take_from_sender>(test); - let reg = test_scenario::take_shared(test); - let reg_ref = ® - - abc::transfer(reg_ref, &mut coin, 500000, user1, ctx(test)); - - test_scenario::return_shared(reg); - test_scenario::return_to_sender(test, coin); - }; - - next_tx(test, user1); - { - let mut coin = test_scenario::take_from_sender>(test); - let transfer = test_scenario::take_from_sender(test); - let reg = test_scenario::take_shared(test); - let reg_ref = ® - - abc::accept_transfer(reg_ref, &mut coin, transfer); - - assert!(rcoin::value(&coin) == 500000, 3); - - test_scenario::return_shared(reg); - test_scenario::return_to_sender(test, coin); - }; - } - - // Admin bans user1 by adding his address to the registry. - fun test_ban_(test: &mut Scenario) { - let (admin, user1, _) = people(); - - test_transfer_(test); - - next_tx(test, admin); - { - let cap = test_scenario::take_from_sender(test); - let mut reg = test_scenario::take_shared(test); - let reg_ref = &mut reg; - - abc::ban(&cap, reg_ref, user1); - - test_scenario::return_shared(reg); - test_scenario::return_to_sender(test, cap); - }; - } - - // Banned User1 fails to create a Transfer. - fun test_address_banned_fail_(test: &mut Scenario) { - let (_, user1, user2) = people(); - - test_ban_(test); - - next_tx(test, user1); - { - let mut coin = test_scenario::take_from_sender>(test); - let reg = test_scenario::take_shared(test); - let reg_ref = ® - - abc::transfer(reg_ref, &mut coin, 250000, user2, ctx(test)); - - test_scenario::return_shared(reg); - test_scenario::return_to_sender(test, coin); - }; - } - - // User1 is banned. Admin tries to make a Transfer to User1 and fails - user banned. - fun test_different_account_fail_(test: &mut Scenario) { - let (admin, user1, _) = people(); - - test_ban_(test); - - next_tx(test, admin); - { - let mut coin = test_scenario::take_from_sender>(test); - let reg = test_scenario::take_shared(test); - let reg_ref = ® - - abc::transfer(reg_ref, &mut coin, 250000, user1, ctx(test)); - - test_scenario::return_shared(reg); - test_scenario::return_to_sender(test, coin); - }; - } - - // User1 is banned and transfers the whole balance to User2. - // User2 tries to use this balance and fails. - fun test_not_owned_balance_fail_(test: &mut Scenario) { - let (_, user1, user2) = people(); - - test_ban_(test); - - next_tx(test, user1); - { - let coin = test_scenario::take_from_sender>(test); - sui::transfer::public_transfer(coin, user2); - }; - - next_tx(test, user2); - { - let mut coin = test_scenario::take_from_sender>(test); - let reg = test_scenario::take_shared(test); - let reg_ref = ® - - abc::transfer(reg_ref, &mut coin, 500000, user1, ctx(test)); - - test_scenario::return_shared(reg); - test_scenario::return_to_sender(test, coin); - } - } -} diff --git a/sui_programmability/examples/fungible_tokens/sources/treasury_lock.move b/sui_programmability/examples/fungible_tokens/sources/treasury_lock.move deleted file mode 100644 index f51264d9af2aa..0000000000000 --- a/sui_programmability/examples/fungible_tokens/sources/treasury_lock.move +++ /dev/null @@ -1,441 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// WARNING: Like all files in the examples section, this code is unaudited -/// and should NOT be running in production. Using the code unaudited could potentially -/// result in lost of funds from hacks, and leakage of transaction amounts. - -/// An example implementation of a 'treasury lock'. It encapsulates the TreasuryCap -/// of a Coin so that additional whitelisted parties (bearers of the `MintCap`) -/// can mint new Coins up to a pre-defined per epoch limit. This can be used e.g. -/// to create a faucet. -module fungible_tokens::treasury_lock { - use sui::coin::{Self, TreasuryCap}; - use sui::balance::{Balance}; - use sui::vec_set::{Self, VecSet}; - - /// This mint capability instance is banned. - const EMintCapBanned: u64 = 0; - /// Requested mint amount exceeds the per epoch mint limit. - const EMintAmountTooLarge: u64 = 1; - - /// Encapsulates the `TreasuryCap` and stores the list of banned mint authorities. - public struct TreasuryLock has key { - id: UID, - treasury_cap: TreasuryCap, - banned_mint_authorities: VecSet - } - - /// Admin capability for `TreasuryLock`. Bearer has the power to create, ban, - /// and unban mint capabilities (`MintCap`) - public struct LockAdminCap has key, store { - id: UID - } - - /// Capability allowing the bearer to mint new Coins up to a pre-defined per epoch limit. - public struct MintCap has key, store { - id: UID, - max_mint_per_epoch: u64, - last_epoch: u64, - minted_in_epoch: u64 - } - - /// Create a new `TreasuryLock` for `TreasuryCap`. - public fun new_lock( - cap: TreasuryCap, ctx: &mut TxContext - ): LockAdminCap { - let lock = TreasuryLock { - id: object::new(ctx), - treasury_cap: cap, - banned_mint_authorities: vec_set::empty() - }; - transfer::share_object(lock); - - LockAdminCap { - id: object::new(ctx), - } - } - - /// Entry function. Creates a new `TreasuryLock` for `TreasuryCap`. Invokes `new_lock`. - public entry fun new_lock_(cap: TreasuryCap, ctx: &mut TxContext) { - transfer::public_transfer( - new_lock(cap, ctx), - tx_context::sender(ctx) - ) - } - - /// Create a new mint capability whose bearer will be allowed to mint - /// `max_mint_per_epoch` coins per epoch. - public fun create_mint_cap( - _cap: &LockAdminCap, max_mint_per_epoch: u64, ctx: &mut TxContext - ): MintCap { - MintCap{ - id: object::new(ctx), - max_mint_per_epoch, - last_epoch: tx_context::epoch(ctx), - minted_in_epoch: 0 - } - } - - /// Entry function. Creates a new mint capability whose bearer will be allowed - /// to mint `max_mint_per_epoch` coins per epoch. Sends it to `recipient`. - public fun create_and_transfer_mint_cap( - cap: &LockAdminCap, max_mint_per_epoch: u64, recipient: address, ctx: &mut TxContext - ) { - transfer::public_transfer( - create_mint_cap(cap, max_mint_per_epoch, ctx), - recipient - ) - } - - /// Ban a `MintCap`. - public fun ban_mint_cap_id( - _cap: &LockAdminCap, lock: &mut TreasuryLock, id: ID - ) { - vec_set::insert(&mut lock.banned_mint_authorities, id) - } - - /// Entry function. Bans a `MintCap`. - public entry fun ban_mint_cap_id_( - cap: &LockAdminCap, lock: &mut TreasuryLock, id: ID - ) { - ban_mint_cap_id(cap, lock, id); - } - - /// Unban a previously banned `MintCap`. - public fun unban_mint_cap_id( - _cap: &LockAdminCap, lock: &mut TreasuryLock, id: ID - ) { - vec_set::remove(&mut lock.banned_mint_authorities, &id) - } - - /// Entry function. Unbans a previously banned `MintCap`. - public entry fun unban_mint_cap_id_( - cap: &LockAdminCap, lock: &mut TreasuryLock, id: ID - ) { - unban_mint_cap_id(cap, lock, id); - } - - /// Borrow the `TreasuryCap` to use directly. - public fun treasury_cap_mut( - _cap: &LockAdminCap, lock: &mut TreasuryLock - ): &mut TreasuryCap { - &mut lock.treasury_cap - } - - /// Mint a `Balance` from a `TreasuryLock` providing a `MintCap`. - public fun mint_balance( - lock: &mut TreasuryLock, cap: &mut MintCap, amount: u64, ctx: &mut TxContext - ): Balance { - assert!( - !vec_set::contains(&lock.banned_mint_authorities, object::uid_as_inner(&cap.id)), - EMintCapBanned - ); - - let epoch = tx_context::epoch(ctx); - if (cap.last_epoch != epoch) { - cap.last_epoch = epoch; - cap.minted_in_epoch = 0; - }; - assert!( - cap.minted_in_epoch + amount <= cap.max_mint_per_epoch, - EMintAmountTooLarge - ); - - cap.minted_in_epoch = cap.minted_in_epoch + amount; - coin::mint_balance(&mut lock.treasury_cap, amount) - } - - /// Entry function. Mint a `Coin` from a `TreasuryLock` providing a `MintCap` - /// and transfer it to recipient. - public entry fun mint_and_transfer( - lock: &mut TreasuryLock, - cap: &mut MintCap, - amount: u64, - recipient: address, - ctx: &mut TxContext - ) { - let balance = mint_balance(lock, cap, amount, ctx); - transfer::public_transfer( - coin::from_balance(balance, ctx), - recipient - ) - } -} - -#[test_only] -module fungible_tokens::treasury_lock_tests { - use sui::test_scenario::{Self, Scenario}; - use sui::balance::{Self, Balance}; - use sui::coin; - use sui::test_utils; - use fungible_tokens::treasury_lock::{Self, TreasuryLock, LockAdminCap, MintCap, create_and_transfer_mint_cap, new_lock, mint_balance}; - - const ADMIN: address = @0xABBA; - const USER: address = @0xB0B; - - // one time witness for the coin used in tests - public struct TREASURY_LOCK_TESTS has drop {} - - fun user_with_mint_cap_scenario(): Scenario { - let mut scenario_ = test_scenario::begin(ADMIN); - let scenario = &mut scenario_; - - // create a currency and lock it - test_scenario::next_tx(scenario, ADMIN); - { - let treasury_lock_tests = test_utils::create_one_time_witness(); - let (treasury, metadata) = coin::create_currency(treasury_lock_tests, 0, b"", b"", b"", option::none(), test_scenario::ctx(scenario)); - transfer::public_freeze_object(metadata); - let admin_cap = new_lock(treasury, test_scenario::ctx(scenario)); - transfer::public_transfer( - admin_cap, - ADMIN - ) - }; - - // create a mint capability and transfer it to user - test_scenario::next_tx(scenario, ADMIN); - { - let admin_cap = test_scenario::take_from_sender>(scenario); - create_and_transfer_mint_cap(&admin_cap, 500, USER, test_scenario::ctx(scenario)); - test_scenario::return_to_sender(scenario, admin_cap); - }; - test_scenario::next_tx(scenario, ADMIN); - - return scenario_ - } - - fun user_mint_balance(scenario: &mut Scenario, amount: u64): Balance { - let mut mint_cap = test_scenario::take_from_sender>(scenario); - let mut lock = test_scenario::take_shared>(scenario); - - let balance = mint_balance( - &mut lock, - &mut mint_cap, - amount, - test_scenario::ctx(scenario) - ); - - test_scenario::return_to_sender(scenario, mint_cap); - test_scenario::return_shared(lock); - - balance - } - - - #[test] - fun test_user_can_mint() { - let mut scenario_ = user_with_mint_cap_scenario(); - let scenario = &mut scenario_; - - // user uses its capability to mint 300 coins - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 300); - assert!(balance::value(&balance) == 300, 0); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - test_scenario::end(scenario_); - } - - #[test] - #[expected_failure(abort_code = treasury_lock::EMintAmountTooLarge)] - fun test_minting_over_limit_fails() { - let mut scenario_ = user_with_mint_cap_scenario(); - let scenario = &mut scenario_; - - // mint 300 coins - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 300); - assert!(balance::value(&balance) == 300, 0); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - - // mint 200 more - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 200); - assert!(balance::value(&balance) == 200, 0); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - - // attempt to mint amount over the epoch limit - should fail - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 1); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - test_scenario::end(scenario_); - } - - #[test] - fun test_minted_amount_resets_at_epoch_change() { - let mut scenario_ = user_with_mint_cap_scenario(); - let scenario = &mut scenario_; - - // mint 300 coins - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 300); - assert!(balance::value(&balance) == 300, 0); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - - // next epoch and mint 300 again - test_scenario::next_epoch(scenario, USER); - { - let balance = user_mint_balance(scenario, 300); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - test_scenario::end(scenario_); - } - - #[test] - #[expected_failure(abort_code = treasury_lock::EMintCapBanned)] - fun test_banned_cap_cannot_mint() { - let mut scenario_ = user_with_mint_cap_scenario(); - let scenario = &mut scenario_; - - // get the mint cap ID for reference - test_scenario::next_tx(scenario, USER); - let mint_cap = test_scenario::take_from_sender>(scenario); - let mint_cap_id = object::id(&mint_cap); - test_scenario::return_to_sender(scenario, mint_cap); - - - // mint 100 coins - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 100); - assert!(balance::value(&balance) == 100, 0); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - - // admin bans mint cap - test_scenario::next_tx(scenario, ADMIN); - { - let admin_cap = test_scenario::take_from_sender>(scenario); - let mut lock = test_scenario::take_shared>(scenario); - - treasury_lock::ban_mint_cap_id( - &admin_cap, - &mut lock, - mint_cap_id - ); - - test_scenario::return_to_sender(scenario, admin_cap); - test_scenario::return_shared(lock); - }; - - // user attempts to mint but fails - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 100); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - test_scenario::end(scenario_); - } - - #[test] - fun test_user_can_mint_after_unban() { - let mut scenario_ = user_with_mint_cap_scenario(); - let scenario = &mut scenario_; - - // get the mint cap ID for reference - test_scenario::next_tx(scenario, USER); - let mint_cap = test_scenario::take_from_sender>(scenario); - let mint_cap_id = object::id(&mint_cap); - test_scenario::return_to_sender(scenario, mint_cap); - - // mint 100 coins - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 100); - assert!(balance::value(&balance) == 100, 0); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - - // admin bans mint cap - test_scenario::next_tx(scenario, ADMIN); - { - let admin_cap = test_scenario::take_from_sender>(scenario); - let mut lock = test_scenario::take_shared>(scenario); - - treasury_lock::ban_mint_cap_id( - &admin_cap, - &mut lock, - mint_cap_id - ); - - test_scenario::return_to_sender(scenario, admin_cap); - test_scenario::return_shared(lock); - }; - - // admin unbans mint cap - test_scenario::next_tx(scenario, ADMIN); - { - let admin_cap = test_scenario::take_from_sender>(scenario); - let mut lock = test_scenario::take_shared>(scenario); - - treasury_lock::unban_mint_cap_id( - &admin_cap, - &mut lock, - mint_cap_id - ); - - test_scenario::return_to_sender(scenario, admin_cap); - test_scenario::return_shared(lock); - }; - - // user can mint - test_scenario::next_tx(scenario, USER); - { - let balance = user_mint_balance(scenario, 100); - assert!(balance::value(&balance) == 100, 0); - - transfer::public_transfer( - coin::from_balance(balance, test_scenario::ctx(scenario)), - USER - ); - }; - test_scenario::end(scenario_); - } -} diff --git a/sui_programmability/examples/fungible_tokens/tests/basket_tests.move b/sui_programmability/examples/fungible_tokens/tests/basket_tests.move deleted file mode 100644 index 78fc04759d54e..0000000000000 --- a/sui_programmability/examples/fungible_tokens/tests/basket_tests.move +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module fungible_tokens::basket_tests { - use fungible_tokens::basket::{Self, Reserve}; - use fungible_tokens::managed::MANAGED; - use sui::pay; - use sui::coin; - use sui::sui::SUI; - use sui::test_scenario; - - #[test] - public fun test_mint_burn() { - let user = @0xA; - - let mut scenario_val = test_scenario::begin(user); - let scenario = &mut scenario_val; - { - let ctx = test_scenario::ctx(scenario); - basket::init_for_testing(ctx); - }; - test_scenario::next_tx(scenario, user); - { - let mut reserve_val = test_scenario::take_shared(scenario); - let reserve = &mut reserve_val; - let ctx = test_scenario::ctx(scenario); - assert!(basket::total_supply(reserve) == 0, 0); - - let num_coins = 10; - let sui = coin::mint_for_testing(num_coins, ctx); - let managed = coin::mint_for_testing(num_coins, ctx); - let basket = basket::mint(reserve, sui, managed, ctx); - assert!(coin::value(&basket) == num_coins, 1); - assert!(basket::total_supply(reserve) == num_coins, 2); - - let (sui, managed) = basket::burn(reserve, basket, ctx); - assert!(coin::value(&sui) == num_coins, 3); - assert!(coin::value(&managed) == num_coins, 4); - - pay::keep(sui, ctx); - pay::keep(managed, ctx); - test_scenario::return_shared(reserve_val); - }; - test_scenario::end(scenario_val); - } - -} diff --git a/sui_programmability/examples/games/Move.toml b/sui_programmability/examples/games/Move.toml deleted file mode 100644 index a8dad0c9d55b9..0000000000000 --- a/sui_programmability/examples/games/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "Games" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -games = "0x0" diff --git a/sui_programmability/examples/games/README.md b/sui_programmability/examples/games/README.md deleted file mode 100644 index 60fd8dc6c3985..0000000000000 --- a/sui_programmability/examples/games/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Games - -Examples of toy games built on top of Sui! - -* TicTacToe: the pencil and paper classic, now on Sui, implemented using single-owner objects only. -* SharedTicTacToe: the pencil and paper classic, now on Sui, using shared objects. -* Hero: an adventure game where an intrepid hero slays vicious boars with a magic sword and heals himself with potions. -* SeaHero: a permissionless mod of the Hero game where the hero can slay sea monsters to earn RUM tokens. -* SeaHeroHelper: a permissionless mod of the economics of the Sea Hero game. A weak hero can request help from a stronger hero, who receives a share of the monster slaying reward. -* RockPaperScissors: a commit-reveal scheme in which players first submit their commitments and then reveal the data that led to these commitments. -* DrandBasedLottery: a lottery game that depends on randomness from drand -* DrandBasedScratchCard: a scratch card game that depends on randomness from drand \ No newline at end of file diff --git a/sui_programmability/examples/games/sources/drand_based_lottery.move b/sui_programmability/examples/games/sources/drand_based_lottery.move deleted file mode 100644 index 26888dae98094..0000000000000 --- a/sui_programmability/examples/games/sources/drand_based_lottery.move +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// A basic game that depends on randomness from drand. -/// -/// The quicknet chain chain of drand creates random 32 bytes every 3 seconds. This randomness is verifiable in the sense -/// that anyone can check if a given 32 bytes bytes are indeed the i-th output of drand. For more details see -/// https://drand.love/ -/// -/// One could implement on-chain games that need unbiasable and unpredictable randomness using drand as the source of -/// randomness. I.e., every time the game needs randomness, it receives the next 32 bytes from drand (whether as part -/// of a transaction or by reading it from an existing object) and follows accordingly. -/// However, this simplistic flow may be insecure in some cases because the blockchain is not aware of the latest round -/// of drand, and thus it may depend on randomness that is already public. -/// -/// Below we design a game that overcomes this issue as following: -/// - The game is defined for a specific drand round N in the future, for example, the round that is expected in -/// 5 mins from now. -/// The current round for the main chain can be retrieved (off-chain) using -/// `curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/latest', -/// or using the following python script: -/// import time -/// genesis = 1692803367 -/// curr_round = (time.time() - genesis) // 3 + 1 -/// The round in 5 mins from now will be curr_round + 5*20. -/// (genesis is the epoch of the first round as returned from -/// curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/info.) -/// - Anyone can *close* the game to new participants by providing drand's randomness of round N-2 (i.e., 1 minute before -/// round N). The randomness of round X can be retrieved using -/// `curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/X'. -/// - Users can join the game as long as it is not closed and receive a *ticket*. -/// - Anyone can *complete* the game by proving drand's randomness of round N, which is used to declare the winner. -/// - The owner of the winning "ticket" can request a "winner ticket" and finish the game. -/// As long as someone is closing the game in time (or at least before round N) we have the guarantee that the winner is -/// selected using unpredictable and unbiasable randomness. Otherwise, someone could wait until the randomness of round N -/// is public, see if it could win the game and if so, join the game and drive it to completion. Therefore, honest users -/// are encouraged to close the game in time. -/// -/// All the external inputs needed for the following APIs can be retrieved from one of drand's public APIs, e.g. using -/// the above curl commands. -/// -module games::drand_based_lottery { - use games::drand_lib::{derive_randomness, verify_drand_signature, safe_selection}; - - - /// Error codes - const EGameNotInProgress: u64 = 0; - const EGameAlreadyCompleted: u64 = 1; - const EInvalidTicket: u64 = 3; - - /// Game status - const IN_PROGRESS: u8 = 0; - const CLOSED: u8 = 1; - const COMPLETED: u8 = 2; - - /// Game represents a set of parameters of a single game. - /// This game can be extended to require ticket purchase, reward winners, etc. - /// - public struct Game has key, store { - id: UID, - round: u64, - status: u8, - participants: u64, - winner: Option, - } - - /// Ticket represents a participant in a single game. - /// Can be deconstructed only by the owner. - public struct Ticket has key, store { - id: UID, - game_id: ID, - participant_index: u64, - } - - /// GameWinner represents a participant that won in a specific game. - /// Can be deconstructed only by the owner. - public struct GameWinner has key, store { - id: UID, - game_id: ID, - } - - /// Create a shared-object Game. - public entry fun create(round: u64, ctx: &mut TxContext) { - let game = Game { - id: object::new(ctx), - round, - status: IN_PROGRESS, - participants: 0, - winner: option::none(), - }; - transfer::public_share_object(game); - } - - /// Anyone can close the game by providing the randomness of round-2. - public entry fun close(game: &mut Game, drand_sig: vector) { - assert!(game.status == IN_PROGRESS, EGameNotInProgress); - verify_drand_signature(drand_sig, closing_round(game.round)); - game.status = CLOSED; - } - - /// Anyone can complete the game by providing the randomness of round. - public entry fun complete(game: &mut Game, drand_sig: vector) { - assert!(game.status != COMPLETED, EGameAlreadyCompleted); - verify_drand_signature(drand_sig, game.round); - game.status = COMPLETED; - // The randomness is derived from drand_sig by passing it through sha2_256 to make it uniform. - let digest = derive_randomness(drand_sig); - game.winner = option::some(safe_selection(game.participants, &digest)); - } - - /// Anyone can participate in the game and receive a ticket. - public entry fun participate(game: &mut Game, ctx: &mut TxContext) { - assert!(game.status == IN_PROGRESS, EGameNotInProgress); - let ticket = Ticket { - id: object::new(ctx), - game_id: object::id(game), - participant_index: game.participants, - }; - game.participants = game.participants + 1; - transfer::public_transfer(ticket, ctx.sender()); - } - - /// The winner can redeem its ticket. - public entry fun redeem(ticket: &Ticket, game: &Game, ctx: &mut TxContext) { - assert!(object::id(game) == ticket.game_id, EInvalidTicket); - assert!(game.winner.contains(&ticket.participant_index), EInvalidTicket); - - let winner = GameWinner { - id: object::new(ctx), - game_id: ticket.game_id, - }; - transfer::public_transfer(winner, ctx.sender()); - } - - // Note that a ticket can be deleted before the game was completed. - public entry fun delete_ticket(ticket: Ticket) { - let Ticket { id, game_id: _, participant_index: _} = ticket; - object::delete(id); - } - - public entry fun delete_game_winner(ticket: GameWinner) { - let GameWinner { id, game_id: _} = ticket; - object::delete(id); - } - - public fun get_ticket_game_id(ticket: &Ticket): &ID { - &ticket.game_id - } - - public fun get_game_winner_game_id(ticket: &GameWinner): &ID { - &ticket.game_id - } - - fun closing_round(round: u64): u64 { - round - 2 - } -} diff --git a/sui_programmability/examples/games/sources/drand_based_scratch_card.move b/sui_programmability/examples/games/sources/drand_based_scratch_card.move deleted file mode 100644 index 486d2073570df..0000000000000 --- a/sui_programmability/examples/games/sources/drand_based_scratch_card.move +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// A basic game that depends on randomness from drand (chained mode). See details on how to work with drand in -/// drand_based_lottery.move. -/// -/// Anyone can create a new game by depositing X*100 SUIs as a reward, and setting the current drand round as the base -/// round. This creates two objects: -/// - Game - an immutable object that includes all parameters to be used when buying tickets. -/// - Reward - a shared object that holds the reward. It can be withdrawn by any winner ("first come, first served"). -/// If not withdrawn within a few epochs, can be returned to the game creator. -/// -/// A user who wishes to play game G should: -/// - Check if G.epoch is the current epoch, and that G.base_drand_round + 24h is in the future. -/// See drand_based_lottery.move for how to calculate a round for a given point in time. -/// - Check that the relevant reward is still non negative. -/// - Call buy_ticket() with the right amount of SUI. -/// - Wait until the relevant drand round's randomness is available, and can call evaluate(). -/// - If received an object Winner, claim the reward using take_reward(). -/// -/// Important: There is 1 reward per game, and there is no limit on the number of tickets that can be bought for a -/// a single game. *Only* the winner of a game who called take_reward first will receive a reward. -/// One may extend this game and add another round in which winners can register their winner tickets, and then one of -/// the winners is chosen at random. This part, however, will require using a shared object. -/// -module games::drand_based_scratch_card { - use games::drand_lib; - use sui::balance::Balance; - use sui::coin::{Self, Coin}; - use sui::hmac::hmac_sha3_256; - - use sui::sui::SUI; - - /// Error codes - const EInvalidDeposit: u64 = 0; - const EInvalidEpoch: u64 = 1; - const EInvalidTicket: u64 = 2; - const EInvalidReward: u64 = 4; - const ETooSoonToRedeem: u64 = 5; - const EInvalidGame: u64 = 6; - - /// Game represents a set of parameters of a single game. - public struct Game has key { - id: UID, - creator: address, - reward_amount: u64, - reward_factor: u64, - base_epoch: u64, - base_drand_round: u64, - } - - /// Reward that is attached to a specific game. Can be withdrawn once. - public struct Reward has key { - id: UID, - game_id: ID, - balance: Balance, - } - - /// Ticket represents a participant in a single game. - /// Can be deconstructed only by the owner. - public struct Ticket has key, store { - id: UID, - game_id: ID, - } - - /// Winner represents a participant that won in a specific game. - /// Can be consumed by the take_reward. - public struct Winner has key, store { - id: UID, - game_id: ID, - } - - /// Create a new game with a given reward. - /// - /// The reward must be a positive balance, dividable by reward_factor. reward/reward_factor will be the ticket - /// price. base_drand_round is the current drand round. - public entry fun create( - reward: Coin, - reward_factor: u64, - base_drand_round: u64, - ctx: &mut TxContext - ) { - let amount = reward.value(); - assert!(amount > 0 && amount % reward_factor == 0 , EInvalidReward); - - let game = Game { - id: object::new(ctx), - reward_amount: reward.value(), - creator: ctx.sender(), - reward_factor, - base_epoch: ctx.epoch(), - base_drand_round, - }; - let reward = Reward { - id: object::new(ctx), - game_id: object::id(&game), - balance: reward.into_balance(), - }; - transfer::freeze_object(game); - transfer::share_object(reward); - } - - /// Buy a ticket for a specific game, costing reward/reward_factor SUI. Can be called only during the epoch in which - /// the game was created. - /// Note that the reward might have been withdrawn already. It's the user's responsibility to verify that. - public entry fun buy_ticket(coin: Coin, game: &Game, ctx: &mut TxContext) { - assert!(coin.value() * game.reward_factor == game.reward_amount, EInvalidDeposit); - assert!(ctx.epoch() == game.base_epoch, EInvalidEpoch); - let ticket = Ticket { - id: object::new(ctx), - game_id: object::id(game), - }; - transfer::public_transfer(coin, game.creator); - transfer::public_transfer(ticket, ctx.sender()); - } - - public entry fun evaluate( - ticket: Ticket, - game: &Game, - drand_sig: vector, - ctx: &mut TxContext - ) { - assert!(ticket.game_id == object::id(game), EInvalidTicket); - drand_lib::verify_drand_signature(drand_sig, end_of_game_round(game.base_drand_round)); - // The randomness for the current ticket is derived by HMAC(drand randomness, ticket id). - // A solution like checking if (drand randomness % reward_factor) == (ticket id % reward_factor) is not secure - // as the adversary can control the values of ticket id. (For this particular game this attack is not - // devastating, but for similar games it might be.) - let random_key = drand_lib::derive_randomness(drand_sig); - let randomness = hmac_sha3_256(&random_key, &object::id(&ticket).to_bytes()); - let is_winner = (drand_lib::safe_selection(game.reward_factor, &randomness) == 0); - - if (is_winner) { - let winner = Winner { - id: object::new(ctx), - game_id: object::id(game), - }; - transfer::public_transfer(winner, ctx.sender()); - }; - // Delete the ticket. - let Ticket { id, game_id: _} = ticket; - object::delete(id); - } - - public entry fun take_reward(winner: Winner, reward: &mut Reward, ctx: &mut TxContext) { - assert!(winner.game_id == reward.game_id, EInvalidTicket); - let full_balance = reward.balance.value(); - if (full_balance > 0) { - transfer::public_transfer(coin::take(&mut reward.balance, full_balance, ctx), ctx.sender()); - }; - let Winner { id, game_id: _} = winner; - object::delete(id); - } - - /// Can be called in case the reward was not withdrawn, to return the coins to the creator. - public entry fun redeem(reward: &mut Reward, game: &Game, ctx: &mut TxContext) { - assert!(reward.balance.value() > 0, EInvalidReward); - assert!(object::id(game) == reward.game_id, EInvalidGame); - // Since we define the game to take 24h+25h, a game that is created in epoch x may be completed in epochs - // x+2 or x+3. - assert!(game.base_epoch + 3 < ctx.epoch(), ETooSoonToRedeem); - let full_balance = reward.balance.value(); - transfer::public_transfer(coin::take(&mut reward.balance, full_balance, ctx), game.creator); - } - - public entry fun delete_ticket(ticket: Ticket) { - let Ticket { id, game_id: _} = ticket; - object::delete(id); - } - - public fun get_game_base_drand_round(game: &Game): u64 { - game.base_drand_round - } - - public fun get_game_base_epoch(game: &Game): u64 { - game.base_epoch - } - - public fun end_of_game_round(round: u64): u64 { - // Since users do not know when an epoch has began, they can only check if the game depends on a round that is - // at least 24 hours from now. Since the creator does not know as well if its game is created in the beginning - // or the end of the epoch, we define the end of the game to be 24h + 24h from when it started, +1h to be on - // the safe side since epoch duration is not deterministic. - round + 20 * 60 * (24 + 25) - } -} diff --git a/sui_programmability/examples/games/sources/drand_lib.move b/sui_programmability/examples/games/sources/drand_lib.move deleted file mode 100644 index 2ab8986514ef6..0000000000000 --- a/sui_programmability/examples/games/sources/drand_lib.move +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Helper module for working with drand outputs. -/// Currently works with chain 52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971 (quicknet). -/// -/// See examples of how to use this in drand_based_lottery.move and drand_based_scratch_card.move. -/// -/// If you want to use this module with the default network which has a 30s period, you need to change the public key, -/// genesis time and include the previous signature in verify_drand_signature. See https://drand.love/developer/ or the -/// previous version of this file: https://github.com/MystenLabs/sui/blob/92df778310679626f00bc4226d7f7a281322cfdd/sui_programmability/examples/games/sources/drand_lib.move -module games::drand_lib { - use std::hash::sha2_256; - - use sui::bls12381; - - /// Error codes - const EInvalidRndLength: u64 = 0; - const EInvalidProof: u64 = 1; - - /// The genesis time of chain 52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971. - const GENESIS: u64 = 1692803367; - /// The public key of chain 52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971. - const DRAND_PK: vector = - x"83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a"; - - /// The time in seconds between randomness beacon rounds. - const PERIOD: u64 = 3; - - /// Check that a given epoch time has passed by verifying a drand signature from a later time. - /// round must be at least (epoch_time - GENESIS)/PERIOD + 1). - public fun verify_time_has_passed(epoch_time: u64, sig: vector, round: u64) { - assert!(epoch_time <= GENESIS + PERIOD * (round - 1), EInvalidProof); - verify_drand_signature(sig, round); - } - - /// Check a drand output. - public fun verify_drand_signature(sig: vector, mut round: u64) { - // Convert round to a byte array in big-endian order. - let mut round_bytes: vector = vector[0, 0, 0, 0, 0, 0, 0, 0]; - let mut i = 7; - - // Note that this loop never copies the last byte of round_bytes, though it is not expected to ever be non-zero. - while (i > 0) { - let curr_byte = round % 0x100; - let curr_element = &mut round_bytes[i]; - *curr_element = (curr_byte as u8); - round = round >> 8; - i = i - 1; - }; - - // Compute sha256(prev_sig, round_bytes). - let digest = sha2_256(round_bytes); - // Verify the signature on the hash. - let drand_pk = DRAND_PK; - assert!(bls12381::bls12381_min_sig_verify(&sig, &drand_pk, &digest), EInvalidProof); - } - - /// Derive a uniform vector from a drand signature. - public fun derive_randomness(drand_sig: vector): vector { - sha2_256(drand_sig) - } - - // Converts the first 16 bytes of rnd to a u128 number and outputs its modulo with input n. - // Since n is u64, the output is at most 2^{-64} biased assuming rnd is uniformly random. - public fun safe_selection(n: u64, rnd: &vector): u64 { - assert!(rnd.length() >= 16, EInvalidRndLength); - let mut m: u128 = 0; - let mut i = 0; - while (i < 16) { - m = m << 8; - let curr_byte = rnd[i]; - m = m + (curr_byte as u128); - i = i + 1; - }; - let n_128 = (n as u128); - let module_128 = m % n_128; - let res = (module_128 as u64); - res - } -} diff --git a/sui_programmability/examples/games/sources/hero.move b/sui_programmability/examples/games/sources/hero.move deleted file mode 100644 index a350b7e053de0..0000000000000 --- a/sui_programmability/examples/games/sources/hero.move +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Example of a game character with basic attributes, inventory, and -/// associated logic. -module games::hero { - use sui::coin::Coin; - use sui::event; - use sui::sui::SUI; - - /// Our hero! - public struct Hero has key, store { - id: UID, - /// Hit points. If they go to zero, the hero can't do anything - hp: u64, - /// Experience of the hero. Begins at zero - experience: u64, - /// The hero's minimal inventory - sword: Option, - /// An ID of the game user is playing - game_id: ID, - } - - /// The hero's trusty sword - public struct Sword has key, store { - id: UID, - /// Constant set at creation. Acts as a multiplier on sword's strength. - /// Swords with high magic are rarer (because they cost more). - magic: u64, - /// Sword grows in strength as we use it - strength: u64, - /// An ID of the game - game_id: ID, - } - - /// For healing wounded heroes - public struct Potion has key, store { - id: UID, - /// Effectiveness of the potion - potency: u64, - /// An ID of the game - game_id: ID, - } - - /// A creature that the hero can slay to level up - public struct Boar has key { - id: UID, - /// Hit points before the boar is slain - hp: u64, - /// Strength of this particular boar - strength: u64, - /// An ID of the game - game_id: ID, - } - - /// An immutable object that contains information about the - /// game admin. Created only once in the module initializer, - /// hence it cannot be recreated or falsified. - public struct GameInfo has key { - id: UID, - admin: address - } - - /// Capability conveying the authority to create boars and potions - public struct GameAdmin has key { - id: UID, - /// Total number of boars the admin has created - boars_created: u64, - /// Total number of potions the admin has created - potions_created: u64, - /// ID of the game where current user is an admin - game_id: ID, - } - - /// Event emitted each time a Hero slays a Boar - public struct BoarSlainEvent has copy, drop { - /// Address of the user that slayed the boar - slayer_address: address, - /// ID of the Hero that slayed the boar - hero: ID, - /// ID of the now-deceased boar - boar: ID, - /// ID of the game where event happened - game_id: ID, - } - - /// Upper bound on player's HP - const MAX_HP: u64 = 1000; - /// Upper bound on how magical a sword can be - const MAX_MAGIC: u64 = 10; - /// Minimum amount you can pay for a sword - const MIN_SWORD_COST: u64 = 100; - - // TODO: proper error codes - /// The boar won the battle - const EBOAR_WON: u64 = 0; - /// Not enough money to purchase the given item - const EINSUFFICIENT_FUNDS: u64 = 3; - /// Trying to remove a sword, but the hero does not have one - const ENO_SWORD: u64 = 4; - /// Assertion errors for testing - const ASSERT_ERR: u64 = 5; - - // --- Initialization - - #[allow(unused_function)] - /// On module publish, sender creates a new game. But once it is published, - /// anyone create a new game with a `new_game` function. - fun init(ctx: &mut TxContext) { - create(ctx); - } - - /// Anyone can create run their own game, all game objects will be - /// linked to this game. - public entry fun new_game(ctx: &mut TxContext) { - create(ctx); - } - - /// Create a new game. Separated to bypass public entry vs init requirements. - fun create(ctx: &mut TxContext) { - let sender = ctx.sender(); - let id = object::new(ctx); - let game_id = id.to_inner(); - - transfer::freeze_object(GameInfo { - id, - admin: sender, - }); - - transfer::transfer( - GameAdmin { - game_id, - id: object::new(ctx), - boars_created: 0, - potions_created: 0, - }, - sender - ) - } - - // --- Gameplay --- - - /// Slay the `boar` with the `hero`'s sword, get experience. - /// Aborts if the hero has 0 HP or is not strong enough to slay the boar - public entry fun slay( - game: &GameInfo, hero: &mut Hero, boar: Boar, ctx: &TxContext - ) { - game.check_id(hero.game_id); - game.check_id(boar.game_id); - let Boar { id: boar_id, strength: boar_strength, hp, game_id: _ } = boar; - let hero_strength = hero_strength(hero); - let mut boar_hp = hp; - let mut hero_hp = hero.hp; - // attack the boar with the sword until its HP goes to zero - while (boar_hp > hero_strength) { - // first, the hero attacks - boar_hp = boar_hp - hero_strength; - // then, the boar gets a turn to attack. if the boar would kill - // the hero, abort--we can't let the boar win! - assert!(hero_hp >= boar_strength , EBOAR_WON); - hero_hp = hero_hp - boar_strength; - - }; - // hero takes their licks - hero.hp = hero_hp; - // hero gains experience proportional to the boar, sword grows in - // strength by one (if hero is using a sword) - hero.experience = hero.experience + hp; - if (hero.sword.is_some()) { - hero.sword.borrow_mut().level_up(1) - }; - // let the world know about the hero's triumph by emitting an event! - event::emit(BoarSlainEvent { - slayer_address: ctx.sender(), - hero: hero.id.to_inner(), - boar: boar_id.to_inner(), - game_id: id(game) - }); - object::delete(boar_id); - } - - public use fun hero_strength as Hero.strength; - - /// Strength of the hero when attacking - public fun hero_strength(hero: &Hero): u64 { - // a hero with zero HP is too tired to fight - if (hero.hp == 0) { - return 0 - }; - - let sword_strength = if (hero.sword.is_some()) { - hero.sword.borrow().strength() - } else { - // hero can fight without a sword, but will not be very strong - 0 - }; - // hero is weaker if he has lower HP - (hero.experience * hero.hp) + sword_strength - } - - use fun level_up_sword as Sword.level_up; - - fun level_up_sword(sword: &mut Sword, amount: u64) { - sword.strength = sword.strength + amount - } - - public use fun sword_strength as Sword.strength; - - /// Strength of a sword when attacking - public fun sword_strength(sword: &Sword): u64 { - sword.magic + sword.strength - } - - // --- Inventory --- - - /// Heal the weary hero with a potion - public fun heal(hero: &mut Hero, potion: Potion) { - assert!(hero.game_id == potion.game_id, 403); - let Potion { id, potency, game_id: _ } = potion; - object::delete(id); - let new_hp = hero.hp + potency; - // cap hero's HP at MAX_HP to avoid int overflows - hero.hp = new_hp.min(MAX_HP) - } - - /// Add `new_sword` to the hero's inventory and return the old sword - /// (if any) - public fun equip_sword(hero: &mut Hero, new_sword: Sword): Option { - hero.sword.swap_or_fill(new_sword) - } - - /// Disarm the hero by returning their sword. - /// Aborts if the hero does not have a sword. - public fun remove_sword(hero: &mut Hero): Sword { - assert!(hero.sword.is_some(), ENO_SWORD); - hero.sword.extract() - } - - // --- Object creation --- - - /// It all starts with the sword. Anyone can buy a sword, and proceeds go - /// to the admin. Amount of magic in the sword depends on how much you pay - /// for it. - public fun create_sword( - game: &GameInfo, - payment: Coin, - ctx: &mut TxContext - ): Sword { - let value = payment.value(); - // ensure the user pays enough for the sword - assert!(value >= MIN_SWORD_COST, EINSUFFICIENT_FUNDS); - // pay the admin for this sword - transfer::public_transfer(payment, game.admin); - - // magic of the sword is proportional to the amount you paid, up to - // a max. one can only imbue a sword with so much magic - let magic = (value - MIN_SWORD_COST) / MIN_SWORD_COST; - Sword { - id: object::new(ctx), - magic: magic.min(MAX_MAGIC), - strength: 1, - game_id: id(game) - } - } - - public entry fun acquire_hero( - game: &GameInfo, payment: Coin, ctx: &mut TxContext - ) { - let sword = game.create_sword(payment, ctx); - let hero = game.create_hero(sword, ctx); - transfer::public_transfer(hero, ctx.sender()) - } - - /// Anyone can create a hero if they have a sword. All heroes start with the - /// same attributes. - public fun create_hero( - game: &GameInfo, sword: Sword, ctx: &mut TxContext - ): Hero { - game.check_id(sword.game_id); - Hero { - id: object::new(ctx), - hp: 100, - experience: 0, - sword: option::some(sword), - game_id: id(game) - } - } - - /// Admin can create a potion with the given `potency` for `recipient` - public entry fun send_potion( - game: &GameInfo, - potency: u64, - player: address, - admin: &mut GameAdmin, - ctx: &mut TxContext - ) { - game.check_id(admin.game_id); - admin.potions_created = admin.potions_created + 1; - // send potion to the designated player - transfer::public_transfer( - Potion { id: object::new(ctx), potency, game_id: id(game) }, - player - ) - } - - /// Admin can create a boar with the given attributes for `recipient` - public entry fun send_boar( - game: &GameInfo, - admin: &mut GameAdmin, - hp: u64, - strength: u64, - player: address, - ctx: &mut TxContext - ) { - game.check_id(admin.game_id); - admin.boars_created = admin.boars_created + 1; - // send boars to the designated player - transfer::transfer( - Boar { id: object::new(ctx), hp, strength, game_id: id(game) }, - player - ) - } - - // --- Game integrity / Links checks --- - - public fun check_id(game_info: &GameInfo, id: ID) { - assert!(game_info.id() == id, 403); // TODO: error code - } - - public fun id(game_info: &GameInfo): ID { - object::id(game_info) - } - - // --- Testing functions --- - public fun assert_hero_strength(hero: &Hero, strength: u64) { - assert!(hero.strength() == strength, ASSERT_ERR); - } - - #[test_only] - public fun delete_hero_for_testing(hero: Hero) { - let Hero { id, hp: _, experience: _, sword, game_id: _ } = hero; - object::delete(id); - let sword = sword.destroy_some(); - let Sword { id, magic: _, strength: _, game_id: _ } = sword; - object::delete(id) - } - - #[test_only] - public fun delete_game_admin_for_testing(admin: GameAdmin) { - let GameAdmin { id, boars_created: _, potions_created: _, game_id: _ } = admin; - object::delete(id); - } - - #[test] - fun slay_boar_test() { - use sui::test_scenario; - use sui::coin; - - let admin = @0xAD014; - let player = @0x0; - - let mut scenario_val = test_scenario::begin(admin); - let scenario = &mut scenario_val; - // Run the module initializers - scenario.next_tx(admin); - { - init(scenario.ctx()); - }; - // Player purchases a hero with the coins - scenario.next_tx(player); - { - let game = scenario.take_immutable(); - let game_ref = &game; - let coin = coin::mint_for_testing(500, scenario.ctx()); - acquire_hero(game_ref, coin, scenario.ctx()); - test_scenario::return_immutable(game); - }; - // Admin sends a boar to the Player - scenario.next_tx(admin); - { - let game = scenario.take_immutable(); - let game_ref = &game; - let mut admin_cap = scenario.take_from_sender(); - send_boar(game_ref, &mut admin_cap, 10, 10, player, scenario.ctx()); - scenario.return_to_sender(admin_cap); - test_scenario::return_immutable(game); - }; - // Player slays the boar! - scenario.next_tx(player); - { - let game = scenario.take_immutable(); - let game_ref = &game; - let mut hero = scenario.take_from_sender(); - let boar = scenario.take_from_sender(); - slay(game_ref, &mut hero, boar, scenario.ctx()); - scenario.return_to_sender(hero); - test_scenario::return_immutable(game); - }; - scenario_val.end(); - } -} diff --git a/sui_programmability/examples/games/sources/rock_paper_scissors.move b/sui_programmability/examples/games/sources/rock_paper_scissors.move deleted file mode 100644 index 6e33fda37b429..0000000000000 --- a/sui_programmability/examples/games/sources/rock_paper_scissors.move +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// This is an idea of a module which will allow some asset to be -// won by playing a rock-paper-scissors (then lizard-spoke) game. -// -// Initial implementation implies so-called commit-reveal scheme -// in which players first submit their commitments -// and then reveal the data that led to these commitments. The -// data is then being verified by one of the parties or a third -// party (depends on implementation and security measures). -// -// In this specific example, the flow is: -// 1. User A creates a Game struct, where he puts a prize asset -// 2. Both users B and C submit their hashes to the game as their -// guesses but don't reveal the actual values yet -// 3. Users B and C submit their salts, so the user A -// can see and prove that the values match, and decides who won the -// round. Asset is then released to the winner or to the game owner -// if nobody won. -// -// TODO: -// - Error codes -// - Status checks -// - If player never revealed the secret -// - If game owner never took or revealed the results (incentives?) - -module games::rock_paper_scissors { - use std::hash; - - // -- Gestures and additional consts -- // - - const NONE: u8 = 0; - const ROCK: u8 = 1; - const PAPER: u8 = 2; - const SCISSORS: u8 = 3; - const CHEAT: u8 = 111; - - public fun rock(): u8 { ROCK } - public fun paper(): u8 { PAPER } - public fun scissors(): u8 { SCISSORS } - - // -- Game statuses list -- // - - const STATUS_READY: u8 = 0; - const STATUS_HASH_SUBMISSION: u8 = 1; - const STATUS_HASHES_SUBMITTED: u8 = 2; - const STATUS_REVEALING: u8 = 3; - const STATUS_REVEALED: u8 = 4; - - /// The Prize that's being held inside the [`Game`] object. Should be - /// eventually replaced with some generic T inside the [`Game`]. - public struct ThePrize has key, store { - id: UID - } - - /// The main resource of the rock_paper_scissors module. Contains all the - /// information about the game state submitted by both players. By default - /// contains empty values and fills as the game progresses. - /// Being destroyed in the end, once [`select_winner`] is called and the game - /// has reached its final state by that time. - public struct Game has key { - id: UID, - prize: ThePrize, - player_one: address, - player_two: address, - hash_one: vector, - hash_two: vector, - gesture_one: u8, - gesture_two: u8, - } - - /// Hashed gesture. It is not reveal-able until both players have - /// submitted their moves to the Game. The turn is passed to the - /// game owner who then adds a hash to the Game object. - public struct PlayerTurn has key { - id: UID, - hash: vector, - player: address, - } - - /// Secret object which is used to reveal the move. Just like [`PlayerTurn`] - /// it is used to reveal the actual gesture a player has submitted. - public struct Secret has key { - id: UID, - salt: vector, - player: address, - } - - /// Shows the current game status. This function is also used in the [`select_winner`] - /// entry point and limits the ability to select a winner, if one of the secrets hasn't - /// been revealed yet. - public fun status(game: &Game): u8 { - let h1_len = game.hash_one.length(); - let h2_len = game.hash_two.length(); - - if (game.gesture_one != NONE && game.gesture_two != NONE) { - STATUS_REVEALED - } else if (game.gesture_one != NONE || game.gesture_two != NONE) { - STATUS_REVEALING - } else if (h1_len == 0 && h2_len == 0) { - STATUS_READY - } else if (h1_len != 0 && h2_len != 0) { - STATUS_HASHES_SUBMITTED - } else if (h1_len != 0 || h2_len != 0) { - STATUS_HASH_SUBMISSION - } else { - 0 - } - } - - /// Start a new game at sender address. The only arguments needed are players, the rest - /// is initiated with default/empty values which will be filled later in the game. - /// - /// todo: extend with generics + T as prize - public entry fun new_game(player_one: address, player_two: address, ctx: &mut TxContext) { - transfer::transfer(Game { - id: object::new(ctx), - prize: ThePrize { id: object::new(ctx) }, - player_one, - player_two, - hash_one: vector[], - hash_two: vector[], - gesture_one: NONE, - gesture_two: NONE, - }, ctx.sender()); - } - - /// Transfer [`PlayerTurn`] to the game owner. Nobody at this point knows what move - /// is encoded inside the [`hash`] argument. - /// - /// Currently there's no check on whether the game exists. - public entry fun player_turn(at: address, hash: vector, ctx: &mut TxContext) { - transfer::transfer(PlayerTurn { - hash, - id: object::new(ctx), - player: ctx.sender(), - }, at); - } - - /// Add a hashed gesture to the game. Store it as a `hash_one` or `hash_two` depending - /// on the player number (one or two) - public entry fun add_hash(game: &mut Game, cap: PlayerTurn) { - let PlayerTurn { hash, id, player } = cap; - let status = status(game); - - assert!(status == STATUS_HASH_SUBMISSION || status == STATUS_READY, 0); - assert!(game.player_one == player || game.player_two == player, 0); - - if (player == game.player_one && game.hash_one.length() == 0) { - game.hash_one = hash; - } else if (player == game.player_two && game.hash_two.length() == 0) { - game.hash_two = hash; - } else { - abort 0 // unreachable!() - }; - - object::delete(id); - } - - /// Submit a [`Secret`] to the game owner who then matches the hash and saves the - /// gesture in the [`Game`] object. - public entry fun reveal(at: address, salt: vector, ctx: &mut TxContext) { - transfer::transfer(Secret { - id: object::new(ctx), - salt, - player: ctx.sender(), - }, at); - } - - /// Use submitted [`Secret`]'s salt to find the gesture played by the player and set it - /// in the [`Game`] object. - /// TODO: think of ways to - public entry fun match_secret(game: &mut Game, secret: Secret) { - let Secret { salt, player, id } = secret; - - assert!(player == game.player_one || player == game.player_two, 0); - - if (player == game.player_one) { - game.gesture_one = find_gesture(salt, &game.hash_one); - } else if (player == game.player_two) { - game.gesture_two = find_gesture(salt, &game.hash_two); - }; - - object::delete(id); - } - - /// The final accord to the game logic. After both secrets have been revealed, - /// the game owner can choose a winner and release the prize. - public entry fun select_winner(game: Game, ctx: &TxContext) { - assert!(status(&game) == STATUS_REVEALED, 0); - - let Game { - id, - prize, - player_one, - player_two, - hash_one: _, - hash_two: _, - gesture_one, - gesture_two, - } = game; - - let p1_wins = play(gesture_one, gesture_two); - let p2_wins = play(gesture_two, gesture_one); - - object::delete(id); - - // If one of the players wins, he takes the prize. - // If there's a tie, the game owner gets the prize. - if (p1_wins) { - transfer::public_transfer(prize, player_one) - } else if (p2_wins) { - transfer::public_transfer(prize, player_two) - } else { - transfer::public_transfer(prize, ctx.sender()) - }; - } - - /// Implement the basic logic of the game. - fun play(one: u8, two: u8): bool { - if (one == ROCK && two == SCISSORS) { true } - else if (one == PAPER && two == ROCK) { true } - else if (one == SCISSORS && two == PAPER) { true } - else if (one != CHEAT && two == CHEAT) { true } - else { false } - } - - /// Hash the salt and the gesture_id and match it against the stored hash. If something - /// matches, the gesture_id is returned, if nothing - player is considered a cheater, and - /// he automatically loses the round. - fun find_gesture(salt: vector, hash: &vector): u8 { - if (hash(ROCK, salt) == *hash) { - ROCK - } else if (hash(PAPER, salt) == *hash) { - PAPER - } else if (hash(SCISSORS, salt) == *hash) { - SCISSORS - } else { - CHEAT - } - } - - /// Internal hashing function to build a [`Secret`] and match it later at the reveal stage. - /// - /// - `salt` argument here is a secret that is only known to the sender. That way we ensure - /// that nobody knows the gesture until the end, but at the same time each player commits - /// to the result with his hash; - fun hash(gesture: u8, mut salt: vector): vector { - salt.push_back(gesture); - hash::sha2_256(salt) - } -} diff --git a/sui_programmability/examples/games/sources/sea_hero.move b/sui_programmability/examples/games/sources/sea_hero.move deleted file mode 100644 index 46236192a5773..0000000000000 --- a/sui_programmability/examples/games/sources/sea_hero.move +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Example of a game mod or different game that uses objects from the Hero -/// game. -/// This mod introduces sea monsters that can also be slain with the hero's -/// sword. Instead of boosting the hero's experience, slaying sea monsters -/// earns RUM tokens for hero's owner. -/// Note that this mod does not require special permissions from `Hero` module; -/// anyone is free to create a mod like this. -module games::sea_hero { - use games::hero::Hero; - - use sui::balance::{Self, Balance, Supply}; - - /// Admin capability granting permission to mint RUM tokens and - /// create monsters - public struct SeaHeroAdmin has key { - id: UID, - /// Permission to mint RUM - supply: Supply, - /// Total number of monsters created so far - monsters_created: u64, - /// cap on the supply of RUM - token_supply_max: u64, - /// cap on the number of monsters that can be created - monster_max: u64 - } - - /// A new kind of monster for the hero to fight - public struct SeaMonster has key, store { - id: UID, - /// Tokens that the user will earn for slaying this monster - reward: Balance - } - - /// Type of the sea game token - public struct RUM has drop {} - - // TODO: proper error codes - /// Hero is not strong enough to defeat the monster. Try healing with a - /// potion, fighting boars to gain more experience, or getting a better - /// sword - const EHERO_NOT_STRONG_ENOUGH: u64 = 0; - - // --- Initialization --- - - - - #[allow(unused_function)] - /// Get a treasury cap for the coin and give it to the admin - // TODO: this leverages Move module initializers - fun init(ctx: &mut TxContext) { - transfer::transfer( - SeaHeroAdmin { - id: object::new(ctx), - supply: balance::create_supply(RUM {}), - monsters_created: 0, - token_supply_max: 1000000, - monster_max: 10, - }, - ctx.sender() - ) - } - - // --- Gameplay --- - - /// Slay the `monster` with the `hero`'s sword, earn RUM tokens in - /// exchange. - /// Aborts if the hero is not strong enough to slay the monster - public fun slay(hero: &Hero, monster: SeaMonster): Balance { - let SeaMonster { id, reward } = monster; - object::delete(id); - // Hero needs strength greater than the reward value to defeat the - // monster - assert!( - hero.strength() >= reward.value(), - EHERO_NOT_STRONG_ENOUGH - ); - - reward - } - - // --- Object and coin creation --- - - /// Game admin can create a monster wrapping a coin worth `reward` and send - /// it to `recipient` - public entry fun create_monster( - admin: &mut SeaHeroAdmin, - reward_amount: u64, - recipient: address, - ctx: &mut TxContext - ) { - let current_coin_supply = admin.supply.supply_value(); - let token_supply_max = admin.token_supply_max; - // TODO: create error codes - // ensure token supply cap is respected - assert!(reward_amount < token_supply_max, 0); - assert!(token_supply_max - reward_amount >= current_coin_supply, 1); - // ensure monster supply cap is respected - assert!(admin.monster_max - 1 >= admin.monsters_created, 2); - - let monster = SeaMonster { - id: object::new(ctx), - reward: admin.supply.increase_supply(reward_amount), - }; - admin.monsters_created = admin.monsters_created + 1; - - transfer::public_transfer(monster, recipient) - } - - /// Reward a hero will reap from slaying this monster - public fun monster_reward(monster: &SeaMonster): u64 { - monster.reward.value() - } -} diff --git a/sui_programmability/examples/games/sources/sea_hero_helper.move b/sui_programmability/examples/games/sources/sea_hero_helper.move deleted file mode 100644 index 2c74e8332700d..0000000000000 --- a/sui_programmability/examples/games/sources/sea_hero_helper.move +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Mod of the economics of the SeaHero game. In the game, a `Hero` can only -/// slay a `SeaMonster` if they have sufficient strength. This mod allows a -/// player with a weak `Hero` to ask a player with a stronger `Hero` to slay -/// the monster for them in exchange for some of the reward. -/// Anyone can create a mod like this--the permission of the `SeaHero` game -/// is not required. -module games::sea_hero_helper { - use games::sea_hero::{Self, SeaMonster, RUM}; - use games::hero::Hero; - use sui::coin::{Self, Coin}; - - /// Created by `monster_owner`, a player with a monster that's too strong - /// for them to slay + transferred to a player who can slay the monster. - /// The two players split the reward for slaying the monster according to - /// the `helper_reward` parameter. - public struct HelpMeSlayThisMonster has key { - id: UID, - /// Monster to be slay by the owner of this object - monster: SeaMonster, - /// Identity of the user that originally owned the monster - monster_owner: address, - /// Number of tokens that will go to the helper. The owner will get - /// the `monster` reward - `helper_reward` tokens - helper_reward: u64, - } - - // TODO: proper error codes - /// The specified helper reward is too large - const EINVALID_HELPER_REWARD: u64 = 0; - - /// Create an offer for `helper` to slay the monster in exchange for - /// some of the reward - public fun create( - monster: SeaMonster, - helper_reward: u64, - helper: address, - ctx: &mut TxContext, - ) { - // make sure the advertised reward is not too large + that the owner - // gets a nonzero reward - assert!( - monster.monster_reward() > helper_reward, - EINVALID_HELPER_REWARD - ); - transfer::transfer( - HelpMeSlayThisMonster { - id: object::new(ctx), - monster, - monster_owner: ctx.sender(), - helper_reward - }, - helper - ) - } - - /// Helper should call this if they are willing to help out and slay the - /// monster. - public fun slay( - hero: &Hero, wrapper: HelpMeSlayThisMonster, ctx: &mut TxContext, - ): Coin { - let HelpMeSlayThisMonster { - id, - monster, - monster_owner, - helper_reward - } = wrapper; - object::delete(id); - let mut owner_reward = sea_hero::slay(hero, monster); - let helper_reward = coin::take(&mut owner_reward, helper_reward, ctx); - transfer::public_transfer(owner_reward.into_coin(ctx), monster_owner); - helper_reward - } - - /// Helper can call this if they can't help slay the monster or don't want - /// to, and are willing to kindly return the monster to its owner. - public fun return_to_owner(wrapper: HelpMeSlayThisMonster) { - let HelpMeSlayThisMonster { - id, - monster, - monster_owner, - helper_reward: _ - } = wrapper; - object::delete(id); - transfer::public_transfer(monster, monster_owner) - } - - /// Return the number of coins that `wrapper.owner` will earn if the - /// the helper slays the monster in `wrapper. - public fun owner_reward(wrapper: &HelpMeSlayThisMonster): u64 { - wrapper.monster.monster_reward() - wrapper.helper_reward - } -} diff --git a/sui_programmability/examples/games/sources/shared_tic_tac_toe.move b/sui_programmability/examples/games/sources/shared_tic_tac_toe.move deleted file mode 100644 index 4e601dca40f59..0000000000000 --- a/sui_programmability/examples/games/sources/shared_tic_tac_toe.move +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// This is a rewrite of TicTacToe using a completely different approach. -// In TicTacToe, since the game object is owned by the admin, the players are not -// able to directly mutate the gameboard. Hence each marker placement takes -// two transactions. -// In this implementation, we make the game object a shared object. -// Both players have access and can mutate the game object, and hence they -// can place markers directly in one transaction. -// In general, using shared object has an extra cost due to the fact -// that Sui needs to sequence the operations that mutate the shared object from -// different transactions. In this case however, since it is expected for players -// to take turns to place the marker, there won't be a significant overhead in practice. -// As we can see, by using shared object, the implementation is much -// simpler than the other implementation. -module games::shared_tic_tac_toe { - use sui::event; - - // Game status - const IN_PROGRESS: u8 = 0; - const X_WIN: u8 = 1; - const O_WIN: u8 = 2; - const DRAW: u8 = 3; - const FINAL_TURN: u8 = 8; - - - // Mark type - const MARK_EMPTY: u8 = 2; - - // Error codes - /// Trying to place a mark when it's not your turn. - const EInvalidTurn: u64 = 0; - /// Trying to place a mark when the game has already ended. - const EGameEnded: u64 = 1; - /// Trying to place a mark in an invalid location, i.e. row/column out of bound. - const EInvalidLocation: u64 = 2; - /// The cell to place a new mark at is already oocupied. - const ECellOccupied: u64 = 3; - - public struct TicTacToe has key { - id: UID, - gameboard: vector>, - cur_turn: u8, - game_status: u8, - x_address: address, - o_address: address, - } - - public struct Trophy has key { - id: UID, - } - - public struct GameEndEvent has copy, drop { - // The Object ID of the game object - game_id: ID, - } - - /// `x_address` and `o_address` are the account address of the two players. - public entry fun create_game(x_address: address, o_address: address, ctx: &mut TxContext) { - // TODO: Validate sender address, only GameAdmin can create games. - - let id = object::new(ctx); - let gameboard = vector[ - vector[MARK_EMPTY, MARK_EMPTY, MARK_EMPTY], - vector[MARK_EMPTY, MARK_EMPTY, MARK_EMPTY], - vector[MARK_EMPTY, MARK_EMPTY, MARK_EMPTY], - ]; - let game = TicTacToe { - id, - gameboard, - cur_turn: 0, - game_status: IN_PROGRESS, - x_address: x_address, - o_address: o_address, - }; - // Make the game a shared object so that both players can mutate it. - transfer::share_object(game); - } - - public entry fun place_mark(game: &mut TicTacToe, row: u8, col: u8, ctx: &mut TxContext) { - assert!(row < 3 && col < 3, EInvalidLocation); - assert!(game.game_status == IN_PROGRESS, EGameEnded); - let addr = game.get_cur_turn_address(); - assert!(addr == ctx.sender(), EInvalidTurn); - - let cell = &mut game.gameboard[row as u64][col as u64]; - assert!(*cell == MARK_EMPTY, ECellOccupied); - - *cell = game.cur_turn % 2; - game.update_winner(); - game.cur_turn = game.cur_turn + 1; - - if (game.game_status != IN_PROGRESS) { - // Notify the server that the game ended so that it can delete the game. - event::emit(GameEndEvent { game_id: object::id(game) }); - if (game.game_status == X_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, game.x_address); - } else if (game.game_status == O_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, game.o_address); - } - } - } - - public entry fun delete_game(game: TicTacToe) { - let TicTacToe { id, gameboard: _, cur_turn: _, game_status: _, x_address: _, o_address: _ } = game; - object::delete(id); - } - - public entry fun delete_trophy(trophy: Trophy) { - let Trophy { id } = trophy; - object::delete(id); - } - - public fun get_status(game: &TicTacToe): u8 { - game.game_status - } - - fun get_cur_turn_address(game: &TicTacToe): address { - if (game.cur_turn % 2 == 0) { - game.x_address - } else { - game.o_address - } - } - - fun get_cell(game: &TicTacToe, row: u64, col: u64): u8 { - game.gameboard[row][col] - } - - fun update_winner(game: &mut TicTacToe) { - // Check all rows - check_for_winner(game, 0, 0, 0, 1, 0, 2); - check_for_winner(game, 1, 0, 1, 1, 1, 2); - check_for_winner(game, 2, 0, 2, 1, 2, 2); - - // Check all columns - check_for_winner(game, 0, 0, 1, 0, 2, 0); - check_for_winner(game, 0, 1, 1, 1, 2, 1); - check_for_winner(game, 0, 2, 1, 2, 2, 2); - - // Check diagonals - check_for_winner(game, 0, 0, 1, 1, 2, 2); - check_for_winner(game, 2, 0, 1, 1, 0, 2); - - // Check if we have a draw - if (game.game_status == IN_PROGRESS && game.cur_turn == FINAL_TURN) { - game.game_status = DRAW; - }; - } - - fun check_for_winner(game: &mut TicTacToe, row1: u64, col1: u64, row2: u64, col2: u64, row3: u64, col3: u64) { - if (game.game_status != IN_PROGRESS) { - return - }; - let result = get_winner_if_all_equal(game, row1, col1, row2, col2, row3, col3); - if (result != MARK_EMPTY) { - game.game_status = if (result == 0) X_WIN else O_WIN; - }; - } - - fun get_winner_if_all_equal(game: &TicTacToe, row1: u64, col1: u64, row2: u64, col2: u64, row3: u64, col3: u64): u8 { - let cell1 = game.get_cell(row1, col1); - let cell2 = game.get_cell(row2, col2); - let cell3 = game.get_cell(row3, col3); - if (cell1 == cell2 && cell1 == cell3) cell1 else MARK_EMPTY - } -} diff --git a/sui_programmability/examples/games/sources/tic_tac_toe.move b/sui_programmability/examples/games/sources/tic_tac_toe.move deleted file mode 100644 index 19819f1efd440..0000000000000 --- a/sui_programmability/examples/games/sources/tic_tac_toe.move +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// This is an implementation of the TicTacToe game. -// The game object (which includes gameboard) is owned by a game admin. -// Since players don't have ownership over the game object, they cannot -// mutate the gameboard directly. In order for each player to place -// a marker, they must first show their intention of placing a marker -// by creating a marker object with the placement information and send -// the marker to the admin. The admin needs to run a centralized service -// that monitors the marker placement events and respond do them. -// Upon receiving an event, the admin will attempt the place the new -// marker on the gameboard. This means that every marker placement operation -// always take two transactions, one by the player, and one by the admin. -// It also means that we need to trust the centralized service for liveness, -// i.e. the service is willing to make progress in the game. -// TicTacToeV2 shows a simpler way to implement this using shared objects, -// providing different trade-offs: using shared object is more expensive, -// however it eliminates the need of a centralized service. -module games::tic_tac_toe { - use sui::event; - - // Game status - const IN_PROGRESS: u8 = 0; - const X_WIN: u8 = 1; - const O_WIN: u8 = 2; - const DRAW: u8 = 3; - const FINAL_TURN: u8 = 8; - - // Error codes - const EInvalidLocation: u64 = 0; - const ENoMoreMark: u64 = 1; - - public struct TicTacToe has key { - id: UID, - gameboard: vector>>, - cur_turn: u8, - game_status: u8, - x_address: address, - o_address: address, - } - - public struct MarkMintCap has key { - id: UID, - game_id: ID, - remaining_supply: u8, - } - - public struct Mark has key, store { - id: UID, - player: address, - row: u64, - col: u64, - } - - public struct Trophy has key { - id: UID, - } - - public struct MarkSentEvent has copy, drop { - // The Object ID of the game object - game_id: ID, - // The object ID of the mark sent - mark_id: ID, - } - - public struct GameEndEvent has copy, drop { - // The Object ID of the game object - game_id: ID, - } - - /// `x_address` and `o_address` are the account address of the two players. - public entry fun create_game(x_address: address, o_address: address, ctx: &mut TxContext) { - // TODO: Validate sender address, only GameAdmin can create games. - - let id = object::new(ctx); - let game_id = id.to_inner(); - let gameboard = vector[ - vector[option::none(), option::none(), option::none()], - vector[option::none(), option::none(), option::none()], - vector[option::none(), option::none(), option::none()], - ]; - let game = TicTacToe { - id, - gameboard, - cur_turn: 0, - game_status: IN_PROGRESS, - x_address: x_address, - o_address: o_address, - }; - transfer::transfer(game, ctx.sender()); - let cap = MarkMintCap { - id: object::new(ctx), - game_id, - remaining_supply: 5, - }; - transfer::transfer(cap, x_address); - let cap = MarkMintCap { - id: object::new(ctx), - game_id, - remaining_supply: 5, - }; - transfer::transfer(cap, o_address); - } - - /// Generate a new mark intended for location (row, col). - /// This new mark is not yet placed, just transferred to the game. - public entry fun send_mark_to_game( - cap: &mut MarkMintCap, - game_address: address, - row: u64, - col: u64, - ctx: &mut TxContext, - ) { - if (row > 2 || col > 2) { - abort EInvalidLocation - }; - let mark = mint_mark(cap, row, col, ctx); - // Once an event is emitted, it should be observed by a game server. - // The game server will then call `place_mark` to place this mark. - event::emit(MarkSentEvent { - game_id: *&cap.game_id, - mark_id: object::id(&mark), - }); - transfer::public_transfer(mark, game_address); - } - - public entry fun place_mark(game: &mut TicTacToe, mark: Mark, ctx: &mut TxContext) { - // If we are placing the mark at the wrong turn, or if game has ended, - // destroy the mark. - let addr = game.get_cur_turn_address(); - if (game.game_status != IN_PROGRESS || &addr != &mark.player) { - mark.delete(); - return - }; - let cell = get_cell_mut_ref(game, mark.row, mark.col); - if (cell.is_some()) { - // There is already a mark in the desired location. - // Destroy the mark. - mark.delete(); - return - }; - cell.fill(mark); - game.update_winner(); - game.cur_turn = game.cur_turn + 1; - - if (game.game_status != IN_PROGRESS) { - // Notify the server that the game ended so that it can delete the game. - event::emit(GameEndEvent { game_id: object::id(game) }); - if (game.game_status == X_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, *&game.x_address); - } else if (game.game_status == O_WIN) { - transfer::transfer(Trophy { id: object::new(ctx) }, *&game.o_address); - } - } - } - - public entry fun delete_game(game: TicTacToe) { - let TicTacToe { id, mut gameboard, cur_turn: _, game_status: _, x_address: _, o_address: _ } = game; - while (gameboard.length() > 0) { - let mut row = gameboard.pop_back(); - while (row.length() > 0) { - let mut element = row.pop_back(); - if (element.is_some()) { - let mark = element.extract(); - mark.delete(); - }; - element.destroy_none(); - }; - row.destroy_empty(); - }; - gameboard.destroy_empty(); - object::delete(id); - } - - public entry fun delete_trophy(trophy: Trophy) { - let Trophy { id } = trophy; - object::delete(id); - } - - public entry fun delete_cap(cap: MarkMintCap) { - let MarkMintCap { id, game_id: _, remaining_supply: _ } = cap; - object::delete(id); - } - - public fun get_status(game: &TicTacToe): u8 { - game.game_status - } - - fun mint_mark(cap: &mut MarkMintCap, row: u64, col: u64, ctx: &mut TxContext): Mark { - if (cap.remaining_supply == 0) { - abort ENoMoreMark - }; - cap.remaining_supply = cap.remaining_supply - 1; - Mark { - id: object::new(ctx), - player: ctx.sender(), - row, - col, - } - } - - fun get_cur_turn_address(game: &TicTacToe): address { - if (game.cur_turn % 2 == 0) { - *&game.x_address - } else { - *&game.o_address - } - } - - fun get_cell_ref(game: &TicTacToe, row: u64, col: u64): &Option { - &game.gameboard[row][col] - } - - fun get_cell_mut_ref(game: &mut TicTacToe, row: u64, col: u64): &mut Option { - &mut game.gameboard[row][col] - } - - fun update_winner(game: &mut TicTacToe) { - // Check all rows - check_for_winner(game, 0, 0, 0, 1, 0, 2); - check_for_winner(game, 1, 0, 1, 1, 1, 2); - check_for_winner(game, 2, 0, 2, 1, 2, 2); - - // Check all columns - check_for_winner(game, 0, 0, 1, 0, 2, 0); - check_for_winner(game, 0, 1, 1, 1, 2, 1); - check_for_winner(game, 0, 2, 1, 2, 2, 2); - - // Check diagonals - check_for_winner(game, 0, 0, 1, 1, 2, 2); - check_for_winner(game, 2, 0, 1, 1, 0, 2); - - // Check if we have a draw - if (game.game_status == IN_PROGRESS && game.cur_turn == FINAL_TURN) { - game.game_status = DRAW; - }; - } - - fun check_for_winner(game: &mut TicTacToe, row1: u64, col1: u64, row2: u64, col2: u64, row3: u64, col3: u64) { - if (game.game_status != IN_PROGRESS) { - return - }; - let mut result = check_all_equal(game, row1, col1, row2, col2, row3, col3); - if (result.is_some()) { - let winner = result.extract(); - game.game_status = if (&winner == &game.x_address) { - X_WIN - } else { - O_WIN - }; - }; - } - - fun check_all_equal(game: &TicTacToe, row1: u64, col1: u64, row2: u64, col2: u64, row3: u64, col3: u64): Option
{ - let cell1 = get_cell_ref(game, row1, col1); - let cell2 = get_cell_ref(game, row2, col2); - let cell3 = get_cell_ref(game, row3, col3); - if (cell1.is_some() && cell2.is_some() && cell3.is_some()) { - let cell1_player = cell1.borrow().player; - let cell2_player = cell2.borrow().player; - let cell3_player = cell3.borrow().player; - if (&cell1_player == &cell2_player && &cell1_player == &cell3_player) { - return option::some(cell1_player) - }; - }; - option::none() - } - - use fun delete_mark as Mark.delete; - - fun delete_mark(mark: Mark) { - let Mark { id, player: _, row: _, col: _ } = mark; - object::delete(id); - } - - public fun mark_player(mark: &Mark): &address { - &mark.player - } - - public fun mark_row(mark: &Mark): u64 { - mark.row - } - - public fun mark_col(mark: &Mark): u64 { - mark.col - } -} diff --git a/sui_programmability/examples/games/sources/vdf_based_lottery.move b/sui_programmability/examples/games/sources/vdf_based_lottery.move deleted file mode 100644 index 2df7aa6c0f61c..0000000000000 --- a/sui_programmability/examples/games/sources/vdf_based_lottery.move +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// A basic lottery game that depends on user-provided randomness which is processed by a verifiable delay function (VDF) -/// to make sure that it is unbiasable. -/// -/// During the submission phase, players can buy tickets. When buying a ticket, a user must provide some randomness `r`. This -/// randomness is added to the combined randomness of the lottery, `h`, as `h = Sha2_256(h, r)`. -/// -/// After the submission phase has ended, the combined randomness is used to generate an input to the VDF. Anyone may now -/// compute the output and submit it along with a proof of correctness to the `complete` function. If the output and proof -/// verifies, the game ends, and the hash of the output is used to pick a winner. -/// -/// The outcome is guaranteed to be fair if: -/// 1) At least one player contributes true randomness, -/// 2) The number of iterations is defined such that it takes at least `submission_phase_length` to compute the VDF. -module games::vdf_based_lottery { - use games::drand_lib::safe_selection; - use sui::clock::Clock; - use std::hash::sha2_256; - use sui::vdf::{hash_to_input, vdf_verify}; - - /// Error codes - const EGameNotInProgress: u64 = 0; - const EGameAlreadyCompleted: u64 = 1; - const EInvalidTicket: u64 = 2; - const ESubmissionPhaseInProgress: u64 = 3; - const EInvalidVdfProof: u64 = 4; - const ESubmissionPhaseFinished: u64 = 5; - const EInvalidRandomness: u64 = 6; - - /// Game status - const IN_PROGRESS: u8 = 0; - const COMPLETED: u8 = 1; - - /// Other constants - const RANDOMNESS_LENGTH: u64 = 16; - - /// Game represents a set of parameters of a single game. - /// This game can be extended to require ticket purchase, reward winners, etc. - /// - public struct Game has key, store { - id: UID, - iterations: u64, - status: u8, - timestamp_start: u64, - submission_phase_length: u64, - participants: u64, - vdf_input_seed: vector, - winner: Option, - } - - /// Ticket represents a participant in a single game. - /// Can be deconstructed only by the owner. - public struct Ticket has key, store { - id: UID, - game_id: ID, - participant_index: u64, - } - - /// GameWinner represents a participant that won in a specific game. - /// Can be deconstructed only by the owner. - public struct GameWinner has key, store { - id: UID, - game_id: ID, - } - - /// Create a shared-object Game. - public fun create(iterations: u64, submission_phase_length: u64, clock: &Clock, ctx: &mut TxContext) { - let game = Game { - id: object::new(ctx), - iterations, - status: IN_PROGRESS, - timestamp_start: clock.timestamp_ms(), - submission_phase_length, - vdf_input_seed: vector::empty(), - participants: 0, - winner: option::none(), - }; - transfer::public_share_object(game); - } - - /// Anyone can participate in the game and receive a ticket. - public fun participate(self: &mut Game, my_randomness: vector, clock: &Clock, ctx: &mut TxContext): Ticket { - assert!(self.status == IN_PROGRESS, EGameNotInProgress); - assert!(clock.timestamp_ms() - self.timestamp_start < self.submission_phase_length, ESubmissionPhaseFinished); - - // Update combined randomness by concatenating the provided randomness and hashing it - assert!(my_randomness.length() == RANDOMNESS_LENGTH, EInvalidRandomness); - self.vdf_input_seed.append(my_randomness); - self.vdf_input_seed = sha2_256(self.vdf_input_seed); - - // Assign index to this participant - let participant_index = self.participants; - self.participants = self.participants + 1; - - Ticket { - id: object::new(ctx), - game_id: object::id(self), - participant_index, - } - } - - /// Complete this lottery by sending VDF output and proof for the seed created from the - /// contributed randomness. Anyone can call this. - public fun complete(self: &mut Game, vdf_output: vector, vdf_proof: vector, clock: &Clock) { - assert!(self.status != COMPLETED, EGameAlreadyCompleted); - assert!(clock.timestamp_ms() - self.timestamp_start >= self.submission_phase_length, ESubmissionPhaseInProgress); - - // Hash combined randomness to vdf input - let vdf_input = hash_to_input(&self.vdf_input_seed); - - // Verify output and proof - assert!(vdf_verify(&vdf_input, &vdf_output, &vdf_proof, self.iterations), EInvalidVdfProof); - - // The randomness is derived from the VDF output by passing it through a hash function with uniformly distributed - // output to make it uniform. Any hash function with uniformly distributed output can be used. - let randomness = sha2_256(vdf_output); - - // Set winner and mark lottery completed - self.winner = option::some(safe_selection(self.participants, &randomness)); - self.status = COMPLETED; - } - - /// The winner can redeem its ticket. - public fun redeem(self: &Game, ticket: &Ticket, ctx: &mut TxContext): GameWinner { - assert!(self.status == COMPLETED, ESubmissionPhaseInProgress); - assert!(object::id(self) == ticket.game_id, EInvalidTicket); - assert!(self.winner.contains(&ticket.participant_index), EInvalidTicket); - - GameWinner { - id: object::new(ctx), - game_id: ticket.game_id, - } - } - - // Note that a ticket can be deleted before the game was completed. - public use fun delete_ticket as Ticket.delete; - public fun delete_ticket(ticket: Ticket) { - let Ticket { id, game_id: _, participant_index: _} = ticket; - object::delete(id); - } - - public use fun delete_game_winner as GameWinner.delete; - public fun delete_game_winner(ticket: GameWinner) { - let GameWinner { id, game_id: _} = ticket; - object::delete(id); - } - - public use fun ticket_game_id as Ticket.game_id; - public fun ticket_game_id(ticket: &Ticket): &ID { - &ticket.game_id - } - - public use fun game_winner_game_id as GameWinner.game_id; - public fun game_winner_game_id(ticket: &GameWinner): &ID { - &ticket.game_id - } - -} diff --git a/sui_programmability/examples/games/tests/drand_based_lottery_tests.move b/sui_programmability/examples/games/tests/drand_based_lottery_tests.move deleted file mode 100644 index 5ad5f2a7ad0c1..0000000000000 --- a/sui_programmability/examples/games/tests/drand_based_lottery_tests.move +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module games::drand_based_lottery_tests { - use sui::test_scenario::{Self}; - use games::drand_based_lottery::{Self, Game, Ticket, GameWinner}; - use games::drand_lib::verify_time_has_passed; - - #[test] - fun test_verify_time_has_passed_success() { - // Taken from the output of - // curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/8 - verify_time_has_passed( - 1692803367 + 3*7, // exactly the 8th round - x"a0c06b9964123d2e6036aa004c140fc301f4edd3ea6b8396a15dfd7dfd70cc0dce0b4a97245995767ab72cf59de58c47", - 8 - ); - verify_time_has_passed( - 1692803367 + 3*7 - 2, // the 8th round - 2 seconds - x"a0c06b9964123d2e6036aa004c140fc301f4edd3ea6b8396a15dfd7dfd70cc0dce0b4a97245995767ab72cf59de58c47", - 8 - ); - } - - #[test] - #[expected_failure(abort_code = games::drand_lib::EInvalidProof)] - fun test_verify_time_has_passed_failure() { - // Taken from the output of - // curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/8 - verify_time_has_passed( - 1692803367 + 3*8, // exactly the 9th round - 10 seconds - x"a0c06b9964123d2e6036aa004c140fc301f4edd3ea6b8396a15dfd7dfd70cc0dce0b4a97245995767ab72cf59de58c47", - 8 - ); - } - - #[test] - fun test_play_drand_lottery() { - let user1 = @0x0; - let user2 = @0x1; - let user3 = @0x2; - let user4 = @0x3; - - let mut scenario = test_scenario::begin(user1); - - drand_based_lottery::create(10, scenario.ctx()); - scenario.next_tx(user1); - let mut game_val = scenario.take_shared(); - let game = &mut game_val; - - // User1 buys a ticket. - scenario.next_tx(user1); - game.participate(scenario.ctx()); - // User2 buys a ticket. - scenario.next_tx(user2); - game.participate(scenario.ctx()); - // User3 buys a tcket - scenario.next_tx(user3); - game.participate(scenario.ctx()); - // User4 buys a tcket - scenario.next_tx(user4); - game.participate(scenario.ctx()); - - // User 2 closes the game. - scenario.next_tx(user2); - // Taken from the output of - // curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/8 - game.close( - x"a0c06b9964123d2e6036aa004c140fc301f4edd3ea6b8396a15dfd7dfd70cc0dce0b4a97245995767ab72cf59de58c47", - ); - - // User3 completes the game. - scenario.next_tx(user3); - // Taken from theoutput of - // curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/10 - game.complete( - x"ac415e508c484053efed1c6c330e3ae0bf20185b66ed088864dac1ff7d6f927610824986390d3239dac4dd73e6f865f5", - ); - - // User2 is the winner since the mod of the hash results in 1. - scenario.next_tx(user2); - assert!(!test_scenario::has_most_recent_for_address(user2), 1); - let ticket = scenario.take_from_address(user2); - let ticket_game_id = *ticket.get_ticket_game_id(); - ticket.redeem(&game_val, scenario.ctx()); - ticket.delete_ticket(); - - // Make sure User2 now has a winner ticket for the right game id. - scenario.next_tx(user2); - let ticket = scenario.take_from_address(user2); - assert!(ticket.get_game_winner_game_id() == &ticket_game_id, 1); - test_scenario::return_to_address(user2, ticket); - - test_scenario::return_shared(game_val); - scenario.end(); - } -} diff --git a/sui_programmability/examples/games/tests/drand_based_scratch_card_tests.move b/sui_programmability/examples/games/tests/drand_based_scratch_card_tests.move deleted file mode 100644 index 4f12459150f10..0000000000000 --- a/sui_programmability/examples/games/tests/drand_based_scratch_card_tests.move +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module games::drand_based_scratch_card_tests { - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - use sui::test_scenario::{Self, Scenario}; - - use games::drand_based_scratch_card; - - fun mint(addr: address, amount: u64, scenario: &mut Scenario) { - transfer::public_transfer(coin::mint_for_testing(amount, scenario.ctx()), addr); - scenario.next_tx(addr); - } - - #[test] - fun test_play_drand_scratch_card_with_winner() { - let user1 = @0x0; - let user2 = @0x1; - - let mut scenario = test_scenario::begin(user1); - - // Create the game and get back the output objects. - mint(user1, 10, &mut scenario); - let coin1 = scenario.take_from_sender>(); - drand_based_scratch_card::create(coin1, 10, 10, scenario.ctx()); - scenario.next_tx(user1); - let game = scenario.take_immutable(); - let mut reward_val = scenario.take_shared(); - let drand_final_round = drand_based_scratch_card::end_of_game_round(game.get_game_base_drand_round()); - assert!(drand_final_round == 58810, 1); - - // Since everything here is deterministic, we know that the 49th ticket will be a winner. - let mut i = 0; - loop { - // User2 buys a ticket. - scenario.next_tx(user2); - mint(user2, 1, &mut scenario); - let coin2 = scenario.take_from_sender>(); - drand_based_scratch_card::buy_ticket(coin2, &game, scenario.ctx()); - scenario.next_tx(user1); - let coin1 = scenario.take_from_sender>(); - assert!(coin1.value() == 1, 1); - scenario.return_to_sender(coin1); - scenario.next_tx(user2); - let ticket = scenario.take_from_sender(); - // Generated using: - // curl https://drand.cloudflare.com/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/58810 - ticket.evaluate( - &game, - x"876b8586ed9522abd0ca596d6e214e9a7e9bedc4a2e9698d27970e892287268062aba93fd1a7c24fcc188a4c7f0a0e98", - scenario.ctx() - ); - scenario.next_tx(user2); - if (scenario.has_most_recent_for_sender()) { - break - }; - i = i + 1; - }; - // This value may change if the object ID is changed. - assert!(i == 3, 1); - - // Claim the reward. - let winner = scenario.take_from_sender(); - scenario.next_tx(user2); - let reward = &mut reward_val; - winner.take_reward(reward, scenario.ctx()); - scenario.next_tx(user2); - let coin2 = scenario.take_from_sender>(); - assert!(coin2.value() == 10, 1); - scenario.return_to_sender(coin2); - - test_scenario::return_shared(reward_val); - test_scenario::return_immutable(game); - scenario.end(); - } - - #[test] - fun test_play_drand_scratch_card_without_winner() { - let user1 = @0x0; - - let mut scenario = test_scenario::begin(user1); - - // Create the game and get back the output objects. - mint(user1, 10, &mut scenario); - let coin1 = scenario.take_from_sender>(); - drand_based_scratch_card::create(coin1, 10, 10, scenario.ctx()); - scenario.next_tx(user1); - let game = scenario.take_immutable(); - let mut reward = scenario.take_shared(); - - // More 4 epochs forward. - scenario.next_epoch(user1); - scenario.next_epoch(user1); - scenario.next_epoch(user1); - scenario.next_epoch(user1); - - // Take back the reward. - reward.redeem(&game, scenario.ctx()); - scenario.next_tx(user1); - let coin1 = scenario.take_from_sender>(); - assert!(coin1.value() == 10, 1); - scenario.return_to_sender(coin1); - - test_scenario::return_shared(reward); - test_scenario::return_immutable(game); - scenario.end(); - } -} diff --git a/sui_programmability/examples/games/tests/rock_paper_scissors_tests.move b/sui_programmability/examples/games/tests/rock_paper_scissors_tests.move deleted file mode 100644 index eed46feea6f3b..0000000000000 --- a/sui_programmability/examples/games/tests/rock_paper_scissors_tests.move +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module games::rock_paper_scissors_tests { - use games::rock_paper_scissors::{Self as game, Game, PlayerTurn, Secret, ThePrize}; - use sui::test_scenario::{Self}; - use std::hash; - - #[test] - fun play_rock_paper_scissors() { - // So these are our heroes. - let the_main_guy = @0xA1C05; - let mr_lizard = @0xA55555; - let mr_spock = @0x590C; - - let mut scenario = test_scenario::begin(the_main_guy); - - // Let the game begin! - game::new_game(mr_spock, mr_lizard, scenario.ctx()); - - // Mr Spock makes his move. He does it secretly and hashes the gesture with a salt - // so that only he knows what it is. - scenario.next_tx(mr_spock); - { - let hash = hash(game::rock(), b"my_phaser_never_failed_me!"); - game::player_turn(the_main_guy, hash, scenario.ctx()); - }; - - // Now it's time for The Main Guy to accept his turn. - scenario.next_tx(the_main_guy); - { - let mut game = scenario.take_from_sender(); - let cap = scenario.take_from_sender(); - - assert!(game.status() == 0, 0); // STATUS_READY - - game.add_hash(cap); - - assert!(game.status() == 1, 0); // STATUS_HASH_SUBMISSION - - scenario.return_to_sender(game); - }; - - // Same for Mr Lizard. He uses his secret phrase to encode his turn. - scenario.next_tx(mr_lizard); - { - let hash = hash(game::scissors(), b"sssssss_you_are_dead!"); - game::player_turn(the_main_guy, hash, scenario.ctx()); - }; - - scenario.next_tx(the_main_guy); - { - let mut game = scenario.take_from_sender(); - let cap = scenario.take_from_sender(); - game.add_hash(cap); - - assert!(game.status() == 2, 0); // STATUS_HASHES_SUBMITTED - - scenario.return_to_sender(game); - }; - - // Now that both sides made their moves, it's time for Mr Spock and Mr Lizard to - // reveal their secrets. The Main Guy will then be able to determine the winner. Who's - // gonna win The Prize? We'll see in a bit! - scenario.next_tx(mr_spock); - game::reveal(the_main_guy, b"my_phaser_never_failed_me!", scenario.ctx()); - - scenario.next_tx(the_main_guy); - { - let mut game = scenario.take_from_sender(); - let secret = scenario.take_from_sender(); - game.match_secret(secret); - - assert!(game.status() == 3, 0); // STATUS_REVEALING - - scenario.return_to_sender(game); - }; - - scenario.next_tx(mr_lizard); - game::reveal(the_main_guy, b"sssssss_you_are_dead!", scenario.ctx()); - - // The final step. The Main Guy matches and reveals the secret of the Mr Lizard and - // calls the [`select_winner`] function to release The Prize. - scenario.next_tx(the_main_guy); - { - let mut game = scenario.take_from_sender(); - let secret = scenario.take_from_sender(); - game.match_secret(secret); - - assert!(game.status() == 4, 0); // STATUS_REVEALED - - game.select_winner(scenario.ctx()); - }; - - scenario.next_tx(mr_spock); - // If it works, then MrSpock is in possession of the prize; - let prize = scenario.take_from_sender(); - // Don't forget to give it back! - scenario.return_to_sender(prize); - scenario.end(); - } - - // Copy of the hashing function from the main module. - fun hash(gesture: u8, mut salt: vector): vector { - salt.push_back(gesture); - hash::sha2_256(salt) - } -} diff --git a/sui_programmability/examples/games/tests/shared_tic_tac_toe_tests.move b/sui_programmability/examples/games/tests/shared_tic_tac_toe_tests.move deleted file mode 100644 index 0cc0fc8e322d4..0000000000000 --- a/sui_programmability/examples/games/tests/shared_tic_tac_toe_tests.move +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module games::shared_tic_tac_toe_tests { - use sui::test_scenario::{Self, Scenario}; - use games::shared_tic_tac_toe::{Self, TicTacToe, Trophy}; - - const IN_PROGRESS: u8 = 0; - const X_WIN: u8 = 1; - const DRAW: u8 = 3; - - #[test] - fun play_tictactoe() { - let player_x = @0x0; - let player_o = @0x1; - - // Anyone can create a game, because the game object will be eventually shared. - let mut scenario_val = test_scenario::begin(player_x); - let scenario = &mut scenario_val; - shared_tic_tac_toe::create_game(copy player_x, copy player_o, scenario.ctx()); - // Player1 places an X in (1, 1). - place_mark(1, 1, player_x, scenario); - /* - Current game board: - _|_|_ - _|X|_ - | | - */ - - // Player2 places an O in (0, 0). - place_mark(0, 0, player_o, scenario); - /* - Current game board: - O|_|_ - _|X|_ - | | - */ - - // Player1 places an X in (0, 2). - place_mark(0, 2, player_x, scenario); - /* - Current game board: - O|_|X - _|X|_ - | | - */ - - // Player2 places an O in (1, 0). - let mut status = place_mark(1, 0, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|_|X - O|X|_ - | | - */ - - // Opportunity for Player1! Player1 places an X in (2, 0). - status = place_mark(2, 0, player_x, scenario); - /* - Current game board: - O|_|X - O|X|_ - X| | - */ - - // Check that X has won! - assert!(status == X_WIN, 2); - - // X has the Trophy - scenario.next_tx(player_x); - assert!( - scenario.has_most_recent_for_sender(), - 1 - ); - - scenario.next_tx(player_o); - // O has no Trophy - assert!( - !scenario.has_most_recent_for_sender(), - 2 - ); - scenario_val.end(); - } - - - #[test] - fun play_tictactoe_draw() { - let player_x = @0x0; - let player_o = @0x1; - - // Anyone can create a game, because the game object will be eventually shared. - let mut scenario_val = test_scenario::begin(player_x); - let scenario = &mut scenario_val; - shared_tic_tac_toe::create_game(copy player_x, copy player_o, scenario.ctx()); - // Player1 places an X in (0, 1). - let mut status = place_mark(0, 1, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - _|X|_ - _|_|_ - | | - */ - - // Player2 places an O in (0, 0). - status = place_mark(0, 0, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|_|_ - | | - */ - - // Player1 places an X in (1, 1). - status = place_mark(1, 1, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|X|_ - | | - */ - - // Player2 places an O in (2, 1). - status = place_mark(2, 1, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|X|_ - |O| - */ - - // Player1 places an X in (2, 0). - status = place_mark(2, 0, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|X|_ - X|O| - */ - - // Player2 places an O in (0, 2). - status = place_mark(0, 2, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|O - _|X|_ - X|O| - */ - - // Player1 places an X in (1, 2). - status = place_mark(1, 2, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|O - _|X|X - X|O| - */ - - // Player2 places an O in (1, 0). - status = place_mark(1, 0, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|O - O|X|X - X|O| - */ - - // Player1 places an X in (2, 2). - status = place_mark(2, 2, player_x, scenario); - /* - Current game board: - O|X|O - O|X|X - X|O|X - */ - - // We have a draw. - assert!(status == DRAW, 2); - - // No one has the trophy - scenario.next_tx(player_x); - assert!( - !scenario.has_most_recent_for_sender(), - 1 - ); - scenario.next_tx(player_o); - assert!( - !scenario.has_most_recent_for_sender(), - 1 - ); - scenario_val.end(); - } - - - fun place_mark( - row: u8, - col: u8, - player: address, - scenario: &mut Scenario, - ): u8 { - // The gameboard is now a shared object. - // Any player can place a mark on it directly. - scenario.next_tx(player); - let status; - { - let mut game_val = scenario.take_shared(); - let game = &mut game_val; - game.place_mark(row, col, scenario.ctx()); - status = game.get_status(); - test_scenario::return_shared(game_val); - }; - status - } -} diff --git a/sui_programmability/examples/games/tests/tic_tac_toe_tests.move b/sui_programmability/examples/games/tests/tic_tac_toe_tests.move deleted file mode 100644 index cb568cb7aabaa..0000000000000 --- a/sui_programmability/examples/games/tests/tic_tac_toe_tests.move +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module games::tic_tac_toe_tests { - use sui::test_scenario::{Self, Scenario}; - use games::tic_tac_toe::{Self, Mark, MarkMintCap, TicTacToe, Trophy}; - - const IN_PROGRESS: u8 = 0; - const X_WIN: u8 = 1; - const DRAW: u8 = 3; - - #[test] - fun play_tictactoe() { - let admin = @0x0; - let player_x = @0x1; - let player_o = @0x2; - - let mut scenario_val = test_scenario::begin(admin); - let scenario = &mut scenario_val; - // Admin creates a game - tic_tac_toe::create_game(player_x, player_o, scenario.ctx()); - // Player1 places an X in (1, 1). - place_mark(1, 1, admin, player_x, scenario); - /* - Current game board: - _|_|_ - _|X|_ - | | - */ - - // Player2 places an O in (0, 0). - place_mark(0, 0, admin, player_o, scenario); - /* - Current game board: - O|_|_ - _|X|_ - | | - */ - - // Player1 places an X in (0, 2). - place_mark(0, 2, admin, player_x, scenario); - /* - Current game board: - O|_|X - _|X|_ - | | - */ - - // Player2 places an O in (1, 0). - let mut status = place_mark(1, 0, admin, player_o, scenario); - /* - Current game board: - O|_|X - O|X|_ - | | - */ - - // Opportunity for Player1! Player1 places an X in (2, 0). - assert!(status == IN_PROGRESS, 1); - status = place_mark(2, 0, admin, player_x, scenario); - - /* - Current game board: - O|_|X - O|X|_ - X| | - */ - - // Check that X has won! - assert!(status == X_WIN, 2); - - // X has the trophy - scenario.next_tx(player_x); - assert!( - scenario.has_most_recent_for_sender(), - 1 - ); - - scenario.next_tx(player_o); - // O has no Trophy - assert!( - !scenario.has_most_recent_for_sender(), - 1 - ); - scenario_val.end(); - } - - - #[test] - fun play_tictactoe_draw() { - let admin = @0x0; - let player_x = @0x1; - let player_o = @0x2; - - let mut scenario_val = test_scenario::begin(admin); - let scenario = &mut scenario_val; - - tic_tac_toe::create_game(player_x, player_o, scenario.ctx()); - // Player1 places an X in (0, 1). - let mut status = place_mark(0, 1, admin, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - _|X|_ - _|_|_ - | | - */ - - // Player2 places an O in (0, 0). - status = place_mark(0, 0, admin, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|_|_ - | | - */ - - // Player1 places an X in (1, 1). - status = place_mark(1, 1, admin, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|X|_ - | | - */ - - // Player2 places an O in (2, 1). - status = place_mark(2, 1, admin, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|X|_ - |O| - */ - - // Player1 places an X in (2, 0). - status = place_mark(2, 0, admin, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|_ - _|X|_ - X|O| - */ - - // Player2 places an O in (0, 2). - status = place_mark(0, 2, admin, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|O - _|X|_ - X|O| - */ - - // Player1 places an X in (1, 2). - status = place_mark(1, 2, admin, player_x, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|O - _|X|X - X|O| - */ - - // Player2 places an O in (1, 0). - status = place_mark(1, 0, admin, player_o, scenario); - assert!(status == IN_PROGRESS, 1); - /* - Current game board: - O|X|O - O|X|X - X|O| - */ - - // Player1 places an X in (2, 2). - status = place_mark(2, 2, admin, player_x, scenario); - /* - Current game board: - O|X|O - O|X|X - X|O|X - */ - - // We have a draw. - assert!(status == DRAW, 2); - - // No one has the trophy - scenario.next_tx(player_x); - assert!( - !scenario.has_most_recent_for_sender(), - 1 - ); - scenario.next_tx(player_o); - assert!( - !scenario.has_most_recent_for_sender(), - 1 - ); - scenario_val.end(); - } - - fun place_mark( - row: u64, - col: u64, - admin: address, - player: address, - scenario: &mut Scenario, - ): u8 { - // Step 1: player creates a mark and sends it to the game. - scenario.next_tx(player); - { - let mut cap = scenario.take_from_sender(); - cap.send_mark_to_game(admin, row, col, scenario.ctx()); - scenario.return_to_sender(cap); - }; - // Step 2: Admin places the received mark on the game board. - scenario.next_tx(admin); - let status; - { - let mut game = scenario.take_from_sender(); - let mark = scenario.take_from_sender(); - assert!(mark.mark_player() == &player, 0); - assert!(mark.mark_row() == row, 1); - assert!(mark.mark_col() == col, 2); - game.place_mark(mark, scenario.ctx()); - status = game.get_status(); - scenario.return_to_sender(game); - }; - // return the game status - status - } -} diff --git a/sui_programmability/examples/games/tests/vdf_based_lottery_tests.move b/sui_programmability/examples/games/tests/vdf_based_lottery_tests.move deleted file mode 100644 index 61631f420d55f..0000000000000 --- a/sui_programmability/examples/games/tests/vdf_based_lottery_tests.move +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module games::vdf_based_lottery_tests { - use sui::test_scenario as ts; - use sui::clock; - use games::vdf_based_lottery::{Self, Game, GameWinner}; - - #[test] - #[expected_failure(abort_code = games::vdf_based_lottery::ESubmissionPhaseInProgress)] - fun test_complete_too_early() { - let user1 = @0x0; - - let mut ts = ts::begin(user1); - let mut clock = clock::create_for_testing(ts.ctx()); - - vdf_based_lottery::create(1000, 1000, &clock, ts.ctx()); - ts.next_tx(user1); - let mut game = ts.take_shared(); - - // User1 buys a ticket. - ts.next_tx(user1); - let t1 = game.participate(b"user1 randomness", &clock, ts.ctx()); - - // Increment time but still in submission phase - clock.increment_for_testing(500); - - // User1 tries to complete the lottery too early. - ts.next_tx(user1); - game.complete( - x"c0014d00b5e624fe10d1cc1e593c0ffb8c3084e49bb70efc4337640a73990bb29dfb430b55710475bcc7524c77627d8067415fffa63e0e84b1204225520fea384999719c66dbdc6e91863d99c64674af971631b56e22b7cc780765bf12d53edea1dadf566f80a62769e287a1e195596d4894b2e1360e451cbf06864762275b4d5063871d45627dea2e42ab93d5345bf172b9724216627abbf295b35a8e64e13e585bca54848a90212c9f7a3adffc25c3b87eefa7d4ab1660b523bf6410b9a9ea0e00c001327d73bebc768d150beb2a1b0de9e80c69ed594ae7787d548af44eb1e0a03616100133146c9c1202ea3a35c331864f3bfe59ffa3c88d6acb8af7a4b1b5ea842c4c4c88d415539389e614876d738d80217a3ad16d001f2de60f62b04a9d8de7ccb4716c3368f0d42e3e719dbb07bdb4355f0e5569714fbcc130f30ac7b49a5b207a444c7e00a0c27edae10c28b05f87545f337283f90c4e4ed69639683154d6a89e6589db4d18702d3a29705b434dc32e10fcbd3c62d1da20b45dba511bcecdf7c101009db7911c39f3937785dd8bd0e9db56c94777bdd867897493f82e0931e0e5facb730c3aa400f815f3d2f61de94373209dcbf9210c5e1f179b675adce2be7159238cb5f89c568004ccfc75d1b3de99a060255bcd6c9dd9a674844251ec27c48119b870f4ce63cac2081541c4269bbfa60148f9dbf2c60c76099a6538a33e88c24ce092e6aad9bdfff330470ffb87b01b666dd98e44843b41896f2be688361fe062692b441b4dd8f8ecfa96948d13daf486259bb8934cab7e9d9788da0eac7edf56", - x"c0010f1ea16b16f3fc46eb0b00a516092a6ab389e259a3013eee5e39e130702de85954b8aac435e724ad0bfd210ab7789fb91b54ac4352154f3251e0a87ccfd2c9a57d26468a384f527e129fc82b33c04b3ebbec3a99967798a95b39820c35ea015fdf4c81e143004b34b99e63462cf350689b2abdd6c3903adcbe55781d3a89c89dc571c312f9a80911a9d64884747319574b3a4ded25478e6d64b9cfb25d9c67366bc25d9ac99bcdba16665158da50a2ba179893292c4b7e76502ecaba1337d693c001fb3867669e0d4e45aa43d959dbe33c3d35b00e8414d1cf1bb9552726bb95bafa0a2c12a014a3b8fb0bd5ab9a40430ff59364b19d58d80665fee0bfee272a38c45413a3688832bf9bcacf7b5723436c120878f85ce084e72b13246ecfec7cd6a5d79e13296bbb51af785c10afe6c4f07f43a5bc711dc398271185d700b1695310d8e428ad3bc6b81a4faac2f5009b723460dbd260c940dfac06e34854d204dc779f94ab3f67847a7b90855dadc3962871c022e172e96b39a08648e045e14dad87c10102f976797f14be801a441f19771a4835640a74cf7c6ad216f18d9cdaf461bb56a897b804e053cd6cc68d659bd9f0ed985f094932d306c1bd76450bd349db3a81008d7591bc826a36583c3c361add7a8f245d18007d79704d79ae27eb08b52a44af17e2f23b441919049f061d69bac3a09c3e15074e4d75cf82f42dbff1c62ddc94fe6167ccb7265e7eab0def7d30d97be441ad763705dd30d4040815996e34643bf6d7a4f06c22aa5d6d5dd30253ea8aa59607724bb71f5425a5e7fee03b7e9fe8", - &clock - ); - - t1.delete(); - - sui::clock::destroy_for_testing(clock); - ts::return_shared(game); - ts.end(); - } - - #[test] - fun test_play_vdf_lottery() { - let user1 = @0x0; - let user2 = @0x1; - let user3 = @0x2; - let user4 = @0x3; - - let mut ts = ts::begin(user1); - let mut clock = clock::create_for_testing(ts.ctx()); - - vdf_based_lottery::create(1000, 1000, &clock, ts.ctx()); - ts.next_tx(user1); - let mut game = ts.take_shared(); - - // User1 buys a ticket. - ts.next_tx(user1); - let t1 = game.participate(b"user1 randomness", &clock, ts.ctx()); - // User2 buys a ticket. - ts.next_tx(user2); - let t2 = game.participate(b"user2 randomness", &clock, ts.ctx()); - // User3 buys a ticket - ts.next_tx(user3); - let t3 = game.participate(b"user3 randomness", &clock, ts.ctx()); - // User4 buys a ticket - ts.next_tx(user4); - let t4 = game.participate(b"user4 randomness", &clock, ts.ctx()); - - // Increment time to after submission phase has ended - clock.increment_for_testing(1000); - - // User3 completes by submitting output and proof of the VDF - ts.next_tx(user3); - game.complete( - x"c0014d00b5e624fe10d1cc1e593c0ffb8c3084e49bb70efc4337640a73990bb29dfb430b55710475bcc7524c77627d8067415fffa63e0e84b1204225520fea384999719c66dbdc6e91863d99c64674af971631b56e22b7cc780765bf12d53edea1dadf566f80a62769e287a1e195596d4894b2e1360e451cbf06864762275b4d5063871d45627dea2e42ab93d5345bf172b9724216627abbf295b35a8e64e13e585bca54848a90212c9f7a3adffc25c3b87eefa7d4ab1660b523bf6410b9a9ea0e00c001327d73bebc768d150beb2a1b0de9e80c69ed594ae7787d548af44eb1e0a03616100133146c9c1202ea3a35c331864f3bfe59ffa3c88d6acb8af7a4b1b5ea842c4c4c88d415539389e614876d738d80217a3ad16d001f2de60f62b04a9d8de7ccb4716c3368f0d42e3e719dbb07bdb4355f0e5569714fbcc130f30ac7b49a5b207a444c7e00a0c27edae10c28b05f87545f337283f90c4e4ed69639683154d6a89e6589db4d18702d3a29705b434dc32e10fcbd3c62d1da20b45dba511bcecdf7c101009db7911c39f3937785dd8bd0e9db56c94777bdd867897493f82e0931e0e5facb730c3aa400f815f3d2f61de94373209dcbf9210c5e1f179b675adce2be7159238cb5f89c568004ccfc75d1b3de99a060255bcd6c9dd9a674844251ec27c48119b870f4ce63cac2081541c4269bbfa60148f9dbf2c60c76099a6538a33e88c24ce092e6aad9bdfff330470ffb87b01b666dd98e44843b41896f2be688361fe062692b441b4dd8f8ecfa96948d13daf486259bb8934cab7e9d9788da0eac7edf56", - x"c0010f1ea16b16f3fc46eb0b00a516092a6ab389e259a3013eee5e39e130702de85954b8aac435e724ad0bfd210ab7789fb91b54ac4352154f3251e0a87ccfd2c9a57d26468a384f527e129fc82b33c04b3ebbec3a99967798a95b39820c35ea015fdf4c81e143004b34b99e63462cf350689b2abdd6c3903adcbe55781d3a89c89dc571c312f9a80911a9d64884747319574b3a4ded25478e6d64b9cfb25d9c67366bc25d9ac99bcdba16665158da50a2ba179893292c4b7e76502ecaba1337d693c001fb3867669e0d4e45aa43d959dbe33c3d35b00e8414d1cf1bb9552726bb95bafa0a2c12a014a3b8fb0bd5ab9a40430ff59364b19d58d80665fee0bfee272a38c45413a3688832bf9bcacf7b5723436c120878f85ce084e72b13246ecfec7cd6a5d79e13296bbb51af785c10afe6c4f07f43a5bc711dc398271185d700b1695310d8e428ad3bc6b81a4faac2f5009b723460dbd260c940dfac06e34854d204dc779f94ab3f67847a7b90855dadc3962871c022e172e96b39a08648e045e14dad87c10102f976797f14be801a441f19771a4835640a74cf7c6ad216f18d9cdaf461bb56a897b804e053cd6cc68d659bd9f0ed985f094932d306c1bd76450bd349db3a81008d7591bc826a36583c3c361add7a8f245d18007d79704d79ae27eb08b52a44af17e2f23b441919049f061d69bac3a09c3e15074e4d75cf82f42dbff1c62ddc94fe6167ccb7265e7eab0def7d30d97be441ad763705dd30d4040815996e34643bf6d7a4f06c22aa5d6d5dd30253ea8aa59607724bb71f5425a5e7fee03b7e9fe8", - &clock - ); - - // User1 is the winner since the mod of the hash results in 0. - ts.next_tx(user1); - assert!(!ts::has_most_recent_for_address(user1), 1); - let winner = game.redeem(&t1, ts.ctx()); - - // Make sure User1 now has a winner ticket for the right game id. - ts.next_tx(user1); - assert!(winner.game_id() == t1.game_id(), 1); - - t1.delete(); - t2.delete(); - t3.delete(); - t4.delete(); - winner.delete(); - - clock.destroy_for_testing(); - ts::return_shared(game); - ts.end(); - } - - #[test] - #[expected_failure(abort_code = games::vdf_based_lottery::EInvalidVdfProof)] - fun test_invalid_vdf_output() { - let user1 = @0x0; - let user2 = @0x1; - let user3 = @0x2; - let user4 = @0x3; - - let mut ts = ts::begin(user1); - let mut clock = clock::create_for_testing(ts.ctx()); - - vdf_based_lottery::create(1000, 1000, &clock, ts.ctx()); - ts.next_tx(user1); - let mut game = ts.take_shared(); - - // User1 buys a ticket. - ts.next_tx(user1); - let t1 = game.participate(b"user1 randomness", &clock, ts.ctx()); - // User2 buys a ticket. - ts.next_tx(user2); - let t2 = game.participate(b"user2 randomness", &clock, ts.ctx()); - // User3 buys a ticket - ts.next_tx(user3); - let t3 = game.participate(b"user3 randomness", &clock, ts.ctx()); - // User4 buys a ticket - ts.next_tx(user4); - let t4 = game.participate(b"user4 randomness", &clock, ts.ctx()); - - // Increment time to after submission phase has ended - clock.increment_for_testing(1000); - - // User3 completes by submitting output and proof of the VDF - ts.next_tx(user3); - game.complete( - x"c001503be6eff558a40ba145da5aa9d1270367f32cde44c1601846cdd3d0911abce8ab6adb6b82682b45107545e9ae1efca44dd6f3ba8d95a687652b94f479f6b1a37156c44194d6bc5f266098b75251b12de6fa67de6aea14250c0481694db5f24db5e3c89da3354aafc10c4bd0371f9a175d1b5b193190c4c1089ed7a95dc07f1ce29021b55f3aaa7eb65725d61277f0996b783c005a919ba121d81f211f63d188ac525056235504fe4858765dc6498362d98e8540287a0ff78424c18de53abe46c0014f847bd49f599960fe3c3b7cfc571cd854c7d21b0e9984070f7e168c872a6e6480d8fd37d30602f57a237b83ae961e6a4acb94b78c32d04f06058bda037d6ad313c81f823db25c53c265b02a29008f727f95010c82b0cf8745e77a7f4000dac929ba83a4594482b4e6ff59c93a78df5c816f244914329c145e288fd3fd4800a1cc2df23f386112e569608e6de40ee65fe870960b4e3fee4bb188d8db0dd5df3c2384eb24a797eb20cf8524d563663ccde866a405e2713cfafdb760e50c77a797c10100a31fc5ca0a91aa788d5f5df17a1433f1a0e6e4da440ce935b1b48dc6868c8fc00d7ee725ce21797a6c4440af02570466081479e99eee1a5b509a3e1ac2e000ed386c35d9fadd130df2a292fa5f9aa2c195c48c9d11e58ac98c8dbd2169721ed2d2c9f5544de17deeaa9655360ed7baa46820f5e008af1e3f028d819dee3fee50ab55b266385dfc8f65f7f0c1b6149e5295bfefb83b14db3a30b2cefd1495ba4e5ae39d2b729f9644fc28764d03243fad3e61145ed83cbf2708b60c0b7cac7148", - x"0101010180032cf35709e1301d02b40a0dbe3dadfe6ec1eeba8fb8060a1decd0c7a126ea3f27fadcad81435601b0e0abca5c89173ef639e5a88043aa29801e6799e430b509e479b57af981f9ddd48d3a8d5919f99258081557a08270bb441233c78030a01e03ec199b5e3eef5ccc9b1a3d4841cbe4ff529c22a8cd1b1b0075338d864e3890942df6b007d2c3e3a8ef1ce7490c6bbec5372adfcbf8704a1ffc9a69db8d9cdc54762f019036e450e457325eef74b794f3f16ff327d68079a5b9de49163d7323937374f8a785a8f9afe84d6a71b336e4de00f239ee3af1d7604a3985e610e1603bd0e1a4998e19fa0c8920ffd8d61b0a87eeee50ac7c03ff7c4708a34f3bc92fd0103758c954ee34032cee2c78ad8cdc79a35dbc810196b7bf6833e1c45c83b09c0d1b78bc6f8753e10770e7045b08d50b4aa16a75b27a096d5ec1331f1fd0a44e95a8737c20240c90307b5497d3470393c2a00da0649e86d13e820591296c644fc1eef9e7c6ca4967c5e19df3153cd7fbd598c271e11c10397349ddc8cc8452ec", - &clock - ); - - t1.delete(); - t2.delete(); - t3.delete(); - t4.delete(); - - clock.destroy_for_testing(); - ts::return_shared(game); - ts.end(); - } - - #[test] - #[expected_failure(abort_code = games::vdf_based_lottery::EInvalidRandomness)] - fun test_empty_randomness() { - let user1 = @0x0; - - let mut ts = ts::begin(user1); - let clock = clock::create_for_testing(ts.ctx()); - - vdf_based_lottery::create(1000, 1000, &clock, ts.ctx()); - ts.next_tx(user1); - let mut game = ts.take_shared(); - - // User1 buys a ticket, but with wrong randomness length. - ts.next_tx(user1); - let t1 = game.participate(b"abcd", &clock, ts.ctx()); - - t1.delete(); - - sui::clock::destroy_for_testing(clock); - ts::return_shared(game); - ts.end(); - } -} diff --git a/sui_programmability/examples/move_tutorial/Move.toml b/sui_programmability/examples/move_tutorial/Move.toml deleted file mode 100644 index e0ce947a8a29c..0000000000000 --- a/sui_programmability/examples/move_tutorial/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "MyFirstPackage" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -my_first_package = "0x0" diff --git a/sui_programmability/examples/move_tutorial/sources/my_module.move b/sui_programmability/examples/move_tutorial/sources/my_module.move deleted file mode 100644 index b9ada5fd69f50..0000000000000 --- a/sui_programmability/examples/move_tutorial/sources/my_module.move +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module my_first_package::my_module { - - // Part 1: These imports are provided by default - // use sui::object::{Self, UID}; - // use sui::transfer; - // use sui::tx_context::{Self, TxContext}; - - // Part 2: struct definitions - public struct Sword has key, store { - id: UID, - magic: u64, - strength: u64, - } - - public struct Forge has key { - id: UID, - swords_created: u64, - } - - // Part 3: Module initializer to be executed when this module is published - fun init(ctx: &mut TxContext) { - let admin = Forge { - id: object::new(ctx), - swords_created: 0, - }; - - // Transfer the forge object to the module/package publisher - transfer::transfer(admin, ctx.sender()); - } - - // Part 4: Accessors required to read the struct fields - public fun magic(self: &Sword): u64 { - self.magic - } - - public fun strength(self: &Sword): u64 { - self.strength - } - - public fun swords_created(self: &Forge): u64 { - self.swords_created - } - - // Part 5: Public/entry functions (introduced later in the tutorial) - public fun sword_create(magic: u64, strength: u64, ctx: &mut TxContext): Sword { - // Create a sword - Sword { - id: object::new(ctx), - magic: magic, - strength: strength, - } - } - - /// Constructor for creating swords - public fun new_sword( - forge: &mut Forge, - magic: u64, - strength: u64, - ctx: &mut TxContext, - ): Sword { - forge.swords_created = forge.swords_created + 1; - Sword { - id: object::new(ctx), - magic: magic, - strength: strength, - } - } - - // Part 6: Tests - #[test] - fun test_sword_create() { - // Create a dummy TxContext for testing - let mut ctx = tx_context::dummy(); - - // Create a sword - let sword = Sword { - id: object::new(&mut ctx), - magic: 42, - strength: 7, - }; - - // Check if accessor functions return correct values - assert!(sword.magic() == 42 && sword.strength() == 7, 1); - - // Create a dummy address and transfer the sword - let dummy_address = @0xCAFE; - transfer::public_transfer(sword, dummy_address); - } - - #[test] - fun test_sword_transactions() { - use sui::test_scenario; - - // Create test addresses representing users - let initial_owner = @0xCAFE; - let final_owner = @0xFACE; - - // First transaction executed by initial owner to create the sword - let mut scenario = test_scenario::begin(initial_owner); - { - // Create the sword and transfer it to the initial owner - let sword = sword_create(42, 7, scenario.ctx()); - transfer::public_transfer(sword, initial_owner); - }; - - // Second transaction executed by the initial sword owner - scenario.next_tx(initial_owner); - { - // Extract the sword owned by the initial owner - let sword = scenario.take_from_sender(); - // Transfer the sword to the final owner - transfer::public_transfer(sword, final_owner); - }; - - // Third transaction executed by the final sword owner - scenario.next_tx(final_owner); - { - // Extract the sword owned by the final owner - let sword = scenario.take_from_sender(); - // Verify that the sword has expected properties - assert!(sword.magic() == 42 && sword.strength() == 7, 1); - // Return the sword to the object pool (it cannot be simply "dropped") - scenario.return_to_sender(sword) - }; - scenario.end(); - } - - #[test] - fun test_module_init() { - use sui::test_scenario; - - // Create test addresses representing users - let admin = @0xAD; - let initial_owner = @0xCAFE; - - // First transaction to emulate module initialization - let mut scenario = test_scenario::begin(admin); - { - init(scenario.ctx()); - }; - - // Second transaction to check if the forge has been created - // and has initial value of zero swords created - scenario.next_tx(admin); - { - // Extract the Forge object - let forge = scenario.take_from_sender(); - // Verify number of created swords - assert!(forge.swords_created() == 0, 1); - // Return the Forge object to the object pool - scenario.return_to_sender(forge); - }; - - // Third transaction executed by admin to create the sword - scenario.next_tx(admin); - { - let mut forge = scenario.take_from_sender(); - // Create the sword and transfer it to the initial owner - let sword = forge.new_sword(42, 7, scenario.ctx()); - transfer::public_transfer(sword, initial_owner); - scenario.return_to_sender(forge); - }; - scenario.end(); - } -} diff --git a/sui_programmability/examples/multi_package/README.md b/sui_programmability/examples/multi_package/README.md deleted file mode 100644 index f8cb10b284dd5..0000000000000 --- a/sui_programmability/examples/multi_package/README.md +++ /dev/null @@ -1,5 +0,0 @@ -An example of how to structure your code to include another user-level package as a dependency. - -Make sure that the dependency name (in this example DepPackage in main_package/Move.toml file's -`[dependencies]` section) is the same as the name of the package (in dep_package/Move.toml file's -`[package]` section). diff --git a/sui_programmability/examples/multi_package/dep_package/Move.toml b/sui_programmability/examples/multi_package/dep_package/Move.toml deleted file mode 100644 index c7a0a7bf5805b..0000000000000 --- a/sui_programmability/examples/multi_package/dep_package/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "DepPackage" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -dep_package = "0x0" diff --git a/sui_programmability/examples/multi_package/dep_package/sources/dep_module.move b/sui_programmability/examples/multi_package/dep_package/sources/dep_module.move deleted file mode 100644 index 5f39a4d557dd9..0000000000000 --- a/sui_programmability/examples/multi_package/dep_package/sources/dep_module.move +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module dep_package::dep_module { - - public fun foo(): u64 { - 42 - } - -} diff --git a/sui_programmability/examples/multi_package/main_package/Move.toml b/sui_programmability/examples/multi_package/main_package/Move.toml deleted file mode 100644 index f220f8d07c53a..0000000000000 --- a/sui_programmability/examples/multi_package/main_package/Move.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "MainPackage" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } -DepPackage = { local = "../dep_package" } - -[addresses] -main_package = "0x0" diff --git a/sui_programmability/examples/multi_package/main_package/sources/main_module.move b/sui_programmability/examples/multi_package/main_package/sources/main_module.move deleted file mode 100644 index 5ab8350df17b2..0000000000000 --- a/sui_programmability/examples/multi_package/main_package/sources/main_module.move +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[allow(unused_function)] -module main_package::main_module { - use dep_package::dep_module; - - fun foo(): u64 { - dep_module::foo() - } - -} diff --git a/sui_programmability/examples/nfts/Move.toml b/sui_programmability/examples/nfts/Move.toml deleted file mode 100644 index 03fd053678170..0000000000000 --- a/sui_programmability/examples/nfts/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "NFTs" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -nfts = "0x0" diff --git a/sui_programmability/examples/nfts/README.md b/sui_programmability/examples/nfts/README.md deleted file mode 100644 index 6ffc53c203c15..0000000000000 --- a/sui_programmability/examples/nfts/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# NFTs - -* Num: Issuing the first ten natural numbers as collectible NFT's. -* Marketplace: An opensea-like marketplace built with shared objects. -* geniteam: NFTs representing collectible monsters and cosmetics used in a farming game. -* Auction: example implementation of an [English auction](https://en.wikipedia.org/wiki/English_auction) using single-owner objects only. -* SharedAuction: example implementation of an [English auction](https://en.wikipedia.org/wiki/English_auction) using shared objects. -* ImageNFT: an NFT wrapping a URL pointing to an image stored off-chain (coming in future). diff --git a/sui_programmability/examples/nfts/sources/auction.move b/sui_programmability/examples/nfts/sources/auction.move deleted file mode 100644 index 02c27f764ec92..0000000000000 --- a/sui_programmability/examples/nfts/sources/auction.move +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This module is an implementation of an English auction -/// (https://en.wikipedia.org/wiki/English_auction) using single-owner -/// objects only. There are three types of parties participating in an -/// auction: -/// - auctioneer - a trusted party that runs the auction -/// - owner - the original owner of an item that is sold at an -/// auction; the owner submits a request to an auctioneer which runs -/// the auction -/// - bidders - parties interested in purchasing items sold -/// at an auction; they submit bids to an auctioneer to affect the -/// state of an auction -/// -/// A typical lifetime of an auction looks as follows: -/// - The auction starts with the owner sending an item to be sold along with -/// its own address to the auctioneer who creates and initializes an -/// auction. -/// - Bidders send their bid to the auctioneer. -/// A bid consists of the funds offered for the item and the bidder's address. -/// - The auctioneer periodically inspects the bids: -/// - (inspected bid > current best bid (initially there is no bid)): -/// The auctioneer updates the auction with the current bid -/// and the funds of the previous highest bid are sent back to their owner. -/// - (inspected bid <= current best bid): -/// The auctioneer sents the inspected bid's funds back to the new bidder, -/// and the auction remains unchanged. -/// - The auctioneer eventually ends the auction: -/// - if no bids were received, the item goes back to the original owner -/// - otherwise the funds accumulated in the auction go to the -/// original owner and the item goes to the bidder that won the auction - -module nfts::auction { - use sui::coin::{Self, Coin}; - use sui::balance::Balance; - use sui::sui::SUI; - - use nfts::auction_lib::{Self, Auction}; - - // Error codes. - - /// A bid submitted for the wrong (e.g. non-existent) auction. - const EWrongAuction: u64 = 1; - - /// Represents a bid sent by a bidder to the auctioneer. - public struct Bid has key { - id: UID, - /// Address of the bidder - bidder: address, - /// ID of the Auction object this bid is intended for - auction_id: ID, - /// Coin used for bidding. - bid: Balance - } - - // Entry functions. - - /// Creates an auction. It would be more natural to generate - /// auction_id in create_auction and be able to return it so that - /// it can be shared with bidders but we cannot do this at the - /// moment. This is executed by the owner of the asset to be - /// auctioned. - public fun create_auction( - to_sell: T, auctioneer: address, ctx: &mut TxContext - ): ID { - let auction = auction_lib::create_auction(to_sell, ctx); - let id = object::id(&auction); - auction_lib::transfer(auction, auctioneer); - id - } - - /// Creates a bid a and send it to the auctioneer along with the - /// ID of the auction. This is executed by a bidder. - public fun bid( - coin: Coin, auction_id: ID, auctioneer: address, ctx: &mut TxContext - ) { - let bid = Bid { - id: object::new(ctx), - bidder: tx_context::sender(ctx), - auction_id, - bid: coin::into_balance(coin), - }; - - transfer::transfer(bid, auctioneer); - } - - /// Updates the auction based on the information in the bid - /// (update auction if higher bid received and send coin back for - /// bids that are too low). This is executed by the auctioneer. - public entry fun update_auction( - auction: &mut Auction, bid: Bid, ctx: &mut TxContext - ) { - let Bid { id, bidder, auction_id, bid: balance } = bid; - assert!(object::borrow_id(auction) == &auction_id, EWrongAuction); - auction_lib::update_auction(auction, bidder, balance, ctx); - - object::delete(id); - } - - /// Ends the auction - transfers item to the currently highest - /// bidder or to the original owner if no bids have been - /// placed. This is executed by the auctioneer. - public entry fun end_auction( - auction: Auction, ctx: &mut TxContext - ) { - auction_lib::end_and_destroy_auction(auction, ctx); - } -} diff --git a/sui_programmability/examples/nfts/sources/auction_lib.move b/sui_programmability/examples/nfts/sources/auction_lib.move deleted file mode 100644 index 0c969e0e57cfa..0000000000000 --- a/sui_programmability/examples/nfts/sources/auction_lib.move +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This is a helper module for implementing two versions of an -/// English auction (https://en.wikipedia.org/wiki/English_auction), -/// one using single-owner objects only and the other using shared -/// objects. -module nfts::auction_lib { - use sui::coin; - use sui::balance::{Self, Balance}; - use sui::sui::SUI; - - /// Stores information about an auction bid. - public struct BidData has store { - /// Coin representing the current (highest) bid. - funds: Balance, - /// Address of the highest bidder. - highest_bidder: address, - } - - /// Maintains the state of the auction owned by a trusted - /// auctioneer. - public struct Auction has key { - id: UID, - /// Item to be sold. It only really needs to be wrapped in - /// Option if Auction represents a shared object but we do it - /// for single-owner Auctions for better code re-use. - to_sell: Option, - /// Owner of the time to be sold. - owner: address, - /// Data representing the highest bid (starts with no bid) - bid_data: Option, - } - - public(package) fun auction_owner(auction: &Auction): address { - auction.owner - } - - /// Creates an auction. This is executed by the owner of the asset to be - /// auctioned. - public(package) fun create_auction( - to_sell: T, ctx: &mut TxContext - ): Auction { - // A question one might asked is how do we know that to_sell - // is owned by the caller of this entry function and the - // answer is that it's checked by the runtime. - Auction { - id: object::new(ctx), - to_sell: option::some(to_sell), - owner: tx_context::sender(ctx), - bid_data: option::none(), - } - } - - /// Updates the auction based on the information in the bid - /// (update auction if higher bid received and send coin back for - /// bids that are too low). - public fun update_auction( - auction: &mut Auction, - bidder: address, - funds: Balance, - ctx: &mut TxContext, - ) { - if (option::is_none(&auction.bid_data)) { - // first bid - let bid_data = BidData { - funds, - highest_bidder: bidder, - }; - option::fill(&mut auction.bid_data, bid_data); - } else { - let prev_bid_data = option::borrow(&auction.bid_data); - if (balance::value(&funds) > balance::value(&prev_bid_data.funds)) { - // a bid higher than currently highest bid received - let new_bid_data = BidData { - funds, - highest_bidder: bidder - }; - - // update auction to reflect highest bid - let BidData { - funds, - highest_bidder - } = option::swap(&mut auction.bid_data, new_bid_data); - - // transfer previously highest bid to its bidder - send_balance(funds, highest_bidder, ctx); - } else { - // a bid is too low - return funds to the bidder - send_balance(funds, bidder, ctx); - } - } - } - - /// Ends the auction - transfers item to the currently highest - /// bidder or to the original owner if no bids have been placed. - fun end_auction( - to_sell: &mut Option, - owner: address, - bid_data: &mut Option, - ctx: &mut TxContext - ) { - let item = option::extract(to_sell); - if (option::is_some(bid_data)) { - // bids have been placed - send funds to the original item - // owner and the item to the highest bidder - let BidData { - funds, - highest_bidder - } = option::extract(bid_data); - - send_balance(funds, owner, ctx); - transfer::public_transfer(item, highest_bidder); - } else { - // no bids placed - send the item back to the original owner - transfer::public_transfer(item, owner); - }; - } - - /// Ends auction and destroys auction object (can only be used if - /// Auction is single-owner object) - transfers item to the - /// currently highest bidder or to the original owner if no bids - /// have been placed. - public fun end_and_destroy_auction( - auction: Auction, ctx: &mut TxContext - ) { - let Auction { id, mut to_sell, owner, mut bid_data } = auction; - object::delete(id); - - end_auction(&mut to_sell, owner, &mut bid_data, ctx); - - option::destroy_none(bid_data); - option::destroy_none(to_sell); - } - - /// Ends auction (should only be used if Auction is a shared - /// object) - transfers item to the currently highest bidder or to - /// the original owner if no bids have been placed. - public fun end_shared_auction( - auction: &mut Auction, ctx: &mut TxContext - ) { - end_auction(&mut auction.to_sell, auction.owner, &mut auction.bid_data, ctx); - } - - /// Helper for the most common operation - wrapping a balance and sending it - fun send_balance(balance: Balance, to: address, ctx: &mut TxContext) { - transfer::public_transfer(coin::from_balance(balance, ctx), to) - } - - /// exposes transfer::transfer - public fun transfer(obj: Auction, recipient: address) { - transfer::transfer(obj, recipient) - } - - #[allow(lint(share_owned))] - public fun share_object(obj: Auction) { - transfer::share_object(obj) - } -} diff --git a/sui_programmability/examples/nfts/sources/chat.move b/sui_programmability/examples/nfts/sources/chat.move deleted file mode 100644 index 7b455494f78b0..0000000000000 --- a/sui_programmability/examples/nfts/sources/chat.move +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module nfts::chat { - use std::ascii::{Self, String}; - use std::option::some; - use std::vector::length; - - /// Max text length. - const MAX_TEXT_LENGTH: u64 = 512; - - /// Text size overflow. - const ETextOverflow: u64 = 0; - - /// Sui Chat NFT (i.e., a post, retweet, like, chat message etc). - public struct Chat has key, store { - id: UID, - // The ID of the chat app. - app_id: address, - // Post's text. - text: String, - // Set if referencing an another object (i.e., due to a Like, Retweet, Reply etc). - // We allow referencing any object type, not only Chat NFTs. - ref_id: Option
, - // app-specific metadata. We do not enforce a metadata format and delegate this to app layer. - metadata: vector, - } - - /// Simple Chat.text getter. - public fun text(chat: &Chat): String { - chat.text - } - - #[allow(lint(self_transfer))] - /// Mint (post) a Chat object. - fun post_internal( - app_id: address, - text: vector, - ref_id: Option
, - metadata: vector, - ctx: &mut TxContext, - ) { - assert!(length(&text) <= MAX_TEXT_LENGTH, ETextOverflow); - let chat = Chat { - id: object::new(ctx), - app_id, - text: ascii::string(text), - ref_id, - metadata, - }; - transfer::public_transfer(chat, tx_context::sender(ctx)); - } - - /// Mint (post) a Chat object without referencing another object. - public entry fun post( - app_identifier: address, - text: vector, - metadata: vector, - ctx: &mut TxContext, - ) { - post_internal(app_identifier, text, option::none(), metadata, ctx); - } - - /// Mint (post) a Chat object and reference another object (i.e., to simulate retweet, reply, like, attach). - /// TODO: Using `address` as `app_identifier` & `ref_identifier` type, because we cannot pass `ID` to entry - /// functions. Using `vector` for `text` instead of `String` for the same reason. - public entry fun post_with_ref( - app_identifier: address, - text: vector, - ref_identifier: address, - metadata: vector, - ctx: &mut TxContext, - ) { - post_internal(app_identifier, text, some(ref_identifier), metadata, ctx); - } - - /// Burn a Chat object. - public entry fun burn(chat: Chat) { - let Chat { id, app_id: _, text: _, ref_id: _, metadata: _ } = chat; - object::delete(id); - } -} diff --git a/sui_programmability/examples/nfts/sources/cross_chain_airdrop.move b/sui_programmability/examples/nfts/sources/cross_chain_airdrop.move deleted file mode 100644 index b189719664184..0000000000000 --- a/sui_programmability/examples/nfts/sources/cross_chain_airdrop.move +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Allow a trusted oracle to mint a copy of NFT from a different chain. There can -/// only be one copy for each unique pair of contract_address and token_id. We only -/// support a single chain(Ethereum) right now, but this can be extended to other -/// chains by adding a chain_id field. -module nfts::cross_chain_airdrop { - use nfts::erc721_metadata::{Self, ERC721Metadata, TokenID}; - - /// The oracle manages one `PerContractAirdropInfo` for each Ethereum contract - public struct CrossChainAirdropOracle has key { - id: UID, - // TODO: replace this with SparseSet for O(1) on-chain uniqueness check - managed_contracts: vector, - } - - /// The address of the source contract - public struct SourceContractAddress has store, copy { - address: vector, - } - - /// Contains the Airdrop info for one contract address on Ethereum - public struct PerContractAirdropInfo has store { - /// A single contract address on Ethereum - source_contract_address: SourceContractAddress, - - /// The Ethereum token ids whose Airdrop has been claimed. These - /// are stored to prevent the same NFT from being claimed twice - // TODO: replace u64 with u256 once the latter is supported - // - // TODO: replace this with SparseSet for O(1) on-chain uniqueness check - claimed_source_token_ids: vector - } - - /// The Sui representation of the original ERC721 NFT on Eth - public struct ERC721 has key, store { - id: UID, - /// The address of the source contract, e.g, the Ethereum contract address - source_contract_address: SourceContractAddress, - /// The metadata associated with this NFT - metadata: ERC721Metadata, - } - - // Error codes - - /// Trying to claim a token that has already been claimed - const ETokenIDClaimed: u64 = 0; - - #[allow(unused_function)] - /// Create the `Orcacle` capability and hand it off to the oracle - /// TODO: To make this usable, the oracle should be sent to a - /// hardcoded address that the contract creator has private key. - fun init(ctx: &mut TxContext) { - transfer::transfer( - CrossChainAirdropOracle { - id: object::new(ctx), - managed_contracts: vector::empty(), - }, - tx_context::sender(ctx) - ) - } - - /// Called by the oracle to mint the airdrop NFT and transfer to the recipient - public entry fun claim( - oracle: &mut CrossChainAirdropOracle, - recipient: address, - source_contract_address: vector, - source_token_id: u64, - name: vector, - token_uri: vector, - ctx: &mut TxContext, - ) { - let contract = get_or_create_contract(oracle, &source_contract_address); - let token_id = erc721_metadata::new_token_id(source_token_id); - // NOTE: this is where the globally uniqueness check happens - assert!(!is_token_claimed(contract, &token_id), ETokenIDClaimed); - let nft = ERC721 { - id: object::new(ctx), - source_contract_address: SourceContractAddress { address: source_contract_address }, - metadata: erc721_metadata::new(token_id, name, token_uri), - }; - vector::push_back(&mut contract.claimed_source_token_ids, token_id); - transfer::public_transfer(nft, recipient) - } - - fun get_or_create_contract(oracle: &mut CrossChainAirdropOracle, source_contract_address: &vector): &mut PerContractAirdropInfo { - let mut index = 0; - // TODO: replace this with SparseSet so that the on-chain uniqueness check can be O(1) - while (index < vector::length(&oracle.managed_contracts)) { - let id = vector::borrow_mut(&mut oracle.managed_contracts, index); - if (&id.source_contract_address.address == source_contract_address) { - return id - }; - index = index + 1; - }; - - create_contract(oracle, source_contract_address) - } - - fun create_contract(oracle: &mut CrossChainAirdropOracle, source_contract_address: &vector): &mut PerContractAirdropInfo { - let id = PerContractAirdropInfo { - source_contract_address: SourceContractAddress { address: *source_contract_address }, - claimed_source_token_ids: vector::empty() - }; - vector::push_back(&mut oracle.managed_contracts, id); - let idx = vector::length(&oracle.managed_contracts) - 1; - vector::borrow_mut(&mut oracle.managed_contracts, idx) - } - - fun is_token_claimed(contract: &PerContractAirdropInfo, source_token_id: &TokenID): bool { - // TODO: replace this with SparseSet so that the on-chain uniqueness check can be O(1) - let mut index = 0; - while (index < vector::length(&contract.claimed_source_token_ids)) { - let claimed_id = vector::borrow(&contract.claimed_source_token_ids, index); - if (claimed_id == source_token_id) { - return true - }; - index = index + 1; - }; - false - } - - #[test_only] - /// Wrapper of module initializer for testing - public fun test_init(ctx: &mut TxContext) { - init(ctx) - } -} - -module nfts::erc721_metadata { - use std::ascii; - use sui::url::{Self, Url}; - use std::string; - - // TODO: add symbol()? - /// A wrapper type for the ERC721 metadata standard https://eips.ethereum.org/EIPS/eip-721 - public struct ERC721Metadata has store { - /// The token id associated with the source contract on Ethereum - token_id: TokenID, - /// A descriptive name for a collection of NFTs in this contract. - /// This corresponds to the `name()` method in the - /// ERC721Metadata interface in EIP-721. - name: string::String, - /// A distinct Uniform Resource Identifier (URI) for a given asset. - /// This corresponds to the `tokenURI()` method in the ERC721Metadata - /// interface in EIP-721. - token_uri: Url, - } - - // TODO: replace u64 with u256 once the latter is supported - // - /// An ERC721 token ID - public struct TokenID has store, copy { - id: u64, - } - - /// Construct a new ERC721Metadata from the given inputs. Does not perform any validation - /// on `token_uri` or `name` - public fun new(token_id: TokenID, name: vector, token_uri: vector): ERC721Metadata { - // Note: this will abort if `token_uri` is not valid ASCII - let uri_str = ascii::string(token_uri); - ERC721Metadata { - token_id, - name: string::utf8(name), - token_uri: url::new_unsafe(uri_str), - } - } - - public fun new_token_id(id: u64): TokenID { - TokenID { id } - } - - public fun token_id(self: &ERC721Metadata): &TokenID { - &self.token_id - } - - public fun token_uri(self: &ERC721Metadata): &Url { - &self.token_uri - } - - public fun name(self: &ERC721Metadata): &string::String { - &self.name - } -} diff --git a/sui_programmability/examples/nfts/sources/devnet_nft.move b/sui_programmability/examples/nfts/sources/devnet_nft.move deleted file mode 100644 index e6ae716e79029..0000000000000 --- a/sui_programmability/examples/nfts/sources/devnet_nft.move +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// TODO: consider renaming this to `example_nft` -/// A minimalist example to demonstrate how to create an NFT like object -/// on Sui. -module nfts::devnet_nft { - use sui::url::{Self, Url}; - use std::string; - use sui::event; - - /// An example NFT that can be minted by anybody - public struct DevNetNFT has key, store { - id: UID, - /// Name for the token - name: string::String, - /// Description of the token - description: string::String, - /// URL for the token - url: Url, - // TODO: allow custom attributes - } - - public struct MintNFTEvent has copy, drop { - // The Object ID of the NFT - object_id: ID, - // The creator of the NFT - creator: address, - // The name of the NFT - name: string::String, - } - - /// Create a new devnet_nft - public entry fun mint( - name: vector, - description: vector, - url: vector, - ctx: &mut TxContext - ) { - let nft = DevNetNFT { - id: object::new(ctx), - name: string::utf8(name), - description: string::utf8(description), - url: url::new_unsafe_from_bytes(url) - }; - let sender = tx_context::sender(ctx); - event::emit(MintNFTEvent { - object_id: object::uid_to_inner(&nft.id), - creator: sender, - name: nft.name, - }); - transfer::public_transfer(nft, sender); - } - - /// Update the `description` of `nft` to `new_description` - public entry fun update_description( - nft: &mut DevNetNFT, - new_description: vector, - ) { - nft.description = string::utf8(new_description) - } - - /// Permanently delete `nft` - public entry fun burn(nft: DevNetNFT) { - let DevNetNFT { id, name: _, description: _, url: _ } = nft; - object::delete(id) - } - - /// Get the NFT's `name` - public fun name(nft: &DevNetNFT): &string::String { - &nft.name - } - - /// Get the NFT's `description` - public fun description(nft: &DevNetNFT): &string::String { - &nft.description - } - - /// Get the NFT's `url` - public fun url(nft: &DevNetNFT): &Url { - &nft.url - } -} - -#[test_only] -module nfts::devnet_nftTests { - use nfts::devnet_nft::{Self, DevNetNFT}; - use sui::test_scenario as ts; - use std::string; - - #[test] - fun mint_transfer_update() { - let addr1 = @0xA; - let addr2 = @0xB; - // create the NFT - let mut scenario = ts::begin(addr1); - { - devnet_nft::mint(b"test", b"a test", b"https://www.sui.io", ts::ctx(&mut scenario)) - }; - // send it from A to B - ts::next_tx(&mut scenario, addr1); - { - let nft = ts::take_from_sender(&scenario); - transfer::public_transfer(nft, addr2); - }; - // update its description - ts::next_tx(&mut scenario, addr2); - { - let mut nft = ts::take_from_sender(&scenario); - devnet_nft::update_description(&mut nft, b"a new description") ; - assert!(*string::as_bytes(devnet_nft::description(&nft)) == b"a new description", 0); - ts::return_to_sender(&scenario, nft); - }; - // burn it - ts::next_tx(&mut scenario, addr2); - { - let nft = ts::take_from_sender(&scenario); - devnet_nft::burn(nft) - }; - ts::end(scenario); - } -} diff --git a/sui_programmability/examples/nfts/sources/discount_coupon.move b/sui_programmability/examples/nfts/sources/discount_coupon.move deleted file mode 100644 index 4f1f8290688f5..0000000000000 --- a/sui_programmability/examples/nfts/sources/discount_coupon.move +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module nfts::discount_coupon { - use sui::coin; - use sui::sui::SUI; - - /// Sending to wrong recipient. - const EWrongRecipient: u64 = 0; - - /// Percentage discount out of range. - const EOutOfRangeDiscount: u64 = 1; - - /// Discount coupon NFT. - public struct DiscountCoupon has key { - id: UID, - // coupon issuer - issuer: address, - // percentage discount [1-100] - discount: u8, - // expiration timestamp (UNIX time) - app specific - expiration: u64, - } - - /// Simple issuer getter. - public fun issuer(coupon: &DiscountCoupon): address { - coupon.issuer - } - - /// Mint then transfer a new `DiscountCoupon` NFT, and top up recipient with some SUI. - public entry fun mint_and_topup( - coin: coin::Coin, - discount: u8, - expiration: u64, - recipient: address, - ctx: &mut TxContext, - ) { - assert!(discount > 0 && discount <= 100, EOutOfRangeDiscount); - let coupon = DiscountCoupon { - id: object::new(ctx), - issuer: tx_context::sender(ctx), - discount, - expiration, - }; - transfer::transfer(coupon, recipient); - transfer::public_transfer(coin, recipient); - } - - /// Burn DiscountCoupon. - public entry fun burn(nft: DiscountCoupon) { - let DiscountCoupon { id, issuer: _, discount: _, expiration: _ } = nft; - object::delete(id); - } - - /// Transfer DiscountCoupon to issuer only. - // TODO: Consider adding more valid recipients. - // If we stick with issuer-as-receiver only, then `recipient` input won't be required). - public entry fun transfer(coupon: DiscountCoupon, recipient: address) { - assert!(&coupon.issuer == &recipient, EWrongRecipient); - transfer::transfer(coupon, recipient); - } -} diff --git a/sui_programmability/examples/nfts/sources/geniteam.move b/sui_programmability/examples/nfts/sources/geniteam.move deleted file mode 100644 index 48855920d97b4..0000000000000 --- a/sui_programmability/examples/nfts/sources/geniteam.move +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module nfts::geniteam { - use sui::object_bag::{Self, ObjectBag}; - use sui::object_table::{Self, ObjectTable}; - use sui::dynamic_object_field; - use nfts::typed_id::{Self, TypedID}; - use std::ascii::{Self, String}; - - /// Trying to add more than 1 farm to a Player - const ETooManyFarms: u64 = 1; - - /// Invalid cosmetic slot - const EInvalidCosmeticsSlot: u64 = 4; - - public struct Player has key { - id: UID, - player_name: String, - water_runes_count: u64, - fire_runes_count: u64, - wind_runes_count: u64, - earth_runes_count: u64, - - // Owned Farm - owned_farm: Option>, - - // Inventory of unassigned cosmetics. - // A cosmetic can be either a FarmCosmetic or a MonsterCosmetic. - // Since they can be of different types, we use Bag instead of Collection. - inventory: ObjectBag, - } - - public struct Farm has key, store { - id: UID, - farm_name: String, - farm_img_index: u64, - level: u64, - current_xp: u64, - total_monster_slots: u64, - occupied_monster_slots: u64, - - // Collection of Pet monsters owned by this Farm - pet_monsters: ObjectTable, - - // Applied cosmetic at this slot - applied_farm_cosmetic_0: Option>, - // Applied cosmetic at this slot - applied_farm_cosmetic_1: Option>, - } - - public struct Monster has key, store { - id: UID, - monster_name: String, - monster_img_index: u64, - breed: u8, - monster_affinity: u8, - monster_description: String, - monster_level: u64, - monster_xp: u64, - hunger_level: u64, - affection_level: u64, - buddy_level: u8, - display: String, - - // Applied cosmetic at this slot - applied_monster_cosmetic_0: Option>, - // Applied cosmetic at this slot - applied_monster_cosmetic_1: Option>, - - } - - public struct FarmCosmetic has key, store{ - id: UID, - cosmetic_type: u8, - display: String, - } - - public struct MonsterCosmetic has key, store { - id: UID, - cosmetic_type: u8, - display: String, - } - - // ============================ Entry functions ============================ - - /// Create a player and transfer it to the transaction sender - public entry fun create_player( - player_name: vector, ctx: &mut TxContext - ) { - // Create player simply and transfer to caller - let player = new_player(player_name, ctx); - transfer::transfer(player, tx_context::sender(ctx)) - } - - /// Create a Farm and add it to the Player - public entry fun create_farm( - player: &mut Player, farm_img_index: u64, farm_name: vector, - total_monster_slots: u64, ctx: &mut TxContext - ) { - // We only allow one farm for now - assert!(option::is_none(&player.owned_farm), ETooManyFarms); - - let farm = new_farm(farm_name, farm_img_index, total_monster_slots, ctx); - let farm_id = typed_id::new(&farm); - - // Transfer ownership of farm to player - dynamic_object_field::add(&mut player.id, farm_id, farm); - - // Store the farm - option::fill(&mut player.owned_farm, farm_id) - } - - /// Create a Monster and add it to the Farm's collection of Monsters, which - /// is unbounded - public entry fun create_monster(player: &mut Player, - monster_name: vector, - monster_img_index: u64, - breed: u8, - monster_affinity: u8, - monster_description: vector, - display: vector, - ctx: &mut TxContext - ) { - let monster = new_monster( - monster_name, - monster_img_index, - breed, - monster_affinity, - monster_description, - display, - ctx - ); - let id = object::id(&monster); - - let farm_id = *option::borrow(&player.owned_farm); - let farm: &mut Farm = dynamic_object_field::borrow_mut(&mut player.id, farm_id); - // TODO: Decouple adding monster to farm from creating a monster. - // Add it to the collection - object_table::add(&mut farm.pet_monsters, id, monster); - } - - /// Create Farm cosmetic owned by player and add to its inventory - public fun create_farm_cosmetics( - player: &mut Player, cosmetic_type: u8, - display: vector, ctx: &mut TxContext - ) { - // Create the farm cosmetic object - let farm_cosmetic = FarmCosmetic { - id: object::new(ctx), - cosmetic_type, - display: ascii::string(display) - }; - - // Add it to the player's inventory - object_bag::add(&mut player.inventory, object::id(&farm_cosmetic), farm_cosmetic); - } - - /// Create Monster cosmetic owned by player and add to its inventory - public fun create_monster_cosmetics( - player: &mut Player, cosmetic_type: u8, - display: vector, ctx: &mut TxContext - ) { - // Create the farm cosmetic object - let monster_cosmetic = MonsterCosmetic { - id: object::new(ctx), - cosmetic_type, - display: ascii::string(display) - }; - - // Add it to the player's inventory - object_bag::add(&mut player.inventory, object::id(&monster_cosmetic), monster_cosmetic); - } - - /// Update the attributes of a player - public fun update_player( - player: &mut Player, - water_runes_count: u64, - fire_runes_count: u64, - wind_runes_count: u64, - earth_runes_count: u64, - ) { - player.water_runes_count = water_runes_count; - player.fire_runes_count = fire_runes_count; - player.wind_runes_count = wind_runes_count; - player.earth_runes_count = earth_runes_count - } - - /// Update the attributes of a monster - public fun update_monster_stats( - player: &mut Player, - monster_id: ID, - monster_affinity: u8, - monster_level: u64, - hunger_level: u64, - affection_level: u64, - buddy_level: u8, - display: vector, - ) { - let farm_id = *option::borrow(&player.owned_farm); - let farm: &mut Farm = dynamic_object_field::borrow_mut(&mut player.id, farm_id); - let monster = object_table::borrow_mut(&mut farm.pet_monsters, monster_id); - monster.monster_affinity = monster_affinity; - monster.monster_level = monster_level; - monster.hunger_level = hunger_level; - monster.affection_level = affection_level; - monster.buddy_level = buddy_level; - if (vector::length(&display) != 0) { - monster.display = ascii::string(display); - } - } - - - /// Update the attributes of the farm - public fun update_farm_stats( - _player: &mut Player, farm: &mut Farm, level: u64, current_xp: u64, - ) { - farm.current_xp = current_xp; - farm.level = level; - } - - /// Apply the cosmetic to the Farm from the inventory - public fun update_farm_cosmetics( - player: &mut Player, - farm_cosmetic: FarmCosmetic, cosmetic_slot_id: u64 - ) { - // Only 2 slots allowed - assert!(cosmetic_slot_id <= 1 , EInvalidCosmeticsSlot); - - // Transfer ownership of cosmetic to this farm - let farm_id = *option::borrow(&player.owned_farm); - let farm: &mut Farm = dynamic_object_field::borrow_mut(&mut player.id, farm_id); - let child_ref = typed_id::new(&farm_cosmetic); - dynamic_object_field::add(&mut farm.id, child_ref, farm_cosmetic); - - // Assign by slot - if (cosmetic_slot_id == 0) { - // Store the cosmetic - option::fill(&mut farm.applied_farm_cosmetic_0, child_ref) - } else { - // Store the cosmetic - option::fill(&mut farm.applied_farm_cosmetic_1, child_ref) - }; - } - - /// Apply the cosmetics to the Monster from the inventory - public fun update_monster_cosmetics( - player: &mut Player, monster_id: ID, monster_cosmetic: MonsterCosmetic, cosmetic_slot_id: u64, - ) { - // Only 2 slots allowed - assert!(cosmetic_slot_id <= 1 , EInvalidCosmeticsSlot); - - let farm_id = *option::borrow(&player.owned_farm); - let farm: &mut Farm = dynamic_object_field::borrow_mut(&mut player.id, farm_id); - let monster = object_table::borrow_mut(&mut farm.pet_monsters, monster_id); - // Transfer ownership of cosmetic to this monster - let child_ref = typed_id::new(&monster_cosmetic); - dynamic_object_field::add(&mut monster.id, child_ref, monster_cosmetic); - - // Assign by slot - if (cosmetic_slot_id == 0) { - // Store the cosmetic - option::fill(&mut monster.applied_monster_cosmetic_0, child_ref) - } else { - // Store the cosmetic - option::fill(&mut monster.applied_monster_cosmetic_1, child_ref) - }; - } - - // ============== Constructors. These create new Sui objects. ============== - - // Constructs a new basic Player object - fun new_player( - player_name: vector, ctx: &mut TxContext - ): Player { - // Create a new id for player. - let id = object::new(ctx); - - // Create inventory collection. - let inventory = object_bag::new(ctx); - - Player { - id, - player_name: ascii::string(player_name), - water_runes_count: 0, - fire_runes_count: 0, - wind_runes_count: 0, - earth_runes_count: 0, - owned_farm: option::none(), - inventory, - } - } - - // Constructs a new basic Farm object - fun new_farm( - farm_name: vector, farm_img_index: u64, total_monster_slots: u64, - ctx: &mut TxContext - ): Farm { - // Create a new id for farm. - let id = object::new(ctx); - - // Create pet monsters collection. - let pet_monsters = object_table::new(ctx); - - Farm { - id, - farm_name: ascii::string(farm_name), - total_monster_slots, - farm_img_index, - level: 0, - current_xp: 0, - occupied_monster_slots: 0, - pet_monsters, - applied_farm_cosmetic_0: option::none(), - applied_farm_cosmetic_1: option::none(), - } - } - - // Constructs a new basic Monster object - fun new_monster( - monster_name: vector, - monster_img_index: u64, - breed: u8, - monster_affinity: u8, - monster_description: vector, - display: vector, - ctx: &mut TxContext - ): Monster { - - Monster { - id: object::new(ctx), - monster_name: ascii::string(monster_name), - monster_img_index, - breed, - monster_affinity, - monster_description: ascii::string(monster_description), - monster_level: 0, - monster_xp: 0, - hunger_level: 0, - affection_level: 0, - buddy_level: 0, - display: ascii::string(display), - applied_monster_cosmetic_0: option::none(), - applied_monster_cosmetic_1: option::none(), - } - } -} - -// temp duplicate to unblock -module nfts::typed_id { - /// An ID of an of type `T`. See `ID` for more details - /// By construction, it is guaranteed that the `ID` represents an object of type `T` - public struct TypedID has copy, drop, store { - id: ID, - } - - /// Get the underlying `ID` of `obj`, and remember the type - public fun new(obj: &T): TypedID { - TypedID { id: object::id(obj) } - } - - /// Borrow the inner `ID` of `typed_id` - public fun as_id(typed_id: &TypedID): &ID { - &typed_id.id - } - - /// Get the inner `ID` of `typed_id` - public fun to_id(typed_id: TypedID): ID { - let TypedID { id } = typed_id; - id - } - - /// Check that underlying `ID` in the `typed_id` equals the objects ID - public fun equals_object(typed_id: &TypedID, obj: &T): bool { - typed_id.id == object::id(obj) - } -} diff --git a/sui_programmability/examples/nfts/sources/marketplace.move b/sui_programmability/examples/nfts/sources/marketplace.move deleted file mode 100644 index 569554776a2ff..0000000000000 --- a/sui_programmability/examples/nfts/sources/marketplace.move +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Basic `Marketplace` implementation. Supports listing of any assets, -/// and does not have constraints. -/// -/// Makes use of `sui::dynamic_object_field` module by attaching `Listing` -/// objects as fields to the `Marketplace` object; as well as stores and -/// merges user profits as dynamic object fields (ofield). -/// -/// Rough illustration of the dynamic field architecture for listings: -/// ``` -/// /--->Listing--->Item -/// (Marketplace)--->Listing--->Item -/// \--->Listing--->Item -/// ``` -/// -/// Profits storage is also attached to the `Marketplace` (indexed by `address`): -/// ``` -/// /--->Coin -/// (Marketplace)--->Coin -/// \--->Coin -/// ``` -module nfts::marketplace { - use sui::dynamic_object_field as ofield; - use sui::coin::{Self, Coin}; - - /// For when amount paid does not match the expected. - const EAmountIncorrect: u64 = 0; - /// For when someone tries to delist without ownership. - const ENotOwner: u64 = 1; - - /// A shared `Marketplace`. Can be created by anyone using the - /// `create` function. One instance of `Marketplace` accepts - /// only one type of Coin - `COIN` for all its listings. - public struct Marketplace has key { - id: UID, - } - - /// A single listing which contains the listed item and its - /// price in [`Coin`]. - public struct Listing has key, store { - id: UID, - ask: u64, - owner: address, - } - - /// Create a new shared Marketplace. - public entry fun create(ctx: &mut TxContext) { - let id = object::new(ctx); - transfer::share_object(Marketplace { id }) - } - - /// List an item at the Marketplace. - public entry fun list( - marketplace: &mut Marketplace, - item: T, - ask: u64, - ctx: &mut TxContext - ) { - let item_id = object::id(&item); - let mut listing = Listing { - ask, - id: object::new(ctx), - owner: tx_context::sender(ctx), - }; - - ofield::add(&mut listing.id, true, item); - ofield::add(&mut marketplace.id, item_id, listing) - } - - /// Remove listing and get an item back. Only owner can do that. - public fun delist( - marketplace: &mut Marketplace, - item_id: ID, - ctx: &TxContext - ): T { - let Listing { - mut id, - owner, - ask: _, - } = ofield::remove(&mut marketplace.id, item_id); - - assert!(tx_context::sender(ctx) == owner, ENotOwner); - - let item = ofield::remove(&mut id, true); - object::delete(id); - item - } - - /// Call [`delist`] and transfer item to the sender. - public entry fun delist_and_take( - marketplace: &mut Marketplace, - item_id: ID, - ctx: &TxContext - ) { - let item = delist(marketplace, item_id, ctx); - transfer::public_transfer(item, tx_context::sender(ctx)); - } - - /// Purchase an item using a known Listing. Payment is done in Coin. - /// Amount paid must match the requested amount. If conditions are met, - /// owner of the item gets the payment and buyer receives their item. - public fun buy( - marketplace: &mut Marketplace, - item_id: ID, - paid: Coin, - ): T { - let Listing { - mut id, - ask, - owner - } = ofield::remove(&mut marketplace.id, item_id); - - assert!(ask == coin::value(&paid), EAmountIncorrect); - - // Check if there's already a Coin hanging and merge `paid` with it. - // Otherwise attach `paid` to the `Marketplace` under owner's `address`. - if (ofield::exists_
(&marketplace.id, owner)) { - coin::join( - ofield::borrow_mut>(&mut marketplace.id, owner), - paid - ) - } else { - ofield::add(&mut marketplace.id, owner, paid) - }; - - let item = ofield::remove(&mut id, true); - object::delete(id); - item - } - - /// Call [`buy`] and transfer item to the sender. - public entry fun buy_and_take( - marketplace: &mut Marketplace, - item_id: ID, - paid: Coin, - ctx: &TxContext - ) { - transfer::public_transfer( - buy(marketplace, item_id, paid), - tx_context::sender(ctx) - ) - } - - /// Take profits from selling items on the `Marketplace`. - public fun take_profits( - marketplace: &mut Marketplace, - ctx: &TxContext - ): Coin { - ofield::remove>(&mut marketplace.id, tx_context::sender(ctx)) - } - - /// Call [`take_profits`] and transfer Coin to the sender. - public entry fun take_profits_and_keep( - marketplace: &mut Marketplace, - ctx: &TxContext - ) { - transfer::public_transfer( - take_profits(marketplace, ctx), - tx_context::sender(ctx) - ) - } -} - -#[test_only] -module nfts::marketplaceTests { - use sui::coin; - use sui::sui::SUI; - use sui::test_scenario::{Self, Scenario}; - use nfts::marketplace; - - // Simple Kitty-NFT data structure. - public struct Kitty has key, store { - id: UID, - kitty_id: u8 - } - - const ADMIN: address = @0xA55; - const SELLER: address = @0x00A; - const BUYER: address = @0x00B; - - #[allow(unused_function)] - /// Create a shared [`Marketplace`]. - fun create_marketplace(scenario: &mut Scenario) { - test_scenario::next_tx(scenario, ADMIN); - marketplace::create(test_scenario::ctx(scenario)); - } - - #[allow(unused_function)] - /// Mint SUI and send it to BUYER. - fun mint_some_coin(scenario: &mut Scenario) { - test_scenario::next_tx(scenario, ADMIN); - let coin = coin::mint_for_testing(1000, test_scenario::ctx(scenario)); - transfer::public_transfer(coin, BUYER); - } - - #[allow(unused_function)] - /// Mint Kitty NFT and send it to SELLER. - fun mint_kitty(scenario: &mut Scenario) { - test_scenario::next_tx(scenario, ADMIN); - let nft = Kitty { id: object::new(test_scenario::ctx(scenario)), kitty_id: 1 }; - transfer::public_transfer(nft, SELLER); - } - - // TODO(dyn-child) redo test with dynamic child object loading - // // SELLER lists Kitty at the Marketplace for 100 SUI. - // fun list_kitty(scenario: &mut Scenario) { - // test_scenario::next_tx(scenario, SELLER); - // let mkp_val = test_scenario::take_shared(scenario); - // let mkp = &mut mkp_val; - // let bag = test_scenario::take_child_object(scenario, mkp); - // let nft = test_scenario::take_from_sender(scenario); - - // marketplace::list(mkp, &mut bag, nft, 100, test_scenario::ctx(scenario)); - // test_scenario::return_shared(mkp_val); - // test_scenario::return_to_sender(scenario, bag); - // } - - // TODO(dyn-child) redo test with dynamic child object loading - // #[test] - // fun list_and_delist() { - // let scenario = &mut test_scenario::begin(ADMIN); - - // create_marketplace(scenario); - // mint_kitty(scenario); - // list_kitty(scenario); - - // test_scenario::next_tx(scenario, SELLER); - // { - // let mkp_val = test_scenario::take_shared(scenario); - // let mkp = &mut mkp_val; - // let bag = test_scenario::take_child_object(scenario, mkp); - // let listing = test_scenario::take_child_object>>(scenario, &bag); - - // // Do the delist operation on a Marketplace. - // let nft = marketplace::delist(mkp, &mut bag, listing, test_scenario::ctx(scenario)); - // let kitty_id = burn_kitty(nft); - - // assert!(kitty_id == 1, 0); - - // test_scenario::return_shared(mkp_val); - // test_scenario::return_to_sender(scenario, bag); - // }; - // } - - // TODO(dyn-child) redo test with dynamic child object loading - // #[test] - // #[expected_failure(abort_code = 1)] - // fun fail_to_delist() { - // let scenario = &mut test_scenario::begin(ADMIN); - - // create_marketplace(scenario); - // mint_some_coin(scenario); - // mint_kitty(scenario); - // list_kitty(scenario); - - // // BUYER attempts to delist Kitty and he has no right to do so. :( - // test_scenario::next_tx(scenario, BUYER); - // { - // let mkp_val = test_scenario::take_shared(scenario); - // let mkp = &mut mkp_val; - // let bag = test_scenario::take_child_object(scenario, mkp); - // let listing = test_scenario::take_child_object>>(scenario, &bag); - - // // Do the delist operation on a Marketplace. - // let nft = marketplace::delist(mkp, &mut bag, listing, test_scenario::ctx(scenario)); - // let _ = burn_kitty(nft); - - // test_scenario::return_shared(mkp_val); - // test_scenario::return_to_sender(scenario, bag); - // }; - // } - - // TODO(dyn-child) redo test with dynamic child object loading - // #[test] - // fun buy_kitty() { - // let scenario = &mut test_scenario::begin(ADMIN); - - // create_marketplace(scenario); - // mint_some_coin(scenario); - // mint_kitty(scenario); - // list_kitty(scenario); - - // // BUYER takes 100 SUI from his wallet and purchases Kitty. - // test_scenario::next_tx(scenario, BUYER); - // { - // let coin = test_scenario::take_from_sender>(scenario); - // let mkp_val = test_scenario::take_shared(scenario); - // let mkp = &mut mkp_val; - // let bag = test_scenario::take_child_object(scenario, mkp); - // let listing = test_scenario::take_child_object>>(scenario, &bag); - // let payment = coin::take(coin::balance_mut(&mut coin), 100, test_scenario::ctx(scenario)); - - // // Do the buy call and expect successful purchase. - // let nft = marketplace::buy(&mut bag, listing, payment); - // let kitty_id = burn_kitty(nft); - - // assert!(kitty_id == 1, 0); - - // test_scenario::return_shared(mkp_val); - // test_scenario::return_to_sender(scenario, bag); - // test_scenario::return_to_sender(scenario, coin); - // }; - // } - - // TODO(dyn-child) redo test with dynamic child object loading - // #[test] - // #[expected_failure(abort_code = 0)] - // fun fail_to_buy() { - // let scenario = &mut test_scenario::begin(ADMIN); - - // create_marketplace(scenario); - // mint_some_coin(scenario); - // mint_kitty(scenario); - // list_kitty(scenario); - - // // BUYER takes 100 SUI from his wallet and purchases Kitty. - // test_scenario::next_tx(scenario, BUYER); - // { - // let coin = test_scenario::take_from_sender>(scenario); - // let mkp_val = test_scenario::take_shared(scenario); - // let mkp = &mut mkp_val; - // let bag = test_scenario::take_child_object(scenario, mkp); - // let listing = test_scenario::take_child_object>>(scenario, &bag); - - // // AMOUNT here is 10 while expected is 100. - // let payment = coin::take(coin::balance_mut(&mut coin), 10, test_scenario::ctx(scenario)); - - // // Attempt to buy and expect failure purchase. - // let nft = marketplace::buy(&mut bag, listing, payment); - // let _ = burn_kitty(nft); - - // test_scenario::return_shared(mkp_val); - // test_scenario::return_to_sender(scenario, bag); - // test_scenario::return_to_sender(scenario, coin); - // }; - // } - - #[allow(unused_function)] - fun burn_kitty(kitty: Kitty): u8 { - let Kitty{ id, kitty_id } = kitty; - object::delete(id); - kitty_id - } -} diff --git a/sui_programmability/examples/nfts/sources/num.move b/sui_programmability/examples/nfts/sources/num.move deleted file mode 100644 index 3774f3c5f0331..0000000000000 --- a/sui_programmability/examples/nfts/sources/num.move +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module nfts::num { - /// Very silly NFT: a natural number! - public struct Num has key, store { - id: UID, - n: u64 - } - - public struct NumIssuerCap has key { - id: UID, - /// Number of NFT's in circulation. Fluctuates with minting and burning. - /// A maximum of `MAX_SUPPLY` NFT's can exist at a given time. - supply: u64, - /// Total number of NFT's that have been issued. Always <= `supply`. - /// The next NFT to be issued will have the value of the counter. - issued_counter: u64, - } - - /// Only allow 10 NFT's to exist at once. Gotta make those NFT's rare! - const MAX_SUPPLY: u64 = 10; - - /// Created more than the maximum supply of Num NFT's - const ETooManyNums: u64 = 0; - - #[allow(unused_function)] - /// Create a unique issuer cap and give it to the transaction sender - fun init(ctx: &mut TxContext) { - let issuer_cap = NumIssuerCap { - id: object::new(ctx), - supply: 0, - issued_counter: 0, - }; - transfer::transfer(issuer_cap, tx_context::sender(ctx)) - } - - /// Create a new `Num` NFT. Aborts if `MAX_SUPPLY` NFT's have already been issued - public fun mint(cap: &mut NumIssuerCap, ctx: &mut TxContext): Num { - let n = cap.issued_counter; - cap.issued_counter = n + 1; - cap.supply = cap.supply + 1; - assert!(cap.supply <= MAX_SUPPLY, ETooManyNums); - Num { id: object::new(ctx), n } - } - - /// Burn `nft`. This reduces the supply. - /// Note: if we burn (e.g.) the NFT for 7, that means - /// no Num with the value 7 can exist again! But if the supply - /// is maxed out, burning will allow us to mint new Num's with - /// higher values. - public fun burn(cap: &mut NumIssuerCap, nft: Num) { - let Num { id, n: _ } = nft; - cap.supply = cap.supply - 1; - object::delete(id); - } -} diff --git a/sui_programmability/examples/nfts/sources/shared_auction.move b/sui_programmability/examples/nfts/sources/shared_auction.move deleted file mode 100644 index 57b799370c1bd..0000000000000 --- a/sui_programmability/examples/nfts/sources/shared_auction.move +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// This is an implementation of an English auction -/// (https://en.wikipedia.org/wiki/English_auction) using shared -/// objects. There are types of participants: -/// - owner - this is the original owner of an item that is sold at an -/// auction; the owner creates an auction and ends it the time of her -/// choice -/// - bidders - these are parties interested in purchasing items sold -/// at an auction; similarly to the owner they have access to the -/// auction object and can submit bids to change its state - -/// A typical lifetime of an auction looks as follows: -/// - auction is created by the owner and shared with the bidders -/// - bidders submit bids to try out-bidding one another -/// - if a submitted bid is higher than the current bid (initially -/// there is no bid), the auction is updated with the current bid -/// and funds representing previous highest bid are sent to the -/// original owner -/// - otherwise (bid is too low) the bidder's funds are sent back to -/// the bidder and the auction remains unchanged -/// - the owner eventually ends the auction -/// - if no bids were received, the item goes back to the owner -/// - otherwise the funds accumulated in the auction go to the owner -/// and the item goes to the bidder that won the auction - -module nfts::shared_auction { - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - - use nfts::auction_lib::{Self, Auction}; - - // Error codes. - - /// An attempt to end auction by a different user than the owner - const EWrongOwner: u64 = 1; - - // Entry functions. - - /// Creates an auction. This is executed by the owner of the asset - /// to be auctioned. - public entry fun create_auction(to_sell: T, ctx: &mut TxContext) { - let auction = auction_lib::create_auction(to_sell, ctx); - auction_lib::share_object(auction); - } - - /// Sends a bid to the auction. The result is either successful - /// change of the auction state (if bid was high enough) or return - /// of the funds (if the bid was too low). This is executed by a - /// bidder. - public entry fun bid( - coin: Coin, auction: &mut Auction, ctx: &mut TxContext - ) { - auction_lib::update_auction( - auction, - tx_context::sender(ctx), - coin::into_balance(coin), - ctx - ); - } - - /// Ends the auction - transfers item to the currently highest - /// bidder or back to the original owner if no bids have been - /// placed. This is executed by the owner of the asset to be - /// auctioned. - public entry fun end_auction( - auction: &mut Auction, ctx: &mut TxContext - ) { - let owner = auction_lib::auction_owner(auction); - assert!(tx_context::sender(ctx) == owner, EWrongOwner); - auction_lib::end_shared_auction(auction, ctx); - } - -} diff --git a/sui_programmability/examples/nfts/tests/auction_tests.move b/sui_programmability/examples/nfts/tests/auction_tests.move deleted file mode 100644 index 2e9b32517c2c6..0000000000000 --- a/sui_programmability/examples/nfts/tests/auction_tests.move +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module nfts::auction_tests { - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - use sui::test_scenario::Self; - - use nfts::auction::{Self, Bid}; - use nfts::auction_lib::Auction; - - // Error codes. - const EWRONG_ITEM_VALUE: u64 = 1; - - // Example of an object type that could be sold at an auction. - public struct SomeItemToSell has key, store { - id: UID, - value: u64, - } - - // Initializes the "state of the world" that mimics what should - // be available in Sui genesis state (e.g., mints and distributes - // coins to users). - fun init_bidders(ctx: &mut TxContext, mut bidders: vector
) { - while (!vector::is_empty(&bidders)) { - let bidder = vector::pop_back(&mut bidders); - let coin = coin::mint_for_testing(100, ctx); - transfer::public_transfer(coin, bidder); - }; - } - - #[test] - fun simple_auction_test() { - let auctioneer = @0xABBA; - let owner = @0xACE; - let bidder1 = @0xFACE; - let bidder2 = @0xCAFE; - - let mut scenario_val = test_scenario::begin(auctioneer); - let scenario = &mut scenario_val; - { - let mut bidders = vector::empty(); - vector::push_back(&mut bidders, bidder1); - vector::push_back(&mut bidders, bidder2); - init_bidders(test_scenario::ctx(scenario), bidders); - }; - - // a transaction by the item owner to put it for auction - test_scenario::next_tx(scenario, owner); - let ctx = test_scenario::ctx(scenario); - let to_sell = SomeItemToSell { - id: object::new(ctx), - value: 42, - }; - // create the auction - let auction_id = auction::create_auction(to_sell, auctioneer, ctx); - - // a transaction by the first bidder to create and put a bid - test_scenario::next_tx(scenario, bidder1); - { - let coin = test_scenario::take_from_sender>(scenario); - - auction::bid(coin, auction_id, auctioneer, test_scenario::ctx(scenario)); - }; - - // a transaction by the auctioneer to update state of the auction - test_scenario::next_tx(scenario, auctioneer); - { - let mut auction = test_scenario::take_from_sender>(scenario); - - let bid = test_scenario::take_from_sender(scenario); - auction::update_auction(&mut auction, bid, test_scenario::ctx(scenario)); - - test_scenario::return_to_sender(scenario, auction); - }; - // a transaction by the second bidder to create and put a bid (a - // bid will fail as it has the same value as that of the first - // bidder's) - test_scenario::next_tx(scenario, bidder2); - { - let coin = test_scenario::take_from_sender>(scenario); - - auction::bid(coin, auction_id, auctioneer, test_scenario::ctx(scenario)); - }; - - // a transaction by the auctioneer to update state of the auction - test_scenario::next_tx(scenario, auctioneer); - { - let mut auction = test_scenario::take_from_sender>(scenario); - - let bid = test_scenario::take_from_sender(scenario); - auction::update_auction(&mut auction, bid, test_scenario::ctx(scenario)); - - test_scenario::return_to_sender(scenario, auction); - }; - - // a transaction by the auctioneer to end auction - test_scenario::next_tx(scenario, auctioneer); - { - let auction = test_scenario::take_from_sender>(scenario); - - auction::end_auction(auction, test_scenario::ctx(scenario)); - }; - - // a transaction to check if the first bidder won (as the - // second bidder's bid was the same as that of the first one) - test_scenario::next_tx(scenario, bidder1); - { - let acquired_item = test_scenario::take_from_sender(scenario); - - assert!(acquired_item.value == 42, EWRONG_ITEM_VALUE); - - test_scenario::return_to_sender(scenario, acquired_item); - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/nfts/tests/chat_tests.move b/sui_programmability/examples/nfts/tests/chat_tests.move deleted file mode 100644 index 86e1e9f0b7d4f..0000000000000 --- a/sui_programmability/examples/nfts/tests/chat_tests.move +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module nfts::chat_tests { - use nfts::chat::{Self, Chat}; - use std::ascii::Self; - use sui::test_scenario::Self; - - const USER1_ADDRESS: address = @0xA001; - const METADATA: vector = vector[0u8]; - const HELLO: vector = vector[72, 101, 108, 108, 111]; // "Hello" in ASCII. - - #[test] - fun test_chat() { - let mut scenario_val = test_scenario::begin(USER1_ADDRESS); - let scenario = &mut scenario_val; - { - chat::post( - @0xC001, // This should be an application object ID. - HELLO, - METADATA, // Some metadata (it could be empty). - test_scenario::ctx(scenario) - ); - }; - - test_scenario::next_tx(scenario, USER1_ADDRESS); - { - assert!(test_scenario::has_most_recent_for_sender(scenario), 0); - let chat = test_scenario::take_from_sender(scenario); // if can remove, object exists - assert!(chat::text(&chat) == ascii::string(HELLO), 0); - test_scenario::return_to_sender(scenario, chat); - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/nfts/tests/cross_chain_airdrop_tests.move b/sui_programmability/examples/nfts/tests/cross_chain_airdrop_tests.move deleted file mode 100644 index 99f8ad7a0a5a3..0000000000000 --- a/sui_programmability/examples/nfts/tests/cross_chain_airdrop_tests.move +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module nfts::cross_chain_airdrop_tests { - use nfts::cross_chain_airdrop::{Self, CrossChainAirdropOracle, ERC721}; - use sui::test_scenario::{Self, Scenario}; - - // Error codes - - /// Trying to claim a token that has already been claimed - const EOBJECT_NOT_FOUND: u64 = 1; - - const ORACLE_ADDRESS: address = @0x1000; - const RECIPIENT_ADDRESS: address = @0x10; - const SOURCE_CONTRACT_ADDRESS: vector = x"BC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"; - const SOURCE_TOKEN_ID: u64 = 101; - const NAME: vector = b"BoredApeYachtClub"; - const TOKEN_URI: vector = b"ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/101"; - - public struct Object has key { - id: UID, - } - - #[test] - fun test_claim_airdrop() { - let (mut scenario, oracle_address) = init_scenario(); - - // claim a token - claim_token(&mut scenario, oracle_address, SOURCE_TOKEN_ID); - - // verify that the recipient has received the nft - assert!(owns_object(RECIPIENT_ADDRESS), EOBJECT_NOT_FOUND); - test_scenario::end(scenario); - } - - #[test] - #[expected_failure(abort_code = cross_chain_airdrop::ETokenIDClaimed)] - fun test_double_claim() { - let (mut scenario, oracle_address) = init_scenario(); - - // claim a token - claim_token(&mut scenario, oracle_address, SOURCE_TOKEN_ID); - - // claim the same token again - claim_token(&mut scenario, oracle_address, SOURCE_TOKEN_ID); - test_scenario::end(scenario); - } - - fun init_scenario(): (Scenario, address) { - let mut scenario = test_scenario::begin(ORACLE_ADDRESS); - { - let ctx = test_scenario::ctx(&mut scenario); - cross_chain_airdrop::test_init(ctx); - }; - (scenario, ORACLE_ADDRESS) - } - - fun claim_token(scenario: &mut Scenario, oracle_address: address, token_id: u64) { - test_scenario::next_tx(scenario, oracle_address); - { - let mut oracle = test_scenario::take_from_sender(scenario); - let ctx = test_scenario::ctx(scenario); - cross_chain_airdrop::claim( - &mut oracle, - RECIPIENT_ADDRESS, - SOURCE_CONTRACT_ADDRESS, - token_id, - NAME, - TOKEN_URI, - ctx, - ); - test_scenario::return_to_sender(scenario, oracle); - }; - test_scenario::next_tx(scenario, oracle_address); - } - - fun owns_object(owner: address): bool{ - // Verify the token has been transfer to the recipient - test_scenario::has_most_recent_for_address(owner) - } -} diff --git a/sui_programmability/examples/nfts/tests/discount_coupon_tests.move b/sui_programmability/examples/nfts/tests/discount_coupon_tests.move deleted file mode 100644 index 4611c6bebbc97..0000000000000 --- a/sui_programmability/examples/nfts/tests/discount_coupon_tests.move +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module nfts::discount_coupon_tests { - use nfts::discount_coupon::{Self, DiscountCoupon}; - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - use sui::test_scenario::Self; - - const ISSUER_ADDRESS: address = @0xA001; - const USER1_ADDRESS: address = @0xB001; - - // Error codes. - // const MINT_FAILED: u64 = 0; - // const TRANSFER_FAILED: u64 = 1; - - #[allow(unused_function)] - // Initializes the "state of the world" that mimics what should - // be available in Sui genesis state (e.g., mints and distributes - // coins to users). - fun init(ctx: &mut TxContext) { - let coin = coin::mint_for_testing(100, ctx); - transfer::public_transfer(coin, ISSUER_ADDRESS); - } - - #[test] - fun test_mint_then_transfer() { - let mut scenario_val = test_scenario::begin(ISSUER_ADDRESS); - let scenario = &mut scenario_val; - { - init(test_scenario::ctx(scenario)); - }; - - // Mint and transfer NFT + top up recipient's address. - test_scenario::next_tx(scenario, ISSUER_ADDRESS); - { - let coin = test_scenario::take_from_sender>(scenario); - discount_coupon::mint_and_topup(coin, 10, 1648820870, USER1_ADDRESS, test_scenario::ctx(scenario)); - }; - - test_scenario::next_tx(scenario, USER1_ADDRESS); - { - assert!( - test_scenario::has_most_recent_for_sender(scenario), - 0 - ); - let nft_coupon = test_scenario::take_from_sender(scenario); // if can remove, object exists - assert!(discount_coupon::issuer(&nft_coupon) == ISSUER_ADDRESS, 0); - test_scenario::return_to_sender(scenario, nft_coupon); - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/nfts/tests/shared_auction_tests.move b/sui_programmability/examples/nfts/tests/shared_auction_tests.move deleted file mode 100644 index 4174b024282ff..0000000000000 --- a/sui_programmability/examples/nfts/tests/shared_auction_tests.move +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module nfts::shared_auction_tests { - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - use sui::test_scenario; - - use nfts::shared_auction; - use nfts::auction_lib::Auction; - - - const COIN_VALUE: u64 = 100; - - // Error codes. - const EWRONG_ITEM_VALUE: u64 = 1; - const EWRONG_COIN_VALUE: u64 = 2; - - // Example of an object type that could be sold at an auction. - public struct SomeItemToSell has key, store { - id: UID, - value: u64, - } - - // Initializes the "state of the world" that mimics what should - // be available in Sui genesis state (e.g., mints and distributes - // coins to users). - fun init_bidders(ctx: &mut TxContext, mut bidders: vector
) { - while (!vector::is_empty(&bidders)) { - let bidder = vector::pop_back(&mut bidders); - let coin = coin::mint_for_testing(COIN_VALUE, ctx); - transfer::public_transfer(coin, bidder); - }; - } - - #[test] - fun simple_auction_test() { - let admin = @0xABBA; // needed only to initialize "state of the world" - let owner = @0xACE; - let bidder1 = @0xFACE; - let bidder2 = @0xCAFE; - - let mut scenario_val = test_scenario::begin(admin); - let scenario = &mut scenario_val; - { - let mut bidders = vector::empty(); - vector::push_back(&mut bidders, bidder1); - vector::push_back(&mut bidders, bidder2); - init_bidders(test_scenario::ctx(scenario), bidders); - }; - - // a transaction by the item owner to put it for auction - test_scenario::next_tx(scenario, owner); - let ctx = test_scenario::ctx(scenario); - { - let to_sell = SomeItemToSell { - id: object::new(ctx), - value: 42, - }; - shared_auction::create_auction(to_sell, ctx); - }; - - // a transaction by the first bidder to put a bid - test_scenario::next_tx(scenario, bidder1); - { - let coin = test_scenario::take_from_sender>(scenario); - let mut auction_val = test_scenario::take_shared>(scenario); - let auction = &mut auction_val; - - shared_auction::bid(coin, auction, test_scenario::ctx(scenario)); - - test_scenario::return_shared(auction_val); - }; - - // a transaction by the second bidder to put a bid (a bid will - // fail as it has the same value as that of the first - // bidder's) - test_scenario::next_tx(scenario, bidder2); - { - let coin = test_scenario::take_from_sender>(scenario); - let mut auction_val = test_scenario::take_shared>(scenario); - let auction = &mut auction_val; - - shared_auction::bid(coin, auction, test_scenario::ctx(scenario)); - - test_scenario::return_shared(auction_val); - }; - - // a transaction by the second bidder to verify that the funds - // have been returned (as a result of the failed bid). - test_scenario::next_tx(scenario, bidder2); - { - let coin = test_scenario::take_from_sender>(scenario); - - assert!(coin::value(&coin) == COIN_VALUE, EWRONG_COIN_VALUE); - - test_scenario::return_to_sender(scenario, coin); - }; - - // a transaction by the owner to end auction - test_scenario::next_tx(scenario, owner); - { - let mut auction_val = test_scenario::take_shared>(scenario); - let auction = &mut auction_val; - - // pass auction as mutable reference as its a shared - // object that cannot be deleted - shared_auction::end_auction(auction, test_scenario::ctx(scenario)); - - test_scenario::return_shared(auction_val); - }; - - // a transaction to check if the first bidder won (as the - // second bidder's bid was the same as that of the first one) - test_scenario::next_tx(scenario, bidder1); - { - let acquired_item = test_scenario::take_from_sender(scenario); - - assert!(acquired_item.value == 42, EWRONG_ITEM_VALUE); - - test_scenario::return_to_sender(scenario, acquired_item); - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/objects_tutorial/Move.toml b/sui_programmability/examples/objects_tutorial/Move.toml deleted file mode 100644 index 53864a96315f3..0000000000000 --- a/sui_programmability/examples/objects_tutorial/Move.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "Tutorial" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -MoveStdlib = { local = "../../../crates/sui-framework/packages/move-stdlib/" } -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -tutorial = "0x0" diff --git a/sui_programmability/examples/objects_tutorial/sources/color_object.move b/sui_programmability/examples/objects_tutorial/sources/color_object.move deleted file mode 100644 index 844d4778d3820..0000000000000 --- a/sui_programmability/examples/objects_tutorial/sources/color_object.move +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module tutorial::color_object { - public struct ColorObject has key { - id: UID, - red: u8, - green: u8, - blue: u8, - } - - // == Functions covered in Chapter 1 == - - fun new(red: u8, green: u8, blue: u8, ctx: &mut TxContext): ColorObject { - ColorObject { - id: object::new(ctx), - red, - green, - blue, - } - } - - public entry fun create(red: u8, green: u8, blue: u8, ctx: &mut TxContext) { - let color_object = new(red, green, blue, ctx); - transfer::transfer(color_object, tx_context::sender(ctx)) - } - - public fun get_color(self: &ColorObject): (u8, u8, u8) { - (self.red, self.green, self.blue) - } - - // == Functions covered in Chapter 2 == - - /// Copies the values of `from_object` into `into_object`. - public entry fun copy_into(from_object: &ColorObject, into_object: &mut ColorObject) { - into_object.red = from_object.red; - into_object.green = from_object.green; - into_object.blue = from_object.blue; - } - - public entry fun delete(object: ColorObject) { - let ColorObject { id, red: _, green: _, blue: _ } = object; - object::delete(id); - } - - public entry fun transfer(object: ColorObject, recipient: address) { - transfer::transfer(object, recipient) - } - - // == Functions covered in Chapter 3 == - - public entry fun freeze_object(object: ColorObject) { - transfer::freeze_object(object) - } - - public entry fun create_immutable(red: u8, green: u8, blue: u8, ctx: &mut TxContext) { - let color_object = new(red, green, blue, ctx); - transfer::freeze_object(color_object) - } - - public entry fun update( - object: &mut ColorObject, - red: u8, green: u8, blue: u8, - ) { - object.red = red; - object.green = green; - object.blue = blue; - } -} - -#[test_only] -module tutorial::color_object_tests { - use sui::test_scenario; - use tutorial::color_object::{Self, ColorObject}; - - // == Tests covered in Chapter 1 == - - #[test] - fun test_create() { - let owner = @0x1; - // Create a ColorObject and transfer it to @owner. - let mut scenario_val = test_scenario::begin(owner); - let scenario = &mut scenario_val; - { - let ctx = test_scenario::ctx(scenario); - color_object::create(255, 0, 255, ctx); - }; - // Check that @not_owner does not own the just-created ColorObject. - let not_owner = @0x2; - test_scenario::next_tx(scenario, not_owner); - { - assert!(!test_scenario::has_most_recent_for_sender(scenario), 0); - }; - // Check that @owner indeed owns the just-created ColorObject. - // Also checks the value fields of the object. - test_scenario::next_tx(scenario, owner); - { - let object = test_scenario::take_from_sender(scenario); - let (red, green, blue) = color_object::get_color(&object); - assert!(red == 255 && green == 0 && blue == 255, 0); - test_scenario::return_to_sender(scenario, object); - }; - test_scenario::end(scenario_val); - } - - // == Tests covered in Chapter 2 == - - #[test] - fun test_copy_into() { - let owner = @0x1; - let mut scenario_val = test_scenario::begin(owner); - let scenario = &mut scenario_val; - // Create two ColorObjects owned by `owner`, and obtain their IDs. - let (id1, id2) = { - let ctx = test_scenario::ctx(scenario); - color_object::create(255, 255, 255, ctx); - let id1 = - object::id_from_address(tx_context::last_created_object_id(ctx)); - color_object::create(0, 0, 0, ctx); - let id2 = - object::id_from_address(tx_context::last_created_object_id(ctx)); - (id1, id2) - }; - test_scenario::next_tx(scenario, owner); - { - let mut obj1 = test_scenario::take_from_sender_by_id(scenario, id1); - let obj2 = test_scenario::take_from_sender_by_id(scenario, id2); - let (red, green, blue) = color_object::get_color(&obj1); - assert!(red == 255 && green == 255 && blue == 255, 0); - - color_object::copy_into(&obj2, &mut obj1); - test_scenario::return_to_sender(scenario, obj1); - test_scenario::return_to_sender(scenario, obj2); - }; - test_scenario::next_tx(scenario, owner); - { - let obj1 = test_scenario::take_from_sender_by_id(scenario, id1); - let (red, green, blue) = color_object::get_color(&obj1); - assert!(red == 0 && green == 0 && blue == 0, 0); - test_scenario::return_to_sender(scenario, obj1); - }; - test_scenario::end(scenario_val); - } - - #[test] - fun test_delete() { - let owner = @0x1; - // Create a ColorObject and transfer it to @owner. - let mut scenario_val = test_scenario::begin(owner); - let scenario = &mut scenario_val; - { - let ctx = test_scenario::ctx(scenario); - color_object::create(255, 0, 255, ctx); - }; - // Delete the ColorObject we just created. - test_scenario::next_tx(scenario, owner); - { - let object = test_scenario::take_from_sender(scenario); - color_object::delete(object); - }; - // Verify that the object was indeed deleted. - test_scenario::next_tx(scenario, owner); - { - assert!(!test_scenario::has_most_recent_for_sender(scenario), 0); - }; - test_scenario::end(scenario_val); - } - - #[test] - fun test_transfer() { - let owner = @0x1; - // Create a ColorObject and transfer it to @owner. - let mut scenario_val = test_scenario::begin(owner); - let scenario = &mut scenario_val; - { - let ctx = test_scenario::ctx(scenario); - color_object::create(255, 0, 255, ctx); - }; - // Transfer the object to recipient. - let recipient = @0x2; - test_scenario::next_tx(scenario, owner); - { - let object = test_scenario::take_from_sender(scenario); - color_object::transfer(object, recipient); - }; - // Check that owner no longer owns the object. - test_scenario::next_tx(scenario, owner); - { - assert!(!test_scenario::has_most_recent_for_sender(scenario), 0); - }; - // Check that recipient now owns the object. - test_scenario::next_tx(scenario, recipient); - { - assert!(test_scenario::has_most_recent_for_sender(scenario), 0); - }; - test_scenario::end(scenario_val); - } - - // == Tests covered in Chapter 3 == - - #[test] - fun test_immutable() { - let sender1 = @0x1; - let mut scenario_val = test_scenario::begin(sender1); - let scenario = &mut scenario_val; - { - let ctx = test_scenario::ctx(scenario); - color_object::create_immutable(255, 0, 255, ctx); - }; - test_scenario::next_tx(scenario, sender1); - { - // take_owned does not work for immutable objects. - assert!(!test_scenario::has_most_recent_for_sender(scenario), 0); - }; - // Any sender can work. - let sender2 = @0x2; - test_scenario::next_tx(scenario, sender2); - { - let object_val = test_scenario::take_immutable(scenario); - let object = &object_val; - let (red, green, blue) = color_object::get_color(object); - assert!(red == 255 && green == 0 && blue == 255, 0); - test_scenario::return_immutable(object_val); - }; - test_scenario::end(scenario_val); - } -} diff --git a/sui_programmability/examples/objects_tutorial/sources/simple_warrior.move b/sui_programmability/examples/objects_tutorial/sources/simple_warrior.move deleted file mode 100644 index 2e5e926927799..0000000000000 --- a/sui_programmability/examples/objects_tutorial/sources/simple_warrior.move +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module tutorial::simple_warrior { - public struct Sword has key, store { - id: UID, - strength: u8, - } - - public struct Shield has key, store { - id: UID, - armor: u8, - } - - public struct SimpleWarrior has key { - id: UID, - sword: Option, - shield: Option, - } - - public entry fun create_sword(strength: u8, ctx: &mut TxContext) { - let sword = Sword { - id: object::new(ctx), - strength, - }; - transfer::transfer(sword, tx_context::sender(ctx)) - } - - public entry fun create_shield(armor: u8, ctx: &mut TxContext) { - let shield = Shield { - id: object::new(ctx), - armor, - }; - transfer::transfer(shield, tx_context::sender(ctx)) - } - - public entry fun create_warrior(ctx: &mut TxContext) { - let warrior = SimpleWarrior { - id: object::new(ctx), - sword: option::none(), - shield: option::none(), - }; - transfer::transfer(warrior, tx_context::sender(ctx)) - } - - public entry fun equip_sword(warrior: &mut SimpleWarrior, sword: Sword, ctx: &TxContext) { - if (option::is_some(&warrior.sword)) { - let old_sword = option::extract(&mut warrior.sword); - transfer::transfer(old_sword, tx_context::sender(ctx)); - }; - option::fill(&mut warrior.sword, sword); - } - - public entry fun equip_shield(warrior: &mut SimpleWarrior, shield: Shield, ctx: &TxContext) { - if (option::is_some(&warrior.shield)) { - let old_shield = option::extract(&mut warrior.shield); - transfer::transfer(old_shield, tx_context::sender(ctx)); - }; - option::fill(&mut warrior.shield, shield); - } -} diff --git a/sui_programmability/examples/objects_tutorial/sources/trusted_swap.move b/sui_programmability/examples/objects_tutorial/sources/trusted_swap.move deleted file mode 100644 index de54fac5c95f2..0000000000000 --- a/sui_programmability/examples/objects_tutorial/sources/trusted_swap.move +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module tutorial::trusted_swap { - use sui::balance::{Self, Balance}; - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - - const MIN_FEE: u64 = 1000; - - public struct Object has key, store { - id: UID, - scarcity: u8, - style: u8, - } - - public struct ObjectWrapper has key { - id: UID, - original_owner: address, - to_swap: Object, - fee: Balance, - } - - public entry fun create_object(scarcity: u8, style: u8, ctx: &mut TxContext) { - let object = Object { - id: object::new(ctx), - scarcity, - style, - }; - transfer::public_transfer(object, tx_context::sender(ctx)) - } - - /// Anyone owns an `Object` can request swapping their object. This object - /// will be wrapped into `ObjectWrapper` and sent to `service_address`. - public entry fun request_swap(object: Object, fee: Coin, service_address: address, ctx: &mut TxContext) { - assert!(coin::value(&fee) >= MIN_FEE, 0); - let wrapper = ObjectWrapper { - id: object::new(ctx), - original_owner: tx_context::sender(ctx), - to_swap: object, - fee: coin::into_balance(fee), - }; - transfer::transfer(wrapper, service_address); - } - - /// When the admin has two swap requests with objects that are trade-able, - /// the admin can execute the swap and send them back to the opposite owner. - public entry fun execute_swap(wrapper1: ObjectWrapper, wrapper2: ObjectWrapper, ctx: &mut TxContext) { - // Only swap if their scarcity is the same and style is different. - assert!(wrapper1.to_swap.scarcity == wrapper2.to_swap.scarcity, 0); - assert!(wrapper1.to_swap.style != wrapper2.to_swap.style, 0); - - // Unpack both wrappers, cross send them to the other owner. - let ObjectWrapper { - id: id1, - original_owner: original_owner1, - to_swap: object1, - fee: mut fee1, - } = wrapper1; - - let ObjectWrapper { - id: id2, - original_owner: original_owner2, - to_swap: object2, - fee: fee2, - } = wrapper2; - - // Perform the swap. - transfer::transfer(object1, original_owner2); - transfer::transfer(object2, original_owner1); - - // Service provider takes the fee. - let service_address = tx_context::sender(ctx); - balance::join(&mut fee1, fee2); - transfer::public_transfer(coin::from_balance(fee1, ctx), service_address); - - // Effectively delete the wrapper objects. - object::delete(id1); - object::delete(id2); - } -} diff --git a/sui_programmability/examples/utils/Move.toml b/sui_programmability/examples/utils/Move.toml deleted file mode 100644 index 0c6408ee6a336..0000000000000 --- a/sui_programmability/examples/utils/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "utils" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -Sui = { local = "../../../crates/sui-framework/packages/sui-framework" } - -[addresses] -utils = "0x0" diff --git a/sui_programmability/examples/utils/sources/epoch_time_lock.move b/sui_programmability/examples/utils/sources/epoch_time_lock.move deleted file mode 100644 index b6820e8b74210..0000000000000 --- a/sui_programmability/examples/utils/sources/epoch_time_lock.move +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module utils::epoch_time_lock { - - /// The epoch passed into the creation of a lock has already passed. - const EEpochAlreadyPassed: u64 = 0; - - /// Attempt is made to unlock a lock that cannot be unlocked yet. - const EEpochNotYetEnded: u64 = 1; - - /// Holder of an epoch number that can only be discarded in the epoch or - /// after the epoch has passed. - public struct EpochTimeLock has store, copy { - epoch: u64 - } - - /// Create a new epoch time lock with `epoch`. Aborts if the current epoch is less than the input epoch. - public fun new(epoch: u64, ctx: &TxContext) : EpochTimeLock { - assert!(ctx.epoch() < epoch, EEpochAlreadyPassed); - EpochTimeLock { epoch } - } - - /// Destroys an epoch time lock. Aborts if the current epoch is less than the locked epoch. - public fun destroy(lock: EpochTimeLock, ctx: &TxContext) { - let EpochTimeLock { epoch } = lock; - assert!(ctx.epoch() >= epoch, EEpochNotYetEnded); - } - - /// Getter for the epoch number. - public fun epoch(lock: &EpochTimeLock): u64 { - lock.epoch - } -} diff --git a/sui_programmability/examples/utils/sources/immutable_external_resource.move b/sui_programmability/examples/utils/sources/immutable_external_resource.move deleted file mode 100644 index 6853765d993d1..0000000000000 --- a/sui_programmability/examples/utils/sources/immutable_external_resource.move +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Sui types for specifying off-chain/external resources. -/// -/// The keywords "MUST", "MUST NOT", "SHOULD", "SHOULD NOT" and "MAY" below should be interpreted as described in -/// RFC 2119. -/// -module utils::immutable_external_resource { - use sui::url::{Url, inner_url}; - - /// ImmutableExternalResource: An arbitrary, mutable URL plus an immutable digest of the resource. - /// - /// Represents a resource that can move but must never change. Example use cases: - /// - NFT images. - /// - NFT metadata. - /// - /// `url` MUST follow RFC-3986. Clients MUST support (at least) the following schemes: ipfs, https. - /// `digest` MUST be set to SHA3-256(content of resource at `url`). - /// - /// Clients of this type MUST fetch the resource at `url`, compute its digest and compare it against `digest`. If - /// the result is false, clients SHOULD indicate that to users or ignore the resource. - public struct ImmutableExternalResource has store, copy, drop { - url: Url, - digest: vector, - } - - /// Create a `ImmutableExternalResource`, and set the immutable hash. - public fun new(url: Url, digest: vector): ImmutableExternalResource { - ImmutableExternalResource { url, digest } - } - - /// Get the hash of the resource. - public fun digest(self: &ImmutableExternalResource): vector { - self.digest - } - - /// Get the URL of the resource. - public fun url(self: &ImmutableExternalResource): Url { - self.url - } - - /// Update the URL, but the digest of the resource must never change. - public fun update(self: &mut ImmutableExternalResource, url: Url) { - self.url.update(url.inner_url()) - } -} diff --git a/sui_programmability/examples/utils/sources/locked_coin.move b/sui_programmability/examples/utils/sources/locked_coin.move deleted file mode 100644 index 4e72dc03543a5..0000000000000 --- a/sui_programmability/examples/utils/sources/locked_coin.move +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module utils::locked_coin { - use sui::balance::Balance; - use sui::coin::{Self, Coin}; - use utils::epoch_time_lock::{Self, EpochTimeLock}; - - /// A coin of type `T` locked until `locked_until_epoch`. - public struct LockedCoin has key { - id: UID, - balance: Balance, - locked_until_epoch: EpochTimeLock - } - - /// Create a LockedCoin from `balance` and transfer it to `owner`. - public fun new_from_balance(balance: Balance, locked_until_epoch: EpochTimeLock, owner: address, ctx: &mut TxContext) { - let locked_coin = LockedCoin { - id: object::new(ctx), - balance, - locked_until_epoch - }; - transfer::transfer(locked_coin, owner); - } - - /// Public getter for the locked coin's value - public fun value(self: &LockedCoin): u64 { - self.balance.value() - } - - /// Lock a coin up until `locked_until_epoch`. The input Coin is deleted and a LockedCoin - /// is transferred to the `recipient`. This function aborts if the `locked_until_epoch` is less than - /// or equal to the current epoch. - public entry fun lock_coin( - coin: Coin, recipient: address, locked_until_epoch: u64, ctx: &mut TxContext - ) { - let balance = coin.into_balance(); - new_from_balance(balance, epoch_time_lock::new(locked_until_epoch, ctx), recipient, ctx); - } - - /// Unlock a locked coin. The function aborts if the current epoch is less than the `locked_until_epoch` - /// of the coin. If the check is successful, the locked coin is deleted and a Coin is transferred back - /// to the sender. - public entry fun unlock_coin(locked_coin: LockedCoin, ctx: &mut TxContext) { - let LockedCoin { id, balance, locked_until_epoch } = locked_coin; - id.delete(); - locked_until_epoch.destroy(ctx); - let coin = coin::from_balance(balance, ctx); - transfer::public_transfer(coin, ctx.sender()); - } -} diff --git a/sui_programmability/examples/utils/sources/safe.move b/sui_programmability/examples/utils/sources/safe.move deleted file mode 100644 index 12eed36871463..0000000000000 --- a/sui_programmability/examples/utils/sources/safe.move +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// The Safe standard is a minimalistic shared wrapper around a coin. It provides a way for users to provide third-party dApps with -/// the capability to transfer coins away from their wallets, if they are provided with the correct permission. -module utils::safe { - use sui::balance::{Self, Balance}; - use sui::coin::{Self, Coin}; - use sui::vec_set::{Self, VecSet}; - - // Errors - const EInvalidTransferCapability: u64 = 0; - const EInvalidOwnerCapability: u64 = 1; - const ETransferCapabilityRevoked: u64 = 2; - const EOverdrawn: u64 = 3; - - // - /// Allows any holder of a capability to transfer a fixed amount of assets from the safe. - /// Useful in situations like an NFT marketplace where you wish to buy the NFTs at a specific price. - /// - /// @ownership: Shared - /// - public struct Safe has key { - id: UID, - balance: Balance, - allowed_safes: VecSet, - } - - public struct OwnerCapability has key, store { - id: UID, - safe_id: ID, - } - - /// - /// Allows the owner of the capability to take `amount` of coins from the box. - /// - /// @ownership: Owned - /// - public struct TransferCapability has store, key { - id: UID, - safe_id: ID, - // The amount that the user is able to transfer. - amount: u64, - } - - ////////////////////////////////////////////////////// - /// HELPER FUNCTIONS - ////////////////////////////////////////////////////// - - /// Check that the capability has not yet been revoked by the owner. - fun check_capability_validity(safe: &Safe, capability: &TransferCapability) { - // Check that the ids match - assert!(object::id(safe) == capability.safe_id, EInvalidTransferCapability); - // Check that it has not been cancelled - assert!(safe.allowed_safes.contains(&object::id(capability)), ETransferCapabilityRevoked); - } - - fun check_owner_capability_validity(safe: &Safe, capability: &OwnerCapability) { - assert!(object::id(safe) == capability.safe_id, EInvalidOwnerCapability); - } - - /// Helper function to create a capability. - fun create_capability_(safe: &mut Safe, withdraw_amount: u64, ctx: &mut TxContext): TransferCapability { - let cap_id = object::new(ctx); - safe.allowed_safes.insert(cap_id.uid_to_inner()); - - let capability = TransferCapability { - id: cap_id, - safe_id: safe.id.uid_to_inner(), - amount: withdraw_amount, - }; - - capability - } - - ////////////////////////////////////////////////////// - /// PUBLIC FUNCTIONS - ////////////////////////////////////////////////////// - - public fun balance(safe: &Safe): &Balance { - &safe.balance - } - - /// Wrap a coin around a safe. - /// a trusted party (or smart contract) to transfer the object out. - public fun create_(balance: Balance, ctx: &mut TxContext): OwnerCapability { - let safe = Safe { - id: object::new(ctx), - balance, - allowed_safes: vec_set::empty(), - }; - let cap = OwnerCapability { - id: object::new(ctx), - safe_id: object::id(&safe), - }; - transfer::share_object(safe); - cap - } - - public entry fun create(coin: Coin, ctx: &mut TxContext) { - let balance = coin.into_balance(); - let cap = create_(balance, ctx); - transfer::public_transfer(cap, ctx.sender()); - } - - public entry fun create_empty(ctx: &mut TxContext) { - let empty_balance = balance::zero(); - let cap = create_(empty_balance, ctx); - transfer::public_transfer(cap, ctx.sender()); - } - - /// Deposit funds to the safe - public fun deposit_(safe: &mut Safe, balance: Balance) { - safe.balance.join(balance); - } - - /// Deposit funds to the safe - public entry fun deposit(safe: &mut Safe, coin: Coin) { - let balance = coin.into_balance(); - deposit_(safe, balance); - } - - /// Withdraw coins from the safe as a `OwnerCapability` holder - public fun withdraw_(safe: &mut Safe, capability: &OwnerCapability, withdraw_amount: u64): Balance { - // Ensures that only the owner can withdraw from the safe. - check_owner_capability_validity(safe, capability); - safe.balance.split(withdraw_amount) - } - - /// Withdraw coins from the safe as a `OwnerCapability` holder - public entry fun withdraw(safe: &mut Safe, capability: &OwnerCapability, withdraw_amount: u64, ctx: &mut TxContext) { - let balance = withdraw_(safe, capability, withdraw_amount); - let coin = coin::from_balance(balance, ctx); - transfer::public_transfer(coin, ctx.sender()); - } - - /// Withdraw coins from the safe as a `TransferCapability` holder. - public fun debit(safe: &mut Safe, capability: &mut TransferCapability, withdraw_amount: u64): Balance { - // Check the validity of the capability - check_capability_validity(safe, capability); - - // Withdraw funds - assert!(capability.amount >= withdraw_amount, EOverdrawn); - capability.amount = capability.amount - withdraw_amount; - safe.balance.split(withdraw_amount) - } - - /// Revoke a `TransferCapability` as an `OwnerCapability` holder - public entry fun revoke_transfer_capability(safe: &mut Safe, capability: &OwnerCapability, capability_id: ID) { - // Ensures that only the owner can withdraw from the safe. - check_owner_capability_validity(safe, capability); - safe.allowed_safes.remove(&capability_id); - } - - /// Revoke a `TransferCapability` as its owner - public entry fun self_revoke_transfer_capability(safe: &mut Safe, capability: &TransferCapability) { - check_capability_validity(safe, capability); - safe.allowed_safes.remove(&object::id(capability)); - } - - /// Create `TransferCapability` as an `OwnerCapability` holder - public fun create_transfer_capability(safe: &mut Safe, capability: &OwnerCapability, withdraw_amount: u64, ctx: &mut TxContext): TransferCapability { - // Ensures that only the owner can withdraw from the safe. - check_owner_capability_validity(safe, capability); - create_capability_(safe, withdraw_amount, ctx) - } -} diff --git a/sui_programmability/examples/utils/sources/typed_id.move b/sui_programmability/examples/utils/sources/typed_id.move deleted file mode 100644 index a6759b62830ce..0000000000000 --- a/sui_programmability/examples/utils/sources/typed_id.move +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -/// Typed wrappers around Sui object IDs -/// While not always necessary, this is helpful for indicating the type of an object, particularly -/// when storing its ID in another object. -/// Additionally, it can be helpful for disambiguating between different IDs in an object. -/// For example -/// ``` -/// struct MyObject has key { -/// id: VersionedID, -/// child1: TypedID, -/// child2: TypedID, -/// } -/// ``` -/// We then know that `child1` is an ID for an object of type `A` and that `child2` is an `ID` -/// of an object of type `B` -module utils::typed_id { - /// An ID of an of type `T`. See `ID` for more details - /// By construction, it is guaranteed that the `ID` represents an object of type `T` - public struct TypedID has copy, drop, store { - id: ID, - } - - /// Get the underlying `ID` of `obj`, and remember the type - public fun new(obj: &T): TypedID { - TypedID { id: object::id(obj) } - } - - /// Borrow the inner `ID` of `typed_id` - public fun as_id(typed_id: &TypedID): &ID { - &typed_id.id - } - - /// Get the inner `ID` of `typed_id` - public fun to_id(typed_id: TypedID): ID { - let TypedID { id } = typed_id; - id - } - - /// Check that underlying `ID` in the `typed_id` equals the objects ID - public fun equals_object(typed_id: &TypedID, obj: &T): bool { - typed_id.id == object::id(obj) - } -} diff --git a/sui_programmability/examples/utils/tests/immutable_external_resource_tests.move b/sui_programmability/examples/utils/tests/immutable_external_resource_tests.move deleted file mode 100644 index 14c8246ac4a4d..0000000000000 --- a/sui_programmability/examples/utils/tests/immutable_external_resource_tests.move +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module utils::immutable_external_resource_tests { - use utils::immutable_external_resource; - use sui::url; - use std::ascii::Self; - use std::hash::sha3_256; - - const EHashStringMisMatch: u64 = 0; - const EUrlStringMisMatch: u64 = 1; - - #[test] - fun test_init() { - // url strings are not currently validated - let url_str = ascii::string(x"414243454647"); - // 32 bytes - let hash = x"1234567890123456789012345678901234567890abcdefabcdefabcdefabcdef"; - - let url = url::new_unsafe(url_str); - let digest = sha3_256(hash); - let mut resource = immutable_external_resource::new(url, digest); - - assert!(resource.url() == url, EUrlStringMisMatch); - assert!(resource.digest() == digest, EHashStringMisMatch); - - let new_url_str = ascii::string(x"37414243454647"); - let new_url = url::new_unsafe(new_url_str); - - resource.update(new_url); - assert!(resource.url() == new_url, EUrlStringMisMatch); - } -} diff --git a/sui_programmability/examples/utils/tests/safe_tests.move b/sui_programmability/examples/utils/tests/safe_tests.move deleted file mode 100644 index 399b24e294687..0000000000000 --- a/sui_programmability/examples/utils/tests/safe_tests.move +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module utils::safe_tests { - use utils::safe::{Self, Safe, TransferCapability, OwnerCapability}; - use sui::test_scenario::{Self as ts, Scenario, ctx}; - use sui::coin::{Self, Coin}; - use sui::sui::SUI; - use sui::test_utils; - - const TEST_SENDER_ADDR: address = @0x1; - const TEST_OWNER_ADDR: address = @0x1337; - const TEST_DELEGATEE_ADDR: address = @0x1ce1ce1ce; - - fun create_safe(scenario: &mut Scenario, owner: address, stored_amount: u64) { - scenario.next_tx(owner); - { - let coin = coin::mint_for_testing(stored_amount, ctx(scenario)); - safe::create(coin, ctx(scenario)); - }; - } - - // Delegates the safe to delegatee and return the capability ID. - fun delegate_safe(scenario: &mut Scenario, owner: address, delegate_to: address, delegate_amount: u64): ID { - let id; - scenario.next_tx(owner); - let mut safe = scenario.take_shared>(); - let cap = scenario.take_from_sender>(); - let capability = safe.create_transfer_capability(&cap, delegate_amount, ctx(scenario)); - id = object::id(&capability); - transfer::public_transfer(capability, delegate_to); - scenario.return_to_sender(cap); - ts::return_shared(safe); - id - } - - fun withdraw_as_delegatee(scenario: &mut Scenario, delegatee: address, withdraw_amount: u64) { - scenario.next_tx(delegatee); - let mut safe = scenario.take_shared>(); - let mut capability = scenario.take_from_sender>(); - let balance = safe.debit(&mut capability, withdraw_amount); - test_utils::destroy(balance); - - scenario.return_to_sender(capability); - ts::return_shared(safe); - } - - fun revoke_capability(scenario: &mut Scenario, owner: address, capability_id: ID) { - scenario.next_tx(owner); - let mut safe = scenario.take_shared>(); - let cap = scenario.take_from_sender>(); - safe.revoke_transfer_capability(&cap, capability_id); - - scenario.return_to_sender(cap); - ts::return_shared(safe); - } - - #[test] - /// Ensure that all funds can be withdrawn by the owners - fun test_safe_create_and_withdraw_funds_as_owner() { - let owner = TEST_OWNER_ADDR; - let mut scenario = ts::begin(TEST_SENDER_ADDR); - - let initial_funds = 1000u64; - create_safe(scenario, owner, initial_funds); - - scenario.next_tx(owner); - let mut safe = scenario.take_shared>(); - let cap = scenario.take_from_sender>(); - - safe.withdraw(&cap, initial_funds, ts::ctx(scenario)); - scenario.next_tx(owner); - let withdrawn_coin = scenario.take_from_sender>(); - assert!(withdrawn_coin.value() == initial_funds, 0); - - test_utils::destroy(withdrawn_coin); - scenario.return_to_sender(cap); - ts::return_shared(safe); - - scenario.end(); - } - - #[test] - /// Ensure that all funds can be withdrawn to a delegator - fun test_safe_create_and_withdraw_funds_as_delegatee() { - let owner = TEST_OWNER_ADDR; - let delegatee = TEST_DELEGATEE_ADDR; - let mut scenario = ts::begin(TEST_SENDER_ADDR); - - let initial_funds = 1000u64; - let delegated_funds = 1000u64; - // Create Safe - create_safe(scenario, owner, initial_funds); - delegate_safe(scenario, owner, delegatee, delegated_funds); - withdraw_as_delegatee(scenario, delegatee, delegated_funds); - - scenario.end(); - } - - #[test] - #[expected_failure(abort_code = safe::EOverdrawn)] - /// Ensure that funds cannot be over withdrawn - fun test_safe_attempt_to_over_withdraw() { - let owner = TEST_OWNER_ADDR; - let delegatee = TEST_DELEGATEE_ADDR; - let mut scenario = ts::begin(TEST_SENDER_ADDR); - - let initial_funds = 1000u64; - let delegated_funds = 1000u64; - // Create Safe - create_safe(scenario, owner, initial_funds); - delegate_safe(scenario, owner, delegatee, delegated_funds); - - // Withdraw all funds - withdraw_as_delegatee(scenario, delegatee, delegated_funds); - // Attempt to withdraw by 1 coin. - withdraw_as_delegatee(scenario, delegatee, 1); - - scenario.end(); - } - - #[test] - #[expected_failure(abort_code = safe::ETransferCapabilityRevoked)] - /// Ensure that funds cannot be over withdrawn - fun test_safe_withdraw_revoked() { - let owner = TEST_OWNER_ADDR; - let delegatee = TEST_DELEGATEE_ADDR; - let mut scenario = ts::begin(TEST_SENDER_ADDR); - - let initial_funds = 1000u64; - let delegated_funds = 1000u64; - // Create Safe - create_safe(scenario, owner, initial_funds); - let capability_id = delegate_safe(scenario, owner, delegatee, delegated_funds); - - revoke_capability(scenario, owner, capability_id); - - // Withdraw funds - withdraw_as_delegatee(scenario, delegatee, delegated_funds); - - scenario.end(); - } - - #[test] - #[expected_failure(abort_code = safe::ETransferCapabilityRevoked)] - /// Ensure owner cannot withdraw funds after revoking itself. - fun test_safe_withdraw_self_revoked() { - let owner = TEST_OWNER_ADDR; - let mut scenario = ts::begin(owner); - - let initial_funds = 1000u64; - create_safe(scenario, owner, initial_funds); - - scenario.next_tx(owner); - let cap = scenario.take_from_sender>(); - let mut safe = scenario.take_shared>(); - let mut transfer_capability = safe.create_transfer_capability(&cap, initial_funds, ctx(scenario)); - // Function under test - safe.self_revoke_transfer_capability(&transfer_capability); - ts::return_shared(safe); - - // Try withdraw funds with transfer capability. - scenario.next_tx(owner); - let mut safe = scenario.take_shared>(); - let balance = safe.debit(&mut transfer_capability, 1000u64); - test_utils::destroy(balance); - - ts::return_shared(safe); - scenario.return_to_sender(cap); - scenario.return_to_sender(transfer_capability); - scenario.end(); - } -} From 0144a2448216a6a856831898f1f4de24e9d1c216 Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:39:46 -0700 Subject: [PATCH 022/163] Fix build (#18645) --- crates/sui-core/src/validator_tx_finalizer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index 989008d20894a..3215f271538b5 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -505,7 +505,7 @@ mod tests { }) .collect(); let auth_agg = AuthorityAggregator::new( - network_config.committee_with_network().committee, + network_config.committee_with_network().committee().clone(), authority_states[0].clone_committee_store(), clients.clone(), default_registry(), From 883b4c017e3f30c6dcdb63a982a533c7fb08e678 Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Fri, 12 Jul 2024 17:57:50 -0700 Subject: [PATCH 023/163] [move][move-2024] Extract macros from precompiled programs for expansion. (#18643) ## Description This extracts macros from the precompiled program so that macro expansion works for them, too. ## Test plan Updated a test to use `vector`'s `do!`. It failed before the fix, and works now. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../tests/programmable/split_coins.exp | 40 +++++++++---------- .../tests/programmable/split_coins.move | 8 ++-- .../move-compiler/src/typing/translate.rs | 34 ++++++++++++++-- 3 files changed, 53 insertions(+), 29 deletions(-) diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp index c9d306673d10c..4b3a66dd88196 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp @@ -3,22 +3,22 @@ processed 20 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-24: +task 1 'publish'. lines 9-22: created: object(1,0) mutated: object(0,2) -gas summary: computation_cost: 1000000, storage_cost: 5403600, storage_rebate: 0, non_refundable_storage_fee: 0 +gas summary: computation_cost: 1000000, storage_cost: 5677200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-30: +task 2 'programmable'. lines 24-28: created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 31-31: +task 3 'run'. lines 29-29: created: object(3,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 4 'view-object'. lines 33-35: +task 4 'view-object'. lines 31-33: Owner: Account Address ( A ) Version: 3 Contents: sui::coin::Coin { @@ -32,12 +32,12 @@ Contents: sui::coin::Coin { }, } -task 5 'programmable'. lines 36-38: +task 5 'programmable'. lines 34-36: created: object(5,0) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 6 'view-object'. lines 40-40: +task 6 'view-object'. lines 38-38: Owner: Account Address ( A ) Version: 4 Contents: sui::coin::Coin { @@ -51,7 +51,7 @@ Contents: sui::coin::Coin { }, } -task 7 'view-object'. lines 42-45: +task 7 'view-object'. lines 40-43: Owner: Account Address ( B ) Version: 4 Contents: sui::coin::Coin { @@ -65,12 +65,12 @@ Contents: sui::coin::Coin { }, } -task 8 'programmable'. lines 46-48: +task 8 'programmable'. lines 44-46: created: object(8,0), object(8,1) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3952000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 9 'view-object'. lines 50-50: +task 9 'view-object'. lines 48-48: Owner: Account Address ( A ) Version: 5 Contents: sui::coin::Coin { @@ -84,7 +84,7 @@ Contents: sui::coin::Coin { }, } -task 10 'view-object'. lines 52-52: +task 10 'view-object'. lines 50-50: Owner: Account Address ( B ) Version: 5 Contents: sui::coin::Coin { @@ -98,7 +98,7 @@ Contents: sui::coin::Coin { }, } -task 11 'view-object'. lines 54-56: +task 11 'view-object'. lines 52-54: Owner: Account Address ( B ) Version: 5 Contents: sui::coin::Coin { @@ -112,12 +112,12 @@ Contents: sui::coin::Coin { }, } -task 12 'programmable'. lines 57-60: +task 12 'programmable'. lines 55-58: created: object(12,0), object(12,1) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3952000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 13 'view-object'. lines 62-62: +task 13 'view-object'. lines 60-60: Owner: Account Address ( A ) Version: 6 Contents: sui::coin::Coin { @@ -131,7 +131,7 @@ Contents: sui::coin::Coin { }, } -task 14 'view-object'. lines 64-64: +task 14 'view-object'. lines 62-62: Owner: Account Address ( B ) Version: 6 Contents: sui::coin::Coin { @@ -145,7 +145,7 @@ Contents: sui::coin::Coin { }, } -task 15 'view-object'. lines 66-69: +task 15 'view-object'. lines 64-67: Owner: Account Address ( B ) Version: 6 Contents: sui::coin::Coin { @@ -159,12 +159,12 @@ Contents: sui::coin::Coin { }, } -task 16 'programmable'. lines 70-74: +task 16 'programmable'. lines 68-72: created: object(16,0), object(16,1) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3952000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 17 'view-object'. lines 76-76: +task 17 'view-object'. lines 74-74: Owner: Account Address ( A ) Version: 7 Contents: sui::coin::Coin { @@ -178,7 +178,7 @@ Contents: sui::coin::Coin { }, } -task 18 'view-object'. lines 78-78: +task 18 'view-object'. lines 76-76: Owner: Account Address ( B ) Version: 7 Contents: sui::coin::Coin { @@ -192,7 +192,7 @@ Contents: sui::coin::Coin { }, } -task 19 'view-object'. lines 80-80: +task 19 'view-object'. lines 78-78: Owner: Account Address ( B ) Version: 7 Contents: sui::coin::Coin { diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.move b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.move index 2cb3f1a452d6e..3446ffdec04ee 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.move +++ b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.move @@ -14,12 +14,10 @@ module test::m1 { 100 } - public fun transfer_(mut v: vector>, r: address) { - while (!vector::is_empty(&v)) { - let c = vector::pop_back(&mut v); + public fun transfer_(v: vector>, r: address) { + v.do!(|c| { transfer::public_transfer(c, r); - }; - vector::destroy_empty(v); + }); } } diff --git a/external-crates/move/crates/move-compiler/src/typing/translate.rs b/external-crates/move/crates/move-compiler/src/typing/translate.rs index 1ac694fd3b1a4..93ac4a264e6ce 100644 --- a/external-crates/move/crates/move-compiler/src/typing/translate.rs +++ b/external-crates/move/crates/move-compiler/src/typing/translate.rs @@ -66,7 +66,7 @@ pub fn program( info, )); - extract_macros(&mut context, &nmodules); + extract_macros(&mut context, &nmodules, &pre_compiled_lib); let mut modules = modules(&mut context, nmodules); assert!(context.constraints.is_empty()); @@ -92,7 +92,11 @@ pub fn program( prog } -fn extract_macros(context: &mut Context, modules: &UniqueMap) { +fn extract_macros( + context: &mut Context, + modules: &UniqueMap, + pre_compiled_lib: &Option>, +) { // Merges the methods of the module into the local methods for each macro. fn merge_use_funs(module_use_funs: &N::UseFuns, mut macro_use_funs: N::UseFuns) -> N::UseFuns { let N::UseFuns { @@ -118,7 +122,24 @@ fn extract_macros(context: &mut Context, modules: &UniqueMap = + UniqueMap::maybe_from_iter(modules.key_cloned_iter().chain( + pre_compiled_lib.iter().flat_map(|pre_compiled| { + pre_compiled + .naming + .inner + .modules + .key_cloned_iter() + .filter(|(mident, _m)| !modules.contains_key(mident)) + }), + )) + .unwrap(); + + let all_macro_definitions = all_modules.map(|_mident, mdef| { mdef.functions.ref_filter_map(|_name, f| { let _macro_loc = f.macro_?; if let N::FunctionBody_::Defined((use_funs, body)) = &f.body.value { @@ -4445,7 +4466,12 @@ fn expand_macro( let res = match macro_expand::call(context, call_loc, m, f, type_args.clone(), args, return_ty) { None => { - assert!(context.env.has_errors() || context.env.ide_mode()); + if !(context.env.has_errors() || context.env.ide_mode()) { + context.env.add_diag(ice!(( + call_loc, + "No macro found, but name resolution passed." + ))); + } (context.error_type(call_loc), TE::UnresolvedError) } Some(macro_expand::ExpandedMacro { From c2ef24af9af2692f1cedb87fb45e24ad60e3230d Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Sat, 13 Jul 2024 14:44:58 +0100 Subject: [PATCH 024/163] [GraphQL][RFC] Introduce UInt53 scalar (#18552) ## Description Whilst working on #18337, I noticed that we were over-using the `Int` scalar -- using it to represent values that could exceed 2^31 - 1 -- when the GraphQL spec states that `Int` must be a 32-bit signed integer. We made this decision at the time (a) because `async-graphql` allowed converting `u64`s to `Int` and we were primarily concerned with the fact that although JSON doesn't specify a precision for its numeric types, JS (among other languages), assumes it is an IEEE double-precision floating point number, so can only represent integral values precisely below 2^53. `cynic` (a Rust GraphQL client library) is (correctly) stricter, however, and maps an `Int` to an `i32`, always. There may be other similarly strict client libraries for other languages. This PR introduces a new scalar, `UInt`, that maps to a JSON number literal, just like `Int`, but allows us to ascribe our own meaning (in this case, it will be an unsigned number, and it can be as large as 2^53). This scalar has been used in many cases where we had previously used `Int`: sequence numbers, counts of objects, checkpoints, transactions, etc. While other uses continue to use `Int` (pagination limits, service limits, values bounded by the number of validators). In some cases, we have switched from `BigInt` to using this scalar notably: - the db cost estimate, which was previously a `BigInt` because we were unsure of its scale, but in hindsight, after benchmarking, it is unlikely that we would want to set a limit greater than 2^31 - 1. - the number of checkpoints in an epoch, as the number of transactions in an epoch (a number that is guaranteed to be greater) is being represented using an `Int` at the moment (and soon a `UInt53`). This will be a breaking change, so will only go out with the new major version. Hopefully, this change will be minimal as the format of this scalar over the wire is the same as for `Int`, but it will require existing clients to register a new scalar in most cases. ## Test plan Existing tests: ``` sui-graphql-rpc$ cargo nextest run sui-graphql-e2e-tests$ cargo nextest run --features pg_integration ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [x] GraphQL: Introduces a new scalar -- `UInt53` -- to represent unsigned 53 bit integer values. Some uses of `Int` in the existing schema have been replaced with `UInt53`. All clients will need to register the new scalar and clients for statically typed languages will also need to use a wider (e.g. 64 bit), unsigned type to hold the value. - [ ] CLI: - [ ] Rust SDK: --- .../schema/current_progress_schema.graphql | 104 +++++++++-------- crates/sui-graphql-rpc/src/config.rs | 27 +++-- crates/sui-graphql-rpc/src/data/pg.rs | 4 +- crates/sui-graphql-rpc/src/error.rs | 2 +- .../src/extensions/query_limits_checker.rs | 18 +-- .../sui-graphql-rpc/src/extensions/timeout.rs | 4 +- crates/sui-graphql-rpc/src/server/builder.rs | 8 +- crates/sui-graphql-rpc/src/types/balance.rs | 5 +- .../sui-graphql-rpc/src/types/checkpoint.rs | 17 +-- crates/sui-graphql-rpc/src/types/coin.rs | 3 +- .../src/types/coin_metadata.rs | 3 +- crates/sui-graphql-rpc/src/types/cursor.rs | 6 +- crates/sui-graphql-rpc/src/types/epoch.rs | 23 ++-- crates/sui-graphql-rpc/src/types/gas.rs | 2 +- crates/sui-graphql-rpc/src/types/mod.rs | 1 + .../sui-graphql-rpc/src/types/move_object.rs | 3 +- .../sui-graphql-rpc/src/types/move_package.rs | 7 +- crates/sui-graphql-rpc/src/types/object.rs | 39 +++---- .../sui-graphql-rpc/src/types/object_read.rs | 6 +- .../src/types/protocol_config.rs | 6 +- crates/sui-graphql-rpc/src/types/query.rs | 21 ++-- crates/sui-graphql-rpc/src/types/stake.rs | 3 +- .../src/types/suins_registration.rs | 3 +- .../src/types/system_parameters.rs | 4 +- .../src/types/system_state_summary.rs | 8 +- .../src/types/transaction_block.rs | 15 ++- .../src/types/transaction_block_effects.rs | 5 +- .../authenticator_state_update.rs | 12 +- .../consensus_commit_prologue.rs | 6 +- .../transaction_block_kind/end_of_epoch.rs | 16 ++- .../transaction_block_kind/programmable.rs | 5 +- .../randomness_state_update.rs | 13 ++- .../src/types/transaction_metadata.rs | 5 +- crates/sui-graphql-rpc/src/types/uint53.rs | 67 +++++++++++ .../src/types/unchanged_shared_object.rs | 12 +- crates/sui-graphql-rpc/src/types/validator.rs | 15 ++- .../tests/examples_validation_tests.rs | 2 +- .../snapshot_tests__schema_sdl_export.snap | 105 ++++++++++-------- 38 files changed, 364 insertions(+), 241 deletions(-) create mode 100644 crates/sui-graphql-rpc/src/types/uint53.rs diff --git a/crates/sui-graphql-rpc/schema/current_progress_schema.graphql b/crates/sui-graphql-rpc/schema/current_progress_schema.graphql index c77e90adce948..c6b25c69ebe35 100644 --- a/crates/sui-graphql-rpc/schema/current_progress_schema.graphql +++ b/crates/sui-graphql-rpc/schema/current_progress_schema.graphql @@ -172,7 +172,7 @@ type AuthenticatorStateExpireTransaction { """ The initial version that the AuthenticatorStateUpdate was shared at. """ - authenticatorObjInitialSharedVersion: Int! + authenticatorObjInitialSharedVersion: UInt53! } """ @@ -186,7 +186,7 @@ type AuthenticatorStateUpdateTransaction { """ Consensus round of the authenticator state update. """ - round: Int! + round: UInt53! """ Newly active JWKs (JSON Web Keys). """ @@ -194,7 +194,7 @@ type AuthenticatorStateUpdateTransaction { """ The initial version of the authenticator object that it was shared at. """ - authenticatorObjInitialSharedVersion: Int! + authenticatorObjInitialSharedVersion: UInt53! } """ @@ -216,7 +216,7 @@ type Balance { """ How many coins of this type constitute the balance """ - coinObjectCount: Int + coinObjectCount: UInt53 """ Total balance across all coin objects of the coin type """ @@ -311,7 +311,7 @@ scalar BigInt type BridgeCommitteeInitTransaction { - bridgeObjInitialSharedVersion: Int! + bridgeObjInitialSharedVersion: UInt53! } type BridgeStateCreateTransaction { @@ -333,7 +333,7 @@ type ChangeEpochTransaction { """ The protocol version in effect in the new epoch. """ - protocolVersion: Int! + protocolVersion: UInt53! """ The total amount of gas charged for storage during the previous epoch (in MIST). """ @@ -378,7 +378,7 @@ type Checkpoint { This checkpoint's position in the total order of finalized checkpoints, agreed upon by consensus. """ - sequenceNumber: Int! + sequenceNumber: UInt53! """ The timestamp at which the checkpoint is agreed to have happened according to consensus. Transactions that access time in this checkpoint will observe this timestamp. @@ -396,7 +396,7 @@ type Checkpoint { """ The total number of transaction blocks in the network by the end of this checkpoint. """ - networkTotalTransactions: Int + networkTotalTransactions: UInt53 """ The computation cost, storage cost, storage rebate, and non-refundable storage fee accumulated during this epoch, up to and including this checkpoint. These values increase @@ -447,7 +447,7 @@ Filter either by the digest, or the sequence number, or neither, to get the late """ input CheckpointId { digest: String - sequenceNumber: Int + sequenceNumber: UInt53 } """ @@ -487,7 +487,7 @@ type Coin implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -646,7 +646,7 @@ type CoinMetadata implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -761,7 +761,7 @@ type ConsensusCommitPrologueTransaction { """ Consensus round of the commit. """ - round: Int! + round: UInt53! """ Unix timestamp from consensus. """ @@ -996,7 +996,7 @@ type Epoch { """ The epoch's id as a sequence number that starts at 0 and is incremented by one at every epoch change. """ - epochId: Int! + epochId: UInt53! """ The minimum gas price that a quorum of validators are guaranteed to sign a transaction for. """ @@ -1016,11 +1016,11 @@ type Epoch { """ The total number of checkpoints in this epoch. """ - totalCheckpoints: BigInt + totalCheckpoints: UInt53 """ The total number of transaction blocks in this epoch. """ - totalTransactions: Int + totalTransactions: UInt53 """ The total amount of gas fees (in MIST) that were paid in this epoch. """ @@ -1073,7 +1073,7 @@ type Epoch { version changes whenever the fields contained in the system state object (held in a dynamic field attached to `0x5`) change. """ - systemStateVersion: Int + systemStateVersion: UInt53 """ Details of the system that are decided during genesis. """ @@ -1404,7 +1404,7 @@ Interface implemented by on-chain values that are addressable by an ID (also ref address). This includes Move objects and packages. """ interface IObject { - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or system package upgrade transaction. LIVE, the version returned is the most recent for the object, and it is not deleted or wrapped at that version. HISTORICAL, the object was referenced at a specific version or checkpoint, so is fetched from historical tables and may not be the latest version of the object. WRAPPED_OR_DELETED, the object is deleted or wrapped and only partial information can be loaded. """ @@ -1515,7 +1515,7 @@ type Linkage { """ The version of the dependency that this package depends on. """ - version: Int! + version: UInt53! } """ @@ -1942,7 +1942,7 @@ type MoveObject implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -2125,7 +2125,7 @@ type MovePackage implements IObject & IOwner { cannot be owned by an address. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -2461,7 +2461,7 @@ type Object implements IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -2660,7 +2660,7 @@ input ObjectFilter { input ObjectKey { objectId: SuiAddress! - version: Int! + version: UInt53! } enum ObjectKind { @@ -2693,7 +2693,7 @@ input ObjectRef { """ Version or sequence number of the object. """ - version: Int! + version: UInt53! """ Digest of the object. """ @@ -2751,7 +2751,7 @@ type OwnedOrImmutable { """ Version of the object being read. """ - version: Int! + version: UInt53! """ 32-byte hash that identifies the object's contents at this version, encoded as a Base58 string. @@ -2935,7 +2935,7 @@ type ProtocolConfigs { The protocol is not required to change on every epoch boundary, so the protocol version tracks which change to the protocol these configs are from. """ - protocolVersion: Int! + protocolVersion: UInt53! """ List all available feature flags and their values. Feature flags are a form of boolean configuration that are usually used to gate features while they are in development. Once a @@ -3021,7 +3021,7 @@ type Query { The object corresponding to the given address at the (optionally) given version. When no version is given, the latest version is returned. """ - object(address: SuiAddress!, version: Int): Object + object(address: SuiAddress!, version: UInt53): Object """ Look-up an Account by its SuiAddress. """ @@ -3034,7 +3034,7 @@ type Query { """ Fetch epoch information by ID (defaults to the latest epoch). """ - epoch(id: Int): Epoch + epoch(id: UInt53): Epoch """ Fetch checkpoint information by sequence number or digest (defaults to the latest available checkpoint). @@ -3071,7 +3071,7 @@ type Query { Fetch the protocol config by protocol version (defaults to the latest protocol version known to the GraphQL service). """ - protocolConfig(protocolVersion: Int): ProtocolConfigs! + protocolConfig(protocolVersion: UInt53): ProtocolConfigs! """ Resolves a SuiNS `domain` name to an address, if it has been bound. """ @@ -3114,7 +3114,7 @@ type RandomnessStateUpdateTransaction { """ Randomness round of the update. """ - randomnessRound: Int! + randomnessRound: UInt53! """ Updated random bytes, encoded as Base64. """ @@ -3122,7 +3122,7 @@ type RandomnessStateUpdateTransaction { """ The initial version the randomness object was shared at. """ - randomnessObjInitialSharedVersion: Int! + randomnessObjInitialSharedVersion: UInt53! } """ @@ -3136,7 +3136,7 @@ type Receiving { """ Version of the object being read. """ - version: Int! + version: UInt53! """ 32-byte hash that identifies the object's contents at this version, encoded as a Base58 string. @@ -3220,7 +3220,7 @@ type ServiceConfig { Maximum estimated cost of a database query used to serve a GraphQL request. This is measured in the same units that the database uses in EXPLAIN queries. """ - maxDbQueryCost: BigInt! + maxDbQueryCost: Int! """ Default number of elements allowed on a single page of a connection. """ @@ -3269,7 +3269,7 @@ A shared object is an object that is shared using the 0x2::transfer::share_objec Unlike owned objects, once an object is shared, it stays mutable and is accessible by anyone. """ type Shared { - initialSharedVersion: Int! + initialSharedVersion: UInt53! } """ @@ -3280,7 +3280,7 @@ type SharedInput { """ The version that this this object was shared at. """ - initialSharedVersion: Int! + initialSharedVersion: UInt53! """ Controls whether the transaction block can reference the shared object as a mutable reference or by value. This has implications for scheduling: Transactions that just read @@ -3302,7 +3302,7 @@ type SharedObjectCancelled { """ The assigned shared object version. It is a special version indicating transaction cancellation reason. """ - version: Int! + version: UInt53! } """ @@ -3318,7 +3318,7 @@ type SharedObjectDelete { The version of the shared object that was assigned to this transaction during by consensus, during sequencing. """ - version: Int! + version: UInt53! """ Whether this transaction intended to use this shared object mutably or not. See `SharedInput.mutable` for further details. @@ -3337,7 +3337,7 @@ type SharedObjectRead { """ Version of the object being read. """ - version: Int! + version: UInt53! """ 32-byte hash that identifies the object's contents at this version, encoded as a Base58 string. @@ -3449,7 +3449,7 @@ type StakedSui implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -3651,7 +3651,7 @@ type SuinsRegistration implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -3777,7 +3777,7 @@ type SystemParameters { """ The epoch at which stake subsidies start being paid out. """ - stakeSubsidyStartEpoch: Int + stakeSubsidyStartEpoch: UInt53 """ The minimum number of active validators that the system supports. """ @@ -3902,7 +3902,7 @@ type TransactionBlockEffects { The latest version of all objects (apart from packages) that have been created or modified by this transaction, immediately following this transaction. """ - lamportVersion: Int! + lamportVersion: UInt53! """ The reason for a transaction failure, if it did fail. If the error is a Move abort, the error message will be resolved to a human-readable form if @@ -3958,9 +3958,9 @@ input TransactionBlockFilter { An input filter selecting for either system or programmable transactions. """ kind: TransactionBlockKindInput - afterCheckpoint: Int - atCheckpoint: Int - beforeCheckpoint: Int + afterCheckpoint: UInt53 + atCheckpoint: UInt53 + beforeCheckpoint: UInt53 signAddress: SuiAddress recvAddress: SuiAddress inputObject: SuiAddress @@ -4028,9 +4028,9 @@ to the sender. """ input TransactionMetadata { sender: SuiAddress - gasPrice: Int + gasPrice: UInt53 gasObjects: [ObjectRef!] - gasBudget: Int + gasBudget: UInt53 gasSponsor: SuiAddress } @@ -4067,6 +4067,12 @@ type TypeOrigin { definingId: SuiAddress! } +""" +An unsigned integer that can hold values up to 2^53 - 1. This can be treated similarly to `Int`, +but it is guaranteed to be non-negative, and it may be larger than 2^32 - 1. +""" +scalar UInt53 + """ Details pertaining to shared objects that are referenced by but not changed by a transaction. This information is considered part of the effects, because although the transaction specifies @@ -4184,11 +4190,11 @@ type Validator { """ Number of exchange rates in the table. """ - exchangeRatesSize: Int + exchangeRatesSize: UInt53 """ The epoch at which this pool became active. """ - stakingPoolActivationEpoch: Int + stakingPoolActivationEpoch: UInt53 """ The total number of SUI tokens in this pool. """ @@ -4242,7 +4248,7 @@ type Validator { The number of epochs for which this validator has been below the low stake threshold. """ - atRisk: Int + atRisk: UInt53 """ The addresses of other validators this validator has reported. """ diff --git a/crates/sui-graphql-rpc/src/config.rs b/crates/sui-graphql-rpc/src/config.rs index fce7ba5da08cc..320653bcbaa3d 100644 --- a/crates/sui-graphql-rpc/src/config.rs +++ b/crates/sui-graphql-rpc/src/config.rs @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 use crate::functional_group::FunctionalGroup; -use crate::types::big_int::BigInt; use async_graphql::*; use fastcrypto_zkp::bn254::zk_login_api::ZkLoginEnv; use serde::{Deserialize, Serialize}; @@ -67,23 +66,23 @@ pub struct Limits { /// Maximum number of nodes in the requests. pub max_query_nodes: u32, /// Maximum number of output nodes allowed in the response. - pub max_output_nodes: u64, + pub max_output_nodes: u32, /// Maximum size (in bytes) of a GraphQL request. pub max_query_payload_size: u32, /// Queries whose EXPLAIN cost are more than this will be logged. Given in the units used by the /// database (where 1.0 is roughly the cost of a sequential page access). - pub max_db_query_cost: u64, + pub max_db_query_cost: u32, /// Paginated queries will return this many elements if a page size is not provided. - pub default_page_size: u64, + pub default_page_size: u32, /// Paginated queries can return at most this many elements. - pub max_page_size: u64, + pub max_page_size: u32, /// Time (in milliseconds) to wait for a transaction to be executed and the results returned /// from GraphQL. If the transaction takes longer than this time to execute, the request will /// return a timeout error, but the transaction may continue executing. - pub mutation_timeout_ms: u64, + pub mutation_timeout_ms: u32, /// Time (in milliseconds) to wait for a read request from the GraphQL service. Requests that /// take longer than this time to return a result will return a timeout error. - pub request_timeout_ms: u64, + pub request_timeout_ms: u32, /// Maximum amount of nesting among type arguments (type arguments nest when a type argument is /// itself generic and has arguments). pub max_type_argument_depth: u32, @@ -223,23 +222,23 @@ impl ServiceConfig { /// with a connection of first: 10 and has a field to a connection with last: 20, the count /// at the second level would be 200 nodes. This is then summed to the count of 10 nodes /// at the first level, for a total of 210 nodes. - pub async fn max_output_nodes(&self) -> u64 { + pub async fn max_output_nodes(&self) -> u32 { self.limits.max_output_nodes } /// Maximum estimated cost of a database query used to serve a GraphQL request. This is /// measured in the same units that the database uses in EXPLAIN queries. - async fn max_db_query_cost(&self) -> BigInt { - BigInt::from(self.limits.max_db_query_cost) + async fn max_db_query_cost(&self) -> u32 { + self.limits.max_db_query_cost } /// Default number of elements allowed on a single page of a connection. - async fn default_page_size(&self) -> u64 { + async fn default_page_size(&self) -> u32 { self.limits.default_page_size } /// Maximum number of elements allowed on a single page of a connection. - async fn max_page_size(&self) -> u64 { + async fn max_page_size(&self) -> u32 { self.limits.max_page_size } @@ -247,12 +246,12 @@ impl ServiceConfig { /// a transaction to execute. Note that the transaction may still succeed even in the case of a /// timeout. Transactions are idempotent, so a transaction that times out should be resubmitted /// until the network returns a definite response (success or failure, not timeout). - async fn mutation_timeout_ms(&self) -> u64 { + async fn mutation_timeout_ms(&self) -> u32 { self.limits.mutation_timeout_ms } /// Maximum time in milliseconds that will be spent to serve one query request. - async fn request_timeout_ms(&self) -> u64 { + async fn request_timeout_ms(&self) -> u32 { self.limits.request_timeout_ms } diff --git a/crates/sui-graphql-rpc/src/data/pg.rs b/crates/sui-graphql-rpc/src/data/pg.rs index 3d556fdaec891..980bde05b1fda 100644 --- a/crates/sui-graphql-rpc/src/data/pg.rs +++ b/crates/sui-graphql-rpc/src/data/pg.rs @@ -25,7 +25,7 @@ pub(crate) struct PgExecutor { } pub(crate) struct PgConnection<'c> { - max_cost: u64, + max_cost: u32, conn: &'c mut diesel::PgConnection, } @@ -147,7 +147,7 @@ mod query_cost { } /// Run `EXPLAIN` on the `query`, and log the estimated cost. - pub(crate) fn log(conn: &mut PgConnection, max_db_query_cost: u64, query: Q) + pub(crate) fn log(conn: &mut PgConnection, max_db_query_cost: u32, query: Q) where Q: Query + QueryId + QueryFragment + RunQueryDsl, { diff --git a/crates/sui-graphql-rpc/src/error.rs b/crates/sui-graphql-rpc/src/error.rs index e20556b3ab38a..8d9f633cbd3b5 100644 --- a/crates/sui-graphql-rpc/src/error.rs +++ b/crates/sui-graphql-rpc/src/error.rs @@ -70,7 +70,7 @@ pub enum Error { #[error("'first' and 'last' must not be used together")] CursorNoFirstLast, #[error("Connection's page size of {0} exceeds max of {1}")] - PageTooLarge(u64, u64), + PageTooLarge(u64, u32), // Catch-all for client-fault errors #[error("{0}")] Client(String), diff --git a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs index a971574f1ec78..98acec0add6f4 100644 --- a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs +++ b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs @@ -31,7 +31,7 @@ pub(crate) struct ShowUsage; #[derive(Clone, Debug, Default)] struct ValidationRes { input_nodes: u32, - output_nodes: u64, + output_nodes: u32, depth: u32, num_variables: u32, num_fragments: u32, @@ -73,7 +73,7 @@ impl ExtensionFactory for QueryLimitsChecker { #[derive(Debug)] struct ComponentCost { pub input_nodes: u32, - pub output_nodes: u64, + pub output_nodes: u32, pub depth: u32, } @@ -234,7 +234,7 @@ impl QueryLimitsChecker { // Use BFS to analyze the query and count the number of nodes and the depth of the query struct ToVisit<'s> { selection: &'s Positioned, - parent_node_count: u64, + parent_node_count: u32, } // Queue to store the nodes at each level @@ -431,8 +431,8 @@ fn check_directives(directives: &[Positioned]) -> ServerResult<()> { fn estimate_output_nodes_for_curr_node( f: &Positioned, variables: &Variables, - default_page_size: u64, -) -> u64 { + default_page_size: u32, +) -> u32 { if !is_connection(f) { 1 } else { @@ -446,11 +446,11 @@ fn estimate_output_nodes_for_curr_node( } } -/// Try to extract a u64 value from the given argument, or return None on failure. -fn extract_limit(value: Option<&Positioned>, variables: &Variables) -> Option { +/// Try to extract a u32 value from the given argument, or return None on failure. +fn extract_limit(value: Option<&Positioned>, variables: &Variables) -> Option { if let GqlValue::Variable(var) = &value?.node { return match variables.get(var) { - Some(Value::Number(num)) => num.as_u64(), + Some(Value::Number(num)) => num.as_u64().map(|v| v as u32), _ => None, }; } @@ -458,7 +458,7 @@ fn extract_limit(value: Option<&Positioned>, variables: &Variables) -> let GqlValue::Number(value) = &value?.node else { return None; }; - value.as_u64() + value.as_u64().map(|v| v as u32) } /// Checks if the given field is a connection field by whether it has 'edges' or 'nodes' selected. diff --git a/crates/sui-graphql-rpc/src/extensions/timeout.rs b/crates/sui-graphql-rpc/src/extensions/timeout.rs index 8035072a39514..6d53ad8924679 100644 --- a/crates/sui-graphql-rpc/src/extensions/timeout.rs +++ b/crates/sui-graphql-rpc/src/extensions/timeout.rs @@ -71,9 +71,9 @@ impl Extension for TimeoutExt { // increase the timeout if the request is a mutation let is_mutation = self.is_mutation.load(Ordering::Relaxed); let request_timeout = if is_mutation { - Duration::from_millis(cfg.limits.mutation_timeout_ms) + Duration::from_millis(cfg.limits.mutation_timeout_ms.into()) } else { - Duration::from_millis(cfg.limits.request_timeout_ms) + Duration::from_millis(cfg.limits.request_timeout_ms.into()) }; timeout(request_timeout, next.run(ctx, operation_name)) diff --git a/crates/sui-graphql-rpc/src/server/builder.rs b/crates/sui-graphql-rpc/src/server/builder.rs index 86fbed2e6a789..5cd601de9039d 100644 --- a/crates/sui-graphql-rpc/src/server/builder.rs +++ b/crates/sui-graphql-rpc/src/server/builder.rs @@ -420,7 +420,7 @@ impl ServerBuilder { // Bound each statement in a request with the overall request timeout, to bound DB // utilisation (in the worst case we will use 2x the request timeout time in DB wall // time). - config.service.limits.request_timeout_ms, + config.service.limits.request_timeout_ms.into(), ) .map_err(|e| Error::Internal(format!("Failed to create pg connection pool: {}", e)))?; @@ -688,7 +688,7 @@ pub mod tests { let reader = PgManager::reader_with_config( connection_config.db_url.clone(), connection_config.db_pool_size, - service_config.limits.request_timeout_ms, + service_config.limits.request_timeout_ms.into(), ) .expect("Failed to create pg connection pool"); @@ -771,8 +771,8 @@ pub mod tests { sui_client: &SuiClient, ) -> Response { let mut cfg = ServiceConfig::default(); - cfg.limits.request_timeout_ms = timeout.as_millis() as u64; - cfg.limits.mutation_timeout_ms = timeout.as_millis() as u64; + cfg.limits.request_timeout_ms = timeout.as_millis() as u32; + cfg.limits.mutation_timeout_ms = timeout.as_millis() as u32; let schema = prep_schema(None, Some(cfg)) .context_data(Some(sui_client.clone())) diff --git a/crates/sui-graphql-rpc/src/types/balance.rs b/crates/sui-graphql-rpc/src/types/balance.rs index 0ce8b6e762113..8e4d199df0be0 100644 --- a/crates/sui-graphql-rpc/src/types/balance.rs +++ b/crates/sui-graphql-rpc/src/types/balance.rs @@ -3,6 +3,7 @@ use super::available_range::AvailableRange; use super::cursor::{self, Page, RawPaginated, Target}; +use super::uint53::UInt53; use super::{big_int::BigInt, move_type::MoveType, sui_address::SuiAddress}; use crate::consistency::Checkpointed; use crate::data::{Db, DbConnection, QueryExecutor}; @@ -26,7 +27,7 @@ pub(crate) struct Balance { /// Coin type for the balance, such as 0x2::sui::SUI pub(crate) coin_type: MoveType, /// How many coins of this type constitute the balance - pub(crate) coin_object_count: Option, + pub(crate) coin_object_count: Option, /// Total balance across all coin objects of the coin type pub(crate) total_balance: Option, } @@ -174,7 +175,7 @@ impl TryFrom for Balance { .transpose() .map_err(|_| Error::Internal("Failed to read balance.".to_string()))?; - let coin_object_count = count.map(|c| c as u64); + let coin_object_count = count.map(|c| UInt53::from(c as u64)); let coin_type = MoveType::new( parse_sui_type_tag(&coin_type) diff --git a/crates/sui-graphql-rpc/src/types/checkpoint.rs b/crates/sui-graphql-rpc/src/types/checkpoint.rs index d4b093b5d8a99..cbebb9935f491 100644 --- a/crates/sui-graphql-rpc/src/types/checkpoint.rs +++ b/crates/sui-graphql-rpc/src/types/checkpoint.rs @@ -11,6 +11,7 @@ use super::{ epoch::Epoch, gas::GasCostSummary, transaction_block::{self, TransactionBlock, TransactionBlockFilter}, + uint53::UInt53, }; use crate::consistency::Checkpointed; use crate::{ @@ -32,7 +33,7 @@ use sui_types::messages_checkpoint::CheckpointDigest; #[derive(Default, InputObject)] pub(crate) struct CheckpointId { pub digest: Option, - pub sequence_number: Option, + pub sequence_number: Option, } /// DataLoader key for fetching a `Checkpoint` by its sequence number, constrained by a consistency @@ -90,8 +91,8 @@ impl Checkpoint { /// This checkpoint's position in the total order of finalized checkpoints, agreed upon by /// consensus. - async fn sequence_number(&self) -> u64 { - self.sequence_number_impl() + async fn sequence_number(&self) -> UInt53 { + self.sequence_number_impl().into() } /// The timestamp at which the checkpoint is agreed to have happened according to consensus. @@ -115,8 +116,8 @@ impl Checkpoint { } /// The total number of transaction blocks in the network by the end of this checkpoint. - async fn network_total_transactions(&self) -> Option { - Some(self.network_total_transactions_impl()) + async fn network_total_transactions(&self) -> Option { + Some(self.network_total_transactions_impl().into()) } /// The computation cost, storage cost, storage rebate, and non-refundable storage fee @@ -157,7 +158,7 @@ impl Checkpoint { let Some(filter) = filter .unwrap_or_default() .intersect(TransactionBlockFilter { - at_checkpoint: Some(self.stored.sequence_number as u64), + at_checkpoint: Some(UInt53::from(self.stored.sequence_number as u64)), ..Default::default() }) else { @@ -178,7 +179,7 @@ impl Checkpoint { impl CheckpointId { pub(crate) fn by_seq_num(seq_num: u64) -> Self { CheckpointId { - sequence_number: Some(seq_num), + sequence_number: Some(seq_num.into()), digest: None, } } @@ -213,7 +214,7 @@ impl Checkpoint { } => { let DataLoader(dl) = ctx.data_unchecked(); dl.load_one(SeqNumKey { - sequence_number, + sequence_number: sequence_number.into(), digest, checkpoint_viewed_at, }) diff --git a/crates/sui-graphql-rpc/src/types/coin.rs b/crates/sui-graphql-rpc/src/types/coin.rs index eb9dbd967ce23..537c7ca2c44b0 100644 --- a/crates/sui-graphql-rpc/src/types/coin.rs +++ b/crates/sui-graphql-rpc/src/types/coin.rs @@ -23,6 +23,7 @@ use super::sui_address::SuiAddress; use super::suins_registration::{DomainFormat, SuinsRegistration}; use super::transaction_block::{self, TransactionBlock, TransactionBlockFilter}; use super::type_filter::ExactTypeFilter; +use super::uint53::UInt53; use async_graphql::*; use async_graphql::connection::{Connection, CursorType, Edge}; @@ -150,7 +151,7 @@ impl Coin { .await } - pub(crate) async fn version(&self) -> u64 { + pub(crate) async fn version(&self) -> UInt53 { ObjectImpl(&self.super_.super_).version().await } diff --git a/crates/sui-graphql-rpc/src/types/coin_metadata.rs b/crates/sui-graphql-rpc/src/types/coin_metadata.rs index 19b0524a4b14c..bad0545636b84 100644 --- a/crates/sui-graphql-rpc/src/types/coin_metadata.rs +++ b/crates/sui-graphql-rpc/src/types/coin_metadata.rs @@ -16,6 +16,7 @@ use super::sui_address::SuiAddress; use super::suins_registration::{DomainFormat, SuinsRegistration}; use super::transaction_block::{self, TransactionBlock, TransactionBlockFilter}; use super::type_filter::ExactTypeFilter; +use super::uint53::UInt53; use crate::data::Db; use crate::error::Error; use async_graphql::connection::Connection; @@ -139,7 +140,7 @@ impl CoinMetadata { .await } - pub(crate) async fn version(&self) -> u64 { + pub(crate) async fn version(&self) -> UInt53 { ObjectImpl(&self.super_.super_).version().await } diff --git a/crates/sui-graphql-rpc/src/types/cursor.rs b/crates/sui-graphql-rpc/src/types/cursor.rs index 592af36cd0ea8..65f7e21673bbb 100644 --- a/crates/sui-graphql-rpc/src/types/cursor.rs +++ b/crates/sui-graphql-rpc/src/types/cursor.rs @@ -140,7 +140,7 @@ impl Page { (limit, after, None, before) => Page { after, before, - limit: limit.unwrap_or(limits.default_page_size), + limit: limit.unwrap_or(limits.default_page_size as u64), end: End::Front, }, @@ -152,7 +152,7 @@ impl Page { }, }; - if page.limit > limits.max_page_size { + if page.limit > limits.max_page_size as u64 { return Err(Error::PageTooLarge(page.limit, limits.max_page_size).extend()); } @@ -797,7 +797,7 @@ mod tests { #[test] fn test_err_page_too_big() { let config = ServiceConfig::default(); - let too_big = config.limits.max_page_size + 1; + let too_big = config.limits.max_page_size as u64 + 1; let err = Page::>::from_params(&config, Some(too_big), None, None, None) .unwrap_err(); diff --git a/crates/sui-graphql-rpc/src/types/epoch.rs b/crates/sui-graphql-rpc/src/types/epoch.rs index 4433d19382a3d..6ca312ca3ba37 100644 --- a/crates/sui-graphql-rpc/src/types/epoch.rs +++ b/crates/sui-graphql-rpc/src/types/epoch.rs @@ -15,6 +15,7 @@ use super::date_time::DateTime; use super::protocol_config::ProtocolConfigs; use super::system_state_summary::SystemStateSummary; use super::transaction_block::{self, TransactionBlock, TransactionBlockFilter}; +use super::uint53::UInt53; use super::validator_set::ValidatorSet; use async_graphql::connection::Connection; use async_graphql::dataloader::Loader; @@ -49,8 +50,8 @@ struct EpochKey { #[Object] impl Epoch { /// The epoch's id as a sequence number that starts at 0 and is incremented by one at every epoch change. - async fn epoch_id(&self) -> u64 { - self.stored.epoch as u64 + async fn epoch_id(&self) -> UInt53 { + UInt53::from(self.stored.epoch as u64) } /// The minimum gas price that a quorum of validators are guaranteed to sign a transaction for. @@ -101,7 +102,7 @@ impl Epoch { } /// The total number of checkpoints in this epoch. - async fn total_checkpoints(&self, ctx: &Context<'_>) -> Result> { + async fn total_checkpoints(&self, ctx: &Context<'_>) -> Result> { let last = match self.stored.last_checkpoint_id { Some(last) => last as u64, None => { @@ -110,15 +111,18 @@ impl Epoch { } }; - Ok(Some(BigInt::from( + Ok(Some(UInt53::from( last - self.stored.first_checkpoint_id as u64, ))) } /// The total number of transaction blocks in this epoch. - async fn total_transactions(&self) -> Result> { + async fn total_transactions(&self) -> Result> { // TODO: this currently returns None for the current epoch. Fix this. - Ok(self.stored.epoch_total_transactions.map(|v| v as u64)) + Ok(self + .stored + .epoch_total_transactions + .map(|v| UInt53::from(v as u64))) } /// The total amount of gas fees (in MIST) that were paid in this epoch. @@ -241,8 +245,11 @@ impl Epoch { .unwrap_or_default() .intersect(TransactionBlockFilter { after_checkpoint: (self.stored.first_checkpoint_id > 0) - .then(|| self.stored.first_checkpoint_id as u64 - 1), - before_checkpoint: self.stored.last_checkpoint_id.map(|id| id as u64 + 1), + .then(|| UInt53::from(self.stored.first_checkpoint_id as u64 - 1)), + before_checkpoint: self + .stored + .last_checkpoint_id + .map(|id| UInt53::from(id as u64 + 1)), ..Default::default() }) else { diff --git a/crates/sui-graphql-rpc/src/types/gas.rs b/crates/sui-graphql-rpc/src/types/gas.rs index 9969b70b9060e..3a73d0d10c4e0 100644 --- a/crates/sui-graphql-rpc/src/types/gas.rs +++ b/crates/sui-graphql-rpc/src/types/gas.rs @@ -171,7 +171,7 @@ impl GasInput { .iter() .map(|o| ObjectKey { object_id: o.0.into(), - version: o.1.value(), + version: o.1.value().into(), }) .collect(), checkpoint_viewed_at, diff --git a/crates/sui-graphql-rpc/src/types/mod.rs b/crates/sui-graphql-rpc/src/types/mod.rs index 9df6df493d55c..e944f0d33ebce 100644 --- a/crates/sui-graphql-rpc/src/types/mod.rs +++ b/crates/sui-graphql-rpc/src/types/mod.rs @@ -53,6 +53,7 @@ pub(crate) mod transaction_block_effects; pub(crate) mod transaction_block_kind; pub(crate) mod transaction_metadata; pub(crate) mod type_filter; +pub(crate) mod uint53; pub(crate) mod unchanged_shared_object; pub(crate) mod validator; pub(crate) mod validator_credentials; diff --git a/crates/sui-graphql-rpc/src/types/move_object.rs b/crates/sui-graphql-rpc/src/types/move_object.rs index a4128c7235745..d41b8dd639420 100644 --- a/crates/sui-graphql-rpc/src/types/move_object.rs +++ b/crates/sui-graphql-rpc/src/types/move_object.rs @@ -18,6 +18,7 @@ use super::sui_address::SuiAddress; use super::suins_registration::{DomainFormat, SuinsRegistration, SuinsRegistrationDowncastError}; use super::transaction_block::{self, TransactionBlock, TransactionBlockFilter}; use super::type_filter::ExactTypeFilter; +use super::uint53::UInt53; use super::{coin::Coin, object::Object}; use crate::data::Db; use crate::error::Error; @@ -218,7 +219,7 @@ impl MoveObject { .await } - pub(crate) async fn version(&self) -> u64 { + pub(crate) async fn version(&self) -> UInt53 { ObjectImpl(&self.super_).version().await } diff --git a/crates/sui-graphql-rpc/src/types/move_package.rs b/crates/sui-graphql-rpc/src/types/move_package.rs index 68aaa72d33820..1791b0bde32ca 100644 --- a/crates/sui-graphql-rpc/src/types/move_package.rs +++ b/crates/sui-graphql-rpc/src/types/move_package.rs @@ -17,6 +17,7 @@ use super::sui_address::SuiAddress; use super::suins_registration::{DomainFormat, SuinsRegistration}; use super::transaction_block::{self, TransactionBlock, TransactionBlockFilter}; use super::type_filter::ExactTypeFilter; +use super::uint53::UInt53; use crate::consistency::ConsistentNamedCursor; use crate::error::Error; use async_graphql::connection::{Connection, CursorType, Edge}; @@ -44,7 +45,7 @@ struct Linkage { upgraded_id: SuiAddress, /// The version of the dependency that this package depends on. - version: u64, + version: UInt53, } /// Information about which previous versions of a package introduced its types. @@ -187,7 +188,7 @@ impl MovePackage { .await } - pub(crate) async fn version(&self) -> u64 { + pub(crate) async fn version(&self) -> UInt53 { ObjectImpl(&self.super_).version().await } @@ -347,7 +348,7 @@ impl MovePackage { .map(|(&runtime_id, upgrade_info)| Linkage { original_id: runtime_id.into(), upgraded_id: upgrade_info.upgraded_id.into(), - version: upgrade_info.upgraded_version.value(), + version: upgrade_info.upgraded_version.value().into(), }) .collect(); diff --git a/crates/sui-graphql-rpc/src/types/object.rs b/crates/sui-graphql-rpc/src/types/object.rs index 6814da6304fd1..8c094c1665334 100644 --- a/crates/sui-graphql-rpc/src/types/object.rs +++ b/crates/sui-graphql-rpc/src/types/object.rs @@ -21,6 +21,7 @@ use super::suins_registration::{DomainFormat, SuinsRegistration}; use super::transaction_block; use super::transaction_block::TransactionBlockFilter; use super::type_filter::{ExactTypeFilter, TypeFilter}; +use super::uint53::UInt53; use super::{owner::Owner, sui_address::SuiAddress, transaction_block::TransactionBlock}; use crate::consistency::{build_objects_query, Checkpointed, View}; use crate::data::package_resolver::PackageResolver; @@ -101,7 +102,7 @@ pub(crate) struct ObjectRef { /// ID of the object. pub address: SuiAddress, /// Version or sequence number of the object. - pub version: u64, + pub version: UInt53, /// Digest of the object. pub digest: Digest, } @@ -137,7 +138,7 @@ pub(crate) struct ObjectFilter { #[derive(InputObject, Debug, Clone, Eq, PartialEq)] pub(crate) struct ObjectKey { pub object_id: SuiAddress, - pub version: u64, + pub version: UInt53, } /// The object's owner type: Immutable, Shared, Parent, or Address. @@ -161,7 +162,7 @@ pub(crate) struct Immutable { /// Unlike owned objects, once an object is shared, it stays mutable and is accessible by anyone. #[derive(SimpleObject, Clone)] pub(crate) struct Shared { - initial_shared_version: u64, + initial_shared_version: UInt53, } /// If the object's owner is a Parent, this object is part of a dynamic field (it is the value of @@ -215,7 +216,7 @@ pub(crate) struct HistoricalObjectCursor { #[derive(Interface)] #[graphql( name = "IObject", - field(name = "version", ty = "u64"), + field(name = "version", ty = "UInt53"), field( name = "status", ty = "ObjectStatus", @@ -395,7 +396,7 @@ impl Object { .await } - pub(crate) async fn version(&self) -> u64 { + pub(crate) async fn version(&self) -> UInt53 { ObjectImpl(self).version().await } @@ -524,8 +525,8 @@ impl Object { } impl ObjectImpl<'_> { - pub(crate) async fn version(&self) -> u64 { - self.0.version_impl() + pub(crate) async fn version(&self) -> UInt53 { + self.0.version_impl().into() } pub(crate) async fn status(&self) -> ObjectStatus { @@ -571,7 +572,7 @@ impl ObjectImpl<'_> { O::Shared { initial_shared_version, } => Some(ObjectOwner::Shared(Shared { - initial_shared_version: initial_shared_version.value(), + initial_shared_version: initial_shared_version.value().into(), })), } } @@ -1002,7 +1003,7 @@ impl ObjectFilter { .filter_map(|(id, v)| { Some(ObjectKey { object_id: *id, - version: (*v)?, + version: (*v)?.into(), }) }) .collect(); @@ -1030,7 +1031,7 @@ impl ObjectFilter { self.object_keys .iter() .flatten() - .map(|key| (key.object_id, Some(key.version))) + .map(|key| (key.object_id, Some(key.version.into()))) // Chain ID filters after Key filters so if there is overlap, we overwrite the key // filter with the ID filter. .chain(self.object_ids.iter().flatten().map(|id| (*id, None))), @@ -1488,11 +1489,11 @@ mod tests { object_keys: Some(vec![ ObjectKey { object_id: i2, - version: 1, + version: 1.into(), }, ObjectKey { object_id: i4, - version: 2, + version: 2.into(), }, ]), ..Default::default() @@ -1502,7 +1503,7 @@ mod tests { object_ids: Some(vec![i1, i2]), object_keys: Some(vec![ObjectKey { object_id: i4, - version: 2, + version: 2.into(), }]), ..Default::default() }; @@ -1516,11 +1517,11 @@ mod tests { object_keys: Some(vec![ ObjectKey { object_id: i2, - version: 2, + version: 2.into(), }, ObjectKey { object_id: i4, - version: 2, + version: 2.into(), }, ]), ..Default::default() @@ -1533,11 +1534,11 @@ mod tests { object_keys: Some(vec![ ObjectKey { object_id: i2, - version: 1 + version: 1.into(), }, ObjectKey { object_id: i4, - version: 2 + version: 2.into(), }, ]), ..Default::default() @@ -1558,11 +1559,11 @@ mod tests { object_keys: Some(vec![ ObjectKey { object_id: i2, - version: 2 + version: 2.into(), }, ObjectKey { object_id: i4, - version: 2 + version: 2.into(), }, ]), ..Default::default() diff --git a/crates/sui-graphql-rpc/src/types/object_read.rs b/crates/sui-graphql-rpc/src/types/object_read.rs index 2e19fe3508667..7294bec75a0e1 100644 --- a/crates/sui-graphql-rpc/src/types/object_read.rs +++ b/crates/sui-graphql-rpc/src/types/object_read.rs @@ -4,7 +4,7 @@ use async_graphql::*; use sui_types::base_types::ObjectRef as NativeObjectRef; -use super::{object::Object, sui_address::SuiAddress}; +use super::{object::Object, sui_address::SuiAddress, uint53::UInt53}; // A helper type representing the read of a specific version of an object. Intended to be // "flattened" into other GraphQL types. @@ -23,8 +23,8 @@ impl ObjectRead { } /// Version of the object being read. - async fn version(&self) -> u64 { - self.version_impl() + async fn version(&self) -> UInt53 { + self.version_impl().into() } /// 32-byte hash that identifies the object's contents at this version, encoded as a Base58 diff --git a/crates/sui-graphql-rpc/src/types/protocol_config.rs b/crates/sui-graphql-rpc/src/types/protocol_config.rs index b8387db16f9b4..9a10021d529cf 100644 --- a/crates/sui-graphql-rpc/src/types/protocol_config.rs +++ b/crates/sui-graphql-rpc/src/types/protocol_config.rs @@ -12,6 +12,8 @@ use crate::{ types::chain_identifier::ChainIdentifier, }; +use super::uint53::UInt53; + /// A single protocol configuration value. #[derive(Clone, Debug, SimpleObject)] pub(crate) struct ProtocolConfigAttr { @@ -38,8 +40,8 @@ pub(crate) struct ProtocolConfigs { impl ProtocolConfigs { /// The protocol is not required to change on every epoch boundary, so the protocol version /// tracks which change to the protocol these configs are from. - async fn protocol_version(&self) -> u64 { - self.native.version.as_u64() + async fn protocol_version(&self) -> UInt53 { + self.native.version.as_u64().into() } /// List all available feature flags and their values. Feature flags are a form of boolean diff --git a/crates/sui-graphql-rpc/src/types/query.rs b/crates/sui-graphql-rpc/src/types/query.rs index 818e173bb47f7..2deef96ce830a 100644 --- a/crates/sui-graphql-rpc/src/types/query.rs +++ b/crates/sui-graphql-rpc/src/types/query.rs @@ -13,6 +13,7 @@ use sui_types::transaction::{TransactionData, TransactionKind}; use sui_types::{gas_coin::GAS, transaction::TransactionDataAPI, TypeTag}; use super::suins_registration::NameService; +use super::uint53::UInt53; use super::{ address::Address, available_range::AvailableRange, @@ -189,14 +190,16 @@ impl Query { &self, ctx: &Context<'_>, address: SuiAddress, - version: Option, + version: Option, ) -> Result> { let Watermark { checkpoint, .. } = *ctx.data()?; match version { - Some(version) => Object::query(ctx, address, Object::at_version(version, checkpoint)) - .await - .extend(), + Some(version) => { + Object::query(ctx, address, Object::at_version(version.into(), checkpoint)) + .await + .extend() + } None => Object::query(ctx, address, Object::latest_at(checkpoint)) .await .extend(), @@ -224,9 +227,11 @@ impl Query { } /// Fetch epoch information by ID (defaults to the latest epoch). - async fn epoch(&self, ctx: &Context<'_>, id: Option) -> Result> { + async fn epoch(&self, ctx: &Context<'_>, id: Option) -> Result> { let Watermark { checkpoint, .. } = *ctx.data()?; - Epoch::query(ctx, id, checkpoint).await.extend() + Epoch::query(ctx, id.map(|id| id.into()), checkpoint) + .await + .extend() } /// Fetch checkpoint information by sequence number or digest (defaults to the latest available @@ -378,9 +383,9 @@ impl Query { async fn protocol_config( &self, ctx: &Context<'_>, - protocol_version: Option, + protocol_version: Option, ) -> Result { - ProtocolConfigs::query(ctx.data_unchecked(), protocol_version) + ProtocolConfigs::query(ctx.data_unchecked(), protocol_version.map(|v| v.into())) .await .extend() } diff --git a/crates/sui-graphql-rpc/src/types/stake.rs b/crates/sui-graphql-rpc/src/types/stake.rs index 43e7b4126e4d8..763741c67b747 100644 --- a/crates/sui-graphql-rpc/src/types/stake.rs +++ b/crates/sui-graphql-rpc/src/types/stake.rs @@ -17,6 +17,7 @@ use super::owner::OwnerImpl; use super::suins_registration::{DomainFormat, SuinsRegistration}; use super::transaction_block::{self, TransactionBlock, TransactionBlockFilter}; use super::type_filter::ExactTypeFilter; +use super::uint53::UInt53; use super::{ big_int::BigInt, epoch::Epoch, move_object::MoveObject, object, sui_address::SuiAddress, }; @@ -158,7 +159,7 @@ impl StakedSui { .await } - pub(crate) async fn version(&self) -> u64 { + pub(crate) async fn version(&self) -> UInt53 { ObjectImpl(&self.super_.super_).version().await } diff --git a/crates/sui-graphql-rpc/src/types/suins_registration.rs b/crates/sui-graphql-rpc/src/types/suins_registration.rs index 9e708314bc70b..ed5337cb5d84f 100644 --- a/crates/sui-graphql-rpc/src/types/suins_registration.rs +++ b/crates/sui-graphql-rpc/src/types/suins_registration.rs @@ -22,6 +22,7 @@ use super::{ sui_address::SuiAddress, transaction_block::{self, TransactionBlock, TransactionBlockFilter}, type_filter::ExactTypeFilter, + uint53::UInt53, }; use crate::{ consistency::{build_objects_query, View}, @@ -195,7 +196,7 @@ impl SuinsRegistration { .await } - pub(crate) async fn version(&self) -> u64 { + pub(crate) async fn version(&self) -> UInt53 { ObjectImpl(&self.super_.super_).version().await } diff --git a/crates/sui-graphql-rpc/src/types/system_parameters.rs b/crates/sui-graphql-rpc/src/types/system_parameters.rs index 96e18254eef0c..7f296d0313a05 100644 --- a/crates/sui-graphql-rpc/src/types/system_parameters.rs +++ b/crates/sui-graphql-rpc/src/types/system_parameters.rs @@ -1,6 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use super::big_int::BigInt; +use super::{big_int::BigInt, uint53::UInt53}; use async_graphql::*; /// Details of the system that are decided during genesis. @@ -10,7 +10,7 @@ pub(crate) struct SystemParameters { pub duration_ms: Option, /// The epoch at which stake subsidies start being paid out. - pub stake_subsidy_start_epoch: Option, + pub stake_subsidy_start_epoch: Option, /// The minimum number of active validators that the system supports. pub min_validator_count: Option, diff --git a/crates/sui-graphql-rpc/src/types/system_state_summary.rs b/crates/sui-graphql-rpc/src/types/system_state_summary.rs index da464f154f265..7065864e06b65 100644 --- a/crates/sui-graphql-rpc/src/types/system_state_summary.rs +++ b/crates/sui-graphql-rpc/src/types/system_state_summary.rs @@ -3,7 +3,7 @@ use super::{ big_int::BigInt, gas::GasCostSummary, safe_mode::SafeMode, stake_subsidy::StakeSubsidy, - storage_fund::StorageFund, system_parameters::SystemParameters, + storage_fund::StorageFund, system_parameters::SystemParameters, uint53::UInt53, }; use async_graphql::*; use sui_types::sui_system_state::sui_system_state_summary::SuiSystemStateSummary as NativeSystemStateSummary; @@ -47,15 +47,15 @@ impl SystemStateSummary { /// The value of the `version` field of `0x5`, the `0x3::sui::SuiSystemState` object. This /// version changes whenever the fields contained in the system state object (held in a dynamic /// field attached to `0x5`) change. - async fn system_state_version(&self) -> Option { - Some(self.native.system_state_version) + async fn system_state_version(&self) -> Option { + Some(self.native.system_state_version.into()) } /// Details of the system that are decided during genesis. async fn system_parameters(&self) -> Option { Some(SystemParameters { duration_ms: Some(BigInt::from(self.native.epoch_duration_ms)), - stake_subsidy_start_epoch: Some(self.native.stake_subsidy_start_epoch), + stake_subsidy_start_epoch: Some(self.native.stake_subsidy_start_epoch.into()), // TODO min validator count can be extracted, but it requires some JSON RPC changes, // so we decided to wait on it for now. min_validator_count: None, diff --git a/crates/sui-graphql-rpc/src/types/transaction_block.rs b/crates/sui-graphql-rpc/src/types/transaction_block.rs index 0241be6614081..5009d076145d8 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block.rs @@ -48,6 +48,7 @@ use super::{ transaction_block_effects::{TransactionBlockEffects, TransactionBlockEffectsKind}, transaction_block_kind::TransactionBlockKind, type_filter::FqNameFilter, + uint53::UInt53, }; /// Wraps the actual transaction block data with the checkpoint sequence number at which the data @@ -99,9 +100,9 @@ pub(crate) struct TransactionBlockFilter { /// An input filter selecting for either system or programmable transactions. pub kind: Option, - pub after_checkpoint: Option, - pub at_checkpoint: Option, - pub before_checkpoint: Option, + pub after_checkpoint: Option, + pub at_checkpoint: Option, + pub before_checkpoint: Option, pub sign_address: Option, pub recv_address: Option, @@ -334,17 +335,19 @@ impl TransactionBlock { } if let Some(c) = &filter.after_checkpoint { - query = query.filter(tx::dsl::checkpoint_sequence_number.gt(*c as i64)); + query = + query.filter(tx::dsl::checkpoint_sequence_number.gt(i64::from(*c))); } if let Some(c) = &filter.at_checkpoint { - query = query.filter(tx::dsl::checkpoint_sequence_number.eq(*c as i64)); + query = + query.filter(tx::dsl::checkpoint_sequence_number.eq(i64::from(*c))); } let before_checkpoint = filter .before_checkpoint .map_or(checkpoint_viewed_at + 1, |c| { - c.min(checkpoint_viewed_at + 1) + u64::from(c).min(checkpoint_viewed_at + 1) }); query = query.filter( tx::dsl::checkpoint_sequence_number.lt(before_checkpoint as i64), diff --git a/crates/sui-graphql-rpc/src/types/transaction_block_effects.rs b/crates/sui-graphql-rpc/src/types/transaction_block_effects.rs index f2ae785e84675..8d7ba31748c97 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block_effects.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block_effects.rs @@ -37,6 +37,7 @@ use super::{ gas::GasEffects, object_change::ObjectChange, transaction_block::{TransactionBlock, TransactionBlockInner}, + uint53::UInt53, unchanged_shared_object::UnchangedSharedObject, }; @@ -110,8 +111,8 @@ impl TransactionBlockEffects { /// The latest version of all objects (apart from packages) that have been created or modified /// by this transaction, immediately following this transaction. - async fn lamport_version(&self) -> u64 { - self.native().lamport_version().value() + async fn lamport_version(&self) -> UInt53 { + self.native().lamport_version().value().into() } /// The reason for a transaction failure, if it did fail. diff --git a/crates/sui-graphql-rpc/src/types/transaction_block_kind/authenticator_state_update.rs b/crates/sui-graphql-rpc/src/types/transaction_block_kind/authenticator_state_update.rs index ba8f0710c6761..3277100d691c3 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block_kind/authenticator_state_update.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block_kind/authenticator_state_update.rs @@ -16,6 +16,7 @@ use crate::{ types::{ cursor::{JsonCursor, Page}, epoch::Epoch, + uint53::UInt53, }, }; @@ -46,8 +47,8 @@ impl AuthenticatorStateUpdateTransaction { } /// Consensus round of the authenticator state update. - async fn round(&self) -> u64 { - self.native.round + async fn round(&self) -> UInt53 { + self.native.round.into() } /// Newly active JWKs (JSON Web Keys). @@ -87,8 +88,11 @@ impl AuthenticatorStateUpdateTransaction { } /// The initial version of the authenticator object that it was shared at. - async fn authenticator_obj_initial_shared_version(&self) -> u64 { - self.native.authenticator_obj_initial_shared_version.value() + async fn authenticator_obj_initial_shared_version(&self) -> UInt53 { + self.native + .authenticator_obj_initial_shared_version + .value() + .into() } } diff --git a/crates/sui-graphql-rpc/src/types/transaction_block_kind/consensus_commit_prologue.rs b/crates/sui-graphql-rpc/src/types/transaction_block_kind/consensus_commit_prologue.rs index 72eaad7c1d929..dc8b55b8e0212 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block_kind/consensus_commit_prologue.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block_kind/consensus_commit_prologue.rs @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::types::{date_time::DateTime, epoch::Epoch}; +use crate::types::{date_time::DateTime, epoch::Epoch, uint53::UInt53}; use async_graphql::*; use fastcrypto::encoding::{Base58, Encoding}; use sui_types::{ @@ -49,8 +49,8 @@ impl ConsensusCommitPrologueTransaction { } /// Consensus round of the commit. - async fn round(&self) -> u64 { - self.round + async fn round(&self) -> UInt53 { + self.round.into() } /// Unix timestamp from consensus. diff --git a/crates/sui-graphql-rpc/src/types/transaction_block_kind/end_of_epoch.rs b/crates/sui-graphql-rpc/src/types/transaction_block_kind/end_of_epoch.rs index 353e760b6af21..b2e2c824fd4cb 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block_kind/end_of_epoch.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block_kind/end_of_epoch.rs @@ -20,6 +20,7 @@ use sui_types::{ use crate::consistency::ConsistentIndexCursor; use crate::types::cursor::{JsonCursor, Page}; use crate::types::sui_address::SuiAddress; +use crate::types::uint53::UInt53; use crate::{ error::Error, types::{ @@ -149,8 +150,8 @@ impl ChangeEpochTransaction { } /// The protocol version in effect in the new epoch. - async fn protocol_version(&self) -> u64 { - self.native.protocol_version.as_u64() + async fn protocol_version(&self) -> UInt53 { + self.native.protocol_version.as_u64().into() } /// The total amount of gas charged for storage during the previous epoch (in MIST). @@ -243,8 +244,11 @@ impl AuthenticatorStateExpireTransaction { } /// The initial version that the AuthenticatorStateUpdate was shared at. - async fn authenticator_obj_initial_shared_version(&self) -> u64 { - self.native.authenticator_obj_initial_shared_version.value() + async fn authenticator_obj_initial_shared_version(&self) -> UInt53 { + self.native + .authenticator_obj_initial_shared_version + .value() + .into() } } @@ -257,8 +261,8 @@ impl BridgeStateCreateTransaction { #[Object] impl BridgeCommitteeInitTransaction { - async fn bridge_obj_initial_shared_version(&self) -> u64 { - self.native.value() + async fn bridge_obj_initial_shared_version(&self) -> UInt53 { + self.native.value().into() } } diff --git a/crates/sui-graphql-rpc/src/types/transaction_block_kind/programmable.rs b/crates/sui-graphql-rpc/src/types/transaction_block_kind/programmable.rs index c59c02f9c9c94..936d87f87696a 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block_kind/programmable.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block_kind/programmable.rs @@ -10,6 +10,7 @@ use crate::{ move_type::MoveType, object_read::ObjectRead, sui_address::SuiAddress, + uint53::UInt53, }, }; use async_graphql::{ @@ -53,7 +54,7 @@ struct OwnedOrImmutable { struct SharedInput { address: SuiAddress, /// The version that this this object was shared at. - initial_shared_version: u64, + initial_shared_version: UInt53, /// Controls whether the transaction block can reference the shared object as a mutable /// reference or by value. This has implications for scheduling: Transactions that just read /// shared objects at a certain version (mutable = false) can be executed concurrently, while @@ -336,7 +337,7 @@ impl TransactionInput { mutable, }) => I::SharedInput(SharedInput { address: id.into(), - initial_shared_version: initial_shared_version.value(), + initial_shared_version: initial_shared_version.value().into(), mutable, }), diff --git a/crates/sui-graphql-rpc/src/types/transaction_block_kind/randomness_state_update.rs b/crates/sui-graphql-rpc/src/types/transaction_block_kind/randomness_state_update.rs index ddeade58d0c0a..6ddde1dae4da5 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block_kind/randomness_state_update.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block_kind/randomness_state_update.rs @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::types::{base64::Base64, epoch::Epoch}; +use crate::types::{base64::Base64, epoch::Epoch, uint53::UInt53}; use async_graphql::*; use sui_types::transaction::RandomnessStateUpdate as NativeRandomnessStateUpdate; @@ -23,8 +23,8 @@ impl RandomnessStateUpdateTransaction { } /// Randomness round of the update. - async fn randomness_round(&self) -> u64 { - self.native.randomness_round.0 + async fn randomness_round(&self) -> UInt53 { + self.native.randomness_round.0.into() } /// Updated random bytes, encoded as Base64. @@ -33,7 +33,10 @@ impl RandomnessStateUpdateTransaction { } /// The initial version the randomness object was shared at. - async fn randomness_obj_initial_shared_version(&self) -> u64 { - self.native.randomness_obj_initial_shared_version.value() + async fn randomness_obj_initial_shared_version(&self) -> UInt53 { + self.native + .randomness_obj_initial_shared_version + .value() + .into() } } diff --git a/crates/sui-graphql-rpc/src/types/transaction_metadata.rs b/crates/sui-graphql-rpc/src/types/transaction_metadata.rs index 8dae3e42bca44..378e4fdd5dfc4 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_metadata.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_metadata.rs @@ -3,6 +3,7 @@ use super::object::ObjectRef; use super::sui_address::SuiAddress; +use super::uint53::UInt53; use async_graphql::*; /// The optional extra data a user can provide to a transaction dry run. @@ -13,8 +14,8 @@ use async_graphql::*; #[derive(Clone, Debug, PartialEq, Eq, InputObject)] pub(crate) struct TransactionMetadata { pub sender: Option, - pub gas_price: Option, + pub gas_price: Option, pub gas_objects: Option>, - pub gas_budget: Option, + pub gas_budget: Option, pub gas_sponsor: Option, } diff --git a/crates/sui-graphql-rpc/src/types/uint53.rs b/crates/sui-graphql-rpc/src/types/uint53.rs new file mode 100644 index 0000000000000..03e8336116e75 --- /dev/null +++ b/crates/sui-graphql-rpc/src/types/uint53.rs @@ -0,0 +1,67 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use std::fmt; + +use async_graphql::*; +use sui_types::{base_types::SequenceNumber, sui_serde::BigInt}; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] +pub(crate) struct UInt53(u64); + +/// An unsigned integer that can hold values up to 2^53 - 1. This can be treated similarly to `Int`, +/// but it is guaranteed to be non-negative, and it may be larger than 2^32 - 1. +#[Scalar(name = "UInt53")] +impl ScalarType for UInt53 { + fn parse(value: Value) -> InputValueResult { + let Value::Number(n) = value else { + return Err(InputValueError::expected_type(value)); + }; + + let Some(n) = n.as_u64() else { + return Err(InputValueError::custom("Expected an unsigned integer.")); + }; + + Ok(UInt53(n)) + } + + fn to_value(&self) -> Value { + Value::Number(self.0.into()) + } +} + +impl fmt::Display for UInt53 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.0) + } +} + +impl From for UInt53 { + fn from(value: u64) -> Self { + Self(value) + } +} + +impl From for SequenceNumber { + fn from(value: UInt53) -> Self { + SequenceNumber::from(value.0) + } +} + +impl From for BigInt { + fn from(value: UInt53) -> Self { + BigInt::from(value.0) + } +} + +impl From for u64 { + fn from(value: UInt53) -> Self { + value.0 + } +} + +impl From for i64 { + fn from(value: UInt53) -> Self { + value.0 as i64 + } +} diff --git a/crates/sui-graphql-rpc/src/types/unchanged_shared_object.rs b/crates/sui-graphql-rpc/src/types/unchanged_shared_object.rs index a80c216871e95..9a1b42b93ca93 100644 --- a/crates/sui-graphql-rpc/src/types/unchanged_shared_object.rs +++ b/crates/sui-graphql-rpc/src/types/unchanged_shared_object.rs @@ -4,7 +4,7 @@ use async_graphql::*; use sui_types::effects::InputSharedObject as NativeInputSharedObject; -use super::{object_read::ObjectRead, sui_address::SuiAddress}; +use super::{object_read::ObjectRead, sui_address::SuiAddress, uint53::UInt53}; /// Details pertaining to shared objects that are referenced by but not changed by a transaction. /// This information is considered part of the effects, because although the transaction specifies @@ -33,7 +33,7 @@ pub(crate) struct SharedObjectDelete { /// The version of the shared object that was assigned to this transaction during by consensus, /// during sequencing. - version: u64, + version: UInt53, /// Whether this transaction intended to use this shared object mutably or not. See /// `SharedInput.mutable` for further details. @@ -47,7 +47,7 @@ pub(crate) struct SharedObjectCancelled { address: SuiAddress, /// The assigned shared object version. It is a special version indicating transaction cancellation reason. - version: u64, + version: UInt53, } /// Error for converting from an `InputSharedObject`. @@ -73,19 +73,19 @@ impl UnchangedSharedObject { I::ReadDeleted(id, v) => Ok(U::Delete(SharedObjectDelete { address: id.into(), - version: v.value(), + version: v.value().into(), mutable: false, })), I::MutateDeleted(id, v) => Ok(U::Delete(SharedObjectDelete { address: id.into(), - version: v.value(), + version: v.value().into(), mutable: true, })), I::Cancelled(id, v) => Ok(U::Cancelled(SharedObjectCancelled { address: id.into(), - version: v.value(), + version: v.value().into(), })), } } diff --git a/crates/sui-graphql-rpc/src/types/validator.rs b/crates/sui-graphql-rpc/src/types/validator.rs index f23758ff5b92a..6dff4af5eac78 100644 --- a/crates/sui-graphql-rpc/src/types/validator.rs +++ b/crates/sui-graphql-rpc/src/types/validator.rs @@ -19,6 +19,7 @@ use super::move_object::MoveObject; use super::object::Object; use super::owner::Owner; use super::sui_address::SuiAddress; +use super::uint53::UInt53; use super::validator_credentials::ValidatorCredentials; use super::{address::Address, base64::Base64}; use crate::error::Error; @@ -237,13 +238,15 @@ impl Validator { } /// Number of exchange rates in the table. - async fn exchange_rates_size(&self) -> Option { - Some(self.validator_summary.exchange_rates_size) + async fn exchange_rates_size(&self) -> Option { + Some(self.validator_summary.exchange_rates_size.into()) } /// The epoch at which this pool became active. - async fn staking_pool_activation_epoch(&self) -> Option { - self.validator_summary.staking_pool_activation_epoch + async fn staking_pool_activation_epoch(&self) -> Option { + self.validator_summary + .staking_pool_activation_epoch + .map(UInt53::from) } /// The total number of SUI tokens in this pool. @@ -317,8 +320,8 @@ impl Validator { /// The number of epochs for which this validator has been below the /// low stake threshold. - async fn at_risk(&self) -> Option { - self.at_risk + async fn at_risk(&self) -> Option { + self.at_risk.map(UInt53::from) } /// The addresses of other validators this validator has reported. diff --git a/crates/sui-graphql-rpc/tests/examples_validation_tests.rs b/crates/sui-graphql-rpc/tests/examples_validation_tests.rs index 39f3c40ea7b40..fc2a95d21c90b 100644 --- a/crates/sui-graphql-rpc/tests/examples_validation_tests.rs +++ b/crates/sui-graphql-rpc/tests/examples_validation_tests.rs @@ -144,7 +144,7 @@ mod tests { default_config.max_query_nodes ); assert!( - max_output_nodes <= default_config.max_output_nodes, + max_output_nodes <= default_config.max_output_nodes as u64, "Max output nodes {} exceeds default limit {}", max_output_nodes, default_config.max_output_nodes diff --git a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap index 8bb4af3e2005e..565c450b28637 100644 --- a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap +++ b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap @@ -176,7 +176,7 @@ type AuthenticatorStateExpireTransaction { """ The initial version that the AuthenticatorStateUpdate was shared at. """ - authenticatorObjInitialSharedVersion: Int! + authenticatorObjInitialSharedVersion: UInt53! } """ @@ -190,7 +190,7 @@ type AuthenticatorStateUpdateTransaction { """ Consensus round of the authenticator state update. """ - round: Int! + round: UInt53! """ Newly active JWKs (JSON Web Keys). """ @@ -198,7 +198,7 @@ type AuthenticatorStateUpdateTransaction { """ The initial version of the authenticator object that it was shared at. """ - authenticatorObjInitialSharedVersion: Int! + authenticatorObjInitialSharedVersion: UInt53! } """ @@ -220,7 +220,7 @@ type Balance { """ How many coins of this type constitute the balance """ - coinObjectCount: Int + coinObjectCount: UInt53 """ Total balance across all coin objects of the coin type """ @@ -315,7 +315,7 @@ scalar BigInt type BridgeCommitteeInitTransaction { - bridgeObjInitialSharedVersion: Int! + bridgeObjInitialSharedVersion: UInt53! } type BridgeStateCreateTransaction { @@ -337,7 +337,7 @@ type ChangeEpochTransaction { """ The protocol version in effect in the new epoch. """ - protocolVersion: Int! + protocolVersion: UInt53! """ The total amount of gas charged for storage during the previous epoch (in MIST). """ @@ -382,7 +382,7 @@ type Checkpoint { This checkpoint's position in the total order of finalized checkpoints, agreed upon by consensus. """ - sequenceNumber: Int! + sequenceNumber: UInt53! """ The timestamp at which the checkpoint is agreed to have happened according to consensus. Transactions that access time in this checkpoint will observe this timestamp. @@ -400,7 +400,7 @@ type Checkpoint { """ The total number of transaction blocks in the network by the end of this checkpoint. """ - networkTotalTransactions: Int + networkTotalTransactions: UInt53 """ The computation cost, storage cost, storage rebate, and non-refundable storage fee accumulated during this epoch, up to and including this checkpoint. These values increase @@ -451,7 +451,7 @@ Filter either by the digest, or the sequence number, or neither, to get the late """ input CheckpointId { digest: String - sequenceNumber: Int + sequenceNumber: UInt53 } """ @@ -491,7 +491,7 @@ type Coin implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -650,7 +650,7 @@ type CoinMetadata implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -765,7 +765,7 @@ type ConsensusCommitPrologueTransaction { """ Consensus round of the commit. """ - round: Int! + round: UInt53! """ Unix timestamp from consensus. """ @@ -1000,7 +1000,7 @@ type Epoch { """ The epoch's id as a sequence number that starts at 0 and is incremented by one at every epoch change. """ - epochId: Int! + epochId: UInt53! """ The minimum gas price that a quorum of validators are guaranteed to sign a transaction for. """ @@ -1020,11 +1020,11 @@ type Epoch { """ The total number of checkpoints in this epoch. """ - totalCheckpoints: BigInt + totalCheckpoints: UInt53 """ The total number of transaction blocks in this epoch. """ - totalTransactions: Int + totalTransactions: UInt53 """ The total amount of gas fees (in MIST) that were paid in this epoch. """ @@ -1077,7 +1077,7 @@ type Epoch { version changes whenever the fields contained in the system state object (held in a dynamic field attached to `0x5`) change. """ - systemStateVersion: Int + systemStateVersion: UInt53 """ Details of the system that are decided during genesis. """ @@ -1408,7 +1408,7 @@ Interface implemented by on-chain values that are addressable by an ID (also ref address). This includes Move objects and packages. """ interface IObject { - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or system package upgrade transaction. LIVE, the version returned is the most recent for the object, and it is not deleted or wrapped at that version. HISTORICAL, the object was referenced at a specific version or checkpoint, so is fetched from historical tables and may not be the latest version of the object. WRAPPED_OR_DELETED, the object is deleted or wrapped and only partial information can be loaded. """ @@ -1519,7 +1519,7 @@ type Linkage { """ The version of the dependency that this package depends on. """ - version: Int! + version: UInt53! } """ @@ -1946,7 +1946,7 @@ type MoveObject implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -2129,7 +2129,7 @@ type MovePackage implements IObject & IOwner { cannot be owned by an address. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -2465,7 +2465,7 @@ type Object implements IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -2664,7 +2664,7 @@ input ObjectFilter { input ObjectKey { objectId: SuiAddress! - version: Int! + version: UInt53! } enum ObjectKind { @@ -2697,7 +2697,7 @@ input ObjectRef { """ Version or sequence number of the object. """ - version: Int! + version: UInt53! """ Digest of the object. """ @@ -2755,7 +2755,7 @@ type OwnedOrImmutable { """ Version of the object being read. """ - version: Int! + version: UInt53! """ 32-byte hash that identifies the object's contents at this version, encoded as a Base58 string. @@ -2939,7 +2939,7 @@ type ProtocolConfigs { The protocol is not required to change on every epoch boundary, so the protocol version tracks which change to the protocol these configs are from. """ - protocolVersion: Int! + protocolVersion: UInt53! """ List all available feature flags and their values. Feature flags are a form of boolean configuration that are usually used to gate features while they are in development. Once a @@ -3025,7 +3025,7 @@ type Query { The object corresponding to the given address at the (optionally) given version. When no version is given, the latest version is returned. """ - object(address: SuiAddress!, version: Int): Object + object(address: SuiAddress!, version: UInt53): Object """ Look-up an Account by its SuiAddress. """ @@ -3038,7 +3038,7 @@ type Query { """ Fetch epoch information by ID (defaults to the latest epoch). """ - epoch(id: Int): Epoch + epoch(id: UInt53): Epoch """ Fetch checkpoint information by sequence number or digest (defaults to the latest available checkpoint). @@ -3075,7 +3075,7 @@ type Query { Fetch the protocol config by protocol version (defaults to the latest protocol version known to the GraphQL service). """ - protocolConfig(protocolVersion: Int): ProtocolConfigs! + protocolConfig(protocolVersion: UInt53): ProtocolConfigs! """ Resolves a SuiNS `domain` name to an address, if it has been bound. """ @@ -3118,7 +3118,7 @@ type RandomnessStateUpdateTransaction { """ Randomness round of the update. """ - randomnessRound: Int! + randomnessRound: UInt53! """ Updated random bytes, encoded as Base64. """ @@ -3126,7 +3126,7 @@ type RandomnessStateUpdateTransaction { """ The initial version the randomness object was shared at. """ - randomnessObjInitialSharedVersion: Int! + randomnessObjInitialSharedVersion: UInt53! } """ @@ -3140,7 +3140,7 @@ type Receiving { """ Version of the object being read. """ - version: Int! + version: UInt53! """ 32-byte hash that identifies the object's contents at this version, encoded as a Base58 string. @@ -3224,7 +3224,7 @@ type ServiceConfig { Maximum estimated cost of a database query used to serve a GraphQL request. This is measured in the same units that the database uses in EXPLAIN queries. """ - maxDbQueryCost: BigInt! + maxDbQueryCost: Int! """ Default number of elements allowed on a single page of a connection. """ @@ -3273,7 +3273,7 @@ A shared object is an object that is shared using the 0x2::transfer::share_objec Unlike owned objects, once an object is shared, it stays mutable and is accessible by anyone. """ type Shared { - initialSharedVersion: Int! + initialSharedVersion: UInt53! } """ @@ -3284,7 +3284,7 @@ type SharedInput { """ The version that this this object was shared at. """ - initialSharedVersion: Int! + initialSharedVersion: UInt53! """ Controls whether the transaction block can reference the shared object as a mutable reference or by value. This has implications for scheduling: Transactions that just read @@ -3306,7 +3306,7 @@ type SharedObjectCancelled { """ The assigned shared object version. It is a special version indicating transaction cancellation reason. """ - version: Int! + version: UInt53! } """ @@ -3322,7 +3322,7 @@ type SharedObjectDelete { The version of the shared object that was assigned to this transaction during by consensus, during sequencing. """ - version: Int! + version: UInt53! """ Whether this transaction intended to use this shared object mutably or not. See `SharedInput.mutable` for further details. @@ -3341,7 +3341,7 @@ type SharedObjectRead { """ Version of the object being read. """ - version: Int! + version: UInt53! """ 32-byte hash that identifies the object's contents at this version, encoded as a Base58 string. @@ -3453,7 +3453,7 @@ type StakedSui implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -3655,7 +3655,7 @@ type SuinsRegistration implements IMoveObject & IObject & IOwner { manage the associated domain. """ suinsRegistrations(first: Int, after: String, last: Int, before: String): SuinsRegistrationConnection! - version: Int! + version: UInt53! """ The current status of the object as read from the off-chain store. The possible states are: NOT_INDEXED, the object is loaded from serialized data, such as the contents of a genesis or @@ -3781,7 +3781,7 @@ type SystemParameters { """ The epoch at which stake subsidies start being paid out. """ - stakeSubsidyStartEpoch: Int + stakeSubsidyStartEpoch: UInt53 """ The minimum number of active validators that the system supports. """ @@ -3906,7 +3906,7 @@ type TransactionBlockEffects { The latest version of all objects (apart from packages) that have been created or modified by this transaction, immediately following this transaction. """ - lamportVersion: Int! + lamportVersion: UInt53! """ The reason for a transaction failure, if it did fail. If the error is a Move abort, the error message will be resolved to a human-readable form if @@ -3962,9 +3962,9 @@ input TransactionBlockFilter { An input filter selecting for either system or programmable transactions. """ kind: TransactionBlockKindInput - afterCheckpoint: Int - atCheckpoint: Int - beforeCheckpoint: Int + afterCheckpoint: UInt53 + atCheckpoint: UInt53 + beforeCheckpoint: UInt53 signAddress: SuiAddress recvAddress: SuiAddress inputObject: SuiAddress @@ -4032,9 +4032,9 @@ to the sender. """ input TransactionMetadata { sender: SuiAddress - gasPrice: Int + gasPrice: UInt53 gasObjects: [ObjectRef!] - gasBudget: Int + gasBudget: UInt53 gasSponsor: SuiAddress } @@ -4071,6 +4071,12 @@ type TypeOrigin { definingId: SuiAddress! } +""" +An unsigned integer that can hold values up to 2^53 - 1. This can be treated similarly to `Int`, +but it is guaranteed to be non-negative, and it may be larger than 2^32 - 1. +""" +scalar UInt53 + """ Details pertaining to shared objects that are referenced by but not changed by a transaction. This information is considered part of the effects, because although the transaction specifies @@ -4188,11 +4194,11 @@ type Validator { """ Number of exchange rates in the table. """ - exchangeRatesSize: Int + exchangeRatesSize: UInt53 """ The epoch at which this pool became active. """ - stakingPoolActivationEpoch: Int + stakingPoolActivationEpoch: UInt53 """ The total number of SUI tokens in this pool. """ @@ -4246,7 +4252,7 @@ type Validator { The number of epochs for which this validator has been below the low stake threshold. """ - atRisk: Int + atRisk: UInt53 """ The addresses of other validators this validator has reported. """ @@ -4387,3 +4393,4 @@ schema { query: Query mutation: Mutation } + From ffd3231924e27f4099fefe380ef48b65885c0aac Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 11 Jul 2024 15:01:02 -0500 Subject: [PATCH 025/163] chore: update fastcrypto and serde_with --- Cargo.lock | 62 +++++++++++++++++++++++++++++++++--------------------- Cargo.toml | 10 ++++----- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3a445d9b4930..c7dc83e9efe56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4382,7 +4382,7 @@ dependencies = [ [[package]] name = "fastcrypto" version = "0.1.8" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=55e7e568842939e01c8545a71d72e2402ad74538#55e7e568842939e01c8545a71d72e2402ad74538" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" dependencies = [ "aes", "aes-gcm", @@ -4422,7 +4422,7 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "sha2 0.10.6", "sha3 0.10.6", "signature 2.0.0", @@ -4436,7 +4436,7 @@ dependencies = [ [[package]] name = "fastcrypto-derive" version = "0.1.3" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=55e7e568842939e01c8545a71d72e2402ad74538#55e7e568842939e01c8545a71d72e2402ad74538" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" dependencies = [ "quote 1.0.35", "syn 1.0.107", @@ -4445,7 +4445,7 @@ dependencies = [ [[package]] name = "fastcrypto-tbls" version = "0.1.0" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=55e7e568842939e01c8545a71d72e2402ad74538#55e7e568842939e01c8545a71d72e2402ad74538" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" dependencies = [ "bcs", "digest 0.10.7", @@ -4463,7 +4463,7 @@ dependencies = [ [[package]] name = "fastcrypto-vdf" version = "0.1.0" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=55e7e568842939e01c8545a71d72e2402ad74538#55e7e568842939e01c8545a71d72e2402ad74538" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" dependencies = [ "bcs", "fastcrypto", @@ -4475,13 +4475,12 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "serde", - "serde_with 2.1.0", ] [[package]] name = "fastcrypto-zkp" version = "0.1.3" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=55e7e568842939e01c8545a71d72e2402ad74538#55e7e568842939e01c8545a71d72e2402ad74538" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" dependencies = [ "ark-bls12-381", "ark-bn254", @@ -7905,7 +7904,7 @@ dependencies = [ "rustversion", "serde", "serde_test", - "serde_with 2.1.0", + "serde_with 3.8.1", "sui-protocol-config", "thiserror", "tokio", @@ -11158,7 +11157,7 @@ dependencies = [ "indexmap 1.9.3", "serde", "serde_json", - "serde_with_macros", + "serde_with_macros 2.1.0", "time", ] @@ -11171,9 +11170,12 @@ dependencies = [ "base64 0.22.1", "chrono", "hex", + "indexmap 1.9.3", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", + "serde_with_macros 3.8.1", "time", ] @@ -11189,6 +11191,18 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling 0.20.3", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", +] + [[package]] name = "serde_yaml" version = "0.8.26" @@ -12240,7 +12254,7 @@ dependencies = [ "rocksdb", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "shared-crypto", "sui-common", "sui-config", @@ -12274,7 +12288,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "shared-crypto", "sui-bridge", "sui-config", @@ -12388,7 +12402,7 @@ dependencies = [ "rand 0.8.5", "reqwest", "serde", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "sui-keys", "sui-protocol-config", @@ -12468,7 +12482,7 @@ dependencies = [ "serde", "serde-reflection", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "shared-crypto", "signature 1.6.4", @@ -12814,7 +12828,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "serde", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "shared-crypto", "sui-config", @@ -12891,7 +12905,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "serial_test", "shared-crypto", @@ -12977,7 +12991,7 @@ dependencies = [ "secrecy", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "simulacrum", "sui-data-ingestion-core", "sui-json", @@ -13152,7 +13166,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "sui-enum-compat-util", "sui-json", "sui-macros", @@ -13606,7 +13620,7 @@ dependencies = [ "move-vm-config", "schemars", "serde", - "serde_with 2.1.0", + "serde_with 3.8.1", "sui-protocol-config-macros", "tracing", ] @@ -13651,7 +13665,7 @@ dependencies = [ "rustls-pemfile", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "snap", "sui-tls", @@ -13685,7 +13699,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "shared-crypto", "shellexpand", @@ -13730,7 +13744,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "sui-protocol-config", "sui-sdk 0.0.0", @@ -13851,7 +13865,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "shared-crypto", "sui-config", "sui-json", @@ -14167,7 +14181,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "serde", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "shared-crypto", "sui-config", @@ -14417,7 +14431,7 @@ dependencies = [ "serde", "serde-name", "serde_json", - "serde_with 2.1.0", + "serde_with 3.8.1", "serde_yaml 0.8.26", "shared-crypto", "signature 1.6.4", diff --git a/Cargo.toml b/Cargo.toml index b72524382288f..04d4ded8299ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -456,7 +456,7 @@ serde_json = { version = "1.0.95", features = [ ] } serde_repr = "0.1" serde_test = "1.0.147" -serde_with = { version = "2.1.0", features = ["hex"] } +serde_with = "3.8" # serde_yaml = "0.9.21" serde_yaml = "0.8.26" shell-words = "1.1.0" @@ -566,10 +566,10 @@ move-abstract-interpreter = { path = "external-crates/move/crates/move-abstract- move-abstract-stack = { path = "external-crates/move/crates/move-abstract-stack" } move-analyzer = { path = "external-crates/move/crates/move-analyzer" } -fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538" } -fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538" } -fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538", package = "fastcrypto-zkp" } -fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538", features = ["experimental"] } +fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340" } +fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340" } +fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340", package = "fastcrypto-zkp" } +fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340", features = ["experimental"] } passkey-types = { version = "0.2.0" } passkey-client = { version = "0.2.0" } passkey-authenticator = { version = "0.2.0" } From bbbd374604f0981714d56bade7507143befd6d5a Mon Sep 17 00:00:00 2001 From: UnMaykr <98741738+unmaykr-aftermath@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:40:58 +0700 Subject: [PATCH 026/163] feat: add optional `root_version` to `Query.owner` (#18486) ## Description This adds an optional `root_version` argument to `Query.owner` as discussed in PR #17934. In summary: ``` `root_version` represents the version of the root object in some nested chain of dynamic fields. It allows historical queries for the case of wrapped objects, which don't have a version. For example, if querying the dynamic fields of a table wrapped in a parent object, passing the parent object's version here will ensure we get the dynamic fields' state at the moment that parent's version was created. If `root_version` is left null, the dynamic fields will be from a consistent snapshot of the Sui state at the latest checkpoint known to the GraphQL RPC. ``` ## Test plan Introduced new E2E tests: ``` sui-graphql-e2e-tests$ cargo nextest run --features pg_integration ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [x] GraphQL: Introduces an optional `rootVersion` parameter to `Query.owner`. This can be used to do versioned lookups when reading dynamic fields rooted on a wrapped object or another dynamic object field. - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: Ashok Menon --- .../tests/owner/root_version.exp | 292 ++++++++++++++++++ .../tests/owner/root_version.move | 194 ++++++++++++ .../schema/current_progress_schema.graphql | 19 +- .../src/types/balance_change.rs | 1 + crates/sui-graphql-rpc/src/types/object.rs | 1 + crates/sui-graphql-rpc/src/types/owner.rs | 28 +- crates/sui-graphql-rpc/src/types/query.rs | 23 +- crates/sui-graphql-rpc/src/types/validator.rs | 1 + .../snapshot_tests__schema_sdl_export.snap | 19 +- 9 files changed, 569 insertions(+), 9 deletions(-) create mode 100644 crates/sui-graphql-e2e-tests/tests/owner/root_version.exp create mode 100644 crates/sui-graphql-e2e-tests/tests/owner/root_version.move diff --git a/crates/sui-graphql-e2e-tests/tests/owner/root_version.exp b/crates/sui-graphql-e2e-tests/tests/owner/root_version.exp new file mode 100644 index 0000000000000..14790da6f9e58 --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/owner/root_version.exp @@ -0,0 +1,292 @@ +processed 17 tasks + +init: +A: object(0,0) + +task 1 'publish'. lines 6-86: +created: object(1,0) +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 10586800, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2 'run'. lines 88-89: +created: object(2,0) +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 2264800, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 3 'run'. lines 91-92: +created: object(3,0) +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 4 'run'. lines 94-95: +created: object(4,0) +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 5 'run'. lines 97-98: +created: object(5,0) +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 6 'run'. lines 101-104: +created: object(6,0), object(6,1) +mutated: object(0,1), object(2,0), object(4,0), object(5,0) +wrapped: object(3,0) +gas summary: computation_cost: 1000000, storage_cost: 9940800, storage_rebate: 6041772, non_refundable_storage_fee: 61028 + +task 7 'view-object'. lines 106-108: +Owner: Account Address ( _ ) +Version: 7 +Contents: P0::M::O { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,0), + }, + }, + count: 0u64, + wrapped: std::option::Option { + vec: vector[ + P0::M::W { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + count: 0u64, + }, + ], + }, +} + +task 8 'run'. lines 110-111: +mutated: object(0,1), object(2,0) +gas summary: computation_cost: 1000000, storage_cost: 2568800, storage_rebate: 2543112, non_refundable_storage_fee: 25688 + +task 9 'run'. lines 113-114: +mutated: object(0,1), object(2,0) +gas summary: computation_cost: 1000000, storage_cost: 2568800, storage_rebate: 2543112, non_refundable_storage_fee: 25688 + +task 10 'run'. lines 116-117: +mutated: object(0,1), object(2,0), object(4,0) +gas summary: computation_cost: 1000000, storage_cost: 3853200, storage_rebate: 3814668, non_refundable_storage_fee: 38532 + +task 11 'run'. lines 119-120: +mutated: object(0,1), object(2,0), object(5,0) +gas summary: computation_cost: 1000000, storage_cost: 3853200, storage_rebate: 3814668, non_refundable_storage_fee: 38532 + +task 12 'view-object'. lines 122-122: +Owner: Account Address ( _ ) +Version: 11 +Contents: P0::M::O { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(2,0), + }, + }, + count: 1u64, + wrapped: std::option::Option { + vec: vector[ + P0::M::W { + id: sui::object::UID { + id: sui::object::ID { + bytes: fake(3,0), + }, + }, + count: 1u64, + }, + ], + }, +} + +task 13 'create-checkpoint'. lines 124-124: +Checkpoint created: 1 + +task 14 'run-graphql'. lines 126-141: +Response: { + "data": { + "latest": { + "asObject": { + "asMoveObject": { + "version": 11, + "contents": { + "json": { + "id": "0x90dc651cc4aef34057af8c944f0ab8a0150295ad088edd4407a1bd4c225e18b8", + "count": "1", + "wrapped": { + "id": "0x3330add01caca066f647d3a3df92917d0191ba9b9aaaa8d2da4d726bb3c330cf", + "count": "1" + } + } + } + } + } + }, + "versioned": { + "asObject": { + "asMoveObject": { + "version": 10, + "contents": { + "json": { + "id": "0x90dc651cc4aef34057af8c944f0ab8a0150295ad088edd4407a1bd4c225e18b8", + "count": "1", + "wrapped": { + "id": "0x3330add01caca066f647d3a3df92917d0191ba9b9aaaa8d2da4d726bb3c330cf", + "count": "1" + } + } + } + } + } + }, + "beforeWrappedBump": { + "asObject": { + "asMoveObject": { + "version": 8, + "contents": { + "json": { + "id": "0x90dc651cc4aef34057af8c944f0ab8a0150295ad088edd4407a1bd4c225e18b8", + "count": "1", + "wrapped": { + "id": "0x3330add01caca066f647d3a3df92917d0191ba9b9aaaa8d2da4d726bb3c330cf", + "count": "0" + } + } + } + } + } + }, + "beforeBump": { + "asObject": { + "asMoveObject": { + "version": 7, + "contents": { + "json": { + "id": "0x90dc651cc4aef34057af8c944f0ab8a0150295ad088edd4407a1bd4c225e18b8", + "count": "0", + "wrapped": { + "id": "0x3330add01caca066f647d3a3df92917d0191ba9b9aaaa8d2da4d726bb3c330cf", + "count": "0" + } + } + } + } + } + } + } +} + +task 15 'run-graphql'. lines 143-171: +Response: { + "data": { + "unversioned": { + "dynamicObjectField": { + "value": { + "version": 7, + "contents": { + "json": { + "id": "0xd38f2f2e8c369c5ec08b8852fac5834c2bcc25308f0205763528364354dc0369", + "count": "0" + } + } + } + } + }, + "latest": { + "dynamicObjectField": { + "value": { + "version": 10, + "contents": { + "json": { + "id": "0xd38f2f2e8c369c5ec08b8852fac5834c2bcc25308f0205763528364354dc0369", + "count": "1" + } + } + } + } + }, + "afterFirstInnerBump": { + "dynamicObjectField": { + "value": { + "version": 10, + "contents": { + "json": { + "id": "0xd38f2f2e8c369c5ec08b8852fac5834c2bcc25308f0205763528364354dc0369", + "count": "1" + } + } + } + } + }, + "beforeFirstInnerBump": { + "dynamicObjectField": { + "value": { + "version": 7, + "contents": { + "json": { + "id": "0xd38f2f2e8c369c5ec08b8852fac5834c2bcc25308f0205763528364354dc0369", + "count": "0" + } + } + } + } + }, + "beforeBumps": { + "dynamicObjectField": { + "value": { + "version": 7, + "contents": { + "json": { + "id": "0xd38f2f2e8c369c5ec08b8852fac5834c2bcc25308f0205763528364354dc0369", + "count": "0" + } + } + } + } + } + } +} + +task 16 'run-graphql'. lines 173-194: +Response: { + "data": { + "unversioned": { + "dynamicObjectField": { + "value": { + "version": 7, + "contents": { + "json": { + "id": "0xab491044d75a8be613bd6fdc2215a0847c740b8774bc6feb9188f4b7233a37d5", + "count": "0" + } + } + } + } + }, + "latest": { + "dynamicObjectField": { + "value": { + "version": 11, + "contents": { + "json": { + "id": "0xab491044d75a8be613bd6fdc2215a0847c740b8774bc6feb9188f4b7233a37d5", + "count": "1" + } + } + } + } + }, + "beforeInnerBump": { + "dynamicObjectField": { + "value": { + "version": 7, + "contents": { + "json": { + "id": "0xab491044d75a8be613bd6fdc2215a0847c740b8774bc6feb9188f4b7233a37d5", + "count": "0" + } + } + } + } + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/owner/root_version.move b/crates/sui-graphql-e2e-tests/tests/owner/root_version.move new file mode 100644 index 0000000000000..4a0c77bb5de35 --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/owner/root_version.move @@ -0,0 +1,194 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +//# init --protocol-version 48 --addresses P0=0x0 --accounts A --simulator + +//# publish +module P0::M { + use sui::dynamic_object_field as dof; + + public struct O has key { + id: UID, + count: u64, + wrapped: Option, + } + + public struct W has key, store { + id: UID, + count: u64, + } + + public struct DOF has key, store { + id: UID, + count: u64, + } + + // Constructors for each part of the chain + + entry fun new_o(ctx: &mut TxContext) { + transfer::transfer( + O { + id: object::new(ctx), + wrapped: option::none(), + count: 0, + }, + ctx.sender(), + ); + } + + entry fun new_w(ctx: &mut TxContext) { + transfer::transfer( + W { id: object::new(ctx), count: 0 }, + ctx.sender(), + ); + } + + entry fun new_dof(ctx: &mut TxContext) { + transfer::transfer( + DOF { id: object::new(ctx), count: 0 }, + ctx.sender(), + ); + } + + entry fun connect(o: &mut O, mut w: W, mut inner: DOF, outer: DOF) { + dof::add(&mut inner.id, false, outer); + dof::add(&mut w.id, false, inner); + o.wrapped.fill(w); + } + + /// Touch just the outer object (nothing else changes). + entry fun touch_root(o: &mut O) { + o.count = o.count + 1; + } + + /// Touch the wrapped object. + entry fun touch_wrapped(o: &mut O) { + let w = o.wrapped.borrow_mut(); + w.count = w.count + 1; + } + + /// Touch the inner dynamic object field. + entry fun touch_inner(o: &mut O) { + let w = o.wrapped.borrow_mut(); + let inner: &mut DOF = dof::borrow_mut(&mut w.id, false); + inner.count = inner.count + 1; + } + + /// Touch the inner dynamic object field. + entry fun touch_outer(o: &mut O) { + let w = o.wrapped.borrow_mut(); + let inner: &mut DOF = dof::borrow_mut(&mut w.id, false); + let outer: &mut DOF = dof::borrow_mut(&mut inner.id, false); + outer.count = outer.count + 1; + } +} + +// Create all the objects + +//# run P0::M::new_o +// lamport version: 3 (o) + +//# run P0::M::new_w +// lamport version: 4 (w) + +//# run P0::M::new_dof +// lamport version: 5 (inner) + +//# run P0::M::new_dof +// lamprot version: 6 (outer) + + +//# run P0::M::connect --args object(2,0) object(3,0) object(4,0) object(5,0) +// lamport version: 7 (o, w, inner, outer) +// Create a chain from the created objects: +// o -(wraps)-> w -(dof)-> inner -(dof)-> outer + +//# view-object 2,0 + +// Nudge each level of the chain in turn: + +//# run P0::M::touch_root --args object(2,0) +// lamport version: 8 (o) + +//# run P0::M::touch_wrapped --args object(2,0) +// lamport version: 9 (o) + +//# run P0::M::touch_inner --args object(2,0) +// lamport version: 10 (o, inner) + +//# run P0::M::touch_outer --args object(2,0) +// lamport version: 11 (o, outer) + +//# view-object 2,0 + +//# create-checkpoint + +//# run-graphql +fragment Obj on Owner { + asObject { + asMoveObject { + version + contents { json } + } + } +} + +{ # Queries for the root object + latest: owner(address: "@{obj_2_0}") { ...Obj } + versioned: owner(address: "@{obj_2_0}", rootVersion: 10) { ...Obj } + beforeWrappedBump: owner(address: "@{obj_2_0}", rootVersion: 8) { ...Obj } + beforeBump: owner(address: "@{obj_2_0}", rootVersion: 7) { ...Obj } +} + +//# run-graphql +fragment DOF on Owner { + dynamicObjectField(name: { type: "bool", bcs: "AA==" }) { + value { + ... on MoveObject { + version + contents { json } + } + } + } +} + +{ # Querying dynamic fields under the wrapped Move object + # AA== is the base64 encoding of the boolean value `false` (0x00). + + # The latest version konwn to the service for the wrapped object is + # the version it was wrapped at, so that will have no dynamic + # fields. + unversioned: owner(address: "@{obj_3_0}") { ...DOF } + + # Specifying the latest version of the wrapping object has the + # desired effect. + latest: owner(address: "@{obj_3_0}", rootVersion: 11) { ...DOF } + + # Look at various versions of the object in history + afterFirstInnerBump: owner(address: "@{obj_3_0}", rootVersion: 10) { ...DOF } + beforeFirstInnerBump: owner(address: "@{obj_3_0}", rootVersion: 9) { ...DOF } + beforeBumps: owner(address: "@{obj_3_0}", rootVersion: 7) { ...DOF } +} + +//# run-graphql +fragment DOF on Owner { + dynamicObjectField(name: { type: "bool", bcs: "AA==" }) { + value { + ... on MoveObject { + version + contents { json } + } + } + } +} + +{ # Querying a nested dynamic field, where the version of the child + # may be greater than the version of its immediate parent + + # At its latest version, it doesn't see the latest change on its child. + unversioned: owner(address: "@{obj_4_0}") { ...DOF } + + # But at its root's latest version, it does + latest: owner(address: "@{obj_4_0}", rootVersion: 11) { ...DOF } + beforeInnerBump: owner(address: "@{obj_4_0}", rootVersion: 10) { ...DOF } +} diff --git a/crates/sui-graphql-rpc/schema/current_progress_schema.graphql b/crates/sui-graphql-rpc/schema/current_progress_schema.graphql index c6b25c69ebe35..c5b5ae6e526c0 100644 --- a/crates/sui-graphql-rpc/schema/current_progress_schema.graphql +++ b/crates/sui-graphql-rpc/schema/current_progress_schema.graphql @@ -3016,7 +3016,24 @@ type Query { non-entry functions, and some other checks. Defaults to false. """ dryRunTransactionBlock(txBytes: String!, txMeta: TransactionMetadata, skipChecks: Boolean): DryRunResult! - owner(address: SuiAddress!): Owner + """ + Look up an Owner by its SuiAddress. + + `rootVersion` represents the version of the root object in some nested chain of dynamic + fields. It allows consistent historical queries for the case of wrapped objects, which don't + have a version. For example, if querying the dynamic field of a table wrapped in a parent + object, passing the parent object's version here will ensure we get the dynamic field's + state at the moment that parent's version was created. + + Also, if this Owner is an object itself, `rootVersion` will be used to bound its version + from above when querying `Owner.asObject`. This can be used, for example, to get the + contents of a dynamic object field when its parent was at `rootVersion`. + + If `rootVersion` is omitted, dynamic fields will be from a consistent snapshot of the Sui + state at the latest checkpoint known to the GraphQL RPC. Similarly, `Owner.asObject` will + return the object's version at the latest checkpoint. + """ + owner(address: SuiAddress!, rootVersion: Int): Owner """ The object corresponding to the given address at the (optionally) given version. When no version is given, the latest version is returned. diff --git a/crates/sui-graphql-rpc/src/types/balance_change.rs b/crates/sui-graphql-rpc/src/types/balance_change.rs index 98a31d01bb811..bf152e12446c4 100644 --- a/crates/sui-graphql-rpc/src/types/balance_change.rs +++ b/crates/sui-graphql-rpc/src/types/balance_change.rs @@ -25,6 +25,7 @@ impl BalanceChange { O::AddressOwner(addr) | O::ObjectOwner(addr) => Some(Owner { address: SuiAddress::from(addr), checkpoint_viewed_at: self.checkpoint_viewed_at, + root_version: None, }), O::Shared { .. } | O::Immutable => None, diff --git a/crates/sui-graphql-rpc/src/types/object.rs b/crates/sui-graphql-rpc/src/types/object.rs index 8c094c1665334..7243666ef520c 100644 --- a/crates/sui-graphql-rpc/src/types/object.rs +++ b/crates/sui-graphql-rpc/src/types/object.rs @@ -553,6 +553,7 @@ impl ObjectImpl<'_> { owner: Some(Owner { address, checkpoint_viewed_at: self.0.checkpoint_viewed_at, + root_version: None, }), })) } diff --git a/crates/sui-graphql-rpc/src/types/owner.rs b/crates/sui-graphql-rpc/src/types/owner.rs index be94e38311fb9..79525ca9e9921 100644 --- a/crates/sui-graphql-rpc/src/types/owner.rs +++ b/crates/sui-graphql-rpc/src/types/owner.rs @@ -28,6 +28,21 @@ pub(crate) struct Owner { pub address: SuiAddress, /// The checkpoint sequence number at which this was viewed at. pub checkpoint_viewed_at: u64, + /// Root parent object version for dynamic fields. + /// + /// This enables consistent dynamic field reads in the case of chained dynamic object fields, + /// e.g., `Parent -> DOF1 -> DOF2`. In such cases, the object versions may end up like + /// `Parent >= DOF1, DOF2` but `DOF1 < DOF2`. Thus, database queries for dynamic fields must + /// bound the object versions by the version of the root object of the tree. + /// + /// Also, if this Owner is an object itself, `root_version` will be used to bound its version + /// from above in [`Owner::as_object`]. + /// + /// Essentially, lamport timestamps of objects are updated for all top-level mutable objects + /// provided as inputs to a transaction as well as any mutated dynamic child objects. However, + /// any dynamic child objects that were loaded but not actually mutated don't end up having + /// their versions updated. + pub root_version: Option, } /// Type to implement GraphQL fields that are shared by all Owners. @@ -236,7 +251,10 @@ impl Owner { Object::query( ctx, self.address, - Object::latest_at(self.checkpoint_viewed_at), + object::ObjectLookup::LatestAt { + parent_version: self.root_version, + checkpoint_viewed_at: self.checkpoint_viewed_at, + }, ) .await .extend() @@ -253,7 +271,7 @@ impl Owner { name: DynamicFieldName, ) -> Result> { OwnerImpl::from(self) - .dynamic_field(ctx, name, /* parent_version */ None) + .dynamic_field(ctx, name, self.root_version) .await } @@ -269,7 +287,7 @@ impl Owner { name: DynamicFieldName, ) -> Result> { OwnerImpl::from(self) - .dynamic_object_field(ctx, name, /* parent_version */ None) + .dynamic_object_field(ctx, name, self.root_version) .await } @@ -285,9 +303,7 @@ impl Owner { before: Option, ) -> Result> { OwnerImpl::from(self) - .dynamic_fields( - ctx, first, after, last, before, /* parent_version */ None, - ) + .dynamic_fields(ctx, first, after, last, before, self.root_version) .await } } diff --git a/crates/sui-graphql-rpc/src/types/query.rs b/crates/sui-graphql-rpc/src/types/query.rs index 2deef96ce830a..f10d28f06236f 100644 --- a/crates/sui-graphql-rpc/src/types/query.rs +++ b/crates/sui-graphql-rpc/src/types/query.rs @@ -176,11 +176,32 @@ impl Query { DryRunResult::try_from(res).extend() } - async fn owner(&self, ctx: &Context<'_>, address: SuiAddress) -> Result> { + /// Look up an Owner by its SuiAddress. + /// + /// `rootVersion` represents the version of the root object in some nested chain of dynamic + /// fields. It allows consistent historical queries for the case of wrapped objects, which don't + /// have a version. For example, if querying the dynamic field of a table wrapped in a parent + /// object, passing the parent object's version here will ensure we get the dynamic field's + /// state at the moment that parent's version was created. + /// + /// Also, if this Owner is an object itself, `rootVersion` will be used to bound its version + /// from above when querying `Owner.asObject`. This can be used, for example, to get the + /// contents of a dynamic object field when its parent was at `rootVersion`. + /// + /// If `rootVersion` is omitted, dynamic fields will be from a consistent snapshot of the Sui + /// state at the latest checkpoint known to the GraphQL RPC. Similarly, `Owner.asObject` will + /// return the object's version at the latest checkpoint. + async fn owner( + &self, + ctx: &Context<'_>, + address: SuiAddress, + root_version: Option, + ) -> Result> { let Watermark { checkpoint, .. } = *ctx.data()?; Ok(Some(Owner { address, checkpoint_viewed_at: checkpoint, + root_version, })) } diff --git a/crates/sui-graphql-rpc/src/types/validator.rs b/crates/sui-graphql-rpc/src/types/validator.rs index 6dff4af5eac78..86addc51d15c0 100644 --- a/crates/sui-graphql-rpc/src/types/validator.rs +++ b/crates/sui-graphql-rpc/src/types/validator.rs @@ -234,6 +234,7 @@ impl Validator { Ok(Some(Owner { address: self.validator_summary.exchange_rates_id.into(), checkpoint_viewed_at: self.checkpoint_viewed_at, + root_version: None, })) } diff --git a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap index 565c450b28637..7746f8124de1c 100644 --- a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap +++ b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap @@ -3020,7 +3020,24 @@ type Query { non-entry functions, and some other checks. Defaults to false. """ dryRunTransactionBlock(txBytes: String!, txMeta: TransactionMetadata, skipChecks: Boolean): DryRunResult! - owner(address: SuiAddress!): Owner + """ + Look up an Owner by its SuiAddress. + + `rootVersion` represents the version of the root object in some nested chain of dynamic + fields. It allows consistent historical queries for the case of wrapped objects, which don't + have a version. For example, if querying the dynamic field of a table wrapped in a parent + object, passing the parent object's version here will ensure we get the dynamic field's + state at the moment that parent's version was created. + + Also, if this Owner is an object itself, `rootVersion` will be used to bound its version + from above when querying `Owner.asObject`. This can be used, for example, to get the + contents of a dynamic object field when its parent was at `rootVersion`. + + If `rootVersion` is omitted, dynamic fields will be from a consistent snapshot of the Sui + state at the latest checkpoint known to the GraphQL RPC. Similarly, `Owner.asObject` will + return the object's version at the latest checkpoint. + """ + owner(address: SuiAddress!, rootVersion: Int): Owner """ The object corresponding to the given address at the (optionally) given version. When no version is given, the latest version is returned. From 5c3ab8c170479145487ab1fd95caa3aa94b253bd Mon Sep 17 00:00:00 2001 From: Joy Wang <108701016+joyqvq@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:17:00 -0400 Subject: [PATCH 027/163] chore: add a new cognito tenant (#18635) ## Description This enables a new aws tenant for devnet for zklogin ## Test plan ``` # this runs a localnet from epoch 0 cargo build --bin sui RUST_LOG=info target/debug/sui start --force-regenesis --with-faucet # in different tab, this composes an auth url. this creates a deterministic way of getting JWT token with a deterministic nonce and ephemeral key with max epoch 10. Terminate this command. target/debug/sui keytool zk-login-sign-and-execute-tx --max-epoch 10 --network localnet --fixed Visit URL (AWS - Ambrus): https://ambrus.auth.us-east-1.amazoncognito.com/login?response_type=token&client_id=t1eouauaitlirg57nove8kvj8&redirect_uri=https://api.ambrus.studio/callback&nonce=hTPpgF7XAKbW37rEUS6pEVZqmoI # once you obtain the JWT token from redirect URL after id_token=xxxx (do not include the access_token), paste it to the following command (no need to change other params, this assumes you are using the fixed ephemeral key, the max epoch fixed at 10) target/debug/sui keytool zk-login-enter-token --parsed-token eyJraWQiOiJWSEFcL3ZZMWQyaDdYMzNEcFo2WkJEUmZuQ1NcL09JZ2lWN3RvQ2R4eUVVRFk9IiwiYWxnIjoiUlMyNTYifQ.eyJhdF9oYXNoIjoiZktkZ21iXzNOMW1KTGlWNFByRG9IUSIsInN1YiI6Ijc0YjhmNGI4LTYwNTEtNzAwNC0wOGUxLTNkNTQxOTE1MzExOCIsImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC51cy1lYXN0LTEuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0xX3FQc1p4WXFkOCIsImNvZ25pdG86dXNlcm5hbWUiOiJnaGZqc2tkIiwibm9uY2UiOiJoVFBwZ0Y3WEFLYlczN3JFVVM2cEVWWnFtb0kiLCJhdWQiOiJ0MWVvdWF1YWl0bGlyZzU3bm92ZThrdmo4IiwiZXZlbnRfaWQiOiI4NmFkNGZhOC1kN2U0LTQ1ZGUtOTI5My1mMWE0YjAzYzkxNTciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcyMDc5MTMzNiwiZXhwIjoxNzIwNzk0OTM2LCJpYXQiOjE3MjA3OTEzMzYsImp0aSI6ImEzM2U1OWM3LTA5ODAtNDk5ZC04YzQzLWEzZDY4NzM0YzI4MCIsImVtYWlsIjoibHVjaWVuQGFtYnJ1cy5zdHVkaW8ifQ.WmcTipaovAmGh9_095RbMZmiQom-rAeboxfWvQz9y5ym-wwMSCL63uwihrLtE1JVzOS_8Qk1dkTm_AoRSd4zIGxSCOUA3bHC3ekqOS5_McIfHfp6V0dLK67KmofKB7HzPFFY8tRh20jpVwcxVBpeuTojs3KFUJUIBFwwxe-pMz8--r62yzplv067sHL9UtoJ86KInQtJCceyk-EepuHisx7dFdspcyue2GpSvTCLYnkyjIJE5T6RUhldfAQOK0d6WNiBMq8MQgbsz8dOhpSWmZk-wa7uftMVZ0IG22MHqaqdaZxCwmmKbMTb3ACMG0dooVkAiclz8hxmP5IUHD4RcQ --max-epoch 10 --jwt-randomness 100681567828351849884072155819400689117 --kp-bigint 84029355920633174015103288781128426107680789454168570548782290541079926444544 --ephemeral-key-identifier 0xcc2196ee1fa156836daf9bb021d88d648a0023fa387e695d3701667a634a331f --network localnet ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-config/src/node.rs | 1 + .../snapshot_tests__network_config_snapshot_matches.snap | 8 +++++++- crates/sui/src/keytool.rs | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index c1749e10b5e24..213da423ff141 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -234,6 +234,7 @@ pub fn default_zklogin_oauth_providers() -> BTreeMap> { "KarrierOne".to_string(), "Credenza3".to_string(), "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A".to_string(), + "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8".to_string(), ]); let providers = BTreeSet::from([ "Google".to_string(), 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 a0341fccb49c4..972df1a52de4e 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 @@ -1,6 +1,5 @@ --- source: crates/sui-swarm-config/tests/snapshot_tests.rs -assertion_line: 151 expression: network_config --- validator_configs: @@ -109,6 +108,7 @@ validator_configs: Unknown: - Apple - "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A" + - "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8" - Credenza3 - Facebook - Google @@ -245,6 +245,7 @@ validator_configs: Unknown: - Apple - "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A" + - "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8" - Credenza3 - Facebook - Google @@ -381,6 +382,7 @@ validator_configs: Unknown: - Apple - "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A" + - "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8" - Credenza3 - Facebook - Google @@ -517,6 +519,7 @@ validator_configs: Unknown: - Apple - "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A" + - "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8" - Credenza3 - Facebook - Google @@ -653,6 +656,7 @@ validator_configs: Unknown: - Apple - "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A" + - "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8" - Credenza3 - Facebook - Google @@ -789,6 +793,7 @@ validator_configs: Unknown: - Apple - "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A" + - "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8" - Credenza3 - Facebook - Google @@ -925,6 +930,7 @@ validator_configs: Unknown: - Apple - "AwsTenant-region:us-east-1-tenant_id:us-east-1_LPSLCkC3A" + - "AwsTenant-region:us-east-1-tenant_id:us-east-1_qPsZxYqd8" - Credenza3 - Facebook - Google diff --git a/crates/sui/src/keytool.rs b/crates/sui/src/keytool.rs index 70f2cf42ac8b1..a2a02b531574e 100644 --- a/crates/sui/src/keytool.rs +++ b/crates/sui/src/keytool.rs @@ -1106,6 +1106,14 @@ impl KeyToolCommand { "https://example.com/callback", &jwt_randomness, )?; + let url_13 = get_oidc_url( + OIDCProvider::AwsTenant(("us-east-1".to_string(), "ambrus".to_string())), + &eph_pk_bytes, + max_epoch, + "t1eouauaitlirg57nove8kvj8", + "https://api.ambrus.studio/callback", + &jwt_randomness, + )?; println!("Visit URL (Google): {url}"); println!("Visit URL (Twitch): {url_2}"); println!("Visit URL (Facebook): {url_3}"); @@ -1119,6 +1127,7 @@ impl KeyToolCommand { println!("Visit URL (Microsoft): {url_10}"); println!("Visit URL (KarrierOne): {url_11}"); println!("Visit URL (Credenza3): {url_12}"); + println!("Visit URL (AWS - Ambrus): {url_13}"); println!("Finish login and paste the entire URL here (e.g. https://sui.io/#id_token=...):"); From a5a4ab37710120a31665448e2da6c1344ead1ea1 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 15 Jul 2024 07:47:59 -0700 Subject: [PATCH 028/163] [AuthAgg] Use epoch start state to construct AuthorityAggregator (#18649) ## Description This PR makes two changes: 1. The primary change is to be able to construct AuthorityAggregator from epoch start state, instead of reading system state from the store. This is much safer and sync way to do it in prod. 2. The secondary change is to extend AuthorityAggregatorBuilder to be able to build more aggregators, to simplify some of the code. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-benchmark/src/lib.rs | 20 +- crates/sui-core/src/authority_aggregator.rs | 213 ++++++++---------- crates/sui-core/src/quorum_driver/mod.rs | 2 +- .../src/quorum_driver/reconfig_observer.rs | 55 ++--- crates/sui-core/src/test_utils.rs | 20 +- .../sui-core/src/transaction_orchestrator.rs | 11 +- .../unit_tests/authority_aggregator_tests.rs | 20 +- crates/sui-core/src/validator_tx_finalizer.rs | 14 +- crates/sui-node/src/lib.rs | 2 + crates/sui-tool/src/commands.rs | 7 +- 10 files changed, 146 insertions(+), 218 deletions(-) diff --git a/crates/sui-benchmark/src/lib.rs b/crates/sui-benchmark/src/lib.rs index 01f21df71b345..b440e5ffb4062 100644 --- a/crates/sui-benchmark/src/lib.rs +++ b/crates/sui-benchmark/src/lib.rs @@ -17,9 +17,7 @@ use std::{ use sui_config::genesis::Genesis; use sui_core::{ authority_aggregator::{AuthorityAggregator, AuthorityAggregatorBuilder}, - authority_client::{ - make_authority_clients_with_timeout_config, AuthorityAPI, NetworkAuthorityClient, - }, + authority_client::{AuthorityAPI, NetworkAuthorityClient}, quorum_driver::{ QuorumDriver, QuorumDriverHandler, QuorumDriverHandlerBuilder, QuorumDriverMetrics, }, @@ -28,7 +26,6 @@ use sui_json_rpc_types::{ SuiObjectDataOptions, SuiObjectResponse, SuiObjectResponseQuery, SuiTransactionBlockEffects, SuiTransactionBlockEffectsAPI, SuiTransactionBlockResponseOptions, }; -use sui_network::{DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_REQUEST_TIMEOUT_SEC}; use sui_sdk::{SuiClient, SuiClientBuilder}; use sui_types::base_types::ConciseableName; use sui_types::committee::CommitteeTrait; @@ -256,24 +253,17 @@ impl LocalValidatorAggregatorProxy { registry: &Registry, reconfig_fullnode_rpc_url: Option<&str>, ) -> Self { - let (aggregator, _) = AuthorityAggregatorBuilder::from_genesis(genesis) + let (aggregator, clients) = AuthorityAggregatorBuilder::from_genesis(genesis) .with_registry(registry) - .build() - .unwrap(); - - let committee = genesis.committee_with_network(); - let clients = make_authority_clients_with_timeout_config( - &committee, - DEFAULT_CONNECT_TIMEOUT_SEC, - DEFAULT_REQUEST_TIMEOUT_SEC, - ); + .build_network_clients(); + let committee = genesis.committee().unwrap(); Self::new_impl( aggregator, registry, reconfig_fullnode_rpc_url, clients, - committee.committee().clone(), + committee, ) .await } diff --git a/crates/sui-core/src/authority_aggregator.rs b/crates/sui-core/src/authority_aggregator.rs index 26a8159bacb2c..c4f7da27474f9 100644 --- a/crates/sui-core/src/authority_aggregator.rs +++ b/crates/sui-core/src/authority_aggregator.rs @@ -6,9 +6,7 @@ use crate::authority_client::{ make_authority_clients_with_timeout_config, make_network_authority_clients_with_network_config, AuthorityAPI, NetworkAuthorityClient, }; -use crate::execution_cache::ObjectCacheRead; use crate::safe_client::{SafeClient, SafeClientMetrics, SafeClientMetricsBase}; -use fastcrypto::traits::ToFromBytes; use futures::{future::BoxFuture, stream::FuturesUnordered, StreamExt}; use mysten_metrics::histogram::Histogram; use mysten_metrics::{monitored_future, spawn_monitored_task, GaugeGuard}; @@ -28,16 +26,19 @@ use sui_types::fp_ensure; use sui_types::message_envelope::Message; use sui_types::object::Object; use sui_types::quorum_driver_types::{GroupedErrors, QuorumDriverResponse}; +use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait; use sui_types::sui_system_state::{SuiSystemState, SuiSystemStateTrait}; use sui_types::{ base_types::*, - committee::{Committee, ProtocolVersion}, + committee::Committee, error::{SuiError, SuiResult}, transaction::*, }; use thiserror::Error; use tracing::{debug, error, info, trace, warn, Instrument}; +use crate::epoch::committee_store::CommitteeStore; +use crate::stake_aggregator::{InsertResult, MultiStakeAggregator, StakeAggregator}; use prometheus::{ register_int_counter_vec_with_registry, register_int_counter_with_registry, register_int_gauge_with_registry, IntCounter, IntCounterVec, IntGauge, Registry, @@ -56,11 +57,9 @@ use sui_types::messages_grpc::{ ObjectInfoRequest, TransactionInfoRequest, }; use sui_types::messages_safe_client::PlainTransactionInfoResponse; +use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemState; use tokio::time::{sleep, timeout}; -use crate::epoch::committee_store::CommitteeStore; -use crate::stake_aggregator::{InsertResult, MultiStakeAggregator, StakeAggregator}; - pub const DEFAULT_RETRIES: usize = 4; #[cfg(test)] @@ -506,53 +505,13 @@ pub struct AuthorityAggregator { impl AuthorityAggregator { pub fn new( - committee: Committee, - committee_store: Arc, - authority_clients: BTreeMap, - registry: &Registry, - validator_display_names: Arc>, - ) -> Self { - Self::new_with_timeouts( - committee, - committee_store, - authority_clients, - registry, - validator_display_names, - Default::default(), - ) - } - - pub fn new_with_timeouts( - committee: Committee, - committee_store: Arc, - authority_clients: BTreeMap, - registry: &Registry, - validator_display_names: Arc>, - timeouts: TimeoutConfig, - ) -> Self { - let safe_client_metrics_base = SafeClientMetricsBase::new(registry); - Self { - committee: Arc::new(committee), - validator_display_names, - authority_clients: create_safe_clients( - authority_clients, - &committee_store, - &safe_client_metrics_base, - ), - metrics: Arc::new(AuthAggMetrics::new(registry)), - safe_client_metrics_base, - timeouts, - committee_store, - } - } - - pub fn new_with_metrics( committee: Committee, committee_store: Arc, authority_clients: BTreeMap, safe_client_metrics_base: SafeClientMetricsBase, auth_agg_metrics: Arc, validator_display_names: Arc>, + timeouts: TimeoutConfig, ) -> Self { Self { committee: Arc::new(committee), @@ -563,7 +522,7 @@ impl AuthorityAggregator { ), metrics: auth_agg_metrics, safe_client_metrics_base, - timeouts: Default::default(), + timeouts, committee_store, validator_display_names, } @@ -682,46 +641,40 @@ fn create_safe_clients( } impl AuthorityAggregator { - /// Create a new network authority aggregator by reading the committee and - /// network address information from the system state object on-chain. - /// This function needs metrics parameters because registry will panic - /// if we attempt to register already-registered metrics again. - pub fn new_from_local_system_state( - store: &Arc, + /// Create a new network authority aggregator by reading the committee and network addresses + /// information from the given epoch start system state. + pub fn new_from_epoch_start_state( + epoch_start_state: &EpochStartSystemState, committee_store: &Arc, safe_client_metrics_base: SafeClientMetricsBase, - auth_agg_metrics: AuthAggMetrics, + auth_agg_metrics: Arc, ) -> Self { - // TODO: We should get the committee from the epoch store instead to ensure consistency. - // Instead of this function use AuthorityEpochStore::epoch_start_configuration() to access this object everywhere - // besides when we are reading fields for the current epoch - let sui_system_state = store - .get_sui_system_state_object_unsafe() - .expect("Get system state object should never fail"); - let committee = sui_system_state.get_current_epoch_committee(); - let validator_display_names = sui_system_state - .into_sui_system_state_summary() - .active_validators - .into_iter() - .filter_map(|s| { - let authority_name = - AuthorityPublicKeyBytes::from_bytes(s.protocol_pubkey_bytes.as_slice()); - if authority_name.is_err() { - return None; - } - let human_readable_name = s.name; - Some((authority_name.unwrap(), human_readable_name)) - }) - .collect(); + let committee = epoch_start_state.get_sui_committee_with_network_metadata(); + let validator_display_names = epoch_start_state.get_authority_names_to_hostnames(); Self::new_from_committee( committee, committee_store, safe_client_metrics_base, - Arc::new(auth_agg_metrics), + auth_agg_metrics, Arc::new(validator_display_names), ) } + /// Create a new AuthorityAggregator using information from the given epoch start system state. + /// This is typically used during reconfiguration to create a new AuthorityAggregator with the + /// new committee and network addresses. + pub fn recreate_with_new_epoch_start_state( + &self, + epoch_start_state: &EpochStartSystemState, + ) -> Self { + Self::new_from_epoch_start_state( + epoch_start_state, + &self.committee_store, + self.safe_client_metrics_base.clone(), + self.metrics.clone(), + ) + } + pub fn new_from_committee( committee: CommitteeWithNetworkMetadata, committee_store: &Arc, @@ -732,13 +685,14 @@ impl AuthorityAggregator { let net_config = default_mysten_network_config(); let authority_clients = make_network_authority_clients_with_network_config(&committee, &net_config); - Self::new_with_metrics( + Self::new( committee.committee().clone(), committee_store.clone(), authority_clients, safe_client_metrics_base, auth_agg_metrics, validator_display_names, + Default::default(), ) } } @@ -1882,38 +1836,37 @@ where .await } } + +#[derive(Default)] pub struct AuthorityAggregatorBuilder<'a> { network_config: Option<&'a NetworkConfig>, genesis: Option<&'a Genesis>, + committee: Option, committee_store: Option>, registry: Option<&'a Registry>, - protocol_version: ProtocolVersion, + timeouts_config: Option, } impl<'a> AuthorityAggregatorBuilder<'a> { pub fn from_network_config(config: &'a NetworkConfig) -> Self { Self { network_config: Some(config), - genesis: None, - committee_store: None, - registry: None, - protocol_version: ProtocolVersion::MIN, + ..Default::default() } } pub fn from_genesis(genesis: &'a Genesis) -> Self { Self { - network_config: None, genesis: Some(genesis), - committee_store: None, - registry: None, - protocol_version: ProtocolVersion::MIN, + ..Default::default() } } - pub fn with_protocol_version(mut self, new_version: ProtocolVersion) -> Self { - self.protocol_version = new_version; - self + pub fn from_committee(committee: Committee) -> Self { + Self { + committee: Some(committee), + ..Default::default() + } } pub fn with_committee_store(mut self, committee_store: Arc) -> Self { @@ -1926,44 +1879,68 @@ impl<'a> AuthorityAggregatorBuilder<'a> { self } - pub fn build( - self, - ) -> anyhow::Result<( - AuthorityAggregator, - BTreeMap, - )> { + pub fn with_timeouts_config(mut self, timeouts_config: TimeoutConfig) -> Self { + self.timeouts_config = Some(timeouts_config); + self + } + + fn get_network_committee(&self) -> CommitteeWithNetworkMetadata { let genesis = if let Some(network_config) = self.network_config { &network_config.genesis } else if let Some(genesis) = self.genesis { genesis } else { - anyhow::bail!("need either NetworkConfig or Genesis."); + panic!("need either NetworkConfig or Genesis."); }; - let committee = genesis.committee_with_network(); - let mut registry = &prometheus::Registry::new(); - if self.registry.is_some() { - registry = self.registry.unwrap(); - } + genesis.committee_with_network() + } + + fn get_committee(&self) -> Committee { + self.committee + .clone() + .unwrap_or_else(|| self.get_network_committee().committee().clone()) + } + pub fn build_network_clients( + self, + ) -> ( + AuthorityAggregator, + BTreeMap, + ) { + let network_committee = self.get_network_committee(); let auth_clients = make_authority_clients_with_timeout_config( - &committee, + &network_committee, DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_REQUEST_TIMEOUT_SEC, ); - let committee_store = if let Some(committee_store) = self.committee_store { - committee_store - } else { - Arc::new(CommitteeStore::new_for_testing(committee.committee())) - }; - Ok(( - AuthorityAggregator::new( - committee.committee().clone(), - committee_store, - auth_clients.clone(), - registry, - Arc::new(HashMap::new()), - ), - auth_clients, - )) + let auth_agg = self.build_custom_clients(auth_clients.clone()); + (auth_agg, auth_clients) + } + + pub fn build_custom_clients( + self, + authority_clients: BTreeMap, + ) -> AuthorityAggregator { + let committee = self.get_committee(); + let registry = Registry::new(); + let registry = self.registry.unwrap_or(®istry); + let safe_client_metrics_base = SafeClientMetricsBase::new(registry); + let auth_agg_metrics = Arc::new(AuthAggMetrics::new(registry)); + + let committee_store = self + .committee_store + .unwrap_or_else(|| Arc::new(CommitteeStore::new_for_testing(&committee))); + + let timeouts_config = self.timeouts_config.unwrap_or_default(); + + AuthorityAggregator::new( + committee, + committee_store, + authority_clients, + safe_client_metrics_base, + auth_agg_metrics, + Arc::new(HashMap::new()), + timeouts_config, + ) } } diff --git a/crates/sui-core/src/quorum_driver/mod.rs b/crates/sui-core/src/quorum_driver/mod.rs index bd641f7f9295e..b10ac8762d781 100644 --- a/crates/sui-core/src/quorum_driver/mod.rs +++ b/crates/sui-core/src/quorum_driver/mod.rs @@ -630,7 +630,7 @@ where let (subscriber_tx, subscriber_rx) = tokio::sync::broadcast::channel::<_>(EFFECTS_QUEUE_SIZE); let quorum_driver = Arc::new(QuorumDriver::new( - ArcSwap::from(validators), + ArcSwap::new(validators), task_tx, subscriber_tx, notifier, diff --git a/crates/sui-core/src/quorum_driver/reconfig_observer.rs b/crates/sui-core/src/quorum_driver/reconfig_observer.rs index 330c083f9e587..896b4c712d32b 100644 --- a/crates/sui-core/src/quorum_driver/reconfig_observer.rs +++ b/crates/sui-core/src/quorum_driver/reconfig_observer.rs @@ -1,21 +1,21 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use async_trait::async_trait; -use std::sync::Arc; -use sui_types::sui_system_state::{SuiSystemState, SuiSystemStateTrait}; -use tokio::sync::broadcast::error::RecvError; -use tracing::{info, warn}; - +use super::QuorumDriver; use crate::{ - authority_aggregator::{AuthAggMetrics, AuthorityAggregator}, + authority_aggregator::AuthAggMetrics, authority_client::{AuthorityAPI, NetworkAuthorityClient}, epoch::committee_store::CommitteeStore, execution_cache::ObjectCacheRead, safe_client::SafeClientMetricsBase, }; - -use super::QuorumDriver; +use async_trait::async_trait; +use std::sync::Arc; +use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait; +use sui_types::sui_system_state::SuiSystemState; +use sui_types::sui_system_state::SuiSystemStateTrait; +use tokio::sync::broadcast::error::RecvError; +use tracing::{info, warn}; #[async_trait] pub trait ReconfigObserver { @@ -29,6 +29,7 @@ pub struct OnsiteReconfigObserver { reconfig_rx: tokio::sync::broadcast::Receiver, execution_cache: Arc, committee_store: Arc, + // TODO: Use Arc for both metrics. safe_client_metrics_base: SafeClientMetricsBase, auth_agg_metrics: AuthAggMetrics, } @@ -49,17 +50,6 @@ impl OnsiteReconfigObserver { auth_agg_metrics, } } - - async fn create_authority_aggregator_from_system_state( - &self, - ) -> AuthorityAggregator { - AuthorityAggregator::new_from_local_system_state( - &self.execution_cache, - &self.committee_store, - self.safe_client_metrics_base.clone(), - self.auth_agg_metrics.clone(), - ) - } } #[async_trait] @@ -75,28 +65,19 @@ impl ReconfigObserver for OnsiteReconfigObserver { } async fn run(&mut self, quorum_driver: Arc>) { - // A tiny optimization: when a very stale node just starts, the - // channel may fill up committees quickly. Here we skip directly to - // the last known committee by looking at SuiSystemState. - let authority_agg = self.create_authority_aggregator_from_system_state().await; - if authority_agg.committee.epoch > quorum_driver.current_epoch() { - quorum_driver - .update_validators(Arc::new(authority_agg)) - .await; - } loop { match self.reconfig_rx.recv().await { Ok(system_state) => { - let committee = system_state.get_current_epoch_committee(); - info!( - "Got reconfig message. New committee: {}", - committee.committee() - ); + let epoch_start_state = system_state.into_epoch_start_state(); + let committee = epoch_start_state.get_sui_committee(); + info!("Got reconfig message. New committee: {}", committee); if committee.epoch() > quorum_driver.current_epoch() { - let authority_agg = - self.create_authority_aggregator_from_system_state().await; + let new_auth_agg = quorum_driver + .authority_aggregator() + .load() + .recreate_with_new_epoch_start_state(&epoch_start_state); quorum_driver - .update_validators(Arc::new(authority_agg)) + .update_validators(Arc::new(new_auth_agg)) .await; } else { // This should only happen when the node just starts diff --git a/crates/sui-core/src/test_utils.rs b/crates/sui-core/src/test_utils.rs index 8786023364a24..190e30caedd60 100644 --- a/crates/sui-core/src/test_utils.rs +++ b/crates/sui-core/src/test_utils.rs @@ -6,9 +6,8 @@ use fastcrypto::traits::KeyPair; use futures::future::join_all; use move_core_types::account_address::AccountAddress; use move_core_types::ident_str; -use prometheus::Registry; use shared_crypto::intent::{Intent, IntentScope}; -use std::collections::{BTreeMap, HashMap}; +use std::collections::BTreeMap; use std::path::PathBuf; use std::sync::Arc; use std::time::Duration; @@ -47,8 +46,7 @@ use tokio::time::timeout; use tracing::{info, warn}; use crate::authority::{test_authority_builder::TestAuthorityBuilder, AuthorityState}; -use crate::authority_aggregator::{AuthorityAggregator, TimeoutConfig}; -use crate::epoch::committee_store::CommitteeStore; +use crate::authority_aggregator::{AuthorityAggregator, AuthorityAggregatorBuilder, TimeoutConfig}; use crate::state_accumulator::StateAccumulator; use crate::test_authority_clients::LocalAuthorityClient; @@ -312,8 +310,6 @@ pub async fn init_local_authorities_with_genesis( authorities: Vec>, ) -> AuthorityAggregator { telemetry_subscribers::init_for_testing(); - let committee = genesis.committee().unwrap(); - let mut clients = BTreeMap::new(); for state in authorities { let name = state.name; @@ -325,15 +321,9 @@ pub async fn init_local_authorities_with_genesis( post_quorum_timeout: Duration::from_secs(5), serial_authority_request_interval: Duration::from_secs(1), }; - let committee_store = Arc::new(CommitteeStore::new_for_testing(&committee)); - AuthorityAggregator::new_with_timeouts( - committee, - committee_store, - clients, - &Registry::new(), - Arc::new(HashMap::new()), - timeouts, - ) + AuthorityAggregatorBuilder::from_genesis(genesis) + .with_timeouts_config(timeouts) + .build_custom_clients(clients) } pub fn make_transfer_sui_transaction( diff --git a/crates/sui-core/src/transaction_orchestrator.rs b/crates/sui-core/src/transaction_orchestrator.rs index 569ad1de2b92d..ac5e0c0d305ce 100644 --- a/crates/sui-core/src/transaction_orchestrator.rs +++ b/crates/sui-core/src/transaction_orchestrator.rs @@ -38,15 +38,15 @@ use sui_types::quorum_driver_types::{ ExecuteTransactionResponse, ExecuteTransactionResponseV3, FinalizedEffects, QuorumDriverEffectsQueueResult, QuorumDriverError, QuorumDriverResponse, QuorumDriverResult, }; +use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemState; use sui_types::sui_system_state::SuiSystemState; +use sui_types::transaction::VerifiedTransaction; use tokio::sync::broadcast::error::RecvError; use tokio::sync::broadcast::Receiver; use tokio::task::JoinHandle; use tokio::time::timeout; use tracing::{debug, error, error_span, info, instrument, warn, Instrument}; -use sui_types::transaction::VerifiedTransaction; - // How long to wait for local execution (including parents) before a timeout // is returned to client. const LOCAL_EXECUTION_TIMEOUT: Duration = Duration::from_secs(10); @@ -64,6 +64,7 @@ pub struct TransactiondOrchestrator { impl TransactiondOrchestrator { pub fn new_with_network_clients( + epoch_start_state: &EpochStartSystemState, validator_state: Arc, reconfig_channel: Receiver, parent_path: &Path, @@ -71,11 +72,11 @@ impl TransactiondOrchestrator { ) -> Self { let safe_client_metrics_base = SafeClientMetricsBase::new(prometheus_registry); let auth_agg_metrics = AuthAggMetrics::new(prometheus_registry); - let validators = AuthorityAggregator::new_from_local_system_state( - validator_state.get_object_cache_reader(), + let validators = AuthorityAggregator::new_from_epoch_start_state( + epoch_start_state, validator_state.committee_store(), safe_client_metrics_base.clone(), - auth_agg_metrics.clone(), + Arc::new(auth_agg_metrics.clone()), ); let observer = OnsiteReconfigObserver::new( diff --git a/crates/sui-core/src/unit_tests/authority_aggregator_tests.rs b/crates/sui-core/src/unit_tests/authority_aggregator_tests.rs index b59c02609a635..cef3075a2e93f 100644 --- a/crates/sui-core/src/unit_tests/authority_aggregator_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_aggregator_tests.rs @@ -684,19 +684,13 @@ fn get_genesis_agg( clients: BTreeMap, ) -> AuthorityAggregator { let committee = Committee::new_for_testing_with_normalized_voting_power(0, authorities); - let committee_store = Arc::new(CommitteeStore::new_for_testing(&committee)); - - AuthorityAggregator::new_with_timeouts( - committee, - committee_store, - clients, - &Registry::new(), - Arc::new(HashMap::new()), - TimeoutConfig { - serial_authority_request_interval: Duration::from_millis(50), - ..Default::default() - }, - ) + let timeouts_config = TimeoutConfig { + serial_authority_request_interval: Duration::from_millis(50), + ..Default::default() + }; + AuthorityAggregatorBuilder::from_committee(committee) + .with_timeouts_config(timeouts_config) + .build_custom_clients(clients) } fn get_agg_at_epoch( diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index 3215f271538b5..fd55c7c13a432 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -176,12 +176,11 @@ where mod tests { use crate::authority::test_authority_builder::TestAuthorityBuilder; use crate::authority::AuthorityState; - use crate::authority_aggregator::AuthorityAggregator; + use crate::authority_aggregator::{AuthorityAggregator, AuthorityAggregatorBuilder}; use crate::authority_client::AuthorityAPI; use crate::validator_tx_finalizer::ValidatorTxFinalizer; use async_trait::async_trait; - use prometheus::default_registry; - use std::collections::{BTreeMap, HashMap}; + use std::collections::BTreeMap; use std::iter; use std::net::SocketAddr; use std::num::NonZeroUsize; @@ -504,13 +503,8 @@ mod tests { ) }) .collect(); - let auth_agg = AuthorityAggregator::new( - network_config.committee_with_network().committee().clone(), - authority_states[0].clone_committee_store(), - clients.clone(), - default_registry(), - Arc::new(HashMap::new()), - ); + let auth_agg = AuthorityAggregatorBuilder::from_network_config(&network_config) + .build_custom_clients(clients.clone()); (authority_states, Arc::new(auth_agg), clients) } diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index e7dbd4c9dc4b3..9f10a41e091a5 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -693,6 +693,7 @@ impl SuiNode { let transaction_orchestrator = if is_full_node && run_with_range.is_none() { Some(Arc::new( TransactiondOrchestrator::new_with_network_clients( + epoch_store.epoch_start_state(), state.clone(), end_of_epoch_receiver, &config.db_path(), @@ -1548,6 +1549,7 @@ impl SuiNode { cur_epoch_store.record_is_safe_mode_metric(latest_system_state.safe_mode()); let new_epoch_start_state = latest_system_state.into_epoch_start_state(); + let next_epoch_committee = new_epoch_start_state.get_sui_committee(); let next_epoch = next_epoch_committee.epoch(); assert_eq!(cur_epoch_store.epoch() + 1, next_epoch); diff --git a/crates/sui-tool/src/commands.rs b/crates/sui-tool/src/commands.rs index 4345f8cb7fdc0..95b39183c96f6 100644 --- a/crates/sui-tool/src/commands.rs +++ b/crates/sui-tool/src/commands.rs @@ -883,7 +883,7 @@ impl ToolCommand { _ => panic!("If setting `CUSTOM_ARCHIVE_BUCKET=true` must set FORMAL_SNAPSHOT_ARCHIVE_BUCKET_TYPE to one of 'gcs', 'azure', or 's3' "), } } else { - // if not explictly overriden, just default to the permissionless archive store + // if not explicitly overridden, just default to the permissionless archive store ObjectStoreConfig { object_store: Some(ObjectStoreType::S3), bucket: archive_bucket.filter(|s| !s.is_empty()), @@ -1134,9 +1134,8 @@ impl ToolCommand { ) .unwrap(); let transaction = Transaction::new(sender_signed_data); - let (agg, _) = AuthorityAggregatorBuilder::from_genesis(&genesis) - .build() - .unwrap(); + let (agg, _) = + AuthorityAggregatorBuilder::from_genesis(&genesis).build_network_clients(); let result = agg.process_transaction(transaction, None).await; println!("{:?}", result); } From ad5d7b9d8ef143c171f6e344bf4330892217e36f Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Mon, 15 Jul 2024 08:27:40 -0700 Subject: [PATCH 029/163] Update graphql e2e test to protocol version 51 (#18653) ## Description I wanted to update it to version 49, since there is a change related to consensus commit prologue V3. But since testnet now uses 51, I choose to use it here as well. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/simulacrum/src/lib.rs | 4 +- .../tests/available_range/available_range.exp | 16 +- .../available_range/available_range.move | 2 +- .../checkpoint_connection_pagination.move | 2 +- .../tests/call/coin_metadata.exp | 1 + .../tests/call/coin_metadata.move | 2 +- .../tests/call/dynamic_fields.exp | 60 +- .../tests/call/dynamic_fields.move | 2 +- .../tests/call/owned_objects.move | 2 +- .../tests/call/simple.exp | 34 +- .../tests/call/simple.move | 2 +- .../tests/consistency/balances.exp | 44 +- .../tests/consistency/balances.move | 2 +- .../checkpoints/transaction_blocks.exp | 36 +- .../checkpoints/transaction_blocks.move | 2 +- .../tests/consistency/coins.exp | 254 +++---- .../tests/consistency/coins.move | 2 +- .../consistency/dynamic_fields/deleted_df.exp | 78 +- .../dynamic_fields/deleted_df.move | 2 +- .../dynamic_fields/deleted_dof.exp | 18 +- .../dynamic_fields/deleted_dof.move | 2 +- .../dof_add_reclaim_transfer.exp | 20 +- .../dof_add_reclaim_transfer.move | 2 +- .../dof_add_reclaim_transfer_reclaim_add.exp | 24 +- .../dof_add_reclaim_transfer_reclaim_add.move | 2 +- .../dynamic_fields/dynamic_fields.exp | 234 +++--- .../dynamic_fields/dynamic_fields.move | 2 +- .../consistency/dynamic_fields/mutated_df.exp | 12 +- .../dynamic_fields/mutated_df.move | 2 +- .../dynamic_fields/mutated_dof.exp | 30 +- .../dynamic_fields/mutated_dof.move | 2 +- .../tests/consistency/epochs/checkpoints.move | 2 +- .../consistency/epochs/transaction_blocks.exp | 236 +++--- .../epochs/transaction_blocks.move | 2 +- .../tests/consistency/object_at_version.exp | 16 +- .../tests/consistency/object_at_version.move | 2 +- .../tests/consistency/objects_pagination.exp | 319 ++++---- .../tests/consistency/objects_pagination.move | 2 +- .../consistency/objects_pagination_single.exp | 60 +- .../objects_pagination_single.move | 2 +- .../consistency/performance/many_objects.exp | 132 ++-- .../consistency/performance/many_objects.move | 2 +- .../tests/consistency/staked_sui.exp | 32 +- .../tests/consistency/staked_sui.move | 2 +- .../tests/consistency/tx_address_objects.exp | 690 +++++++++--------- .../tests/consistency/tx_address_objects.move | 2 +- .../tests/datetime/datetime.move | 2 +- .../tests/epoch/epoch.exp | 8 +- .../tests/epoch/epoch.move | 2 +- .../tests/epoch/system_state.exp | 4 +- .../tests/epoch/system_state.move | 2 +- .../tests/errors/clever_errors.exp | 40 +- .../tests/errors/clever_errors.move | 2 +- .../tests/errors/clever_errors_in_macros.exp | 6 +- .../tests/errors/clever_errors_in_macros.move | 2 +- .../event_connection/event_connection.exp | 24 +- .../event_connection/event_connection.move | 2 +- .../event_connection/nested_emit_event.exp | 6 +- .../event_connection/nested_emit_event.move | 2 +- .../tests/event_connection/pagination.exp | 18 +- .../tests/event_connection/pagination.move | 2 +- .../tests/limits/directives.exp | 4 +- .../tests/limits/directives.move | 2 +- .../tests/limits/output_node_estimation.exp | 22 +- .../tests/limits/output_node_estimation.move | 2 +- .../tests/objects/coin.exp | 37 +- .../tests/objects/coin.move | 2 +- .../tests/objects/data.exp | 250 +++---- .../tests/objects/data.move | 2 +- .../tests/objects/display.exp | 18 +- .../tests/objects/display.move | 2 +- .../tests/objects/enum_data.exp | 328 ++++++++- .../tests/objects/enum_data.move | 2 +- .../tests/objects/filter_by_type.exp | 18 +- .../tests/objects/filter_by_type.move | 2 +- .../tests/objects/pagination.exp | 38 +- .../tests/objects/pagination.move | 2 +- .../tests/objects/public_transfer.exp | 10 +- .../tests/objects/public_transfer.move | 2 +- .../tests/objects/received.exp | 2 +- .../tests/objects/received.move | 2 +- .../tests/objects/staked_sui.exp | 22 +- .../tests/objects/staked_sui.move | 2 +- .../tests/owner/downcasts.exp | 2 +- .../tests/owner/downcasts.move | 2 +- .../tests/packages/datatypes.exp | 311 +++++--- .../tests/packages/datatypes.move | 2 +- .../tests/packages/enums.exp | 252 ++++++- .../tests/packages/enums.move | 2 +- .../tests/packages/friends.move | 2 +- .../tests/packages/functions.exp | 38 +- .../tests/packages/functions.move | 2 +- .../tests/packages/modules.exp | 48 +- .../tests/packages/modules.move | 2 +- .../tests/packages/structs.exp | 72 +- .../tests/packages/structs.move | 2 +- .../tests/packages/types.exp | 2 +- .../tests/packages/types.move | 2 +- .../balance_changes.move | 2 +- .../dependencies.exp | 61 +- .../dependencies.move | 2 +- .../transaction_block_effects/events.move | 2 +- .../object_changes.move | 2 +- .../tests/transactions/errors.exp | 4 +- .../tests/transactions/errors.move | 2 +- .../tests/transactions/programmable.exp | 168 ++--- .../tests/transactions/programmable.move | 2 +- .../tests/transactions/random.exp | 4 +- .../tests/transactions/random.move | 2 +- .../tests/transactions/shared.exp | 16 +- .../tests/transactions/shared.move | 2 +- .../tests/transactions/system.exp | 335 +++++---- .../tests/transactions/system.move | 2 +- .../tests/validator/validator.move | 2 +- 114 files changed, 2645 insertions(+), 1995 deletions(-) diff --git a/crates/simulacrum/src/lib.rs b/crates/simulacrum/src/lib.rs index 1c121756684c1..c7dc6e949d353 100644 --- a/crates/simulacrum/src/lib.rs +++ b/crates/simulacrum/src/lib.rs @@ -222,13 +222,13 @@ impl Simulacrum { let round = self.epoch_state.next_consensus_round(); let timestamp_ms = self.store.get_clock().timestamp_ms() + duration.as_millis() as u64; - // TODO(zhewu): use V3 once graphql tests are upgraded to protocol version 49. let consensus_commit_prologue_transaction = - VerifiedTransaction::new_consensus_commit_prologue_v2( + VerifiedTransaction::new_consensus_commit_prologue_v3( epoch, round, timestamp_ms, ConsensusCommitDigest::default(), + Vec::new(), ); self.execute_transaction(consensus_commit_prologue_transaction.into()) diff --git a/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp b/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp index 3d462f44c4f6c..c55b0fa1e784f 100644 --- a/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp +++ b/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp @@ -5,20 +5,20 @@ Response: { "data": { "availableRange": { "first": { - "digest": "DKLNxHiQP2JHxDHhCSDcDtvBcw6PrCXLVvYB2KVfUctJ", + "digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k", "sequenceNumber": 0 }, "last": { - "digest": "DKLNxHiQP2JHxDHhCSDcDtvBcw6PrCXLVvYB2KVfUctJ", + "digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k", "sequenceNumber": 0 } }, "first": { - "digest": "DKLNxHiQP2JHxDHhCSDcDtvBcw6PrCXLVvYB2KVfUctJ", + "digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k", "sequenceNumber": 0 }, "last": { - "digest": "DKLNxHiQP2JHxDHhCSDcDtvBcw6PrCXLVvYB2KVfUctJ", + "digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k", "sequenceNumber": 0 } } @@ -35,20 +35,20 @@ Response: { "data": { "availableRange": { "first": { - "digest": "DKLNxHiQP2JHxDHhCSDcDtvBcw6PrCXLVvYB2KVfUctJ", + "digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k", "sequenceNumber": 0 }, "last": { - "digest": "C3gNdxw7tLsULYLt541SEEY2vuyPYBimZwutcY8YQB1a", + "digest": "5GTvEftM57hVrNtNapMU73cE5Wj6mYFuzd9K644n1Zqs", "sequenceNumber": 2 } }, "first": { - "digest": "DKLNxHiQP2JHxDHhCSDcDtvBcw6PrCXLVvYB2KVfUctJ", + "digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k", "sequenceNumber": 0 }, "last": { - "digest": "C3gNdxw7tLsULYLt541SEEY2vuyPYBimZwutcY8YQB1a", + "digest": "5GTvEftM57hVrNtNapMU73cE5Wj6mYFuzd9K644n1Zqs", "sequenceNumber": 2 } } diff --git a/crates/sui-graphql-e2e-tests/tests/available_range/available_range.move b/crates/sui-graphql-e2e-tests/tests/available_range/available_range.move index c1175471391db..d6855d560f766 100644 --- a/crates/sui-graphql-e2e-tests/tests/available_range/available_range.move +++ b/crates/sui-graphql-e2e-tests/tests/available_range/available_range.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator +//# init --protocol-version 51 --simulator //# run-graphql { diff --git a/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.move b/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.move index f48aee790666a..f326335c7e1a1 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.move +++ b/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 --simulator +//# init --protocol-version 51 --addresses Test=0x0 --simulator // Test cursor connection pagination logic // The implementation privileges `after`, `before`, `first`, and `last` in that order. diff --git a/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp b/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp index 47d94818d5336..8a8a3702e5491 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp @@ -29,6 +29,7 @@ Response: { task 4 'programmable'. lines 35-37: created: object(4,0) mutated: object(0,0), object(1,2) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 2663496, non_refundable_storage_fee: 26904 task 5 'create-checkpoint'. lines 39-39: diff --git a/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.move b/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.move index 617d92fd9c881..1a7fcf1abd6e9 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.move +++ b/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses test=0x0 --accounts A --simulator //# publish --sender A module test::fake { diff --git a/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp b/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp index f5598a4d34afb..4ce724a86d1b4 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp @@ -35,10 +35,10 @@ Response: { { "name": { "type": { - "repr": "bool" + "repr": "vector" }, "data": { - "Bool": false + "Vector": [] }, "bcs": "AA==" }, @@ -63,12 +63,12 @@ Response: { { "name": { "type": { - "repr": "u64" + "repr": "bool" }, "data": { - "Number": "0" + "Bool": false }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { "__typename": "MoveValue" @@ -77,12 +77,12 @@ Response: { { "name": { "type": { - "repr": "vector" + "repr": "u64" }, "data": { - "Vector": [] + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { "__typename": "MoveValue" @@ -112,10 +112,10 @@ Response: { { "name": { "type": { - "repr": "bool" + "repr": "vector" }, "data": { - "Bool": false + "Vector": [] }, "bcs": "AA==" }, @@ -140,12 +140,12 @@ Response: { { "name": { "type": { - "repr": "u64" + "repr": "bool" }, "data": { - "Number": "0" + "Bool": false }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { "__typename": "MoveValue" @@ -154,12 +154,12 @@ Response: { { "name": { "type": { - "repr": "vector" + "repr": "u64" }, "data": { - "Vector": [] + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { "__typename": "MoveValue" @@ -180,17 +180,17 @@ Response: { { "name": { "type": { - "repr": "bool" + "repr": "vector" }, "data": { - "Bool": false + "Vector": [] }, "bcs": "AA==" }, "value": { - "bcs": "AgAAAAAAAAA=", + "bcs": "AQAAAAAAAAA=", "data": { - "Number": "2" + "Number": "1" }, "__typename": "MoveValue" } @@ -212,17 +212,17 @@ Response: { { "name": { "type": { - "repr": "u64" + "repr": "bool" }, "data": { - "Number": "0" + "Bool": false }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { - "bcs": "AAAAAAAAAAA=", + "bcs": "AgAAAAAAAAA=", "data": { - "Number": "0" + "Number": "2" }, "__typename": "MoveValue" } @@ -230,17 +230,17 @@ Response: { { "name": { "type": { - "repr": "vector" + "repr": "u64" }, "data": { - "Vector": [] + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { - "bcs": "AQAAAAAAAAA=", + "bcs": "AAAAAAAAAAA=", "data": { - "Number": "1" + "Number": "0" }, "__typename": "MoveValue" } diff --git a/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.move b/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.move index 71e60e78e7db0..e9c5a46703ea8 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.move +++ b/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.move @@ -8,7 +8,7 @@ // This test also demonstrates why we need separate dynamicField and dynamicObjectField APIs. // It is possible for a dynamic field and a dynamic object field to share the same name lookup. -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::m { diff --git a/crates/sui-graphql-e2e-tests/tests/call/owned_objects.move b/crates/sui-graphql-e2e-tests/tests/call/owned_objects.move index a0f4c58d7ff63..8e8de9bbb3f03 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/owned_objects.move +++ b/crates/sui-graphql-e2e-tests/tests/call/owned_objects.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 A=0x42 --simulator +//# init --protocol-version 51 --addresses Test=0x0 A=0x42 --simulator // Tests objects on address, object, and owner. // diff --git a/crates/sui-graphql-e2e-tests/tests/call/simple.exp b/crates/sui-graphql-e2e-tests/tests/call/simple.exp index dc5da0a6d6dd7..6e500c9aa663f 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/simple.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/simple.exp @@ -67,7 +67,7 @@ task 9 'advance-epoch'. lines 41-41: Epoch advanced: 5 task 10 'view-checkpoint'. lines 43-43: -CheckpointSummary { epoch: 5, seq: 10, content_digest: EANv9gfNqrc3zQszFfPeZbsf8ytTgrjbhPuRKL1JFDjR, +CheckpointSummary { epoch: 5, seq: 10, content_digest: BDEsevJNRZ9x9xxb3eCdVtrHpu1EQP6gz2fTCGjcswdL, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 0, storage_cost: 0, storage_rebate: 0, non_refundable_storage_fee: 0 }} task 11 'run-graphql'. lines 45-50: @@ -139,8 +139,8 @@ Response: { "edges": [ { "node": { - "address": "0xd0ee3488b5f0ebf60bfd0762ad1291e9873bf709d927fea294dd9e8ceb41d8be", - "digest": "B5KRdJ3bhVZ5p9qiV8ee2DPuSqWhVqAtmGu3ngdcwxk5", + "address": "0x23ef71b8e66389131447b14f452128212257d2db53805e37af8fba4b41ad8ca3", + "digest": "3qUjwuGdE86PTc8Z3ucr1WKZC4SmUXtXdjUcPywy6hLQ", "owner": { "__typename": "AddressOwner" } @@ -165,8 +165,8 @@ Response: { "edges": [ { "node": { - "address": "0xd0ee3488b5f0ebf60bfd0762ad1291e9873bf709d927fea294dd9e8ceb41d8be", - "digest": "B5KRdJ3bhVZ5p9qiV8ee2DPuSqWhVqAtmGu3ngdcwxk5", + "address": "0x23ef71b8e66389131447b14f452128212257d2db53805e37af8fba4b41ad8ca3", + "digest": "3qUjwuGdE86PTc8Z3ucr1WKZC4SmUXtXdjUcPywy6hLQ", "owner": { "__typename": "AddressOwner" } @@ -180,8 +180,8 @@ Response: { "edges": [ { "node": { - "address": "0x2c6b4bac8eb891f26d75e357a04d432507ce28e360bcf4e43659b96072bc3c53", - "digest": "8pbfonjvo3mczuSBJFY2qxaoGPU4Z9Qy1wSGmmg1bf5b", + "address": "0x423c9d76d2aaf5fcacfe5c95b934d44c43f9e88775264c1316a802b3f4623afb", + "digest": "83GBKCTiDtfEV5F8QaProZjfzHVfH3p5Y9hrSt9FW85Z", "owner": { "__typename": "AddressOwner" } @@ -189,8 +189,8 @@ Response: { }, { "node": { - "address": "0x6099d85f9f20169105988442b6c82fd45632dd0e8d47beb4e991842271ba41f9", - "digest": "24hWWDvKPbSd6qVqrpQwyadPrxTWcukfHM26VebnpfHc", + "address": "0x6163fffa44de65f44ccaf0a0d661c40822af07ceaa02e601b4cb59b458ab6ce2", + "digest": "2y11yoS1zEnvCqvHFGrQDaXaQSFhd9hKvN9haoP8jNqz", "owner": { "__typename": "AddressOwner" } @@ -198,8 +198,8 @@ Response: { }, { "node": { - "address": "0xa595dcc92eb897757da558be7ff7332385ad0b285b537ac80c9176698e9be713", - "digest": "4aYQ3gTV2zanQ8LzRhyiT2TsNErrmuK17f4GYEZY9L7J", + "address": "0x860b53513475993cdbf119f102b717aae27b89e98976f60bf7d5ab12745bcfee", + "digest": "QGwjjqDADc9nKpPs4adk3psoDk1J7zqT85wdPxkrSW9", "owner": { "__typename": "AddressOwner" } @@ -207,8 +207,8 @@ Response: { }, { "node": { - "address": "0xbb7dbe1592122e91c5c403c9ddf4d029f532950f855e260e5a876b1986092c5c", - "digest": "GkPyMcNdpehHikEpWnVqK4jgcP4Yrh4mKBitAWKbifWq", + "address": "0xc54929d1ab1827a88599f75721ab9664f3511e51cff51dfd40a1c2ec0475bf7f", + "digest": "AgssqQczdyipDRxi1j9pMGgC9FuC7CCFmn4Y14PeyNst", "owner": { "__typename": "AddressOwner" } @@ -216,8 +216,8 @@ Response: { }, { "node": { - "address": "0xc7ad0217e82376799893bc234d79d9f774b9e769d1c9b0c100e9c4860660236e", - "digest": "58WMysQQDjV33YC8WPeVEcLncMUKS3oBFUtfVygRQDm7", + "address": "0xe82d10c71669c207b6b2381daabe3079cedb17983d0cbe20e0062811feafdcd1", + "digest": "Gp6pvP9Q8hMK2b15mica61hENUJBatvQXx75q2P4MTuV", "owner": { "__typename": "AddressOwner" } @@ -225,8 +225,8 @@ Response: { }, { "node": { - "address": "0xf264b2c3b43738574821da90a969b02ce247bc7c3ff410d667dc46b40d8e4743", - "digest": "BBtanixT9e92HBXmCJQqiYhpPfqSLGsb9ELsKTXdNjPQ", + "address": "0xfe887d694d116e30f8efa961484a199fff9f845542845a86be86b4d8f474ed4a", + "digest": "8qaumCh1NPMvjdwamiaVy8LnqMQPbSmhSSigcHZQ6Cy1", "owner": { "__typename": "AddressOwner" } diff --git a/crates/sui-graphql-e2e-tests/tests/call/simple.move b/crates/sui-graphql-e2e-tests/tests/call/simple.move index d31eb41227788..6f95ee2072da3 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/simple.move +++ b/crates/sui-graphql-e2e-tests/tests/call/simple.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 A=0x42 --simulator --custom-validator-account --reference-gas-price 234 --default-gas-price 1000 +//# init --protocol-version 51 --addresses Test=0x0 A=0x42 --simulator --custom-validator-account --reference-gas-price 234 --default-gas-price 1000 //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp b/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp index ef115d5617072..4dfca4529cdf7 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp @@ -6,6 +6,7 @@ A: object(0,0), B: object(0,1) task 1 'publish'. lines 19-46: created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 15663600, storage_rebate: 0, non_refundable_storage_fee: 0 task 2 'create-checkpoint'. lines 48-48: @@ -13,6 +14,7 @@ Checkpoint created: 1 task 3 'programmable'. lines 50-52: mutated: object(0,0), object(1,1), object(1,5) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 3972672, non_refundable_storage_fee: 40128 task 4 'create-checkpoint'. lines 54-54: @@ -20,6 +22,7 @@ Checkpoint created: 2 task 5 'transfer-object'. lines 56-56: mutated: object(0,0), object(1,2) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 task 6 'create-checkpoint'. lines 58-58: @@ -27,6 +30,7 @@ Checkpoint created: 3 task 7 'transfer-object'. lines 60-60: mutated: object(0,0), object(1,3) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 task 9 'create-checkpoint'. lines 64-64: @@ -62,7 +66,7 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 3, "totalBalance": "700" @@ -84,7 +88,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "400" + "totalBalance": "500" }, "allBalances": { "nodes": [ @@ -97,10 +101,10 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 2, - "totalBalance": "400" + "totalBalance": "500" } ] } @@ -119,7 +123,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "300" + "totalBalance": "400" }, "allBalances": { "nodes": [ @@ -132,10 +136,10 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 1, - "totalBalance": "300" + "totalBalance": "400" } ] } @@ -173,7 +177,7 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 3, "totalBalance": "700" @@ -195,7 +199,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "400" + "totalBalance": "500" }, "allBalances": { "nodes": [ @@ -208,10 +212,10 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 2, - "totalBalance": "400" + "totalBalance": "500" } ] } @@ -230,7 +234,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "300" + "totalBalance": "400" }, "allBalances": { "nodes": [ @@ -243,10 +247,10 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 1, - "totalBalance": "300" + "totalBalance": "400" } ] } @@ -305,7 +309,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "400" + "totalBalance": "500" }, "allBalances": { "nodes": [ @@ -318,10 +322,10 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 2, - "totalBalance": "400" + "totalBalance": "500" } ] } @@ -340,7 +344,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "300" + "totalBalance": "400" }, "allBalances": { "nodes": [ @@ -353,10 +357,10 @@ Response: { }, { "coinType": { - "repr": "0xce2986cf8820ccde29cd46cd15617ff996d913af68d647a2d114fa8cc878a5cd::fake::FAKE" + "repr": "0x4cb538cc5d434cbcb404ea346e0fcd175e5db3edccbada62a489de17da4e81f1::fake::FAKE" }, "coinObjectCount": 1, - "totalBalance": "300" + "totalBalance": "400" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/balances.move b/crates/sui-graphql-e2e-tests/tests/consistency/balances.move index b9443c04db0dd..70059773d3946 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/balances.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/balances.move @@ -14,7 +14,7 @@ // snapshot@[0, 4), first two transaction blocks are out of available range. // snapshot@[0, 6), all transaction blocks are out of available range. -//# init --protocol-version 48 --addresses P0=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses P0=0x0 --accounts A B --simulator //# publish --sender A module P0::fake { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp b/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp index 8824be6cec348..d16fa51988c57 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp @@ -80,12 +80,12 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJ0YyI6MX0", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7", + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -95,12 +95,12 @@ Response: { { "cursor": "eyJjIjozLCJ0IjozLCJ0YyI6MX0", "node": { - "digest": "8FGXx3CxjRxi7xV2d6R2FsiyrsyiBfiHLPyGtVtZodES", + "digest": "H1WU8uXMGaENQs54EpoHGpV1iMYdH8P5scd1d16s9ECB", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -110,12 +110,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo0LCJ0YyI6MX0", "node": { - "digest": "HsVHTLTZk5EPHudApRULZfARE7CpCjMsuAPd1UeC6QiP", + "digest": "4vJbSYKwEJb5sYU2jiayqsZNRnBywD8y6sd3RQoMppF9", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -125,12 +125,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo1LCJ0YyI6MX0", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3", + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -147,12 +147,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo2LCJ0YyI6Mn0", "node": { - "digest": "9k4rfA8ZMvyvsU6ar3DVBHH928Tw2aKorQCGJKNCUnYb", + "digest": "JLAF7P6DumC8rgzT1Ygp2QgTwpHE2FUqQbVXL6cGEEQ", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -162,12 +162,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo3LCJ0YyI6Mn0", "node": { - "digest": "GLiUrKx2gJVwbRaMtGwVX26PPyhtUbknb3Q9pa3c9XbQ", + "digest": "BVMVdn7DDpTbCjtYwWFekcFA9sNeMgDh1wTNWRrngZxh", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -177,12 +177,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo4LCJ0YyI6Mn0", "node": { - "digest": "9w6r3o2uCzXjbktKREZJSkAFcAH3uKjNFPCTS1qasXKD", + "digest": "4J5tno4AoU4NPS2NgEseAZK7cpLDh6KJduVtbtwzmHk5", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -199,12 +199,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo5LCJ0YyI6M30", "node": { - "digest": "12ZTS2Sz3L1HkXMbDsUnfBZHX7XqgtB4KYwNcXfJ2WfS", + "digest": "5BCS9sencxEJRJHBBPeGhx3rWutYoGSuLFCmnMAaYcDm", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } @@ -214,12 +214,12 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwidGMiOjN9", "node": { - "digest": "5cHBxf8yer7uxaGUR1H3X3zHFvqTHgW3fp298CRFdxL", + "digest": "HQYJnLLcGf4DwgTkpqF4zHbQsLHwc1s4WbQ3Xr5BBaxh", "sender": { "objects": { "edges": [ { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXAwAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8AwAAAAAAAAA=" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.move b/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.move index 8a86ec83506f4..c505e86cccd0c 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.move @@ -8,7 +8,7 @@ // 2 | 3 // 3 | 2 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp b/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp index a145a9dc09e71..776aa9ef21110 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp @@ -6,6 +6,7 @@ A: object(0,0), B: object(0,1) task 1 'publish'. lines 12-39: created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 15663600, storage_rebate: 0, non_refundable_storage_fee: 0 task 2 'create-checkpoint'. lines 41-41: @@ -13,6 +14,7 @@ Checkpoint created: 1 task 3 'programmable'. lines 43-45: mutated: object(0,0), object(1,1), object(1,5) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 3972672, non_refundable_storage_fee: 40128 task 4 'create-checkpoint'. lines 47-47: @@ -24,7 +26,7 @@ Response: { "queryCoinsAtLatest": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAgAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AgAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -32,37 +34,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAgAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAgAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAgAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -76,16 +78,16 @@ Response: { }, "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAgAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAgAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -93,37 +95,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAgAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAgAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAgAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -137,16 +139,16 @@ Response: { }, "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAgAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AgAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -154,37 +156,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAgAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAgAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAgAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -198,7 +200,7 @@ Response: { }, "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -212,37 +214,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAgAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAgAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAgAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -262,7 +264,7 @@ Response: { "queryCoinsAtChkpt1": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -270,37 +272,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAQAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -314,16 +316,16 @@ Response: { }, "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -331,37 +333,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAQAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -375,9 +377,9 @@ Response: { }, "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } @@ -389,26 +391,26 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } @@ -422,10 +424,12 @@ Response: { task 7 'transfer-object'. lines 135-135: mutated: object(0,0), object(1,2) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 task 8 'transfer-object'. lines 137-137: mutated: object(0,0), object(1,3) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 task 9 'create-checkpoint'. lines 139-139: @@ -437,7 +441,7 @@ Response: { "queryCoins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAwAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AwAAAAAAAAA=", "node": { "owner": { "owner": { @@ -445,13 +449,13 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAwAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } @@ -463,16 +467,16 @@ Response: { }, "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAwAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAwAAAAAAAAA=", "node": { "owner": { "owner": { @@ -480,24 +484,24 @@ Response: { "coins": { "edges": [ { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAwAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAwAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -511,16 +515,16 @@ Response: { }, "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAwAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AwAAAAAAAAA=", "node": { "owner": { "owner": { @@ -528,24 +532,24 @@ Response: { "coins": { "edges": [ { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAwAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAwAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -559,7 +563,7 @@ Response: { }, "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -573,13 +577,13 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAwAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "100200" + "value": "100300" } } } @@ -592,24 +596,24 @@ Response: { "coins": { "edges": [ { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAwAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAwAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -638,7 +642,7 @@ Response: { "queryCoinsAtChkpt1BeforeSnapshotCatchup": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -646,37 +650,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAQAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -690,16 +694,16 @@ Response: { }, "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -707,37 +711,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } } }, { - "cursor": "IP43q6a/xEEnB5jyaFdgQnXY2AwarcCwCi7PLI/bRPuIAQAAAAAAAAA=", + "cursor": "INvVgLVfu65ukifQh30BNot195gE45+jwKQekLi2+XX5AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xfe37aba6bfc441270798f26857604275d8d80c1aadc0b00a2ecf2c8fdb44fb88", + "id": "0xdbd580b55fbbae6e9227d0877d01368b75f79804e39fa3c0a41e90b8b6f975f9", "balance": { "value": "100" } @@ -751,9 +755,9 @@ Response: { }, "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } @@ -765,26 +769,26 @@ Response: { "coins": { "edges": [ { - "cursor": "IHm1xv3SSenvmYDQCYNS3g8PPG3cJoIRJjBI2JV09+1sAQAAAAAAAAA=", + "cursor": "IInOO25b7OLrzHU3/p2iQ4vqVRlcuGr7fd9alLifbc72AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x79b5c6fdd249e9ef9980d0098352de0f0f3c6ddc268211263048d89574f7ed6c", + "id": "0x89ce3b6e5bece2ebcc7537fe9da2438bea55195cb86afb7ddf5a94b89f6dcef6", "balance": { - "value": "200" + "value": "300" } } } } }, { - "cursor": "IMLizONLkUGpGqbmrvrdiM9clJgJKMh9ST1MfWOYbCcQAQAAAAAAAAA=", + "cursor": "INs4hFLNnqflqu5eGW8MOzUCEfYiGoqxYWNks0dajqpyAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc2e2cce34b9141a91aa6e6aefadd88cf5c94980928c87d493d4c7d63986c2710", + "id": "0xdb388452cd9ea7e5aaee5e196f0c3b350211f6221a8ab1616364b3475a8eaa72", "balance": { - "value": "300" + "value": "200" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/coins.move b/crates/sui-graphql-e2e-tests/tests/consistency/coins.move index 70159cfd3450d..98db3d246f714 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/coins.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/coins.move @@ -7,7 +7,7 @@ // coin2@A | coin2@B | coin2@B | coin2@B | coin2@B | coin2@B // coin3@A | coin3@A | coin3@A | coin3@A | coin3@A | coin3@A -//# init --protocol-version 48 --addresses P0=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses P0=0x0 --accounts A B --simulator //# publish --sender A module P0::fake { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp index 4e969f28aa472..b49d3833680b4 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp @@ -79,35 +79,35 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDve1Ab2c1fYbmGadpom7ao3qAredUZ7LNuO6Ci7/UDwAQAAAAAAAAA=", + "cursor": "IKZJq+zukU0mYqXPOEbMnAuJAEEJxRu/3QmIbhKM33V3AQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNg==" + "bcs": "A2RmNQ==" }, "value": { - "json": "df6" + "json": "df5" } } }, { - "cursor": "IJ7RuOEv7VxWHIzZpdWX872yQb4iDGq5uGMxvcWO1ZzsAQAAAAAAAAA=", + "cursor": "ILRu8aFxTJ4nn6MsbE3TJ/diWQoHMAICnUjy1RktEITLAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==" + "bcs": "A2RmNA==" }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IMcFM1h6jtqVoSQyhWRQygyPjkUFGTyjB3q7bK67cDqUAQAAAAAAAAA=", + "cursor": "ILjcF1bSfeRYSdTStBcQVLiBb5YTmJ/qNviAKgZCGcDcAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==" + "bcs": "A2RmNg==" }, "value": { - "json": "df4" + "json": "df6" } } } @@ -128,35 +128,35 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDve1Ab2c1fYbmGadpom7ao3qAredUZ7LNuO6Ci7/UDwAQAAAAAAAAA=", + "cursor": "IKZJq+zukU0mYqXPOEbMnAuJAEEJxRu/3QmIbhKM33V3AQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNg==" + "bcs": "A2RmNQ==" }, "value": { - "json": "df6" + "json": "df5" } } }, { - "cursor": "IJ7RuOEv7VxWHIzZpdWX872yQb4iDGq5uGMxvcWO1ZzsAQAAAAAAAAA=", + "cursor": "ILRu8aFxTJ4nn6MsbE3TJ/diWQoHMAICnUjy1RktEITLAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==" + "bcs": "A2RmNA==" }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IMcFM1h6jtqVoSQyhWRQygyPjkUFGTyjB3q7bK67cDqUAQAAAAAAAAA=", + "cursor": "ILjcF1bSfeRYSdTStBcQVLiBb5YTmJ/qNviAKgZCGcDcAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==" + "bcs": "A2RmNg==" }, "value": { - "json": "df4" + "json": "df6" } } } @@ -177,29 +177,29 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDve1Ab2c1fYbmGadpom7ao3qAredUZ7LNuO6Ci7/UDwAQAAAAAAAAA=", + "cursor": "IHqaCZ0vJNy8gny5hx0IinhABVDiHsTtxEeZ0Rc4mKGmAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNg==" + "bcs": "A2RmMw==" }, "value": { - "json": "df6" + "json": "df3" } } }, { - "cursor": "IHiMzS7DmrXh1WuxA4M603OwMBLG1UQYnL/ltpi9llE/AQAAAAAAAAA=", + "cursor": "IHy6H8038k3eOI8fOlDrvDujD5mJgc3oaqf9bbilQ+RNAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==" + "bcs": "A2RmMQ==" }, "value": { - "json": "df3" + "json": "df1" } } }, { - "cursor": "IIf8W/33wau6FjgMjs5osDb8GPYKDgmHIvvx04PFMsWuAQAAAAAAAAA=", + "cursor": "IJEAplHRqEgqh28GXZyD1a2GP5MPU594DXNvQGh68idPAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==" @@ -210,7 +210,7 @@ Response: { } }, { - "cursor": "IJ7RuOEv7VxWHIzZpdWX872yQb4iDGq5uGMxvcWO1ZzsAQAAAAAAAAA=", + "cursor": "IKZJq+zukU0mYqXPOEbMnAuJAEEJxRu/3QmIbhKM33V3AQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNQ==" @@ -221,7 +221,7 @@ Response: { } }, { - "cursor": "IMcFM1h6jtqVoSQyhWRQygyPjkUFGTyjB3q7bK67cDqUAQAAAAAAAAA=", + "cursor": "ILRu8aFxTJ4nn6MsbE3TJ/diWQoHMAICnUjy1RktEITLAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNA==" @@ -232,13 +232,13 @@ Response: { } }, { - "cursor": "IP0BJ68aixVY+x5azuc+CXoy/Ilv3pCk32dD3+cSEWZlAQAAAAAAAAA=", + "cursor": "ILjcF1bSfeRYSdTStBcQVLiBb5YTmJ/qNviAKgZCGcDcAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==" + "bcs": "A2RmNg==" }, "value": { - "json": "df1" + "json": "df6" } } } @@ -271,35 +271,35 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDve1Ab2c1fYbmGadpom7ao3qAredUZ7LNuO6Ci7/UDwAQAAAAAAAAA=", + "cursor": "IKZJq+zukU0mYqXPOEbMnAuJAEEJxRu/3QmIbhKM33V3AQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNg==" + "bcs": "A2RmNQ==" }, "value": { - "json": "df6" + "json": "df5" } } }, { - "cursor": "IJ7RuOEv7VxWHIzZpdWX872yQb4iDGq5uGMxvcWO1ZzsAQAAAAAAAAA=", + "cursor": "ILRu8aFxTJ4nn6MsbE3TJ/diWQoHMAICnUjy1RktEITLAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==" + "bcs": "A2RmNA==" }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IMcFM1h6jtqVoSQyhWRQygyPjkUFGTyjB3q7bK67cDqUAQAAAAAAAAA=", + "cursor": "ILjcF1bSfeRYSdTStBcQVLiBb5YTmJ/qNviAKgZCGcDcAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==" + "bcs": "A2RmNg==" }, "value": { - "json": "df4" + "json": "df6" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.move b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.move index a81b309bacc73..0d0167a3f5da0 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.move @@ -9,7 +9,7 @@ // 5 | removed df1, df2, df3 // 6 | mutated parent -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp index 6d9323876bd88..b6210cde55e02 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp @@ -33,7 +33,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IF0gTKVLCuzm0AzM9pTA1PzCyWFU0UFoMI2ng9G2vSEJAQAAAAAAAAA=", + "cursor": "IHuruxbquGBybOUaXwCrYwB8y2JstlC7KGMPEhrLmQTfAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -41,7 +41,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9faa721dfa5f9664d87dd5504f7756b6da860137c46e81936225db3f0aebdfba", + "id": "0x135e44a228378b182429771f0bbb1f1a8c7ad0139c79cbf6f1ba3c0b07c6e9e0", "count": "0" } } @@ -57,7 +57,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9faa721dfa5f9664d87dd5504f7756b6da860137c46e81936225db3f0aebdfba", + "id": "0x135e44a228378b182429771f0bbb1f1a8c7ad0139c79cbf6f1ba3c0b07c6e9e0", "count": "0" } } @@ -69,7 +69,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IF0gTKVLCuzm0AzM9pTA1PzCyWFU0UFoMI2ng9G2vSEJAQAAAAAAAAA=", + "cursor": "IHuruxbquGBybOUaXwCrYwB8y2JstlC7KGMPEhrLmQTfAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -77,7 +77,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9faa721dfa5f9664d87dd5504f7756b6da860137c46e81936225db3f0aebdfba", + "id": "0x135e44a228378b182429771f0bbb1f1a8c7ad0139c79cbf6f1ba3c0b07c6e9e0", "count": "0" } } @@ -93,7 +93,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9faa721dfa5f9664d87dd5504f7756b6da860137c46e81936225db3f0aebdfba", + "id": "0x135e44a228378b182429771f0bbb1f1a8c7ad0139c79cbf6f1ba3c0b07c6e9e0", "count": "0" } } @@ -109,7 +109,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9faa721dfa5f9664d87dd5504f7756b6da860137c46e81936225db3f0aebdfba", + "id": "0x135e44a228378b182429771f0bbb1f1a8c7ad0139c79cbf6f1ba3c0b07c6e9e0", "count": "0" } } @@ -157,7 +157,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9faa721dfa5f9664d87dd5504f7756b6da860137c46e81936225db3f0aebdfba", + "id": "0x135e44a228378b182429771f0bbb1f1a8c7ad0139c79cbf6f1ba3c0b07c6e9e0", "count": "0" } } @@ -208,7 +208,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9faa721dfa5f9664d87dd5504f7756b6da860137c46e81936225db3f0aebdfba", + "id": "0x135e44a228378b182429771f0bbb1f1a8c7ad0139c79cbf6f1ba3c0b07c6e9e0", "count": "0" } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.move b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.move index f32aa6c9ce881..9663ff0638640 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.move @@ -9,7 +9,7 @@ // 5 | | deleted child // 6 | | mutated parent -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp index e511bac23e58e..b4bf34c302834 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp @@ -29,7 +29,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IL1UnJ4tEMbcRfNVxJ2raKarUdPXhW9vuUUOe+8FfSlYAQAAAAAAAAA=", + "cursor": "IINo9rtSKYxa8qTnsANAx+SVF2gwG9jIfKKxVO/XfZaIAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -37,7 +37,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x3a30ed78d68480f4647031c12f33823162bb54acf1b9b8abe282c42ed034ed41", + "id": "0xdcaee2e464dd4cd63e5863474e921177ebbc3e9309f63eb3825ea98285600b7f", "count": "0" } } @@ -53,7 +53,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x3a30ed78d68480f4647031c12f33823162bb54acf1b9b8abe282c42ed034ed41", + "id": "0xdcaee2e464dd4cd63e5863474e921177ebbc3e9309f63eb3825ea98285600b7f", "count": "0" } } @@ -64,7 +64,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IL1UnJ4tEMbcRfNVxJ2raKarUdPXhW9vuUUOe+8FfSlYAQAAAAAAAAA=", + "cursor": "IINo9rtSKYxa8qTnsANAx+SVF2gwG9jIfKKxVO/XfZaIAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -72,7 +72,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x3a30ed78d68480f4647031c12f33823162bb54acf1b9b8abe282c42ed034ed41", + "id": "0xdcaee2e464dd4cd63e5863474e921177ebbc3e9309f63eb3825ea98285600b7f", "count": "0" } } @@ -88,7 +88,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x3a30ed78d68480f4647031c12f33823162bb54acf1b9b8abe282c42ed034ed41", + "id": "0xdcaee2e464dd4cd63e5863474e921177ebbc3e9309f63eb3825ea98285600b7f", "count": "0" } } @@ -100,7 +100,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IL1UnJ4tEMbcRfNVxJ2raKarUdPXhW9vuUUOe+8FfSlYAQAAAAAAAAA=", + "cursor": "IINo9rtSKYxa8qTnsANAx+SVF2gwG9jIfKKxVO/XfZaIAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -108,7 +108,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x3a30ed78d68480f4647031c12f33823162bb54acf1b9b8abe282c42ed034ed41", + "id": "0xdcaee2e464dd4cd63e5863474e921177ebbc3e9309f63eb3825ea98285600b7f", "count": "0" } } @@ -124,7 +124,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x3a30ed78d68480f4647031c12f33823162bb54acf1b9b8abe282c42ed034ed41", + "id": "0xdcaee2e464dd4cd63e5863474e921177ebbc3e9309f63eb3825ea98285600b7f", "count": "0" } } @@ -174,7 +174,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x3a30ed78d68480f4647031c12f33823162bb54acf1b9b8abe282c42ed034ed41", + "id": "0xdcaee2e464dd4cd63e5863474e921177ebbc3e9309f63eb3825ea98285600b7f", "count": "0" } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.move b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.move index 04e1b73994cb1..a1d0ae6783a76 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.move @@ -14,7 +14,7 @@ // 3 | 3 | added child to parent // 4 | 4 | reclaimed child from parent -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp index fa84a51751d97..5761c7338afa0 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp @@ -49,7 +49,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IOADSwXfcUdh/UGPZalwSFUb+34fSTR19MLMvbkykY7/AQAAAAAAAAA=", + "cursor": "ICfYK9hpoZz2TvVoLEtiMG3hhlC9hZZKkiU4pl4iMT4YAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -57,7 +57,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } @@ -73,7 +73,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } @@ -84,7 +84,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IOADSwXfcUdh/UGPZalwSFUb+34fSTR19MLMvbkykY7/AQAAAAAAAAA=", + "cursor": "ICfYK9hpoZz2TvVoLEtiMG3hhlC9hZZKkiU4pl4iMT4YAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -92,7 +92,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } @@ -108,7 +108,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } @@ -127,7 +127,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IOADSwXfcUdh/UGPZalwSFUb+34fSTR19MLMvbkykY7/AQAAAAAAAAA=", + "cursor": "ICfYK9hpoZz2TvVoLEtiMG3hhlC9hZZKkiU4pl4iMT4YAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -135,7 +135,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } @@ -151,7 +151,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } @@ -170,7 +170,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IOADSwXfcUdh/UGPZalwSFUb+34fSTR19MLMvbkykY7/AQAAAAAAAAA=", + "cursor": "ICfYK9hpoZz2TvVoLEtiMG3hhlC9hZZKkiU4pl4iMT4YAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -178,7 +178,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } @@ -194,7 +194,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x842728c7e396d2f1efe644062d1af1b24c47172c18d901e14c36f6bbfebb169f", + "id": "0x082e460818873777f5d3bd1f9b4fefb932d010d508d4d17316b94b4efdd78151", "count": "0" } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.move b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.move index 82590d1997c31..d39fd6f8688d1 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.move @@ -13,7 +13,7 @@ // 4 | 6 | reclaim child from another parent // 7 | 7 | add child to original parent -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp index 1f42650dab510..4278c2f57e771 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp @@ -71,7 +71,7 @@ task 9 'run-graphql'. lines 102-164: Response: { "data": { "parent_version_2_no_dof": { - "address": "0x5d44d1ef3e2f226feb906d681df9fcbb5316b8d64bc02ff3ee05662161ebd9a2", + "address": "0x40a75d0f1bb3802e1ef5e5f98e4ce159870d80af3d7d79c4255de35d921bc2a4", "dynamicFields": { "edges": [] } @@ -80,7 +80,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqAQAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTAQAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -91,7 +91,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "1" } } @@ -102,13 +102,13 @@ Response: { } }, "child_version_2_no_parent": { - "address": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "address": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "owner": {} }, "child_version_3_has_parent": { "owner": { "parent": { - "address": "0x2aab3a564c7a1c19a3b450893501a3dc7cc5050efb66965d4c85b2b61c0698aa" + "address": "0x27188c07839565cd72e8bc18bb23f054ed79b52f980bb0a262d3bdba1ee15953" } } } @@ -153,7 +153,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IBE3vqECaVpgvL4V5Ue1aHf4rXS/NJ5sGNRVsJewQ0S7AgAAAAAAAAA=", + "cursor": "IBu9HmepVoENxkFIzNbdhqnTXOZUE+2eVoC/j4W8kZM0AgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==", @@ -167,7 +167,7 @@ Response: { } }, { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqAgAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTAgAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -178,7 +178,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -186,30 +186,30 @@ Response: { } }, { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43AgAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VAgAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } } @@ -220,7 +220,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqAgAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTAgAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -231,7 +231,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "1" } } @@ -250,30 +250,30 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43AgAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VAgAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } } @@ -307,7 +307,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "1" } } @@ -326,7 +326,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -385,7 +385,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IBE3vqECaVpgvL4V5Ue1aHf4rXS/NJ5sGNRVsJewQ0S7AwAAAAAAAAA=", + "cursor": "IBu9HmepVoENxkFIzNbdhqnTXOZUE+2eVoC/j4W8kZM0AwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==", @@ -399,7 +399,7 @@ Response: { } }, { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqAwAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTAwAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -410,7 +410,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -418,30 +418,30 @@ Response: { } }, { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43AwAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VAwAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } } @@ -452,30 +452,30 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43AgAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VAgAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } } @@ -486,7 +486,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IBE3vqECaVpgvL4V5Ue1aHf4rXS/NJ5sGNRVsJewQ0S7AwAAAAAAAAA=", + "cursor": "IBu9HmepVoENxkFIzNbdhqnTXOZUE+2eVoC/j4W8kZM0AwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==", @@ -500,7 +500,7 @@ Response: { } }, { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqAwAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTAwAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -511,7 +511,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -519,35 +519,35 @@ Response: { } }, { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43AwAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VAwAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } }, { - "cursor": "IGzyQPM2sCXzzf/ffZn4ejUrGDdWWBP9lzjprMgXO6HUAwAAAAAAAAA=", + "cursor": "IFshQaGmiN295CGbfzbLNJ8dM9rQd4ZFHYMKPA41oWdOAwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -561,30 +561,30 @@ Response: { } }, { - "cursor": "IHyU3J4wb+4rtDayF7wzyFfPprk19Yy1HgerwvaerQQgAwAAAAAAAAA=", + "cursor": "IIRmgnmPueemYOYD96Wne4t7x4ZFBek0fbBlni8FlY5HAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==", + "bcs": "A2RmNA==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJPRu9Lu4vWqz99fcFS69YjVb3WSYbSPH/tV2G2YORd6AwAAAAAAAAA=", + "cursor": "IOFWPka97OJZ2Ia9l1R0ER1fhI5P/jltrvGJbm/ekNWAAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "A2RmNQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df4" + "json": "df5" } } } @@ -595,35 +595,35 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43AwAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VAwAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } }, { - "cursor": "IGzyQPM2sCXzzf/ffZn4ejUrGDdWWBP9lzjprMgXO6HUAwAAAAAAAAA=", + "cursor": "IFshQaGmiN295CGbfzbLNJ8dM9rQd4ZFHYMKPA41oWdOAwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -637,30 +637,30 @@ Response: { } }, { - "cursor": "IHyU3J4wb+4rtDayF7wzyFfPprk19Yy1HgerwvaerQQgAwAAAAAAAAA=", + "cursor": "IIRmgnmPueemYOYD96Wne4t7x4ZFBek0fbBlni8FlY5HAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==", + "bcs": "A2RmNA==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJPRu9Lu4vWqz99fcFS69YjVb3WSYbSPH/tV2G2YORd6AwAAAAAAAAA=", + "cursor": "IOFWPka97OJZ2Ia9l1R0ER1fhI5P/jltrvGJbm/ekNWAAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "A2RmNQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df4" + "json": "df5" } } } @@ -708,7 +708,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IBE3vqECaVpgvL4V5Ue1aHf4rXS/NJ5sGNRVsJewQ0S7BAAAAAAAAAA=", + "cursor": "IBu9HmepVoENxkFIzNbdhqnTXOZUE+2eVoC/j4W8kZM0BAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==", @@ -722,7 +722,7 @@ Response: { } }, { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqBAAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTBAAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -733,7 +733,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -741,30 +741,30 @@ Response: { } }, { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43BAAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VBAAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } } @@ -775,30 +775,30 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDHVR7rljFBCp61DB3y1jtd077khUkj1O2eRyuo8Si43AgAAAAAAAAA=", + "cursor": "IDBPnpTMVoGeHsujMrTiQJkInJGvOqcRiRAq8gR7c+ZEAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df3" } } }, { - "cursor": "IF/yimojYFsFiaF/BkJLbQLFAAzw9I07bgPiS8aEHh4VAgAAAAAAAAA=", + "cursor": "IFrngMYMh3uJFj1HbkDk2ZD2SKCTSD/INbrn6SqQ1SoRAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmMQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df1" } } } @@ -809,7 +809,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqBAAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTBAAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -820,7 +820,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -828,7 +828,7 @@ Response: { } }, { - "cursor": "IGzyQPM2sCXzzf/ffZn4ejUrGDdWWBP9lzjprMgXO6HUBAAAAAAAAAA=", + "cursor": "IFshQaGmiN295CGbfzbLNJ8dM9rQd4ZFHYMKPA41oWdOBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -842,30 +842,30 @@ Response: { } }, { - "cursor": "IHyU3J4wb+4rtDayF7wzyFfPprk19Yy1HgerwvaerQQgBAAAAAAAAAA=", + "cursor": "IIRmgnmPueemYOYD96Wne4t7x4ZFBek0fbBlni8FlY5HBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==", + "bcs": "A2RmNA==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJPRu9Lu4vWqz99fcFS69YjVb3WSYbSPH/tV2G2YORd6BAAAAAAAAAA=", + "cursor": "IOFWPka97OJZ2Ia9l1R0ER1fhI5P/jltrvGJbm/ekNWABAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "A2RmNQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df4" + "json": "df5" } } } @@ -876,7 +876,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IGzyQPM2sCXzzf/ffZn4ejUrGDdWWBP9lzjprMgXO6HUBAAAAAAAAAA=", + "cursor": "IFshQaGmiN295CGbfzbLNJ8dM9rQd4ZFHYMKPA41oWdOBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -890,30 +890,30 @@ Response: { } }, { - "cursor": "IHyU3J4wb+4rtDayF7wzyFfPprk19Yy1HgerwvaerQQgBAAAAAAAAAA=", + "cursor": "IIRmgnmPueemYOYD96Wne4t7x4ZFBek0fbBlni8FlY5HBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==", + "bcs": "A2RmNA==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJPRu9Lu4vWqz99fcFS69YjVb3WSYbSPH/tV2G2YORd6BAAAAAAAAAA=", + "cursor": "IOFWPka97OJZ2Ia9l1R0ER1fhI5P/jltrvGJbm/ekNWABAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "A2RmNQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df4" + "json": "df5" } } } @@ -964,7 +964,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqBwAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTBwAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -975,7 +975,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -990,7 +990,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "ICqrOlZMehwZo7RQiTUBo9x8xQUO+2aWXUyFsrYcBpiqBwAAAAAAAAA=", + "cursor": "ICcYjAeDlWXNcui8GLsj8FTtebUvmAuwomLTvboe4VlTBwAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -1001,7 +1001,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x49cf623123e519b96c66de2c643cd2823f87957fbfcec77c2797acfe5b1925bb", + "id": "0x6444dfc849d5430a0cc760d35a942d594984f940a26a70a78024a6f99da41d0f", "count": "2" } } @@ -1009,7 +1009,7 @@ Response: { } }, { - "cursor": "IGzyQPM2sCXzzf/ffZn4ejUrGDdWWBP9lzjprMgXO6HUBwAAAAAAAAA=", + "cursor": "IFshQaGmiN295CGbfzbLNJ8dM9rQd4ZFHYMKPA41oWdOBwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -1023,30 +1023,30 @@ Response: { } }, { - "cursor": "IHyU3J4wb+4rtDayF7wzyFfPprk19Yy1HgerwvaerQQgBwAAAAAAAAA=", + "cursor": "IIRmgnmPueemYOYD96Wne4t7x4ZFBek0fbBlni8FlY5HBwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==", + "bcs": "A2RmNA==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJPRu9Lu4vWqz99fcFS69YjVb3WSYbSPH/tV2G2YORd6BwAAAAAAAAA=", + "cursor": "IOFWPka97OJZ2Ia9l1R0ER1fhI5P/jltrvGJbm/ekNWABwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "A2RmNQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df4" + "json": "df5" } } } @@ -1057,7 +1057,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IGzyQPM2sCXzzf/ffZn4ejUrGDdWWBP9lzjprMgXO6HUBAAAAAAAAAA=", + "cursor": "IFshQaGmiN295CGbfzbLNJ8dM9rQd4ZFHYMKPA41oWdOBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -1071,30 +1071,30 @@ Response: { } }, { - "cursor": "IHyU3J4wb+4rtDayF7wzyFfPprk19Yy1HgerwvaerQQgBAAAAAAAAAA=", + "cursor": "IIRmgnmPueemYOYD96Wne4t7x4ZFBek0fbBlni8FlY5HBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==", + "bcs": "A2RmNA==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJPRu9Lu4vWqz99fcFS69YjVb3WSYbSPH/tV2G2YORd6BAAAAAAAAAA=", + "cursor": "IOFWPka97OJZ2Ia9l1R0ER1fhI5P/jltrvGJbm/ekNWABAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "A2RmNQ==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df4" + "json": "df5" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.move b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.move index 6a76fbed00a71..15bbf6e153580 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.move @@ -7,7 +7,7 @@ // chkpt3: add df4, 5, 6 parent @ version 5, child @ version 4 // chkpt4: remove df1, df2, df3 parent @ version 6, child @ version 4 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp index 664b56a868208..0a343b5ec74e3 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp @@ -69,7 +69,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "ICn5gcQFrNzWftdQxGdl5rOuHh/2e4HoJeF5fjmGSsE5AQAAAAAAAAA=", + "cursor": "IC2fT4MkuNdi3Nvnb8m8dqkwj9EcXifzn/uWeklDnbOTAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==" @@ -80,7 +80,7 @@ Response: { } }, { - "cursor": "IHD52Y61wj4GKPM1fYcvq/5UQklV7fL9Sj82ZxZMjlZTAQAAAAAAAAA=", + "cursor": "IHHoOU78QBVu3gJtqZMHtZhLsebo3AyFYSgZ+Mfmh2fPAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMw==" @@ -91,7 +91,7 @@ Response: { } }, { - "cursor": "IPNcyWm+ErnKsMocl0XBxpIdhR18erkcDtEtvt60tnU3AQAAAAAAAAA=", + "cursor": "IOgTnWXmEwqr+XesX5bghNK0s1TBQJ0/GNLACjJ9LOytAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==" @@ -185,7 +185,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "ICn5gcQFrNzWftdQxGdl5rOuHh/2e4HoJeF5fjmGSsE5AgAAAAAAAAA=", + "cursor": "IC2fT4MkuNdi3Nvnb8m8dqkwj9EcXifzn/uWeklDnbOTAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==" @@ -196,7 +196,7 @@ Response: { } }, { - "cursor": "IHD52Y61wj4GKPM1fYcvq/5UQklV7fL9Sj82ZxZMjlZTAgAAAAAAAAA=", + "cursor": "IHHoOU78QBVu3gJtqZMHtZhLsebo3AyFYSgZ+Mfmh2fPAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMw==" @@ -207,7 +207,7 @@ Response: { } }, { - "cursor": "IPNcyWm+ErnKsMocl0XBxpIdhR18erkcDtEtvt60tnU3AgAAAAAAAAA=", + "cursor": "IOgTnWXmEwqr+XesX5bghNK0s1TBQJ0/GNLACjJ9LOytAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==" diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.move b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.move index cb877448a42ef..44f10a839e954 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.move @@ -9,7 +9,7 @@ // 5 | mutated df1 // 6 | mutated parent again -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp index 47b67c35aacae..0c061bcc5bd11 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp @@ -33,7 +33,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "INRhscHCqMshT377bLFT85NRpBKzpMYOMwx1ae2tpgK5AQAAAAAAAAA=", + "cursor": "ICTT97Z4RvHmIwcxdPAmcPJw7gHLD+b58TJGeBgWQ4JtAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -41,7 +41,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "0" } } @@ -57,7 +57,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "0" } } @@ -69,7 +69,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "INRhscHCqMshT377bLFT85NRpBKzpMYOMwx1ae2tpgK5AQAAAAAAAAA=", + "cursor": "ICTT97Z4RvHmIwcxdPAmcPJw7gHLD+b58TJGeBgWQ4JtAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -77,7 +77,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "0" } } @@ -93,7 +93,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "0" } } @@ -109,7 +109,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "0" } } @@ -157,7 +157,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "0" } } @@ -187,7 +187,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "INRhscHCqMshT377bLFT85NRpBKzpMYOMwx1ae2tpgK5AwAAAAAAAAA=", + "cursor": "ICTT97Z4RvHmIwcxdPAmcPJw7gHLD+b58TJGeBgWQ4JtAwAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -195,7 +195,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "1" } } @@ -211,7 +211,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "1" } } @@ -223,7 +223,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "INRhscHCqMshT377bLFT85NRpBKzpMYOMwx1ae2tpgK5AwAAAAAAAAA=", + "cursor": "ICTT97Z4RvHmIwcxdPAmcPJw7gHLD+b58TJGeBgWQ4JtAwAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -231,7 +231,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "1" } } @@ -247,7 +247,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "1" } } @@ -268,7 +268,7 @@ Response: { "value": { "contents": { "json": { - "id": "0xead9661b59861e79296c5c2486b54d4c997fde91edf2b7e2f89b2d747a79e149", + "id": "0x36c21ebf0f400be2910c524ee30635e60c220a4b493ce49536b10ec85519e065", "count": "0" } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.move b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.move index e60b6a8f850ba..c924aac6d138e 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.move @@ -10,7 +10,7 @@ // 5 | 6 | mutated child // 7 | 7 | add child back to parent -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.move b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.move index bd89cee5487ce..5cf67da69731a 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.move @@ -8,7 +8,7 @@ // 2 | 2 // An additional checkpoint is created at the end. -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator //# create-checkpoint diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp index 0410f919ff3b3..58a47cd86d052 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp @@ -35,25 +35,25 @@ Response: { { "cursor": "eyJjIjozLCJ0IjowLCJ0YyI6MH0", "node": { - "digest": "AXoD3PWjAdYov3o7FaWgAqJA8RmvQrjwxGxAi2MNEujz" + "digest": "J7mHXcoa7LXwyjzZUWsk8zvYZjek359TM4d2hQK4LGHo" } }, { "cursor": "eyJjIjozLCJ0IjoxLCJ0YyI6MX0", "node": { - "digest": "52yc8DL8MoGSRqPPnQ53VNa9R93ygKBJGFD72xx1JpJV" + "digest": "J1pYPDrTgsKgzB8XWtW8jLJ8RPsbJcC1SQ4Mv2T1hAWt" } }, { "cursor": "eyJjIjozLCJ0IjoyLCJ0YyI6Mn0", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7" + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs" } }, { "cursor": "eyJjIjozLCJ0IjozLCJ0YyI6M30", "node": { - "digest": "8svV8pFnr17sZtWvDrQEb2ZXeSWw5CoGFVeuRPF3CXvu" + "digest": "Bym7b7ELP77KxVHtgj6F4FB7H6n5LYQuBQYmdvvFxEmM" } } ] @@ -132,25 +132,25 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MCwidGMiOjB9", "node": { - "digest": "AXoD3PWjAdYov3o7FaWgAqJA8RmvQrjwxGxAi2MNEujz" + "digest": "J7mHXcoa7LXwyjzZUWsk8zvYZjek359TM4d2hQK4LGHo" } }, { "cursor": "eyJjIjoxMiwidCI6MSwidGMiOjF9", "node": { - "digest": "52yc8DL8MoGSRqPPnQ53VNa9R93ygKBJGFD72xx1JpJV" + "digest": "J1pYPDrTgsKgzB8XWtW8jLJ8RPsbJcC1SQ4Mv2T1hAWt" } }, { "cursor": "eyJjIjoxMiwidCI6MiwidGMiOjJ9", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7" + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs" } }, { "cursor": "eyJjIjoxMiwidCI6MywidGMiOjN9", "node": { - "digest": "8svV8pFnr17sZtWvDrQEb2ZXeSWw5CoGFVeuRPF3CXvu" + "digest": "Bym7b7ELP77KxVHtgj6F4FB7H6n5LYQuBQYmdvvFxEmM" } } ] @@ -161,19 +161,19 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjowLCJ0YyI6MH0", "node": { - "digest": "AXoD3PWjAdYov3o7FaWgAqJA8RmvQrjwxGxAi2MNEujz" + "digest": "J7mHXcoa7LXwyjzZUWsk8zvYZjek359TM4d2hQK4LGHo" } }, { "cursor": "eyJjIjo0LCJ0IjoxLCJ0YyI6MX0", "node": { - "digest": "52yc8DL8MoGSRqPPnQ53VNa9R93ygKBJGFD72xx1JpJV" + "digest": "J1pYPDrTgsKgzB8XWtW8jLJ8RPsbJcC1SQ4Mv2T1hAWt" } }, { "cursor": "eyJjIjo0LCJ0IjoyLCJ0YyI6Mn0", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7" + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs" } } ] @@ -185,25 +185,25 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NCwidGMiOjR9", "node": { - "digest": "8FGXx3CxjRxi7xV2d6R2FsiyrsyiBfiHLPyGtVtZodES" + "digest": "H1WU8uXMGaENQs54EpoHGpV1iMYdH8P5scd1d16s9ECB" } }, { "cursor": "eyJjIjoxMiwidCI6NSwidGMiOjV9", "node": { - "digest": "HsVHTLTZk5EPHudApRULZfARE7CpCjMsuAPd1UeC6QiP" + "digest": "4vJbSYKwEJb5sYU2jiayqsZNRnBywD8y6sd3RQoMppF9" } }, { "cursor": "eyJjIjoxMiwidCI6NiwidGMiOjZ9", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3" + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB" } }, { "cursor": "eyJjIjoxMiwidCI6NywidGMiOjd9", "node": { - "digest": "AFum9GCMdvZFTH5CHyoNNYARuuTDmxukmZN4iC9BMKQh" + "digest": "D251V1BnvyRKNFZmiFxaf7gSZLGdLo8fYbbVDb5vJWfd" } } ] @@ -214,43 +214,43 @@ Response: { { "cursor": "eyJjIjo4LCJ0IjowLCJ0YyI6MH0", "node": { - "digest": "AXoD3PWjAdYov3o7FaWgAqJA8RmvQrjwxGxAi2MNEujz" + "digest": "J7mHXcoa7LXwyjzZUWsk8zvYZjek359TM4d2hQK4LGHo" } }, { "cursor": "eyJjIjo4LCJ0IjoxLCJ0YyI6MX0", "node": { - "digest": "52yc8DL8MoGSRqPPnQ53VNa9R93ygKBJGFD72xx1JpJV" + "digest": "J1pYPDrTgsKgzB8XWtW8jLJ8RPsbJcC1SQ4Mv2T1hAWt" } }, { "cursor": "eyJjIjo4LCJ0IjoyLCJ0YyI6Mn0", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7" + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs" } }, { "cursor": "eyJjIjo4LCJ0IjozLCJ0YyI6M30", "node": { - "digest": "8svV8pFnr17sZtWvDrQEb2ZXeSWw5CoGFVeuRPF3CXvu" + "digest": "Bym7b7ELP77KxVHtgj6F4FB7H6n5LYQuBQYmdvvFxEmM" } }, { "cursor": "eyJjIjo4LCJ0Ijo0LCJ0YyI6NH0", "node": { - "digest": "8FGXx3CxjRxi7xV2d6R2FsiyrsyiBfiHLPyGtVtZodES" + "digest": "H1WU8uXMGaENQs54EpoHGpV1iMYdH8P5scd1d16s9ECB" } }, { "cursor": "eyJjIjo4LCJ0Ijo1LCJ0YyI6NX0", "node": { - "digest": "HsVHTLTZk5EPHudApRULZfARE7CpCjMsuAPd1UeC6QiP" + "digest": "4vJbSYKwEJb5sYU2jiayqsZNRnBywD8y6sd3RQoMppF9" } }, { "cursor": "eyJjIjo4LCJ0Ijo2LCJ0YyI6Nn0", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3" + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB" } } ] @@ -262,25 +262,25 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OCwidGMiOjh9", "node": { - "digest": "9k4rfA8ZMvyvsU6ar3DVBHH928Tw2aKorQCGJKNCUnYb" + "digest": "JLAF7P6DumC8rgzT1Ygp2QgTwpHE2FUqQbVXL6cGEEQ" } }, { "cursor": "eyJjIjoxMiwidCI6OSwidGMiOjl9", "node": { - "digest": "GLiUrKx2gJVwbRaMtGwVX26PPyhtUbknb3Q9pa3c9XbQ" + "digest": "BVMVdn7DDpTbCjtYwWFekcFA9sNeMgDh1wTNWRrngZxh" } }, { "cursor": "eyJjIjoxMiwidCI6MTAsInRjIjoxMH0", "node": { - "digest": "9w6r3o2uCzXjbktKREZJSkAFcAH3uKjNFPCTS1qasXKD" + "digest": "4J5tno4AoU4NPS2NgEseAZK7cpLDh6KJduVtbtwzmHk5" } }, { "cursor": "eyJjIjoxMiwidCI6MTEsInRjIjoxMX0", "node": { - "digest": "G8TQXpFziMtikrQ131b1uwMb9asAJp98tWHRf8wfeta" + "digest": "GngPX2ztACkKE96VUfoujZ3vA11MMDhPSwwgKhK7hVa" } } ] @@ -291,67 +291,67 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MCwidGMiOjB9", "node": { - "digest": "AXoD3PWjAdYov3o7FaWgAqJA8RmvQrjwxGxAi2MNEujz" + "digest": "J7mHXcoa7LXwyjzZUWsk8zvYZjek359TM4d2hQK4LGHo" } }, { "cursor": "eyJjIjoxMiwidCI6MSwidGMiOjF9", "node": { - "digest": "52yc8DL8MoGSRqPPnQ53VNa9R93ygKBJGFD72xx1JpJV" + "digest": "J1pYPDrTgsKgzB8XWtW8jLJ8RPsbJcC1SQ4Mv2T1hAWt" } }, { "cursor": "eyJjIjoxMiwidCI6MiwidGMiOjJ9", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7" + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs" } }, { "cursor": "eyJjIjoxMiwidCI6MywidGMiOjN9", "node": { - "digest": "8svV8pFnr17sZtWvDrQEb2ZXeSWw5CoGFVeuRPF3CXvu" + "digest": "Bym7b7ELP77KxVHtgj6F4FB7H6n5LYQuBQYmdvvFxEmM" } }, { "cursor": "eyJjIjoxMiwidCI6NCwidGMiOjR9", "node": { - "digest": "8FGXx3CxjRxi7xV2d6R2FsiyrsyiBfiHLPyGtVtZodES" + "digest": "H1WU8uXMGaENQs54EpoHGpV1iMYdH8P5scd1d16s9ECB" } }, { "cursor": "eyJjIjoxMiwidCI6NSwidGMiOjV9", "node": { - "digest": "HsVHTLTZk5EPHudApRULZfARE7CpCjMsuAPd1UeC6QiP" + "digest": "4vJbSYKwEJb5sYU2jiayqsZNRnBywD8y6sd3RQoMppF9" } }, { "cursor": "eyJjIjoxMiwidCI6NiwidGMiOjZ9", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3" + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB" } }, { "cursor": "eyJjIjoxMiwidCI6NywidGMiOjd9", "node": { - "digest": "AFum9GCMdvZFTH5CHyoNNYARuuTDmxukmZN4iC9BMKQh" + "digest": "D251V1BnvyRKNFZmiFxaf7gSZLGdLo8fYbbVDb5vJWfd" } }, { "cursor": "eyJjIjoxMiwidCI6OCwidGMiOjh9", "node": { - "digest": "9k4rfA8ZMvyvsU6ar3DVBHH928Tw2aKorQCGJKNCUnYb" + "digest": "JLAF7P6DumC8rgzT1Ygp2QgTwpHE2FUqQbVXL6cGEEQ" } }, { "cursor": "eyJjIjoxMiwidCI6OSwidGMiOjl9", "node": { - "digest": "GLiUrKx2gJVwbRaMtGwVX26PPyhtUbknb3Q9pa3c9XbQ" + "digest": "BVMVdn7DDpTbCjtYwWFekcFA9sNeMgDh1wTNWRrngZxh" } }, { "cursor": "eyJjIjoxMiwidCI6MTAsInRjIjoxMH0", "node": { - "digest": "9w6r3o2uCzXjbktKREZJSkAFcAH3uKjNFPCTS1qasXKD" + "digest": "4J5tno4AoU4NPS2NgEseAZK7cpLDh6KJduVtbtwzmHk5" } } ] @@ -372,19 +372,19 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjoxLCJ0YyI6MX0", "node": { - "digest": "52yc8DL8MoGSRqPPnQ53VNa9R93ygKBJGFD72xx1JpJV" + "digest": "J1pYPDrTgsKgzB8XWtW8jLJ8RPsbJcC1SQ4Mv2T1hAWt" } }, { "cursor": "eyJjIjo3LCJ0IjoyLCJ0YyI6Mn0", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7" + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs" } }, { "cursor": "eyJjIjo3LCJ0IjozLCJ0YyI6M30", "node": { - "digest": "8svV8pFnr17sZtWvDrQEb2ZXeSWw5CoGFVeuRPF3CXvu" + "digest": "Bym7b7ELP77KxVHtgj6F4FB7H6n5LYQuBQYmdvvFxEmM" } } ] @@ -397,19 +397,19 @@ Response: { { "cursor": "eyJjIjoxMSwidCI6NSwidGMiOjV9", "node": { - "digest": "HsVHTLTZk5EPHudApRULZfARE7CpCjMsuAPd1UeC6QiP" + "digest": "4vJbSYKwEJb5sYU2jiayqsZNRnBywD8y6sd3RQoMppF9" } }, { "cursor": "eyJjIjoxMSwidCI6NiwidGMiOjZ9", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3" + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB" } }, { "cursor": "eyJjIjoxMSwidCI6NywidGMiOjd9", "node": { - "digest": "AFum9GCMdvZFTH5CHyoNNYARuuTDmxukmZN4iC9BMKQh" + "digest": "D251V1BnvyRKNFZmiFxaf7gSZLGdLo8fYbbVDb5vJWfd" } } ] @@ -422,19 +422,19 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OSwidGMiOjl9", "node": { - "digest": "GLiUrKx2gJVwbRaMtGwVX26PPyhtUbknb3Q9pa3c9XbQ" + "digest": "BVMVdn7DDpTbCjtYwWFekcFA9sNeMgDh1wTNWRrngZxh" } }, { "cursor": "eyJjIjoxMiwidCI6MTAsInRjIjoxMH0", "node": { - "digest": "9w6r3o2uCzXjbktKREZJSkAFcAH3uKjNFPCTS1qasXKD" + "digest": "4J5tno4AoU4NPS2NgEseAZK7cpLDh6KJduVtbtwzmHk5" } }, { "cursor": "eyJjIjoxMiwidCI6MTEsInRjIjoxMX0", "node": { - "digest": "G8TQXpFziMtikrQ131b1uwMb9asAJp98tWHRf8wfeta" + "digest": "GngPX2ztACkKE96VUfoujZ3vA11MMDhPSwwgKhK7hVa" } } ] @@ -456,7 +456,7 @@ Response: { { "cursor": "eyJjIjoyLCJ0IjoyLCJ0YyI6Mn0", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7" + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs" } } ] @@ -469,7 +469,7 @@ Response: { { "cursor": "eyJjIjo2LCJ0Ijo2LCJ0YyI6Nn0", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3" + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB" } } ] @@ -482,7 +482,7 @@ Response: { { "cursor": "eyJjIjoxMCwidCI6MTAsInRjIjoxMH0", "node": { - "digest": "9w6r3o2uCzXjbktKREZJSkAFcAH3uKjNFPCTS1qasXKD" + "digest": "4J5tno4AoU4NPS2NgEseAZK7cpLDh6KJduVtbtwzmHk5" } } ] @@ -502,24 +502,24 @@ Response: { { "cursor": "eyJjIjo2LCJ0Ijo2LCJ0YyI6Nn0", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3", + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowBgAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BBgAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeBgAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0BgAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJBgAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmBgAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHBgAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUBgAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXBgAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkBgAAAAAAAAA=" } ] } @@ -533,33 +533,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MiwidGMiOjJ9", "node": { - "digest": "Ap9FiJGfZ2hbKbbYiWvKCqUriZh51TuaLqavgM9eafD7", + "digest": "Cwqr9jTgQjajoYaqcjzAaQGcQEyCg8XxoN7smGCLiBrs", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowDAAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BDAAAAAAAAAA=" }, { - "cursor": "IBVqwFN+K1tPwVPZ2Buo50CdJpYJ46cFKdqJZS39a1eQDAAAAAAAAAA=" + "cursor": "IF/uIRaMgBMCI+kzIXbynkkgR1IqqzEFTdlab1OX1hK7DAAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeDAAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0DAAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJDAAAAAAAAAA=" + "cursor": "IKlQ9F2RqOqHllHkIqzqS/vQR74f1DWxQJuH7L0DCyToDAAAAAAAAAA=" }, { - "cursor": "IJaV3ii49Tae7LtbGR4JkowXPNbm98GHsvBdSFJhZXcsDAAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmDAAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHDAAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUDAAAAAAAAAA=" }, { - "cursor": "IL/Cy7u/c+rjJFY8kH+rcGIElYbhvwwKH2oppHIqeaw/DAAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkDAAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXDAAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8DAAAAAAAAAA=" } ] } @@ -569,33 +569,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NCwidGMiOjR9", "node": { - "digest": "8FGXx3CxjRxi7xV2d6R2FsiyrsyiBfiHLPyGtVtZodES", + "digest": "H1WU8uXMGaENQs54EpoHGpV1iMYdH8P5scd1d16s9ECB", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowDAAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BDAAAAAAAAAA=" }, { - "cursor": "IBVqwFN+K1tPwVPZ2Buo50CdJpYJ46cFKdqJZS39a1eQDAAAAAAAAAA=" + "cursor": "IF/uIRaMgBMCI+kzIXbynkkgR1IqqzEFTdlab1OX1hK7DAAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeDAAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0DAAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJDAAAAAAAAAA=" + "cursor": "IKlQ9F2RqOqHllHkIqzqS/vQR74f1DWxQJuH7L0DCyToDAAAAAAAAAA=" }, { - "cursor": "IJaV3ii49Tae7LtbGR4JkowXPNbm98GHsvBdSFJhZXcsDAAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmDAAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHDAAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUDAAAAAAAAAA=" }, { - "cursor": "IL/Cy7u/c+rjJFY8kH+rcGIElYbhvwwKH2oppHIqeaw/DAAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkDAAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXDAAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8DAAAAAAAAAA=" } ] } @@ -605,33 +605,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NSwidGMiOjV9", "node": { - "digest": "HsVHTLTZk5EPHudApRULZfARE7CpCjMsuAPd1UeC6QiP", + "digest": "4vJbSYKwEJb5sYU2jiayqsZNRnBywD8y6sd3RQoMppF9", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowDAAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BDAAAAAAAAAA=" }, { - "cursor": "IBVqwFN+K1tPwVPZ2Buo50CdJpYJ46cFKdqJZS39a1eQDAAAAAAAAAA=" + "cursor": "IF/uIRaMgBMCI+kzIXbynkkgR1IqqzEFTdlab1OX1hK7DAAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeDAAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0DAAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJDAAAAAAAAAA=" + "cursor": "IKlQ9F2RqOqHllHkIqzqS/vQR74f1DWxQJuH7L0DCyToDAAAAAAAAAA=" }, { - "cursor": "IJaV3ii49Tae7LtbGR4JkowXPNbm98GHsvBdSFJhZXcsDAAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmDAAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHDAAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUDAAAAAAAAAA=" }, { - "cursor": "IL/Cy7u/c+rjJFY8kH+rcGIElYbhvwwKH2oppHIqeaw/DAAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkDAAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXDAAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8DAAAAAAAAAA=" } ] } @@ -641,33 +641,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NiwidGMiOjZ9", "node": { - "digest": "qMEs41Xi9K7Nae7AxdnJT9d82EYYDvyk9KDixC8ktt3", + "digest": "4W23PZz7dHVxoZ2VMCWU9j38Jxy7tLkqcFBcJUB3aCSB", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowDAAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BDAAAAAAAAAA=" }, { - "cursor": "IBVqwFN+K1tPwVPZ2Buo50CdJpYJ46cFKdqJZS39a1eQDAAAAAAAAAA=" + "cursor": "IF/uIRaMgBMCI+kzIXbynkkgR1IqqzEFTdlab1OX1hK7DAAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeDAAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0DAAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJDAAAAAAAAAA=" + "cursor": "IKlQ9F2RqOqHllHkIqzqS/vQR74f1DWxQJuH7L0DCyToDAAAAAAAAAA=" }, { - "cursor": "IJaV3ii49Tae7LtbGR4JkowXPNbm98GHsvBdSFJhZXcsDAAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmDAAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHDAAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUDAAAAAAAAAA=" }, { - "cursor": "IL/Cy7u/c+rjJFY8kH+rcGIElYbhvwwKH2oppHIqeaw/DAAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkDAAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXDAAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8DAAAAAAAAAA=" } ] } @@ -677,33 +677,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OCwidGMiOjh9", "node": { - "digest": "9k4rfA8ZMvyvsU6ar3DVBHH928Tw2aKorQCGJKNCUnYb", + "digest": "JLAF7P6DumC8rgzT1Ygp2QgTwpHE2FUqQbVXL6cGEEQ", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowDAAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BDAAAAAAAAAA=" }, { - "cursor": "IBVqwFN+K1tPwVPZ2Buo50CdJpYJ46cFKdqJZS39a1eQDAAAAAAAAAA=" + "cursor": "IF/uIRaMgBMCI+kzIXbynkkgR1IqqzEFTdlab1OX1hK7DAAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeDAAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0DAAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJDAAAAAAAAAA=" + "cursor": "IKlQ9F2RqOqHllHkIqzqS/vQR74f1DWxQJuH7L0DCyToDAAAAAAAAAA=" }, { - "cursor": "IJaV3ii49Tae7LtbGR4JkowXPNbm98GHsvBdSFJhZXcsDAAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmDAAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHDAAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUDAAAAAAAAAA=" }, { - "cursor": "IL/Cy7u/c+rjJFY8kH+rcGIElYbhvwwKH2oppHIqeaw/DAAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkDAAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXDAAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8DAAAAAAAAAA=" } ] } @@ -713,33 +713,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OSwidGMiOjl9", "node": { - "digest": "GLiUrKx2gJVwbRaMtGwVX26PPyhtUbknb3Q9pa3c9XbQ", + "digest": "BVMVdn7DDpTbCjtYwWFekcFA9sNeMgDh1wTNWRrngZxh", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowDAAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BDAAAAAAAAAA=" }, { - "cursor": "IBVqwFN+K1tPwVPZ2Buo50CdJpYJ46cFKdqJZS39a1eQDAAAAAAAAAA=" + "cursor": "IF/uIRaMgBMCI+kzIXbynkkgR1IqqzEFTdlab1OX1hK7DAAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeDAAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0DAAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJDAAAAAAAAAA=" + "cursor": "IKlQ9F2RqOqHllHkIqzqS/vQR74f1DWxQJuH7L0DCyToDAAAAAAAAAA=" }, { - "cursor": "IJaV3ii49Tae7LtbGR4JkowXPNbm98GHsvBdSFJhZXcsDAAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmDAAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHDAAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUDAAAAAAAAAA=" }, { - "cursor": "IL/Cy7u/c+rjJFY8kH+rcGIElYbhvwwKH2oppHIqeaw/DAAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkDAAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXDAAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8DAAAAAAAAAA=" } ] } @@ -749,33 +749,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MTAsInRjIjoxMH0", "node": { - "digest": "9w6r3o2uCzXjbktKREZJSkAFcAH3uKjNFPCTS1qasXKD", + "digest": "4J5tno4AoU4NPS2NgEseAZK7cpLDh6KJduVtbtwzmHk5", "sender": { "objects": { "edges": [ { - "cursor": "IAQNrQFBNb8BA02jUeYW1Tnd31jow8sGwIispP8BrPowDAAAAAAAAAA=" + "cursor": "IEc7/GlJ0OzYvLoXrYb8i5a4bH/GJV+rf3OdCN0ybK6BDAAAAAAAAAA=" }, { - "cursor": "IBVqwFN+K1tPwVPZ2Buo50CdJpYJ46cFKdqJZS39a1eQDAAAAAAAAAA=" + "cursor": "IF/uIRaMgBMCI+kzIXbynkkgR1IqqzEFTdlab1OX1hK7DAAAAAAAAAA=" }, { - "cursor": "IE9kNX+G9MnpHdDbTLJ+kJE6OmkAKwJwQENg3UVB+YpeDAAAAAAAAAA=" + "cursor": "IIqPTFnX+rHDcS4xCUFXG4ZsOQcWEdkXi1f+8/v0IBH0DAAAAAAAAAA=" }, { - "cursor": "IHJCnYMS4fQMP4wvtETAscLjpUdyWQVcGpl+n2Bed4XJDAAAAAAAAAA=" + "cursor": "IKlQ9F2RqOqHllHkIqzqS/vQR74f1DWxQJuH7L0DCyToDAAAAAAAAAA=" }, { - "cursor": "IJaV3ii49Tae7LtbGR4JkowXPNbm98GHsvBdSFJhZXcsDAAAAAAAAAA=" + "cursor": "INbqP41ZqynANs92ptMyMn/+lSNP12oLtw8bpZIEWDkmDAAAAAAAAAA=" }, { - "cursor": "IKvtDnxcge491zwCHDFA+bevfZnSqe+EnKOnUeRrMUsHDAAAAAAAAAA=" + "cursor": "INpMDx0x9g66unG0Cuxh6o2J2gVYeYeWUOCSgt4SbrtUDAAAAAAAAAA=" }, { - "cursor": "IL/Cy7u/c+rjJFY8kH+rcGIElYbhvwwKH2oppHIqeaw/DAAAAAAAAAA=" + "cursor": "IOLsptmHdyPvEY5wclPNEAiDho6BXIICZmmOGq0F0DNkDAAAAAAAAAA=" }, { - "cursor": "INZniY4QS/3KTPQmfQkXW+1ZEk7bT4cRwgbiMhUcllEXDAAAAAAAAAA=" + "cursor": "IPdBQipzs53YXv+f5ZHkysnhkenevKFjtWcKDBtTiWu8DAAAAAAAAAA=" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.move b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.move index 20fe86f05d329..39c8368818df3 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.move @@ -17,7 +17,7 @@ // 11 | epoch | 11 | 2 // 12 | epoch | 12 | 3 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp b/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp index 41924300bfc62..86fa7bf15e70b 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp @@ -25,7 +25,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "0" } } @@ -50,7 +50,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "1" } } @@ -62,7 +62,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "0" } } @@ -94,7 +94,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "1" } } @@ -121,7 +121,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "1" } } @@ -138,7 +138,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "0" } } @@ -186,7 +186,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "1" } } @@ -203,7 +203,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0x3a52109e235a2b2b1e09b617e300547148e6a60068ac23248b2c96f43a690336", + "id": "0x08db6cef6b0f6a69902b4476a5e9b3db98789497a664bbfe054c4754625d86d7", "value": "0" } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.move b/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.move index 5cb3ceb5c5bb4..4065ae9fccdf0 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.move @@ -14,7 +14,7 @@ // checkpoint 4. The object would only be visible at version 6 from objects_snapshot, and at version // 7 from objects_history. -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp index 763152a96650c..26492d64de0e2 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp @@ -26,24 +26,26 @@ Response: { "data": { "one_of_these_will_yield_an_object": { "objects": { - "nodes": [ - { - "version": 4, + "nodes": [] + } + }, + "if_the_other_does_not": { + "nodes": [ + { + "version": 3, + "asMoveObject": { "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } } - ] - } - }, - "if_the_other_does_not": { - "nodes": [] + } + ] } } } @@ -66,24 +68,26 @@ Response: { "data": { "paginating_on_checkpoint_1": { "objects": { - "nodes": [ - { - "version": 4, + "nodes": [] + } + }, + "should_not_have_more_than_one_result": { + "nodes": [ + { + "version": 3, + "asMoveObject": { "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } } - ] - } - }, - "should_not_have_more_than_one_result": { - "nodes": [] + } + ] } } } @@ -95,50 +99,50 @@ Response: { "objects": { "nodes": [ { - "version": 6, + "version": 4, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", - "value": "3" + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", + "value": "1" } } }, { - "version": 3, + "version": 6, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", - "value": "0" + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", + "value": "3" } } }, { - "version": 5, + "version": 3, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x9e5e1e3c286c6fbd13c45af6993d5cc1c8879ec70bc0590530b7d5238f353ab4", - "value": "2" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471", + "value": "2" } } } @@ -155,50 +159,50 @@ Response: { "objects": { "nodes": [ { - "version": 6, + "version": 4, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", - "value": "3" + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", + "value": "1" } } }, { - "version": 3, + "version": 6, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", - "value": "0" + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", + "value": "3" } } }, { - "version": 5, + "version": 3, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x9e5e1e3c286c6fbd13c45af6993d5cc1c8879ec70bc0590530b7d5238f353ab4", - "value": "2" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471", + "value": "2" } } } @@ -220,33 +224,36 @@ Response: { "data": { "after_obj_6_0_at_checkpoint_2": { "objects": { - "nodes": [ - { - "version": 4, + "nodes": [] + } + }, + "before_obj_6_0_at_checkpoint_2": { + "nodes": [ + { + "version": 4, + "asMoveObject": { "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", "value": "1" } }, - "owner_at_latest_state_has_sui_only": { + "note_that_owner_result_should_reflect_latest_state": { "owner": { "objects": { "nodes": [ { - "version": 1, + "version": 4, "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", - "balance": { - "value": "300000000000000" - } + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", + "value": "1" } } }, @@ -254,47 +261,49 @@ Response: { "version": 6, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", "value": "3" } } }, { - "version": 3, + "version": 1, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", - "value": "0" + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", + "balance": { + "value": "300000000000000" + } } } }, { - "version": 5, + "version": 3, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x9e5e1e3c286c6fbd13c45af6993d5cc1c8879ec70bc0590530b7d5238f353ab4", - "value": "2" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471", + "value": "2" } } } @@ -303,20 +312,16 @@ Response: { } } } - ] - } - }, - "before_obj_6_0_at_checkpoint_2": { - "nodes": [ + }, { "version": 6, "asMoveObject": { "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", "value": "3" } }, @@ -325,16 +330,14 @@ Response: { "objects": { "nodes": [ { - "version": 1, + "version": 4, "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", - "balance": { - "value": "300000000000000" - } + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", + "value": "1" } } }, @@ -342,47 +345,49 @@ Response: { "version": 6, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", "value": "3" } } }, { - "version": 3, + "version": 1, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", - "value": "0" + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", + "balance": { + "value": "300000000000000" + } } } }, { - "version": 5, + "version": 3, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x9e5e1e3c286c6fbd13c45af6993d5cc1c8879ec70bc0590530b7d5238f353ab4", - "value": "2" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471", + "value": "2" } } } @@ -397,10 +402,10 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", "value": "0" } }, @@ -409,16 +414,14 @@ Response: { "objects": { "nodes": [ { - "version": 1, + "version": 4, "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", - "balance": { - "value": "300000000000000" - } + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", + "value": "1" } } }, @@ -426,47 +429,49 @@ Response: { "version": 6, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", "value": "3" } } }, { - "version": 3, + "version": 1, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", - "value": "0" + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", + "balance": { + "value": "300000000000000" + } } } }, { - "version": 5, + "version": 3, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x9e5e1e3c286c6fbd13c45af6993d5cc1c8879ec70bc0590530b7d5238f353ab4", - "value": "2" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471", + "value": "2" } } } @@ -525,11 +530,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", - "value": "3" + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", + "value": "1" } } }, @@ -537,11 +542,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", - "value": "0" + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", + "value": "3" } } }, @@ -549,11 +554,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x9e5e1e3c286c6fbd13c45af6993d5cc1c8879ec70bc0590530b7d5238f353ab4", - "value": "2" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } }, @@ -561,11 +566,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471", + "value": "2" } } } @@ -582,50 +587,50 @@ Response: { "objects": { "nodes": [ { - "version": 6, + "version": 4, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x5606fabce74f48671642cacd0b69a8ef932ed89e2da36dd3d56f64712c43e42a", - "value": "3" + "id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71", + "value": "1" } } }, { - "version": 3, + "version": 6, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x7822fed12c5b387c36bf7e7180a0bd24472955fbcc0354cdc2a68ea7a6830036", - "value": "0" + "id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3", + "value": "3" } } }, { - "version": 5, + "version": 3, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0x9e5e1e3c286c6fbd13c45af6993d5cc1c8879ec70bc0590530b7d5238f353ab4", - "value": "2" + "id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xccb4b18fc62a781f4e941f887adc7199745263e8e1e5cf28151557947703ac30::M1::Object" + "repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object" }, "json": { - "id": "0xf423ce789b5a9f893dbf58e44e97d207f4090475dcc08dfe4ea72c3328d4df1f", - "value": "1" + "id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471", + "value": "2" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.move b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.move index cf7cd38b93497..f17b1c04fc831 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator // cp | object_id | owner diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp index 931274141cc82..eb78279ac0352 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp @@ -35,10 +35,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "100" } } @@ -71,10 +71,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "100" } } @@ -100,10 +100,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xb0ee31984e13962c43e49c8a458a872746a1bad4182c0a53e2a63540c5ae00fc", + "id": "0x5a036eccabb35fa40c8dce9e83414df4086b4c14505b95ba6791de66e20e9648", "value": "1" } } @@ -112,10 +112,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } } @@ -130,10 +130,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } }, @@ -145,10 +145,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xb0ee31984e13962c43e49c8a458a872746a1bad4182c0a53e2a63540c5ae00fc", + "id": "0x5a036eccabb35fa40c8dce9e83414df4086b4c14505b95ba6791de66e20e9648", "value": "1" } } @@ -157,10 +157,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } } @@ -198,10 +198,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } }, @@ -213,10 +213,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xb0ee31984e13962c43e49c8a458a872746a1bad4182c0a53e2a63540c5ae00fc", + "id": "0x5a036eccabb35fa40c8dce9e83414df4086b4c14505b95ba6791de66e20e9648", "value": "1" } } @@ -225,10 +225,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } } @@ -259,10 +259,10 @@ Response: { "version": 6, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xb0ee31984e13962c43e49c8a458a872746a1bad4182c0a53e2a63540c5ae00fc", + "id": "0x5a036eccabb35fa40c8dce9e83414df4086b4c14505b95ba6791de66e20e9648", "value": "300" } } @@ -271,10 +271,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } } @@ -289,10 +289,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } }, @@ -304,10 +304,10 @@ Response: { "version": 6, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xb0ee31984e13962c43e49c8a458a872746a1bad4182c0a53e2a63540c5ae00fc", + "id": "0x5a036eccabb35fa40c8dce9e83414df4086b4c14505b95ba6791de66e20e9648", "value": "300" } } @@ -316,10 +316,10 @@ Response: { "version": 5, "contents": { "type": { - "repr": "0xc50c3d1b815e6b11a499175ba7e732eb6fbcee23bd2ad106dfb4a2474a2a186b::M1::Object" + "repr": "0x20cee016ae87d51618e53d13497a6558c373f80647fd570b1d60dea66fda28d5::M1::Object" }, "json": { - "id": "0xc4bddcbccc6243088c23181ede4367a8299f494f97b49e91cb19c45dcd8cf3ef", + "id": "0xcfa9863ef3521130fa9821f63be4db23a292af6da509a9e0d7c8121a21a98685", "value": "200" } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.move b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.move index 8aa62af4af40d..c0374af589d4c 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.move @@ -5,7 +5,7 @@ // one object as a cursor to view the other object that gets mutated per checkpoint. The ordering is // consistent even if the cursor object is mutated. -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp b/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp index 556b8596884e1..dc0cc60eadd7e 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp @@ -31,11 +31,11 @@ Response: { }, "contents": { "json": { - "id": "0xff46241272ccb3df378164e860d33401382c2c464ac01fe4d3e950e8b5a04706", - "value": "352" + "id": "0xff7f5ef9e5a7b5b6265b414ddc0f76a1daa5677e6333d10c280223d036a7038f", + "value": "6" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -50,11 +50,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -72,11 +72,11 @@ Response: { }, "contents": { "json": { - "id": "0xfed4b92bf629151a77c3b5350ac776002c5868a1c45a3ef9f0c9d08a81efb84b", - "value": "453" + "id": "0xfecefff3d2e3952957d14e450ef967f370986d101867386df4d581366063f153", + "value": "263" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } }, @@ -88,11 +88,11 @@ Response: { }, "contents": { "json": { - "id": "0xff37ce70d95051877924ed05c8fb0d9890aea3be46d9f21585b87547e3ff7c87", - "value": "124" + "id": "0xfef205520684c9953fac1dee89681b03fc8cd19d8574f660202972b95bb7a5a8", + "value": "275" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } }, @@ -104,11 +104,11 @@ Response: { }, "contents": { "json": { - "id": "0xff46241272ccb3df378164e860d33401382c2c464ac01fe4d3e950e8b5a04706", - "value": "352" + "id": "0xff7f5ef9e5a7b5b6265b414ddc0f76a1daa5677e6333d10c280223d036a7038f", + "value": "6" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } }, @@ -120,11 +120,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -155,7 +155,7 @@ Contents: Test::M1::Object { bytes: fake(2,498), }, }, - value: 352u64, + value: 6u64, } task 9 'view-object'. lines 92-92: @@ -167,7 +167,7 @@ Contents: Test::M1::Object { bytes: fake(2,497), }, }, - value: 124u64, + value: 275u64, } task 10 'create-checkpoint'. lines 94-94: @@ -188,11 +188,11 @@ Response: { }, "contents": { "json": { - "id": "0xff37ce70d95051877924ed05c8fb0d9890aea3be46d9f21585b87547e3ff7c87", - "value": "124" + "id": "0xfef205520684c9953fac1dee89681b03fc8cd19d8574f660202972b95bb7a5a8", + "value": "275" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -207,11 +207,11 @@ Response: { }, "contents": { "json": { - "id": "0xff46241272ccb3df378164e860d33401382c2c464ac01fe4d3e950e8b5a04706", - "value": "352" + "id": "0xff7f5ef9e5a7b5b6265b414ddc0f76a1daa5677e6333d10c280223d036a7038f", + "value": "6" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -226,11 +226,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -249,11 +249,11 @@ Response: { }, "contents": { "json": { - "id": "0xfed4b92bf629151a77c3b5350ac776002c5868a1c45a3ef9f0c9d08a81efb84b", - "value": "453" + "id": "0xfecefff3d2e3952957d14e450ef967f370986d101867386df4d581366063f153", + "value": "263" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -275,11 +275,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -293,11 +293,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -313,11 +313,11 @@ Response: { }, "contents": { "json": { - "id": "0xff37ce70d95051877924ed05c8fb0d9890aea3be46d9f21585b87547e3ff7c87", - "value": "124" + "id": "0xfef205520684c9953fac1dee89681b03fc8cd19d8574f660202972b95bb7a5a8", + "value": "275" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -331,11 +331,11 @@ Response: { }, "contents": { "json": { - "id": "0xff46241272ccb3df378164e860d33401382c2c464ac01fe4d3e950e8b5a04706", - "value": "352" + "id": "0xff7f5ef9e5a7b5b6265b414ddc0f76a1daa5677e6333d10c280223d036a7038f", + "value": "6" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -349,11 +349,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -371,11 +371,11 @@ Response: { }, "contents": { "json": { - "id": "0xff37ce70d95051877924ed05c8fb0d9890aea3be46d9f21585b87547e3ff7c87", - "value": "124" + "id": "0xfef205520684c9953fac1dee89681b03fc8cd19d8574f660202972b95bb7a5a8", + "value": "275" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -389,11 +389,11 @@ Response: { }, "contents": { "json": { - "id": "0xff46241272ccb3df378164e860d33401382c2c464ac01fe4d3e950e8b5a04706", - "value": "352" + "id": "0xff7f5ef9e5a7b5b6265b414ddc0f76a1daa5677e6333d10c280223d036a7038f", + "value": "6" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -407,11 +407,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } @@ -430,7 +430,7 @@ Response: { }, "contents": { "json": { - "id": "0x59268a0a0a1e185d8f1826c4fb8af694293bb74fe720517d1edf18898bc55ea7", + "id": "0x666f28299115f43a52d09d94ffda7828cc16a28daeb6dc2ed89665cf2d014f53", "balance": { "value": "300000000000000" } @@ -449,11 +449,11 @@ Response: { }, "contents": { "json": { - "id": "0xff37ce70d95051877924ed05c8fb0d9890aea3be46d9f21585b87547e3ff7c87", - "value": "124" + "id": "0xfef205520684c9953fac1dee89681b03fc8cd19d8574f660202972b95bb7a5a8", + "value": "275" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } }, @@ -466,11 +466,11 @@ Response: { }, "contents": { "json": { - "id": "0xff46241272ccb3df378164e860d33401382c2c464ac01fe4d3e950e8b5a04706", - "value": "352" + "id": "0xff7f5ef9e5a7b5b6265b414ddc0f76a1daa5677e6333d10c280223d036a7038f", + "value": "6" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } }, @@ -483,11 +483,11 @@ Response: { }, "contents": { "json": { - "id": "0xffc82a69fa0d5ac2de37a76de889c1584b5870a0873d133050fb9f34929b1a4c", - "value": "394" + "id": "0xfffc711287a6c859f0855d276c5439941b0a916bcdb4f31a62547bf94b073682", + "value": "107" }, "type": { - "repr": "0xd0a99640afc983f3fce8aa2c6b02a49f23bc5bfb3cbbd7f4356c77e72a8ddb04::M1::Object" + "repr": "0x361adca72b31788356405445166ccc9c01ab86b80ab7a28fc7aff4da14b0bbb7::M1::Object" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.move b/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.move index 37b3e2650f45a..2cb78277f3a45 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.move @@ -7,7 +7,7 @@ // criteria are then invalidated by a newer version of the matched object. We set `last: 1` but // transfer the last 3 objects because we increase the limit by 2 behind the scenes. -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp b/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp index 81cdd9e8d5351..42449ff1ad3c1 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp @@ -20,7 +20,7 @@ mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 task 3 'run'. lines 24-24: -events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [47, 110, 138, 153, 188, 27, 152, 129, 24, 104, 150, 221, 204, 249, 164, 26, 86, 20, 242, 110, 225, 63, 55, 123, 107, 51, 205, 228, 29, 90, 126, 74, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(3,0), object(3,1) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(_), object(2,0) @@ -38,7 +38,7 @@ mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 task 7 'run'. lines 34-34: -events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [47, 110, 138, 153, 188, 27, 152, 129, 24, 104, 150, 221, 204, 249, 164, 26, 86, 20, 242, 110, 225, 63, 55, 123, 107, 51, 205, 228, 29, 90, 126, 74, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(7,0) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0), object(3,0) deleted: object(6,0) @@ -93,13 +93,13 @@ Response: { "stakedSuis": { "edges": [ { - "cursor": "IMCqYYUFtQgPF2vk6KmFReZSmEBb7bMyp4Gc9VWZO437BAAAAAAAAAA=", + "cursor": "IAidrcQW7UwLfNo5bGuGok1F1WjdHLpWsHjM9DfHu3cTBAAAAAAAAAA=", "node": { "principal": "10000000000" } }, { - "cursor": "IPI9o24alDXGVaatOzS0UpLQ7Gn3kXdzMSuZUmqi97TRBAAAAAAAAAA=", + "cursor": "IIfCdVF/ksapbQZhjXV6RV32ZC1RPOn4asTmI03lIcvOBAAAAAAAAAA=", "node": { "principal": "10000000000" } @@ -140,10 +140,15 @@ task 14 'run-graphql'. lines 104-147: Response: { "data": { "coins_after_obj_3_1_chkpt_3": { + "stakedSuis": { + "edges": [] + } + }, + "coins_before_obj_3_1_chkpt_3": { "stakedSuis": { "edges": [ { - "cursor": "IPI9o24alDXGVaatOzS0UpLQ7Gn3kXdzMSuZUmqi97TRAwAAAAAAAAA=", + "cursor": "IAidrcQW7UwLfNo5bGuGok1F1WjdHLpWsHjM9DfHu3cTAwAAAAAAAAA=", "node": { "principal": "10000000000" } @@ -151,27 +156,22 @@ Response: { ] } }, - "coins_before_obj_3_1_chkpt_3": { - "stakedSuis": { - "edges": [] - } - }, "coins_after_obj_7_0_chkpt_3": { - "stakedSuis": { - "edges": [] - } - }, - "coins_before_obj_7_0_chkpt_3": { "stakedSuis": { "edges": [ { - "cursor": "IMCqYYUFtQgPF2vk6KmFReZSmEBb7bMyp4Gc9VWZO437AwAAAAAAAAA=", + "cursor": "IIfCdVF/ksapbQZhjXV6RV32ZC1RPOn4asTmI03lIcvOAwAAAAAAAAA=", "node": { "principal": "10000000000" } } ] } + }, + "coins_before_obj_7_0_chkpt_3": { + "stakedSuis": { + "edges": [] + } } } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.move b/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.move index f5992178d5fe8..fe1e6c3b9808c 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator --accounts C +//# init --protocol-version 51 --simulator --accounts C //# run-graphql { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp b/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp index b541f86de44e2..7b1eedded760d 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp @@ -44,66 +44,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -119,66 +119,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -192,66 +192,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -267,7 +267,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", "balance": { "value": "299999993044572" } @@ -289,66 +289,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -372,66 +372,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -445,66 +445,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -520,7 +520,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", "balance": { "value": "300000000000000" } @@ -539,66 +539,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -612,66 +612,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -687,7 +687,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", "balance": { "value": "299999996697200" } @@ -706,66 +706,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -779,66 +779,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -854,7 +854,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", "balance": { "value": "299999993044572" } @@ -886,66 +886,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -961,66 +961,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1034,66 +1034,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1109,7 +1109,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x4f64357f86f4c9e91dd0db4cb27e90913a3a69002b0270404360dd4541f98a5e", + "id": "0x473bfc6949d0ecd8bcba17ad86fc8b96b86c7fc6255fab7f739d08dd326cae81", "balance": { "value": "299999993044572" } @@ -1131,66 +1131,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1217,66 +1217,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1290,66 +1290,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1365,66 +1365,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1438,66 +1438,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1513,66 +1513,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } @@ -1586,66 +1586,66 @@ Response: { { "contents": { "json": { - "id": "0x0adc35c5da6cf1b4f90395fbad3014e1fbf0340a072964d3e9d4fd267fbbff14", - "value": "6" + "id": "0x061f33f54b5739b9e1f07c6f6e7920190c479ca4ac891072bbf064f7ea0acc2d", + "value": "2" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x4643058893bba48ddd24f496631d70b65b9fb06073e40e931054551e278273cf", + "id": "0x0ce458859f0a77b9d37bd9314e8d84a16031681b2f4bffbdfd593f07bbe4ef3a", "value": "5" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x55681d04f40782bef733b12b82f1f02170f6455d3016dde9762174db8a510830", - "value": "200" + "id": "0x48c00039edcf263d27eb7f2acd79fe0725b23d28496cd71f62501034eec3204e", + "value": "3" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0x5fcd6fc6f73a3b3031c7d5143d01834a9fdc1b20154d4103441191efc51fd79d", - "value": "2" + "id": "0x7588dfba122235fc33c51c5d220af6031f8f735456ab1e76741856c7f3f416d6", + "value": "6" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xc8879d0ef952a3d230d87f12496c2adbf901f4e2722eb0f6826f8762852ae84c", - "value": "4" + "id": "0x96a0f7ec0384968bad48e98227bcf85607ca88ecf0b579676af72e40a1e7d83a", + "value": "200" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } }, { "contents": { "json": { - "id": "0xde4451754a98759de3114961b722189bbd2d4bd9158ce161bb604c6996bfd17a", - "value": "3" + "id": "0xfc4ac7a73983267a4e4c29b1b75767ecc1047ceba8b5ac68a201016558df2960", + "value": "4" }, "type": { - "repr": "0x7f55ca07a125dd5bd2a5e4a5eaa09aef1ccb3e6e56efdb44d55f8098a60956d8::M1::Object" + "repr": "0x8c554cf17f642954470b874c3846d3e0d81bb9b5401e86ecda92924b766277c1::M1::Object" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.move b/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.move index 7080fbe192181..bca9988aa2af6 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.move +++ b/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.move @@ -12,7 +12,7 @@ // 2 | (3, 3, 3) // 3 | (4, 4, 4, 4) -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/datetime/datetime.move b/crates/sui-graphql-e2e-tests/tests/datetime/datetime.move index 60cedfc382f67..e76a509f2c767 100644 --- a/crates/sui-graphql-e2e-tests/tests/datetime/datetime.move +++ b/crates/sui-graphql-e2e-tests/tests/datetime/datetime.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator +//# init --protocol-version 51 --simulator //# create-checkpoint diff --git a/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp b/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp index 251b70ebf8c84..db30674dec2b3 100644 --- a/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp +++ b/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp @@ -15,7 +15,7 @@ mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 task 4 'run'. lines 16-18: -events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [47, 110, 138, 153, 188, 27, 152, 129, 24, 104, 150, 221, 204, 249, 164, 26, 86, 20, 242, 110, 225, 63, 55, 123, 107, 51, 205, 228, 29, 90, 126, 74, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) @@ -52,7 +52,7 @@ Response: { ] }, "validatorCandidatesSize": 0, - "inactivePoolsId": "0xd42add765a665c5ce0d95915cf08a43e48e2776778c2f2bd299cc8ac356911d4" + "inactivePoolsId": "0xf937977c0d8d7627bca5e2abe751a5aba6a69b9fe3dd9afbcf913a9654285d3f" }, "totalGasFees": "1000000", "totalStakeRewards": "1000000", @@ -67,13 +67,13 @@ Response: { "kind": { "__typename": "ProgrammableTransactionBlock" }, - "digest": "G9KNcs15xsvXxQDkgket5he2RzrFf6X3ASKj9GxC6m7F" + "digest": "Gmyzb2VbPeBeaEaUHz7UkcLy8ptVe3CCynfKdvd27BYs" }, { "kind": { "__typename": "EndOfEpochTransaction" }, - "digest": "EFNTnhwCsGwNzNq4CdYGZSh8a7EMTiJ9M4ug7kEL9khP" + "digest": "3e1j1uEGkxTFNdsq5srGGGNADrDuebKFj9c2JFeqNG7t" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/epoch/epoch.move b/crates/sui-graphql-e2e-tests/tests/epoch/epoch.move index 1f43c477d4b7c..8b9612d940ec7 100644 --- a/crates/sui-graphql-e2e-tests/tests/epoch/epoch.move +++ b/crates/sui-graphql-e2e-tests/tests/epoch/epoch.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator --accounts C +//# init --protocol-version 51 --simulator --accounts C // TODO: Short term hack to get around indexer epoch issue diff --git a/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp b/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp index fa94374bf6f45..c67b8b5cdfdb5 100644 --- a/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp +++ b/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp @@ -15,7 +15,7 @@ mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 task 4 'run'. lines 18-18: -events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [169, 50, 245, 224, 111, 204, 249, 228, 37, 95, 36, 67, 193, 8, 151, 25, 98, 236, 218, 103, 86, 132, 168, 26, 250, 5, 211, 223, 88, 15, 165, 43, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [248, 78, 186, 99, 231, 9, 139, 242, 111, 186, 194, 226, 178, 139, 36, 108, 107, 38, 243, 45, 234, 239, 71, 218, 67, 179, 228, 139, 121, 123, 170, 161, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) @@ -45,7 +45,7 @@ task 11 'advance-epoch'. lines 34-34: Epoch advanced: 3 task 12 'run'. lines 36-36: -events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("UnstakingRequestEvent"), type_params: [] }, contents: [169, 50, 245, 224, 111, 204, 249, 228, 37, 95, 36, 67, 193, 8, 151, 25, 98, 236, 218, 103, 86, 132, 168, 26, 250, 5, 211, 223, 88, 15, 165, 43, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } +events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("UnstakingRequestEvent"), type_params: [] }, contents: [248, 78, 186, 99, 231, 9, 139, 242, 111, 186, 194, 226, 178, 139, 36, 108, 107, 38, 243, 45, 234, 239, 71, 218, 67, 179, 228, 139, 121, 123, 170, 161, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } created: object(12,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(4,0) diff --git a/crates/sui-graphql-e2e-tests/tests/epoch/system_state.move b/crates/sui-graphql-e2e-tests/tests/epoch/system_state.move index 8b3d66f3b241c..edc568d8afe3c 100644 --- a/crates/sui-graphql-e2e-tests/tests/epoch/system_state.move +++ b/crates/sui-graphql-e2e-tests/tests/epoch/system_state.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator --accounts C --custom-validator-account +//# init --protocol-version 51 --simulator --accounts C --custom-validator-account // Run a few transactions and check that the system state storage fund is correctly reported // for historical epochs diff --git a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp index 70d24dd285bb1..cb88eba807b89 100644 --- a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp +++ b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp @@ -63,67 +63,67 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callU8' (line 29), abort 'ImAU8': 0" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callU8' (line 29), abort 'ImAU8': 0" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callU16' (line 32), abort 'ImAU16': 1" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callU16' (line 32), abort 'ImAU16': 1" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callU32' (line 35), abort 'ImAU32': 2" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callU32' (line 35), abort 'ImAU32': 2" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callU64' (line 38), abort 'ImAU64': 3" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callU64' (line 38), abort 'ImAU64': 3" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callU128' (line 41), abort 'ImAU128': 4" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callU128' (line 41), abort 'ImAU128': 4" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callU256' (line 44), abort 'ImAU256': 5" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callU256' (line 44), abort 'ImAU256': 5" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callAddress' (line 47), abort 'ImAnAddress': 0x0000000000000000000000000000000000000000000000000000000000000006" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callAddress' (line 47), abort 'ImAnAddress': 0x0000000000000000000000000000000000000000000000000000000000000006" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callString' (line 50), abort 'ImAString': This is a string" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callString' (line 50), abort 'ImAString': This is a string" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::callU64vec' (line 53), abort 'ImNotAString': BQEAAAAAAAAAAgAAAAAAAAADAAAAAAAAAAQAAAAAAAAABQAAAAAAAAA=" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::callU64vec' (line 53), abort 'ImNotAString': BQEAAAAAAAAAAgAAAAAAAAADAAAAAAAAAAQAAAAAAAAABQAAAAAAAAA=" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::normalAbort' (instruction 1), abort code: 0" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::normalAbort' (instruction 1), abort code: 0" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x13f0e7121815525f6f713c0d0b5d79d56ed352b0c50b0342a7b508092845bd5a::m::assertLineNo' (line 59)" + "errors": "Error in 1st command, from '0xc4823e6a5f0f064ab9004946eed4875893f664cb0fe611c106ea85f34c52a7cd::m::assertLineNo' (line 59)" } } ] @@ -220,7 +220,7 @@ Response: { }, "errors": [ { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -236,7 +236,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -252,7 +252,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -268,7 +268,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -284,7 +284,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -300,7 +300,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -316,7 +316,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -332,7 +332,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, @@ -348,7 +348,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 7e6b30c3a5fb6ce2077c4a116a0b772333f21f989fee00b67e214a9d112a1e74", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: d1bd7272f34936db7dc7600632e33be690fc45912db6f309a390f143be72ea20", "locations": [ { "line": 6, diff --git a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.move b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.move index 7d67411a2dfaf..5e69a8498888d 100644 --- a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.move +++ b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 P1=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 P1=0x0 --accounts A --simulator //# publish --upgradeable --sender A module P0::m { diff --git a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp index 209c7586ef72f..690f53706ea03 100644 --- a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp +++ b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp @@ -31,19 +31,19 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0xe16ef5f74c51308b89b85b71f5e062bc1bd06733fe65b34915f6851031f75e94::m::t_a' (line 20)" + "errors": "Error in 1st command, from '0x6846951eaea99f8742b4ad253534ef8b44459248f322f3cd404050aa1b9a3cbb::m::t_a' (line 20)" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0xe16ef5f74c51308b89b85b71f5e062bc1bd06733fe65b34915f6851031f75e94::m::t_calls_a' (line 23)" + "errors": "Error in 1st command, from '0x6846951eaea99f8742b4ad253534ef8b44459248f322f3cd404050aa1b9a3cbb::m::t_calls_a' (line 23)" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0xe16ef5f74c51308b89b85b71f5e062bc1bd06733fe65b34915f6851031f75e94::m::t_const_assert' (line 9), abort 'EMsg': This is a string" + "errors": "Error in 1st command, from '0x6846951eaea99f8742b4ad253534ef8b44459248f322f3cd404050aa1b9a3cbb::m::t_const_assert' (line 9), abort 'EMsg': This is a string" } } ] diff --git a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.move b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.move index 7f2ed6a76d855..259d2f4104dbe 100644 --- a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.move +++ b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 --accounts A --simulator //# publish --sender A module P0::m { diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp index 0d3a6855d7a15..6b43bc83d265a 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp @@ -53,7 +53,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventA" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -71,7 +71,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventB<0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::Object>" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventB<0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::Object>" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -89,7 +89,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M2::EventA" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M2::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -107,7 +107,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M2::EventB<0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M2::Object>" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M2::EventB<0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M2::Object>" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -135,7 +135,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventA" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -153,7 +153,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventB<0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::Object>" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventB<0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::Object>" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -171,7 +171,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M2::EventA" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M2::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -189,7 +189,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M2::EventB<0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M2::Object>" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M2::EventB<0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M2::Object>" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -217,7 +217,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventA" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -235,7 +235,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventB<0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::Object>" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventB<0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::Object>" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -263,7 +263,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventA" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -291,7 +291,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::EventB<0xa2d6f1ec1f6128e358f75bd7ffbe2bbc7643eaa5eef807e383b401c1339b4bc9::M1::Object>" + "repr": "0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::EventB<0x08c5d7466382add5a3962c5fbe295af8fc8331bd3140f4f23b031cc1439416ab::M1::Object>" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.move b/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.move index 8d823b74426e9..4e5dc82048984 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.move +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.move @@ -9,7 +9,7 @@ // Verifies correct event when filtered for Test::M1::EventB // Verifies error when filtered on sender, package, module and event type with generics and < -//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp index 9aa6c1568c008..e44c59f4c28b2 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp @@ -26,7 +26,7 @@ Response: { "name": "M3" }, "type": { - "repr": "0x5428e32c5697392b37b5b68636823b75cfd13a8c8ce0e5cfa0222fbf06a0cbfb::M1::EventA" + "repr": "0x0d72d40a7520bc67f48a16f325a5f189cb79788025784c7f41bf02598d02d2d0::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -51,7 +51,7 @@ Response: { "name": "M3" }, "type": { - "repr": "0x5428e32c5697392b37b5b68636823b75cfd13a8c8ce0e5cfa0222fbf06a0cbfb::M1::EventA" + "repr": "0x0d72d40a7520bc67f48a16f325a5f189cb79788025784c7f41bf02598d02d2d0::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -94,7 +94,7 @@ Response: { "name": "M3" }, "type": { - "repr": "0x5428e32c5697392b37b5b68636823b75cfd13a8c8ce0e5cfa0222fbf06a0cbfb::M1::EventA" + "repr": "0x0d72d40a7520bc67f48a16f325a5f189cb79788025784c7f41bf02598d02d2d0::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.move b/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.move index b698217614b3e..62290d4c2ed47 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.move +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.move @@ -5,7 +5,7 @@ // The emitting module is where the entrypoint function is defined - // in other words, the function called by a programmable transaction block. -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp index 6424fb73ff7f5..9a8c6e243b753 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp @@ -37,7 +37,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -55,7 +55,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -73,7 +73,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -105,7 +105,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -123,7 +123,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -155,7 +155,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -173,7 +173,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -205,7 +205,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" @@ -223,7 +223,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x51eaabd782d304a773932638852262fb65567766132d13c72d749af8ef531e5a::M1::EventA" + "repr": "0x5ba7fdbca31dfa8d9642b26cd297043adba83d87276b248ef9feecd2fe80f9ec::M1::EventA" }, "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.move b/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.move index 6be1b010a12e2..560c08d090ca6 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.move +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp index 44bf1fa4b1fa8..27c666b948b9e 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp +++ b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp @@ -49,14 +49,14 @@ Response: { task 4 'run-graphql'. lines 50-54: Response: { "data": { - "chainIdentifier": "8f58ad28" + "chainIdentifier": "3989ac57" } } task 5 'run-graphql'. lines 56-60: Response: { "data": { - "chainIdentifier": "8f58ad28" + "chainIdentifier": "3989ac57" } } diff --git a/crates/sui-graphql-e2e-tests/tests/limits/directives.move b/crates/sui-graphql-e2e-tests/tests/limits/directives.move index 13631cd5b6a74..d3b0fbad6c8b4 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/directives.move +++ b/crates/sui-graphql-e2e-tests/tests/limits/directives.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# run-graphql diff --git a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp index 54a4a80b12cd2..90b87a03faaf2 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp +++ b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp @@ -28,7 +28,7 @@ Response: { "edges": [ { "node": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } } ] @@ -56,7 +56,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } } ] @@ -87,7 +87,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } } ] @@ -96,7 +96,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } } ] @@ -127,7 +127,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } } ] @@ -158,7 +158,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } } ] @@ -183,7 +183,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } } ] @@ -208,7 +208,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3", + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH", "first": null, "last": null } @@ -234,7 +234,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3", + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH", "first": null, "last": null } @@ -260,7 +260,7 @@ Response: { "edges": [ { "txns": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3", + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH", "a": null, "b": null } @@ -290,7 +290,7 @@ Response: { "edges": [ { "node": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3", + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH", "a": null } } diff --git a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move index 151ae48ef7101..2d23f48fd7c71 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move +++ b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses A=0x42 --simulator +//# init --protocol-version 51 --addresses A=0x42 --simulator //# run-graphql --show-usage # pageInfo does not inherit connection's weights diff --git a/crates/sui-graphql-e2e-tests/tests/objects/coin.exp b/crates/sui-graphql-e2e-tests/tests/objects/coin.exp index 302f824445de2..2a109c9e03a3f 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/coin.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/coin.exp @@ -6,6 +6,7 @@ A: object(0,0) task 1 'publish'. lines 6-33: created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) +unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 15663600, storage_rebate: 0, non_refundable_storage_fee: 0 task 2 'create-checkpoint'. lines 35-35: @@ -17,9 +18,9 @@ Response: { "suiCoins": { "edges": [ { - "cursor": "IEo/RZXfAOH+hXLpHQvfDOVTU+xsHFK7dBds5C0ELZYUAQAAAAAAAAA=", + "cursor": "IEhCgqa6qcXlsUkDdo32eGgBmUs4z6L2mXH6NqmZC77tAQAAAAAAAAA=", "node": { - "coinBalance": "300000000000000", + "coinBalance": "30000000000000000", "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" @@ -28,7 +29,7 @@ Response: { } }, { - "cursor": "IFO2Nln0kQsFY1dahdyjJU8etBvW+CNc8lCO5sGPQpOrAQAAAAAAAAA=", + "cursor": "IFPq3e4mD3JLmBt7U2WNzZgSFLwsz/6YjP9z9qBPRqm7AQAAAAAAAAA=", "node": { "coinBalance": "299999983336400", "contents": { @@ -39,9 +40,9 @@ Response: { } }, { - "cursor": "IOztw2llorHhwZkdl/Vt/oCAvETGrPf3qbD8ewUNgF1qAQAAAAAAAAA=", + "cursor": "IKV7Ha9vWwyzIt4w9/tCrV9KV/hnFQgrdUxX7TF8yo3LAQAAAAAAAAA=", "node": { - "coinBalance": "30000000000000000", + "coinBalance": "300000000000000", "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" @@ -54,34 +55,34 @@ Response: { "fakeCoins": { "edges": [ { - "cursor": "IFUAez+45XGcP6inIrt8eYnLy4fUmEunKFCGR3wAK2yiAQAAAAAAAAA=", + "cursor": "IAvGb3x1uHG3vlbwOmbpqu9G1y6lFMPvy78W0dYzfPPEAQAAAAAAAAA=", "node": { - "coinBalance": "2", + "coinBalance": "1", "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0xa345c290d7a872171d0fecb41c23459e4ef4e8e2d1c879e307a220e884dd5465::fake::FAKE>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0xc8929d74fe1877d36330e4c4b9980a43f866e60092e06deaf7960f0997ded3c1::fake::FAKE>" } } } }, { - "cursor": "IGegLzUFP9H8rIcvGXmW80SZPnKsBiNiuEEejkOB5WWUAQAAAAAAAAA=", + "cursor": "ICgGWFLi6bcN2HoJAXojP5/0CGlFjapIWCCQ/MXDN6WdAQAAAAAAAAA=", "node": { - "coinBalance": "1", + "coinBalance": "3", "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0xa345c290d7a872171d0fecb41c23459e4ef4e8e2d1c879e307a220e884dd5465::fake::FAKE>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0xc8929d74fe1877d36330e4c4b9980a43f866e60092e06deaf7960f0997ded3c1::fake::FAKE>" } } } }, { - "cursor": "IOlGP7AcZ43RGuuTINovc/Ygy05PR6kk17yCBrFEL9KYAQAAAAAAAAA=", + "cursor": "IDRByp+p4cbkrDs67RXidklQ7KGHDFFVTgDxwcTDLfo4AQAAAAAAAAA=", "node": { - "coinBalance": "3", + "coinBalance": "2", "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0xa345c290d7a872171d0fecb41c23459e4ef4e8e2d1c879e307a220e884dd5465::fake::FAKE>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0xc8929d74fe1877d36330e4c4b9980a43f866e60092e06deaf7960f0997ded3c1::fake::FAKE>" } } } @@ -92,7 +93,7 @@ Response: { "coins": { "edges": [ { - "cursor": "IFO2Nln0kQsFY1dahdyjJU8etBvW+CNc8lCO5sGPQpOrAQAAAAAAAAA=", + "cursor": "IFPq3e4mD3JLmBt7U2WNzZgSFLwsz/6YjP9z9qBPRqm7AQAAAAAAAAA=", "node": { "coinBalance": "299999983336400", "contents": { @@ -117,10 +118,10 @@ Response: { } }, { - "cursor": "eyJ0IjoiMHhhMzQ1YzI5MGQ3YTg3MjE3MWQwZmVjYjQxYzIzNDU5ZTRlZjRlOGUyZDFjODc5ZTMwN2EyMjBlODg0ZGQ1NDY1OjpmYWtlOjpGQUtFIiwiYyI6MX0", + "cursor": "eyJ0IjoiMHhjODkyOWQ3NGZlMTg3N2QzNjMzMGU0YzRiOTk4MGE0M2Y4NjZlNjAwOTJlMDZkZWFmNzk2MGYwOTk3ZGVkM2MxOjpmYWtlOjpGQUtFIiwiYyI6MX0", "node": { "coinType": { - "repr": "0xa345c290d7a872171d0fecb41c23459e4ef4e8e2d1c879e307a220e884dd5465::fake::FAKE" + "repr": "0xc8929d74fe1877d36330e4c4b9980a43f866e60092e06deaf7960f0997ded3c1::fake::FAKE" }, "coinObjectCount": 3, "totalBalance": "6" @@ -138,7 +139,7 @@ Response: { "lastBalance": { "edges": [ { - "cursor": "eyJ0IjoiMHhhMzQ1YzI5MGQ3YTg3MjE3MWQwZmVjYjQxYzIzNDU5ZTRlZjRlOGUyZDFjODc5ZTMwN2EyMjBlODg0ZGQ1NDY1OjpmYWtlOjpGQUtFIiwiYyI6MX0" + "cursor": "eyJ0IjoiMHhjODkyOWQ3NGZlMTg3N2QzNjMzMGU0YzRiOTk4MGE0M2Y4NjZlNjAwOTJlMDZkZWFmNzk2MGYwOTk3ZGVkM2MxOjpmYWtlOjpGQUtFIiwiYyI6MX0" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/coin.move b/crates/sui-graphql-e2e-tests/tests/objects/coin.move index f683f63dc4665..77b54a9f9d00e 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/coin.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/coin.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 --accounts A --simulator //# publish --sender A module P0::fake { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/data.exp b/crates/sui-graphql-e2e-tests/tests/objects/data.exp index c6fc43434d825..3e8fd63d041d4 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/data.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/data.exp @@ -38,38 +38,38 @@ Response: { "name": "id", "value": { "UID": [ - 74, - 63, - 69, - 149, - 223, - 0, - 225, - 254, - 133, - 114, - 233, + 165, + 123, 29, - 11, - 223, + 175, + 111, + 91, 12, - 229, - 83, - 83, - 236, - 108, - 28, - 82, - 187, - 116, - 23, - 108, - 228, - 45, - 4, - 45, - 150, - 20 + 179, + 34, + 222, + 48, + 247, + 251, + 66, + 173, + 95, + 74, + 87, + 248, + 103, + 21, + 8, + 43, + 117, + 76, + 87, + 237, + 49, + 124, + 202, + 141, + 203 ] } }, @@ -89,7 +89,7 @@ Response: { ] }, "json": { - "id": "0x4a3f4595df00e1fe8572e91d0bdf0ce55353ec6c1c52bb74176ce42d042d9614", + "id": "0xa57b1daf6f5b0cb322de30f7fb42ad5f4a57f86715082b754c57ed317cca8dcb", "balance": { "value": "299999988444520" } @@ -103,7 +103,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x43e458adbc5ad1c5a8a73788068627249e7e88cd2f08abb420fe142ccfbd27d4::m::Foo" + "repr": "0x624933cec0be5148f0f974c60ae272409b71a5df70c030371628513fefeb34d0::m::Foo" }, "data": { "Struct": [ @@ -111,38 +111,38 @@ Response: { "name": "id", "value": { "UID": [ - 193, - 3, - 234, - 105, - 40, - 231, - 173, - 229, - 146, - 133, - 161, - 89, - 195, - 50, - 50, 187, + 160, + 0, + 21, + 187, + 221, + 83, + 145, + 58, + 113, + 33, + 140, + 191, + 124, + 97, + 26, + 205, + 146, 90, - 214, - 241, - 19, - 129, - 175, - 30, - 127, - 47, - 155, - 226, - 238, - 214, - 134, - 5, - 97 + 178, + 103, + 140, + 106, + 92, + 145, + 166, + 59, + 64, + 110, + 221, + 168, + 197 ] } }, @@ -150,38 +150,38 @@ Response: { "name": "f0", "value": { "ID": [ - 193, - 3, - 234, - 105, - 40, - 231, - 173, - 229, - 146, - 133, - 161, - 89, - 195, - 50, - 50, 187, + 160, + 0, + 21, + 187, + 221, + 83, + 145, + 58, + 113, + 33, + 140, + 191, + 124, + 97, + 26, + 205, + 146, 90, - 214, - 241, - 19, - 129, - 175, - 30, - 127, - 47, - 155, - 226, - 238, - 214, - 134, - 5, - 97 + 178, + 103, + 140, + 106, + 92, + 145, + 166, + 59, + 64, + 110, + 221, + 168, + 197 ] } }, @@ -221,38 +221,38 @@ Response: { "Vector": [ { "Address": [ - 193, - 3, - 234, - 105, - 40, - 231, - 173, - 229, - 146, - 133, - 161, - 89, - 195, - 50, - 50, 187, + 160, + 0, + 21, + 187, + 221, + 83, + 145, + 58, + 113, + 33, + 140, + 191, + 124, + 97, + 26, + 205, + 146, 90, - 214, - 241, - 19, - 129, - 175, - 30, - 127, - 47, - 155, - 226, - 238, - 214, - 134, - 5, - 97 + 178, + 103, + 140, + 106, + 92, + 145, + 166, + 59, + 64, + 110, + 221, + 168, + 197 ] } ] @@ -269,15 +269,15 @@ Response: { ] }, "json": { - "id": "0xc103ea6928e7ade59285a159c33232bb5ad6f11381af1e7f2f9be2eed6860561", - "f0": "0xc103ea6928e7ade59285a159c33232bb5ad6f11381af1e7f2f9be2eed6860561", + "id": "0xbba00015bbdd53913a71218cbf7c611acd925ab2678c6a5c91a63b406edda8c5", + "f0": "0xbba00015bbdd53913a71218cbf7c611acd925ab2678c6a5c91a63b406edda8c5", "f1": true, "f2": 42, "f3": "43", "f4": "hello", "f5": "world", "f6": [ - "0xc103ea6928e7ade59285a159c33232bb5ad6f11381af1e7f2f9be2eed6860561" + "0xbba00015bbdd53913a71218cbf7c611acd925ab2678c6a5c91a63b406edda8c5" ], "f7": 44 } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/data.move b/crates/sui-graphql-e2e-tests/tests/objects/data.move index 75999c9945317..4ccd3b7eabb92 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/data.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/data.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 --accounts A --simulator //# publish module P0::m { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/display.exp b/crates/sui-graphql-e2e-tests/tests/objects/display.exp index af5d3190536e1..c39d89fc62a7b 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/display.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/display.exp @@ -4,7 +4,7 @@ init: A: object(0,0) task 1 'publish'. lines 6-130: -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("DisplayCreated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [204, 70, 201, 195, 154, 37, 234, 154, 45, 182, 115, 158, 32, 71, 101, 226, 106, 116, 83, 118, 34, 131, 196, 249, 96, 105, 136, 132, 210, 20, 50, 122] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("DisplayCreated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103] } created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 21470000, storage_rebate: 0, non_refundable_storage_fee: 0 @@ -13,7 +13,7 @@ task 2 'create-checkpoint'. lines 132-132: Checkpoint created: 1 task 3 'view-checkpoint'. lines 134-134: -CheckpointSummary { epoch: 0, seq: 1, content_digest: ASMemYYi136k6mnn5Xynj4hNbbsYZA7Burj4fwAHEvDh, +CheckpointSummary { epoch: 0, seq: 1, content_digest: 38F9Kd5S9DxwyU8sCegbmKqkYPZrjZBZicUNhhhbPsKu, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 1000000, storage_cost: 21470000, storage_rebate: 0, non_refundable_storage_fee: 0 }} task 4 'run'. lines 136-136: @@ -22,7 +22,7 @@ mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3556800, storage_rebate: 978120, non_refundable_storage_fee: 9880 task 5 'run'. lines 138-138: -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [204, 70, 201, 195, 154, 37, 234, 154, 45, 182, 115, 158, 32, 71, 101, 226, 106, 116, 83, 118, 34, 131, 196, 249, 96, 105, 136, 132, 210, 20, 50, 122, 1, 0, 3, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103, 1, 0, 3, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2941200, storage_rebate: 2625876, non_refundable_storage_fee: 26524 @@ -30,7 +30,7 @@ task 6 'create-checkpoint'. lines 140-140: Checkpoint created: 2 task 7 'view-checkpoint'. lines 142-142: -CheckpointSummary { epoch: 0, seq: 2, content_digest: 6wBqzvvX1WvdGxBGxfEd3fNkg8k4346fH5hGzsKuXxvQ, +CheckpointSummary { epoch: 0, seq: 2, content_digest: 2UUsxLrzkkoM2BZmzxtmF2JyJrQVjUz7a3WbkQbMSkUN, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 3000000, storage_cost: 27968000, storage_rebate: 3603996, non_refundable_storage_fee: 36404 }} task 8 'run-graphql'. lines 144-157: @@ -65,7 +65,7 @@ Response: { } task 9 'run'. lines 159-159: -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [204, 70, 201, 195, 154, 37, 234, 154, 45, 182, 115, 158, 32, 71, 101, 226, 106, 116, 83, 118, 34, 131, 196, 249, 96, 105, 136, 132, 210, 20, 50, 122, 2, 0, 4, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103, 2, 0, 4, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 3032400, storage_rebate: 2911788, non_refundable_storage_fee: 29412 @@ -73,7 +73,7 @@ task 10 'create-checkpoint'. lines 161-161: Checkpoint created: 3 task 11 'view-checkpoint'. lines 163-163: -CheckpointSummary { epoch: 0, seq: 3, content_digest: 46rmXvZBajiZvbacTGo4kNgv4xmhwZh4gJF5oUtQLCJj, +CheckpointSummary { epoch: 0, seq: 3, content_digest: 6GU2oy7ZTAeGuvjYLJ7tERdTW5BuynyhRoTr34W2o6tw, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 4000000, storage_cost: 31000400, storage_rebate: 6515784, non_refundable_storage_fee: 65816 }} task 12 'run-graphql'. lines 165-178: @@ -113,7 +113,7 @@ Response: { } task 13 'run'. lines 180-180: -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [204, 70, 201, 195, 154, 37, 234, 154, 45, 182, 115, 158, 32, 71, 101, 226, 106, 116, 83, 118, 34, 131, 196, 249, 96, 105, 136, 132, 210, 20, 50, 122, 3, 0, 15, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125, 5, 98, 111, 111, 108, 115, 7, 123, 98, 111, 111, 108, 115, 125, 5, 98, 117, 121, 101, 114, 7, 123, 98, 117, 121, 101, 114, 125, 4, 110, 97, 109, 101, 6, 123, 110, 97, 109, 101, 125, 7, 99, 114, 101, 97, 116, 111, 114, 9, 123, 99, 114, 101, 97, 116, 111, 114, 125, 5, 112, 114, 105, 99, 101, 7, 123, 112, 114, 105, 99, 101, 125, 11, 112, 114, 111, 106, 101, 99, 116, 95, 117, 114, 108, 58, 85, 110, 105, 113, 117, 101, 32, 66, 111, 97, 114, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 66, 111, 97, 114, 115, 32, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 32, 119, 105, 116, 104, 32, 123, 110, 97, 109, 101, 125, 32, 97, 110, 100, 32, 123, 105, 100, 125, 8, 98, 97, 115, 101, 95, 117, 114, 108, 32, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 123, 105, 109, 103, 95, 117, 114, 108, 125, 11, 110, 111, 95, 116, 101, 109, 112, 108, 97, 116, 101, 23, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 3, 97, 103, 101, 21, 123, 109, 101, 116, 97, 100, 97, 116, 97, 46, 110, 101, 115, 116, 101, 100, 46, 97, 103, 101, 125, 8, 102, 117, 108, 108, 95, 117, 114, 108, 10, 123, 102, 117, 108, 108, 95, 117, 114, 108, 125, 13, 101, 115, 99, 97, 112, 101, 95, 115, 121, 110, 116, 97, 120, 8, 92, 123, 110, 97, 109, 101, 92, 125] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103, 3, 0, 15, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125, 5, 98, 111, 111, 108, 115, 7, 123, 98, 111, 111, 108, 115, 125, 5, 98, 117, 121, 101, 114, 7, 123, 98, 117, 121, 101, 114, 125, 4, 110, 97, 109, 101, 6, 123, 110, 97, 109, 101, 125, 7, 99, 114, 101, 97, 116, 111, 114, 9, 123, 99, 114, 101, 97, 116, 111, 114, 125, 5, 112, 114, 105, 99, 101, 7, 123, 112, 114, 105, 99, 101, 125, 11, 112, 114, 111, 106, 101, 99, 116, 95, 117, 114, 108, 58, 85, 110, 105, 113, 117, 101, 32, 66, 111, 97, 114, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 66, 111, 97, 114, 115, 32, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 32, 119, 105, 116, 104, 32, 123, 110, 97, 109, 101, 125, 32, 97, 110, 100, 32, 123, 105, 100, 125, 8, 98, 97, 115, 101, 95, 117, 114, 108, 32, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 123, 105, 109, 103, 95, 117, 114, 108, 125, 11, 110, 111, 95, 116, 101, 109, 112, 108, 97, 116, 101, 23, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 3, 97, 103, 101, 21, 123, 109, 101, 116, 97, 100, 97, 116, 97, 46, 110, 101, 115, 116, 101, 100, 46, 97, 103, 101, 125, 8, 102, 117, 108, 108, 95, 117, 114, 108, 10, 123, 102, 117, 108, 108, 95, 117, 114, 108, 125, 13, 101, 115, 99, 97, 112, 101, 95, 115, 121, 110, 116, 97, 120, 8, 92, 123, 110, 97, 109, 101, 92, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5236400, storage_rebate: 3002076, non_refundable_storage_fee: 30324 @@ -121,7 +121,7 @@ task 14 'create-checkpoint'. lines 182-182: Checkpoint created: 4 task 15 'view-checkpoint'. lines 184-184: -CheckpointSummary { epoch: 0, seq: 4, content_digest: 94cyLcF3eyAQ8RPnjBqKzaov5iztZy5F2j91SMCSMQHe, +CheckpointSummary { epoch: 0, seq: 4, content_digest: XAuLWwCkKRGkkGtQopDS64y6VLVMRxRZTKUrSmJWJPS, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 5000000, storage_cost: 36236800, storage_rebate: 9517860, non_refundable_storage_fee: 96140 }} task 16 'run-graphql'. lines 186-199: @@ -179,7 +179,7 @@ Response: { }, { "key": "project_url", - "value": "Unique Boar from the Boars collection with First Boar and 0x159935d8c2760c375def04d771c4056810f29dce75eb920822fff07bf8eca43f", + "value": "Unique Boar from the Boars collection with First Boar and 0xa88095cf047234523b2eac15be50a1f1450d04020d60d09cb858bbfaf27ae291", "error": null }, { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/display.move b/crates/sui-graphql-e2e-tests/tests/objects/display.move index 78406a9662c19..1f29d8af66648 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/display.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/display.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish --sender A module Test::boars { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp b/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp index b224642898272..f4c9e4615047c 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp @@ -4,11 +4,14 @@ init: A: object(0,0) task 1 'publish'. lines 6-54: -Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. -Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERSION, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } +created: object(1,0), object(1,1) +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 10510800, storage_rebate: 0, non_refundable_storage_fee: 0 task 2 'programmable'. lines 56-58: -Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } +created: object(2,0) +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 3032400, storage_rebate: 0, non_refundable_storage_fee: 0 task 3 'create-checkpoint'. lines 60-60: Checkpoint created: 1 @@ -35,38 +38,38 @@ Response: { "name": "id", "value": { "UID": [ - 83, - 182, - 54, - 89, - 244, - 145, - 11, - 5, - 99, + 165, + 123, + 29, + 175, + 111, + 91, + 12, + 179, + 34, + 222, + 48, + 247, + 251, + 66, + 173, + 95, + 74, 87, - 90, - 133, - 220, - 163, - 37, - 79, - 30, - 180, - 27, - 214, 248, - 35, - 92, - 242, - 80, - 142, - 230, - 193, - 143, - 66, - 147, - 171 + 103, + 21, + 8, + 43, + 117, + 76, + 87, + 237, + 49, + 124, + 202, + 141, + 203 ] } }, @@ -77,7 +80,7 @@ Response: { { "name": "value", "value": { - "Number": "299999998012000" + "Number": "299999995967600" } } ] @@ -86,9 +89,262 @@ Response: { ] }, "json": { - "id": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "id": "0xa57b1daf6f5b0cb322de30f7fb42ad5f4a57f86715082b754c57ed317cca8dcb", "balance": { - "value": "299999998012000" + "value": "299999995967600" + } + } + } + } + } + }, + { + "outputState": { + "asMoveObject": { + "contents": { + "type": { + "repr": "0xdb78ae794282c4b7cdd0be71548346391b9872c9f331c600ee326dda0197288b::m::Foo" + }, + "data": { + "Struct": [ + { + "name": "id", + "value": { + "UID": [ + 250, + 110, + 106, + 241, + 90, + 199, + 216, + 123, + 138, + 250, + 196, + 147, + 115, + 221, + 65, + 142, + 233, + 105, + 128, + 102, + 67, + 13, + 125, + 253, + 217, + 189, + 67, + 187, + 113, + 125, + 47, + 110 + ] + } + }, + { + "name": "f0", + "value": { + "ID": [ + 250, + 110, + 106, + 241, + 90, + 199, + 216, + 123, + 138, + 250, + 196, + 147, + 115, + 221, + 65, + 142, + 233, + 105, + 128, + 102, + 67, + 13, + 125, + 253, + 217, + 189, + 67, + 187, + 113, + 125, + 47, + 110 + ] + } + }, + { + "name": "f1", + "value": { + "Bool": true + } + }, + { + "name": "f2", + "value": { + "Number": "42" + } + }, + { + "name": "f3", + "value": { + "Number": "43" + } + }, + { + "name": "f4", + "value": { + "String": "hello" + } + }, + { + "name": "f5", + "value": { + "String": "world" + } + }, + { + "name": "f6", + "value": { + "Vector": [ + { + "Address": [ + 250, + 110, + 106, + 241, + 90, + 199, + 216, + 123, + 138, + 250, + 196, + 147, + 115, + 221, + 65, + 142, + 233, + 105, + 128, + 102, + 67, + 13, + 125, + 253, + 217, + 189, + 67, + 187, + 113, + 125, + 47, + 110 + ] + } + ] + } + }, + { + "name": "f7", + "value": { + "Option": { + "Number": "44" + } + } + }, + { + "name": "f8", + "value": { + "Variant": { + "name": "A", + "fields": [] + } + } + }, + { + "name": "f9", + "value": { + "Variant": { + "name": "B", + "fields": [] + } + } + }, + { + "name": "f10", + "value": { + "Variant": { + "name": "C", + "fields": [ + { + "name": "pos0", + "value": { + "Number": "45" + } + } + ] + } + } + }, + { + "name": "f11", + "value": { + "Variant": { + "name": "D", + "fields": [ + { + "name": "x", + "value": { + "Number": "46" + } + } + ] + } + } + } + ] + }, + "json": { + "id": "0xfa6e6af15ac7d87b8afac49373dd418ee9698066430d7dfdd9bd43bb717d2f6e", + "f0": "0xfa6e6af15ac7d87b8afac49373dd418ee9698066430d7dfdd9bd43bb717d2f6e", + "f1": true, + "f2": 42, + "f3": "43", + "f4": "hello", + "f5": "world", + "f6": [ + "0xfa6e6af15ac7d87b8afac49373dd418ee9698066430d7dfdd9bd43bb717d2f6e" + ], + "f7": 44, + "f8": { + "A": {} + }, + "f9": { + "B": {} + }, + "f10": { + "C": { + "pos0": 45 + } + }, + "f11": { + "D": { + "x": "46" + } } } } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/enum_data.move b/crates/sui-graphql-e2e-tests/tests/objects/enum_data.move index 6f3a288f987e7..bd3e0a37f2467 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/enum_data.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/enum_data.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --addresses P0=0x0 P1=0x0 --accounts A --simulator --protocol-version 48 +//# init --addresses P0=0x0 P1=0x0 --accounts A --simulator --protocol-version 51 //# publish --upgradeable --sender A module P0::m { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp b/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp index 37fe3f2a5e20b..13e936b1defe6 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp @@ -15,7 +15,7 @@ mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 task 4 'run'. lines 15-17: -events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [47, 110, 138, 153, 188, 27, 152, 129, 24, 104, 150, 221, 204, 249, 164, 26, 86, 20, 242, 110, 225, 63, 55, 123, 107, 51, 205, 228, 29, 90, 126, 74, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) @@ -124,7 +124,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::CoinMetadata<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } @@ -168,7 +168,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } @@ -190,7 +190,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::CoinMetadata<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" } } } @@ -201,7 +201,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" } } } @@ -234,7 +234,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } @@ -256,7 +256,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } @@ -277,7 +277,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::CoinMetadata<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" } } } @@ -299,7 +299,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::CoinMetadata<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.move b/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.move index 1f6517ee1da8c..846ed646f9ca6 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator --accounts C +//# init --protocol-version 51 --simulator --accounts C // TODO: Short term hack to get around indexer epoch issue //# create-checkpoint diff --git a/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp b/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp index 99e666fb8da06..2e2e42dd4dff5 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp @@ -40,19 +40,19 @@ Response: { "objects": { "edges": [ { - "cursor": "IAMePMPOFpzY1IhbjiIiR5GHGkDqH4lvxSEJVZCkvtU7AQAAAAAAAAA=" + "cursor": "IA0aEaJEDlKDSC1RffR0g05xlej/ngllhWVEzxP/GJRzAQAAAAAAAAA=" }, { - "cursor": "IECijfeVROwCM/8FWCiVoroEXZe9gX7GjoLGsJgjdJzvAQAAAAAAAAA=" + "cursor": "ICQBOGJKQBVnTSjPn8d4hczgW9e+v+DLOnn6QGDo6U7zAQAAAAAAAAA=" }, { - "cursor": "IFAEpxUcBPE8F5z5yWlitHaYI2rliiS7w9fFhXssDaCpAQAAAAAAAAA=" + "cursor": "ID3HvUbFPVmeQdDWVsKCpPr3nh9mRKSj7N245yafRVURAQAAAAAAAAA=" }, { - "cursor": "IIqj/uDYsk1nEFODJBankuUXWrmCfKgDvU2P0GvVfnWmAQAAAAAAAAA=" + "cursor": "ILwUdsEdxfOAmqkMcN3XldEVIQbAQF/kmEzvivjUOCMYAQAAAAAAAAA=" }, { - "cursor": "IIvXcDAQ5RgKZu6eVQmb/412/LLX5dHwEFLgG2PJVptzAQAAAAAAAAA=" + "cursor": "IOilIztfYgbUm3NYHLbi80gIwVDLSHfs90ZoTKUdnHk9AQAAAAAAAAA=" } ] } @@ -67,10 +67,10 @@ Response: { "objects": { "edges": [ { - "cursor": "IAMePMPOFpzY1IhbjiIiR5GHGkDqH4lvxSEJVZCkvtU7AQAAAAAAAAA=" + "cursor": "IA0aEaJEDlKDSC1RffR0g05xlej/ngllhWVEzxP/GJRzAQAAAAAAAAA=" }, { - "cursor": "IECijfeVROwCM/8FWCiVoroEXZe9gX7GjoLGsJgjdJzvAQAAAAAAAAA=" + "cursor": "ICQBOGJKQBVnTSjPn8d4hczgW9e+v+DLOnn6QGDo6U7zAQAAAAAAAAA=" } ] } @@ -83,14 +83,7 @@ Response: { "data": { "address": { "objects": { - "edges": [ - { - "cursor": "IFAEpxUcBPE8F5z5yWlitHaYI2rliiS7w9fFhXssDaCpAQAAAAAAAAA=" - }, - { - "cursor": "IIqj/uDYsk1nEFODJBankuUXWrmCfKgDvU2P0GvVfnWmAQAAAAAAAAA=" - } - ] + "edges": [] } } } @@ -103,7 +96,10 @@ Response: { "objects": { "edges": [ { - "cursor": "IIvXcDAQ5RgKZu6eVQmb/412/LLX5dHwEFLgG2PJVptzAQAAAAAAAAA=" + "cursor": "ICQBOGJKQBVnTSjPn8d4hczgW9e+v+DLOnn6QGDo6U7zAQAAAAAAAAA=" + }, + { + "cursor": "ID3HvUbFPVmeQdDWVsKCpPr3nh9mRKSj7N245yafRVURAQAAAAAAAAA=" } ] } @@ -116,7 +112,11 @@ Response: { "data": { "address": { "objects": { - "edges": [] + "edges": [ + { + "cursor": "IA0aEaJEDlKDSC1RffR0g05xlej/ngllhWVEzxP/GJRzAQAAAAAAAAA=" + } + ] } } } @@ -129,10 +129,10 @@ Response: { "objects": { "edges": [ { - "cursor": "IIqj/uDYsk1nEFODJBankuUXWrmCfKgDvU2P0GvVfnWmAQAAAAAAAAA=" + "cursor": "ILwUdsEdxfOAmqkMcN3XldEVIQbAQF/kmEzvivjUOCMYAQAAAAAAAAA=" }, { - "cursor": "IIvXcDAQ5RgKZu6eVQmb/412/LLX5dHwEFLgG2PJVptzAQAAAAAAAAA=" + "cursor": "IOilIztfYgbUm3NYHLbi80gIwVDLSHfs90ZoTKUdnHk9AQAAAAAAAAA=" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/pagination.move b/crates/sui-graphql-e2e-tests/tests/objects/pagination.move index 3822ea5a94d4d..4416f8e4b95e1 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/pagination.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/pagination.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 A=0x42 --simulator +//# init --protocol-version 51 --addresses Test=0x0 A=0x42 --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp b/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp index 43da3204b0e34..dcd828d169cb8 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp @@ -30,10 +30,10 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0xc896d0db7835d08180ada6f21f1a74d90c4bf4722a6915fa3f03675e255fdf92::m::Bar" } }, - "hasPublicTransfer": true + "hasPublicTransfer": false } } }, @@ -42,7 +42,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0xbe62f7a823957b03180ce3bbc7499d12103309feca3a2e1d15c7acce28cdd0fa::m::Foo" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" } }, "hasPublicTransfer": true @@ -54,10 +54,10 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0xbe62f7a823957b03180ce3bbc7499d12103309feca3a2e1d15c7acce28cdd0fa::m::Bar" + "repr": "0xc896d0db7835d08180ada6f21f1a74d90c4bf4722a6915fa3f03675e255fdf92::m::Foo" } }, - "hasPublicTransfer": false + "hasPublicTransfer": true } } } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.move b/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.move index b8fd58bdd8ad5..576d7083afc65 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 --accounts A --simulator //# publish module P0::m { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/received.exp b/crates/sui-graphql-e2e-tests/tests/objects/received.exp index 50efd9a1df988..f85c9445db89a 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/received.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/received.exp @@ -26,7 +26,7 @@ Response: { "receivedTransactionBlocks": { "nodes": [ { - "digest": "D91wGNEf2KSxd2N6dEUHtGXitVJ1yNAF13JmKS3qhFj3" + "digest": "6stsHkPZxpZr1kuzuNCfUQJJh6fb27jWdnwEpBYX7uHL" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/received.move b/crates/sui-graphql-e2e-tests/tests/objects/received.move index 8c25043261725..5c6f949c841ac 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/received.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/received.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --simulator +//# init --protocol-version 51 --addresses P0=0x0 --simulator //# run-graphql { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp b/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp index 2cfc09da23889..a6ddedc93f234 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp @@ -9,7 +9,7 @@ Response: { "objects": { "edges": [ { - "cursor": "IJ9RseyeF9gF9ifznNScAt9vSXyjy+uFFy6FGnzmGEu9AAAAAAAAAAA=", + "cursor": "IJdddv7ctEE+DF5quWpbQy6Gbh1zoREdiDCwOweZutarAAAAAAAAAAA=", "node": { "asMoveObject": { "asStakedSui": { @@ -34,7 +34,7 @@ mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 task 3 'run'. lines 37-37: -events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [47, 110, 138, 153, 188, 27, 152, 129, 24, 104, 150, 221, 204, 249, 164, 26, 86, 20, 242, 110, 225, 63, 55, 123, 107, 51, 205, 228, 29, 90, 126, 74, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(3,0), object(3,1) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(_), object(2,0) @@ -52,34 +52,34 @@ Response: { "objects": { "edges": [ { - "cursor": "IJxvknKB0vTO11V48h8u7AZE1oSyjGlo/tJfMruC5UL3AgAAAAAAAAA=", + "cursor": "IAIBJktCWLXHqadKvg7cMsx5K2wvGEif2hRpCOa1abMjAgAAAAAAAAA=", "node": { "asMoveObject": { "asStakedSui": { "principal": "40000", - "poolId": "0x2f6e8a99bc1b9881186896ddccf9a41a5614f26ee13f377b6b33cde41d5a7e4a" + "poolId": "0x878df22326187cc356dbb27f6e28c99770a9a6b75db447d28d2523976e5e451d" } } } }, { - "cursor": "IJ9RseyeF9gF9ifznNScAt9vSXyjy+uFFy6FGnzmGEu9AgAAAAAAAAA=", + "cursor": "IIfCdVF/ksapbQZhjXV6RV32ZC1RPOn4asTmI03lIcvOAgAAAAAAAAA=", "node": { "asMoveObject": { "asStakedSui": { - "principal": "20000000000000000", - "poolId": "0x2f6e8a99bc1b9881186896ddccf9a41a5614f26ee13f377b6b33cde41d5a7e4a" + "principal": "10000000000", + "poolId": "0x878df22326187cc356dbb27f6e28c99770a9a6b75db447d28d2523976e5e451d" } } } }, { - "cursor": "IMCqYYUFtQgPF2vk6KmFReZSmEBb7bMyp4Gc9VWZO437AgAAAAAAAAA=", + "cursor": "IJdddv7ctEE+DF5quWpbQy6Gbh1zoREdiDCwOweZutarAgAAAAAAAAA=", "node": { "asMoveObject": { "asStakedSui": { - "principal": "10000000000", - "poolId": "0x2f6e8a99bc1b9881186896ddccf9a41a5614f26ee13f377b6b33cde41d5a7e4a" + "principal": "20000000000000000", + "poolId": "0x878df22326187cc356dbb27f6e28c99770a9a6b75db447d28d2523976e5e451d" } } } @@ -90,7 +90,7 @@ Response: { "stakedSuis": { "edges": [ { - "cursor": "IMCqYYUFtQgPF2vk6KmFReZSmEBb7bMyp4Gc9VWZO437AgAAAAAAAAA=", + "cursor": "IIfCdVF/ksapbQZhjXV6RV32ZC1RPOn4asTmI03lIcvOAgAAAAAAAAA=", "node": { "principal": "10000000000" } diff --git a/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.move b/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.move index 92c7c15e2bcd2..c34c07261b635 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.move +++ b/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator --accounts C +//# init --protocol-version 51 --simulator --accounts C //# run-graphql { # Initial query yields only the validator's stake diff --git a/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp b/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp index e625198f6e1c5..6d52a8d3b70f4 100644 --- a/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp +++ b/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp @@ -19,7 +19,7 @@ Response: { }, "coin": { "asObject": { - "digest": "5awQuF5aUf5G81GJp4h1kebfNmf9RczbBAYyfdsiQVz2" + "digest": "B7KFVrNkesXXKghMbvKQAwbfYzapa8FCkSQJV9ZxrYHT" } } } diff --git a/crates/sui-graphql-e2e-tests/tests/owner/downcasts.move b/crates/sui-graphql-e2e-tests/tests/owner/downcasts.move index 316df83140be1..bf15dd8f90902 100644 --- a/crates/sui-graphql-e2e-tests/tests/owner/downcasts.move +++ b/crates/sui-graphql-e2e-tests/tests/owner/downcasts.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 --accounts A --simulator // Split off a gas coin, so we have an object to query //# programmable --sender A --inputs 1000 @A diff --git a/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp b/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp index 7adb7699a7bb2..fe8ac6a65abf2 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp @@ -136,119 +136,232 @@ Response: { } task 2 'publish'. lines 56-66: -Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. -Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERSION, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } +created: object(2,0), object(2,1) +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 5981200, storage_rebate: 0, non_refundable_storage_fee: 0 task 3 'create-checkpoint'. lines 68-68: Checkpoint created: 1 task 4 'view-object'. lines 70-70: -Error: task 4, lines 70-70. Unbound fake id 2,0 +2,0::m task 5 'run-graphql'. lines 72-96: -Error: Unknown variable: obj_2_0 -Allowed variable mappings are { - "A": "@A", - "A_opt": "@A", - "P0": "0x0", - "P0_opt": "0x0", - "P1": "0x0", - "P1_opt": "0x0", - "bridge": "0xb", - "bridge_opt": "0xb", - "deepbook": "0xdee9", - "deepbook_opt": "0xdee9", - "obj_0_0": "object(0,0)", - "obj_0_0_opt": "object(0,0)", - "obj_0_1": "object(0,1)", - "obj_0_1_opt": "object(0,1)", - "std": "0x1", - "std_opt": "0x1", - "sui": "0x2", - "sui_opt": "0x2", - "sui_system": "0x3", - "sui_system_opt": "0x3", - "validator_0": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", - "validator_0_opt": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", +Response: { + "data": { + "object": { + "address": "0xd2fc664278ad66cd85ad423b87c88678bb8852a40640978a1dbe794e052cf0df", + "asMovePackage": { + "module": { + "datatypes": { + "nodes": [ + { + "name": "IsAStruct", + "abilities": [], + "typeParameters": [] + }, + { + "name": "IsAnEnum", + "abilities": [ + "COPY", + "DROP" + ], + "typeParameters": [] + } + ], + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": false + } + } + } + } + } + } } task 6 'run-graphql'. lines 98-143: -Error: Unknown variable: obj_2_0 -Allowed variable mappings are { - "A": "@A", - "A_opt": "@A", - "P0": "0x0", - "P0_opt": "0x0", - "P1": "0x0", - "P1_opt": "0x0", - "bridge": "0xb", - "bridge_opt": "0xb", - "deepbook": "0xdee9", - "deepbook_opt": "0xdee9", - "obj_0_0": "object(0,0)", - "obj_0_0_opt": "object(0,0)", - "obj_0_1": "object(0,1)", - "obj_0_1_opt": "object(0,1)", - "std": "0x1", - "std_opt": "0x1", - "sui": "0x2", - "sui_opt": "0x2", - "sui_system": "0x3", - "sui_system_opt": "0x3", - "validator_0": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", - "validator_0_opt": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", +Response: { + "data": { + "object": { + "address": "0xd2fc664278ad66cd85ad423b87c88678bb8852a40640978a1dbe794e052cf0df", + "asMovePackage": { + "module": { + "datatypes": { + "nodes": [ + { + "name": "IsAStruct", + "abilities": [], + "typeParameters": [], + "asMoveEnum": null, + "asMoveStruct": { + "fields": [ + { + "name": "x", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + }, + { + "name": "y", + "type": { + "repr": "bool", + "signature": { + "ref": null, + "body": "bool" + } + } + } + ] + } + }, + { + "name": "IsAnEnum", + "abilities": [ + "COPY", + "DROP" + ], + "typeParameters": [], + "asMoveEnum": { + "variants": [ + { + "name": "V1", + "fields": [ + { + "name": "pos0", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + }, + { + "name": "V2", + "fields": [ + { + "name": "x", + "type": { + "repr": "bool", + "signature": { + "ref": null, + "body": "bool" + } + } + }, + { + "name": "y", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + } + ] + }, + "asMoveStruct": null + } + ], + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": false + } + } + } + } + } + } } task 7 'run-graphql'. lines 145-174: -Error: Unknown variable: obj_2_0 -Allowed variable mappings are { - "A": "@A", - "A_opt": "@A", - "P0": "0x0", - "P0_opt": "0x0", - "P1": "0x0", - "P1_opt": "0x0", - "bridge": "0xb", - "bridge_opt": "0xb", - "deepbook": "0xdee9", - "deepbook_opt": "0xdee9", - "obj_0_0": "object(0,0)", - "obj_0_0_opt": "object(0,0)", - "obj_0_1": "object(0,1)", - "obj_0_1_opt": "object(0,1)", - "std": "0x1", - "std_opt": "0x1", - "sui": "0x2", - "sui_opt": "0x2", - "sui_system": "0x3", - "sui_system_opt": "0x3", - "validator_0": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", - "validator_0_opt": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", +Response: { + "data": { + "object": { + "asMovePackage": { + "module": { + "datatype": { + "name": "IsAnEnum", + "abilities": [ + "COPY", + "DROP" + ], + "typeParameters": [], + "asMoveEnum": { + "variants": [ + { + "name": "V1", + "fields": [ + { + "name": "pos0", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + }, + { + "name": "V2", + "fields": [ + { + "name": "x", + "type": { + "repr": "bool", + "signature": { + "ref": null, + "body": "bool" + } + } + }, + { + "name": "y", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + } + ] + } + } + } + } + } + } } task 8 'run-graphql'. lines 176-206: -Error: Unknown variable: obj_2_0 -Allowed variable mappings are { - "A": "@A", - "A_opt": "@A", - "P0": "0x0", - "P0_opt": "0x0", - "P1": "0x0", - "P1_opt": "0x0", - "bridge": "0xb", - "bridge_opt": "0xb", - "deepbook": "0xdee9", - "deepbook_opt": "0xdee9", - "obj_0_0": "object(0,0)", - "obj_0_0_opt": "object(0,0)", - "obj_0_1": "object(0,1)", - "obj_0_1_opt": "object(0,1)", - "std": "0x1", - "std_opt": "0x1", - "sui": "0x2", - "sui_opt": "0x2", - "sui_system": "0x3", - "sui_system_opt": "0x3", - "validator_0": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", - "validator_0_opt": "0xda83166d01afd7ddcf8af5f844f45aaa53f48548e5117c23f5a2978cfd422244", +Response: { + "data": { + "object": { + "asMovePackage": { + "module": { + "datatype": { + "name": "IsAStruct", + "abilities": [], + "typeParameters": [], + "asMoveEnum": null + } + } + } + } + } } diff --git a/crates/sui-graphql-e2e-tests/tests/packages/datatypes.move b/crates/sui-graphql-e2e-tests/tests/packages/datatypes.move index fbd5d98901c02..528fda040e329 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/datatypes.move +++ b/crates/sui-graphql-e2e-tests/tests/packages/datatypes.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --addresses P0=0x0 P1=0x0 --accounts A --simulator --protocol-version 48 +//# init --addresses P0=0x0 P1=0x0 --accounts A --simulator --protocol-version 51 //# run-graphql diff --git a/crates/sui-graphql-e2e-tests/tests/packages/enums.exp b/crates/sui-graphql-e2e-tests/tests/packages/enums.exp index 429026bf8d015..cbb2d101ad3d3 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/enums.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/enums.exp @@ -4,8 +4,9 @@ init: A: object(0,0) task 1 'publish'. lines 6-17: -Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. -Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERSION, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } +created: object(1,0), object(1,1) +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 5783600, storage_rebate: 0, non_refundable_storage_fee: 0 task 2 'create-checkpoint'. lines 19-19: Checkpoint created: 1 @@ -21,9 +22,74 @@ Response: { "nodes": [ { "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "address": "0x0483b83855b7046d6a5fc1dff0f25b77b1534d747c7319852c6b9d922c48df23", "asMovePackage": null } + }, + { + "outputState": { + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0xf3d86fb7e84350b48622005e24ff77cc59bf3b30d2855853030eb7528f3ad646", + "asMovePackage": { + "module": { + "enum": { + "name": "S", + "abilities": [ + "COPY", + "DROP" + ], + "typeParameters": [], + "variants": [ + { + "name": "V1", + "fields": [ + { + "name": "pos0", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + }, + { + "name": "V2", + "fields": [ + { + "name": "x", + "type": { + "repr": "bool", + "signature": { + "ref": null, + "body": "bool" + } + } + }, + { + "name": "y", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + } + ] + } + } + } + } } ] } @@ -35,7 +101,9 @@ Response: { } task 4 'upgrade'. lines 68-81: -Error: INVALID TEST. Unknown object, object(1,1) +created: object(4,0) +mutated: object(0,0), object(1,1) +gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 task 5 'create-checkpoint'. lines 83-83: Checkpoint created: 2 @@ -51,9 +119,158 @@ Response: { "nodes": [ { "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "address": "0x0483b83855b7046d6a5fc1dff0f25b77b1534d747c7319852c6b9d922c48df23", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", "asMovePackage": null } + }, + { + "outputState": { + "address": "0xfd70c6e4a3dba33764886514466b1063dc3005945c4792dd2c7b41b1dc3d4591", + "asMovePackage": { + "module": { + "s": { + "module": { + "package": { + "address": "0xf3d86fb7e84350b48622005e24ff77cc59bf3b30d2855853030eb7528f3ad646" + } + }, + "name": "S", + "abilities": [ + "COPY", + "DROP" + ], + "typeParameters": [], + "variants": [ + { + "name": "V1", + "fields": [ + { + "name": "pos0", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + }, + { + "name": "V2", + "fields": [ + { + "name": "x", + "type": { + "repr": "bool", + "signature": { + "ref": null, + "body": "bool" + } + } + }, + { + "name": "y", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + } + ] + } + ] + }, + "t": { + "module": { + "package": { + "address": "0xfd70c6e4a3dba33764886514466b1063dc3005945c4792dd2c7b41b1dc3d4591" + } + }, + "name": "T", + "abilities": [], + "typeParameters": [ + { + "constraints": [ + "DROP" + ], + "isPhantom": false + } + ], + "variants": [ + { + "name": "VV", + "fields": [ + { + "name": "y", + "type": { + "repr": "u64", + "signature": { + "ref": null, + "body": "u64" + } + } + }, + { + "name": "s", + "type": { + "repr": "0xf3d86fb7e84350b48622005e24ff77cc59bf3b30d2855853030eb7528f3ad646::m::S", + "signature": { + "ref": null, + "body": { + "datatype": { + "package": "0xf3d86fb7e84350b48622005e24ff77cc59bf3b30d2855853030eb7528f3ad646", + "module": "m", + "type": "S", + "typeParameters": [] + } + } + } + } + }, + { + "name": "u", + "type": { + "repr": "$0", + "signature": { + "ref": null, + "body": { + "typeParameter": 0 + } + } + } + } + ] + } + ] + }, + "v": { + "name": "V", + "variants": [ + { + "name": "V", + "fields": [ + { + "name": "t", + "type": { + "repr": "0xf3d86fb7e84350b48622005e24ff77cc59bf3b30d2855853030eb7528f3ad646::m::T<0xf3d86fb7e84350b48622005e24ff77cc59bf3b30d2855853030eb7528f3ad646::m::S>" + } + } + ] + } + ] + } + } + } + } } ] } @@ -77,6 +294,31 @@ Response: { "outputState": { "asMovePackage": null } + }, + { + "outputState": { + "asMovePackage": null + } + }, + { + "outputState": { + "asMovePackage": { + "module": { + "s": { + "module": { + "enum": null + } + }, + "t": { + "module": { + "enum": { + "name": "T" + } + } + } + } + } + } } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/packages/enums.move b/crates/sui-graphql-e2e-tests/tests/packages/enums.move index 0793fe90afeec..9bae15a9e8378 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/enums.move +++ b/crates/sui-graphql-e2e-tests/tests/packages/enums.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --addresses P0=0x0 P1=0x0 --accounts A --simulator --protocol-version 48 +//# init --addresses P0=0x0 P1=0x0 --accounts A --simulator --protocol-version 51 //# publish --upgradeable --sender A diff --git a/crates/sui-graphql-e2e-tests/tests/packages/friends.move b/crates/sui-graphql-e2e-tests/tests/packages/friends.move index 398c8fa1268d6..aa572774d2104 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/friends.move +++ b/crates/sui-graphql-e2e-tests/tests/packages/friends.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 P1=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 P1=0x0 --accounts A --simulator //# publish --upgradeable --sender A diff --git a/crates/sui-graphql-e2e-tests/tests/packages/functions.exp b/crates/sui-graphql-e2e-tests/tests/packages/functions.exp index 9605520e8b1d1..169fa18dbeda4 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/functions.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/functions.exp @@ -91,25 +91,19 @@ Response: { "nodes": [ { "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "address": "0x3719b3c504667a19c9e74ef201f80de7ec442c36168ec906f9c071eaea0c2310", "asMovePackage": null } }, { "outputState": { - "address": "0xf1c9c7ad1ffe43bc039571bb59e92cd999acb84357516f8b0e633478c2c52fa6", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0xfb7800a2d857fb6af5839c0517a94948c72d4d7b804a89e5d4173203a819b3d4", + "address": "0x3b0214c71a45ce74c853ec2b17a64ccbe92c09daaf2bc21a7f4a15a972a1e0e2", "asMovePackage": { "module": { "function": { "module": { "package": { - "address": "0xfb7800a2d857fb6af5839c0517a94948c72d4d7b804a89e5d4173203a819b3d4" + "address": "0x3b0214c71a45ce74c853ec2b17a64ccbe92c09daaf2bc21a7f4a15a972a1e0e2" } }, "name": "f", @@ -139,6 +133,12 @@ Response: { } } } + }, + { + "outputState": { + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "asMovePackage": null + } } ] } @@ -168,19 +168,25 @@ Response: { "nodes": [ { "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "address": "0x3719b3c504667a19c9e74ef201f80de7ec442c36168ec906f9c071eaea0c2310", "asMovePackage": null } }, { "outputState": { - "address": "0xf0babf7b922b2aebbccaeb88d0ae8ea3540f440b54cdc2081242d1b5c70c5789", + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x76ebf19f8ea6bfa546ad4517196f912bc1eaf5652752eeceb48d03a35340e49e", "asMovePackage": { "module": { "f": { "module": { "package": { - "address": "0xf0babf7b922b2aebbccaeb88d0ae8ea3540f440b54cdc2081242d1b5c70c5789" + "address": "0x76ebf19f8ea6bfa546ad4517196f912bc1eaf5652752eeceb48d03a35340e49e" } }, "name": "f", @@ -210,7 +216,7 @@ Response: { "g": { "module": { "package": { - "address": "0xf0babf7b922b2aebbccaeb88d0ae8ea3540f440b54cdc2081242d1b5c70c5789" + "address": "0x76ebf19f8ea6bfa546ad4517196f912bc1eaf5652752eeceb48d03a35340e49e" } }, "name": "g", @@ -227,12 +233,6 @@ Response: { } } } - }, - { - "outputState": { - "address": "0xf1c9c7ad1ffe43bc039571bb59e92cd999acb84357516f8b0e633478c2c52fa6", - "asMovePackage": null - } } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/packages/functions.move b/crates/sui-graphql-e2e-tests/tests/packages/functions.move index 5b064c1af022e..98367dd2bac01 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/functions.move +++ b/crates/sui-graphql-e2e-tests/tests/packages/functions.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 P1=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 P1=0x0 --accounts A --simulator //# run-graphql diff --git a/crates/sui-graphql-e2e-tests/tests/packages/modules.exp b/crates/sui-graphql-e2e-tests/tests/packages/modules.exp index 166654d85f46a..382ecd96ac6a9 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/modules.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/modules.exp @@ -19,25 +19,25 @@ Response: { "nodes": [ { "outputState": { - "address": "0x0fbc1d78ec040a294fee0c728b2523c70f60784b82645feadb34ccd2772eb5eb", + "address": "0x433fc1353e363ad6a756ce9711eb0b38604f070fd307869d009b884db80af456", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x90a54cf41ae1d22964b70cd0b3fa8a838341889a3610c2e797e0ff5de895cc11", "asMovePackage": { "module": { "name": "m", "package": { - "address": "0x0fbc1d78ec040a294fee0c728b2523c70f60784b82645feadb34ccd2772eb5eb" + "address": "0x90a54cf41ae1d22964b70cd0b3fa8a838341889a3610c2e797e0ff5de895cc11" }, "fileFormatVersion": 6, - "bytes": "oRzrCwYAAAAIAQAGAgYKAxARBCEEBSUfB0QiCGZADKYBMAAFAQMBBgEADAEAAQIBAgAABAABAQIAAgIBAAEHBQEBAAIEAAYCAwYLAAEJAAEDAQYLAAEIAQABCQABBgsAAQkAAQgBBENvaW4DU1VJA2JhcgRjb2luA2ZvbwFtA3N1aQV2YWx1ZQ+8HXjsBAopT+4McoslI8cPYHhLgmRf6ts0zNJ3LrXrAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAQAAAwULATgACwAWAgEBAAADCAYqAAAAAAAAAAoAOAEGKwAAAAAAAAALADgBGAIA", - "disassembly": "// Move bytecode v6\nmodule fbc1d78ec040a294fee0c728b2523c70f60784b82645feadb34ccd2772eb5eb.m {\nuse 0000000000000000000000000000000000000000000000000000000000000002::coin;\nuse 0000000000000000000000000000000000000000000000000000000000000002::sui;\n\n\n\n\n\n\npublic foo(Arg0: u64, Arg1: &Coin): u64 {\nB0:\n\t0: MoveLoc[1](Arg1: &Coin)\n\t1: Call coin::value(&Coin): u64\n\t2: MoveLoc[0](Arg0: u64)\n\t3: Add\n\t4: Ret\n\n}\npublic bar(Arg0: &Coin): u64 {\nB0:\n\t0: LdU64(42)\n\t1: CopyLoc[0](Arg0: &Coin)\n\t2: Call foo(u64, &Coin): u64\n\t3: LdU64(43)\n\t4: MoveLoc[0](Arg0: &Coin)\n\t5: Call foo(u64, &Coin): u64\n\t6: Mul\n\t7: Ret\n\n}\n}" + "bytes": "oRzrCwYAAAAIAQAGAgYKAxARBCEEBSUfB0QiCGZADKYBMAAFAQMBBgEADAEAAQIBAgAABAABAQIAAgIBAAEHBQEBAAIEAAYCAwYLAAEJAAEDAQYLAAEIAQABCQABBgsAAQkAAQgBBENvaW4DU1VJA2JhcgRjb2luA2ZvbwFtA3N1aQV2YWx1ZZClTPQa4dIpZLcM0LP6ioODQYiaNhDC55fg/13olcwRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAQAAAwULATgACwAWAgEBAAADCAYqAAAAAAAAAAoAOAEGKwAAAAAAAAALADgBGAIA", + "disassembly": "// Move bytecode v6\nmodule 90a54cf41ae1d22964b70cd0b3fa8a838341889a3610c2e797e0ff5de895cc11.m {\nuse 0000000000000000000000000000000000000000000000000000000000000002::coin;\nuse 0000000000000000000000000000000000000000000000000000000000000002::sui;\n\n\n\n\n\n\npublic foo(Arg0: u64, Arg1: &Coin): u64 {\nB0:\n\t0: MoveLoc[1](Arg1: &Coin)\n\t1: Call coin::value(&Coin): u64\n\t2: MoveLoc[0](Arg0: u64)\n\t3: Add\n\t4: Ret\n\n}\npublic bar(Arg0: &Coin): u64 {\nB0:\n\t0: LdU64(42)\n\t1: CopyLoc[0](Arg0: &Coin)\n\t2: Call foo(u64, &Coin): u64\n\t3: LdU64(43)\n\t4: MoveLoc[0](Arg0: &Coin)\n\t5: Call foo(u64, &Coin): u64\n\t6: Mul\n\t7: Ret\n\n}\n}" } } } - }, - { - "outputState": { - "address": "0xfe65744d7cd54aede5cf29427b7cd86c36aa6eece1e2c1dc021befbcc4daaf7b", - "asMovePackage": null - } } ] } @@ -59,7 +59,13 @@ Response: { "nodes": [ { "outputState": { - "address": "0x0fbc1d78ec040a294fee0c728b2523c70f60784b82645feadb34ccd2772eb5eb", + "address": "0x433fc1353e363ad6a756ce9711eb0b38604f070fd307869d009b884db80af456", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x90a54cf41ae1d22964b70cd0b3fa8a838341889a3610c2e797e0ff5de895cc11", "asMovePackage": { "all": { "edges": [ @@ -129,12 +135,6 @@ Response: { } } } - }, - { - "outputState": { - "address": "0xfe65744d7cd54aede5cf29427b7cd86c36aa6eece1e2c1dc021befbcc4daaf7b", - "asMovePackage": null - } } ] } @@ -156,7 +156,13 @@ Response: { "nodes": [ { "outputState": { - "address": "0x0fbc1d78ec040a294fee0c728b2523c70f60784b82645feadb34ccd2772eb5eb", + "address": "0x433fc1353e363ad6a756ce9711eb0b38604f070fd307869d009b884db80af456", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x90a54cf41ae1d22964b70cd0b3fa8a838341889a3610c2e797e0ff5de895cc11", "asMovePackage": { "prefix": { "edges": [ @@ -268,12 +274,6 @@ Response: { } } } - }, - { - "outputState": { - "address": "0xfe65744d7cd54aede5cf29427b7cd86c36aa6eece1e2c1dc021befbcc4daaf7b", - "asMovePackage": null - } } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/packages/modules.move b/crates/sui-graphql-e2e-tests/tests/packages/modules.move index 911314f98e8d7..026e987e26ba9 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/modules.move +++ b/crates/sui-graphql-e2e-tests/tests/packages/modules.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses pkg=0x0 --simulator +//# init --protocol-version 51 --addresses pkg=0x0 --simulator //# publish diff --git a/crates/sui-graphql-e2e-tests/tests/packages/structs.exp b/crates/sui-graphql-e2e-tests/tests/packages/structs.exp index 9b02cc4f1c7df..6a4c029955cb9 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/structs.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/structs.exp @@ -150,13 +150,7 @@ Response: { "nodes": [ { "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0x549a78d56640d7503e41f1d69f957c5c30aee431c92771ed562deda56ee39ebd", + "address": "0x0516a97c38ac8f8e7ec1fec2e1aa8a64a416adc4fc47815ab3fb51f0fa5d7301", "asMovePackage": { "module": { "struct": { @@ -185,7 +179,13 @@ Response: { }, { "outputState": { - "address": "0xc8095af4e59e2d213d344713d7e7338f51c64bad49ba1f1d876c6c2093fc488f", + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x767d679e36db949cb8fceeeba743a67487788b97c6a72db397d72d0840285bdf", "asMovePackage": null } } @@ -217,13 +217,25 @@ Response: { "nodes": [ { "outputState": { - "address": "0x2a81c2f91c61fb9ccf6a0e7b6fac1062330357e84a2cd0cf1709bec7022e9fd0", + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x767d679e36db949cb8fceeeba743a67487788b97c6a72db397d72d0840285bdf", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x8f225fe07ab4384f0078020cc6a83a00bf6fb186745fda4dcee2091e470a8fe0", "asMovePackage": { "module": { "s": { "module": { "package": { - "address": "0x549a78d56640d7503e41f1d69f957c5c30aee431c92771ed562deda56ee39ebd" + "address": "0x0516a97c38ac8f8e7ec1fec2e1aa8a64a416adc4fc47815ab3fb51f0fa5d7301" } }, "name": "S", @@ -248,7 +260,7 @@ Response: { "t": { "module": { "package": { - "address": "0x2a81c2f91c61fb9ccf6a0e7b6fac1062330357e84a2cd0cf1709bec7022e9fd0" + "address": "0x8f225fe07ab4384f0078020cc6a83a00bf6fb186745fda4dcee2091e470a8fe0" } }, "name": "T", @@ -275,12 +287,12 @@ Response: { { "name": "s", "type": { - "repr": "0x549a78d56640d7503e41f1d69f957c5c30aee431c92771ed562deda56ee39ebd::m::S", + "repr": "0x0516a97c38ac8f8e7ec1fec2e1aa8a64a416adc4fc47815ab3fb51f0fa5d7301::m::S", "signature": { "ref": null, "body": { "datatype": { - "package": "0x549a78d56640d7503e41f1d69f957c5c30aee431c92771ed562deda56ee39ebd", + "package": "0x0516a97c38ac8f8e7ec1fec2e1aa8a64a416adc4fc47815ab3fb51f0fa5d7301", "module": "m", "type": "S", "typeParameters": [] @@ -309,7 +321,7 @@ Response: { { "name": "t", "type": { - "repr": "0x549a78d56640d7503e41f1d69f957c5c30aee431c92771ed562deda56ee39ebd::m::T<0x549a78d56640d7503e41f1d69f957c5c30aee431c92771ed562deda56ee39ebd::m::S>" + "repr": "0x0516a97c38ac8f8e7ec1fec2e1aa8a64a416adc4fc47815ab3fb51f0fa5d7301::m::T<0x0516a97c38ac8f8e7ec1fec2e1aa8a64a416adc4fc47815ab3fb51f0fa5d7301::m::S>" } } ] @@ -317,18 +329,6 @@ Response: { } } } - }, - { - "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0xc8095af4e59e2d213d344713d7e7338f51c64bad49ba1f1d876c6c2093fc488f", - "asMovePackage": null - } } ] } @@ -348,6 +348,16 @@ Response: { "effects": { "objectChanges": { "nodes": [ + { + "outputState": { + "asMovePackage": null + } + }, + { + "outputState": { + "asMovePackage": null + } + }, { "outputState": { "asMovePackage": { @@ -367,16 +377,6 @@ Response: { } } } - }, - { - "outputState": { - "asMovePackage": null - } - }, - { - "outputState": { - "asMovePackage": null - } } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/packages/structs.move b/crates/sui-graphql-e2e-tests/tests/packages/structs.move index 5aca6002c1731..e43d9b7bcad2b 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/structs.move +++ b/crates/sui-graphql-e2e-tests/tests/packages/structs.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 P1=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 P1=0x0 --accounts A --simulator //# run-graphql diff --git a/crates/sui-graphql-e2e-tests/tests/packages/types.exp b/crates/sui-graphql-e2e-tests/tests/packages/types.exp index 380cace5b2b28..67b889c9be97a 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/types.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/types.exp @@ -264,7 +264,7 @@ Response: { "data": null, "errors": [ { - "message": "Internal error occurred while processing request: Error calculating layout for 0x937399b0bcc43b07718b65310d7a07e0e695b7dbc931f9f6cba27139f274bde1::m::S1: Type layout nesting exceeded limit of 128", + "message": "Internal error occurred while processing request: Error calculating layout for 0xce4a112d19a8f3e6b79c995b88f08fba7526973082fa9e2b871fdc7ddefc9e45::m::S1: Type layout nesting exceeded limit of 128", "locations": [ { "line": 4, diff --git a/crates/sui-graphql-e2e-tests/tests/packages/types.move b/crates/sui-graphql-e2e-tests/tests/packages/types.move index 45e6dc5dfa30e..63cc873130d7d 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/types.move +++ b/crates/sui-graphql-e2e-tests/tests/packages/types.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --simulator +//# init --protocol-version 51 --addresses P0=0x0 --simulator //# run-graphql # Happy path -- valid type, get everything diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.move b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.move index 93bc601a5e098..440a303b66b7a 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.move +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator --accounts C O P Q R S +//# init --protocol-version 51 --simulator --accounts C O P Q R S //# programmable --sender C --inputs @C 1000 2000 3000 4000 5000 //> SplitCoins(Gas, [Input(1), Input(2), Input(3), Input(4), Input(5)]); diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp index 0b3d18fd9e086..67cf6d574545b 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp @@ -51,7 +51,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "HLyukKeMLQ9thMNQ1LwQcADrAW8McDCxNAyB1185aXmk", + "digest": "6c1VrCKixZoK9Pmhna8fGzeSnmuYFcd3DR3n7mk44iKm", "effects": { "dependencies": { "pageInfo": { @@ -64,25 +64,7 @@ Response: { { "cursor": "eyJpIjowLCJjIjoxfQ", "node": { - "digest": "AmCr9Zq9BDfcyBLvmfXYNkh4uaXmLKbgP4AqdFQj13Nq", - "kind": { - "__typename": "ProgrammableTransactionBlock", - "transactions": { - "nodes": [ - {}, - { - "module": "package", - "functionName": "make_immutable" - } - ] - } - } - } - }, - { - "cursor": "eyJpIjoxLCJjIjoxfQ", - "node": { - "digest": "BrQ7RFvpq59mcoQcnjoWCkPtkhf5cJndi5uPAgmY6R2L", + "digest": "TCVU1ZmKsviJsuhqvpS76f6X8qKoN2eH7VfrhQ2c4Gf", "kind": { "__typename": "ProgrammableTransactionBlock", "transactions": { @@ -107,6 +89,24 @@ Response: { } } } + }, + { + "cursor": "eyJpIjoxLCJjIjoxfQ", + "node": { + "digest": "3S1Bm2ipnoGVsCTMfGrRMzgEFShwfS7huM3KWJ8MMf1P", + "kind": { + "__typename": "ProgrammableTransactionBlock", + "transactions": { + "nodes": [ + {}, + { + "module": "package", + "functionName": "make_immutable" + } + ] + } + } + } } ] } @@ -123,7 +123,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "HLyukKeMLQ9thMNQ1LwQcADrAW8McDCxNAyB1185aXmk", + "digest": "6c1VrCKixZoK9Pmhna8fGzeSnmuYFcd3DR3n7mk44iKm", "effects": { "dependencies": { "pageInfo": { @@ -136,26 +136,15 @@ Response: { { "cursor": "eyJpIjoxLCJjIjoxfQ", "node": { - "digest": "BrQ7RFvpq59mcoQcnjoWCkPtkhf5cJndi5uPAgmY6R2L", + "digest": "3S1Bm2ipnoGVsCTMfGrRMzgEFShwfS7huM3KWJ8MMf1P", "kind": { "__typename": "ProgrammableTransactionBlock", "transactions": { "nodes": [ + {}, { - "module": "M1", - "functionName": "sum" - }, - { - "module": "M1", - "functionName": "sum" - }, - { - "module": "M1", - "functionName": "sum" - }, - { - "module": "M1", - "functionName": "create" + "module": "package", + "functionName": "make_immutable" } ] } diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.move b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.move index d22118a482f74..d8521d77d53d1 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.move +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.move b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.move index 084c2d34b750c..332923f207378 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.move +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses Test=0x0 --accounts A --simulator //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.move b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.move index 80dfa3c62d458..7ab3118e9c4b3 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.move +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses Test=0x0 A=0x42 --simulator --custom-validator-account --reference-gas-price 234 --default-gas-price 1000 +//# init --protocol-version 51 --addresses Test=0x0 A=0x42 --simulator --custom-validator-account --reference-gas-price 234 --default-gas-price 1000 //# publish module Test::M1 { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp b/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp index 07fc1a94d8d55..6dced09578f47 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp @@ -20,7 +20,7 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x35e5dca0ba845a32259958cef96aa7d05d910e1c2c5f6151cdf8dc183c988acb::m::boom' (instruction 1), abort code: 42" + "errors": "Error in 1st command, from '0xf3d0d32cbacdccefba19a343e281fec9846e3b4bab89bd11d54fcb9a2630e82a::m::boom' (instruction 1), abort code: 42" } } ] @@ -43,7 +43,7 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 3rd command, from '0x35e5dca0ba845a32259958cef96aa7d05d910e1c2c5f6151cdf8dc183c988acb::m::boom' (instruction 1), abort code: 42" + "errors": "Error in 3rd command, from '0xf3d0d32cbacdccefba19a343e281fec9846e3b4bab89bd11d54fcb9a2630e82a::m::boom' (instruction 1), abort code: 42" } } ] diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/errors.move b/crates/sui-graphql-e2e-tests/tests/transactions/errors.move index 8c27911be0969..19907bd35b87b 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/errors.move +++ b/crates/sui-graphql-e2e-tests/tests/transactions/errors.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --simulator +//# init --protocol-version 51 --addresses P0=0x0 --simulator //# publish diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp b/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp index 8bbb17315dd14..448059f04b6aa 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp @@ -17,12 +17,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "AD5r6DuehhRWarqfvXLyB13kQpVpXZjTVKutFZSEp8DQ", + "digest": "2z8R3K3FveqEYu8uQEHofD68KF12bxGXLfG6DULEZEpq", "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" }, "signatures": [ - "ADGNKoothBXKZVpMBVqUopxTxi1VSJ86Ke25pTxyDDpQv3znSF5i0cph8lEUKWDNd9Vnl5UdFj0NWsWbsdajTAN/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "ANwYUV89z+5bMI91fUHN/aZ+AtQzAO33sDCQ888nfwgW46sCqQG+RbrbIu6/AEFnz2p9yW0pz+XTcTwWskzYmwl/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -31,7 +31,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" } ] }, @@ -93,7 +93,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "4U25VGAB2VkWrQVcYHmhcJ1auBMoR6wGJ1XkAVWThvRR" + "digest": "FPhSSzT7tHmrPhs3H9GT1n4Dqj3eyCgaFLkQSc9FEDVV" } ] }, @@ -113,37 +113,37 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", - "digest": "5Ywn6F3JBRTso4V1S1FEipR6mbEty4GsBANZgoFeHaFb" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "digest": "kjCRJ5Lmb2vp8gEsYtvFJVVn7EUzJkXRUZA9sHVyqbx" } }, { - "address": "0x5e3e5ecc6365ea39407ba44f395862cf54937699b9bd927e65ccc173c8425403", + "address": "0x55dc30270cd2176aa589a56b841b22e5aa5c820b5512d3f5ce4182ad89c7d7c1", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x5e3e5ecc6365ea39407ba44f395862cf54937699b9bd927e65ccc173c8425403", - "digest": "FFyM74voKhLHXP73eCkhKUBGPH45ZF66gwABH6ypQ96B" + "address": "0x55dc30270cd2176aa589a56b841b22e5aa5c820b5512d3f5ce4182ad89c7d7c1", + "digest": "FP1o2La2EQniZ7QHbcDqU1i8VJVt5NZYZbv51h2Gr25r" } }, { - "address": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65", + "address": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65", - "digest": "F63R6pTeRTcGmPSMuxAnGsq9mKeSxJfiyLPSiUhfX21J" + "address": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229", + "digest": "5bJNmRnMAjj8DAYkq3PZxF2jjq3Q8AyTVwK1G4vaff2v" } } ] }, "gasEffects": { "gasObject": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" }, "gasSummary": { "computationCost": "1000000", @@ -160,7 +160,7 @@ Response: { "sequenceNumber": 1 }, "transactionBlock": { - "digest": "AD5r6DuehhRWarqfvXLyB13kQpVpXZjTVKutFZSEp8DQ" + "digest": "2z8R3K3FveqEYu8uQEHofD68KF12bxGXLfG6DULEZEpq" } }, "expiration": null @@ -184,12 +184,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "12w8soicrAp7ZL6mvHSQw7z2w9atZZ2nHJJQqZMux3tp", + "digest": "HVYsG3xnX2HB1V1Lq1yKidoskDi2SSunhXxctfUdPjHK", "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" }, "signatures": [ - "AC+GC4o8O/f6NL6NE1JblSDctDzUgIiQkescL5h/8Bkf5Tc2OcxjEyecOTb+jmb6AzOVrnm1Twz5lyyA/kEARgl/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "AI0EJMdZGqYdx8OAIpix0M/d42qinv2tojreG1cUARbkVNXP68UOa9H5Q0GUaiZuRBkZ7mcULGMlwamTjKYnIQ5/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -198,7 +198,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" } ] }, @@ -213,21 +213,21 @@ Response: { "cursor": "eyJpIjowLCJjIjoyfQ", "node": { "__typename": "OwnedOrImmutable", - "address": "0x5e3e5ecc6365ea39407ba44f395862cf54937699b9bd927e65ccc173c8425403", + "address": "0x55dc30270cd2176aa589a56b841b22e5aa5c820b5512d3f5ce4182ad89c7d7c1", "version": 2, - "digest": "FFyM74voKhLHXP73eCkhKUBGPH45ZF66gwABH6ypQ96B", + "digest": "FP1o2La2EQniZ7QHbcDqU1i8VJVt5NZYZbv51h2Gr25r", "object": { - "address": "0x5e3e5ecc6365ea39407ba44f395862cf54937699b9bd927e65ccc173c8425403", + "address": "0x55dc30270cd2176aa589a56b841b22e5aa5c820b5512d3f5ce4182ad89c7d7c1", "version": 2, - "digest": "FFyM74voKhLHXP73eCkhKUBGPH45ZF66gwABH6ypQ96B", + "digest": "FP1o2La2EQniZ7QHbcDqU1i8VJVt5NZYZbv51h2Gr25r", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::package::UpgradeCap" }, "json": { - "id": "0x5e3e5ecc6365ea39407ba44f395862cf54937699b9bd927e65ccc173c8425403", - "package": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65", + "id": "0x55dc30270cd2176aa589a56b841b22e5aa5c820b5512d3f5ce4182ad89c7d7c1", + "package": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229", "version": "1", "policy": 0 } @@ -309,7 +309,7 @@ Response: { "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000002" ], - "currentPackage": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65", + "currentPackage": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229", "upgradeTicket": { "__typename": "Result", "cmd": 0, @@ -361,10 +361,10 @@ Response: { "dependencies": { "nodes": [ { - "digest": "4U25VGAB2VkWrQVcYHmhcJ1auBMoR6wGJ1XkAVWThvRR" + "digest": "2z8R3K3FveqEYu8uQEHofD68KF12bxGXLfG6DULEZEpq" }, { - "digest": "AD5r6DuehhRWarqfvXLyB13kQpVpXZjTVKutFZSEp8DQ" + "digest": "FPhSSzT7tHmrPhs3H9GT1n4Dqj3eyCgaFLkQSc9FEDVV" } ] }, @@ -384,37 +384,37 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", - "digest": "4uLgbe1sSbz6VxHCpW8TT8pSiCqXsFDd2ricDZXzjjno" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "digest": "CGMDfx56DmkYu5d7WdRyqu2Ez1kmi73NrV2Zvk2jidrg" } }, { - "address": "0x5e3e5ecc6365ea39407ba44f395862cf54937699b9bd927e65ccc173c8425403", + "address": "0x55dc30270cd2176aa589a56b841b22e5aa5c820b5512d3f5ce4182ad89c7d7c1", "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x5e3e5ecc6365ea39407ba44f395862cf54937699b9bd927e65ccc173c8425403", - "digest": "FEvsHqXF8VrgstibcntVYGVFBsbr5cEVMRMqB4w4dijd" + "address": "0x55dc30270cd2176aa589a56b841b22e5aa5c820b5512d3f5ce4182ad89c7d7c1", + "digest": "7tDvS384jbXCPVk6m7PabFnS5g5iZyAJXYjSEFkHHFJv" } }, { - "address": "0xa46e8e45f4844aca3ded4db9a1bf2e57ef9193ab6367ada58060d191bd8ca105", + "address": "0xe176ab1e83e4de5c347124ac909f8e0b15306c041ce6ef946a3db16e00e51cd2", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xa46e8e45f4844aca3ded4db9a1bf2e57ef9193ab6367ada58060d191bd8ca105", - "digest": "2898ecAyq6gLiNKuGsyUgbWFAMZhovcchGNfphNtsGqq" + "address": "0xe176ab1e83e4de5c347124ac909f8e0b15306c041ce6ef946a3db16e00e51cd2", + "digest": "A4L9QBT9UcKHoCCw1dpkwb98afXTeJ38YMEcZ25R23iK" } } ] }, "gasEffects": { "gasObject": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" }, "gasSummary": { "computationCost": "1000000", @@ -431,7 +431,7 @@ Response: { "sequenceNumber": 2 }, "transactionBlock": { - "digest": "12w8soicrAp7ZL6mvHSQw7z2w9atZZ2nHJJQqZMux3tp" + "digest": "HVYsG3xnX2HB1V1Lq1yKidoskDi2SSunhXxctfUdPjHK" } }, "expiration": null @@ -460,12 +460,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "7DQpTQbZ2bcCgE1y7meWquPeeMHFqVCXrxCFPtQCDCLo", + "digest": "4rfsnPECHa33SJmKgRtiG5jMUtzRfW3krDbXE6i69R1f", "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" }, "signatures": [ - "AI7FRy26oEy9FeyVVWh5GgsUWXwlGGEN28rbHRGEYfhWYScJYxlUeXzZISWiGuDcGJ+8mTbvIWnvI2G757BnVw9/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "ANivhRi5cXgXRm5M6aTSonvv9C7KSi9Cp6/ufsW4NUr8tyIgJ+CfsVRObqTHqjOSh6LhoxGBevpx3TTuaxbtIwl/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -474,7 +474,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" } ] }, @@ -569,7 +569,7 @@ Response: { "cursor": "eyJpIjozLCJjIjozfQ", "node": { "__typename": "MoveCallTransaction", - "package": "0xa46e8e45f4844aca3ded4db9a1bf2e57ef9193ab6367ada58060d191bd8ca105", + "package": "0xe176ab1e83e4de5c347124ac909f8e0b15306c041ce6ef946a3db16e00e51cd2", "module": "m", "functionName": "new", "typeArguments": [], @@ -593,7 +593,7 @@ Response: { ], "return": [ { - "repr": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65::m::Foo" + "repr": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229::m::Foo" } ] } @@ -620,7 +620,7 @@ Response: { "cursor": "eyJpIjo1LCJjIjozfQ", "node": { "__typename": "MoveCallTransaction", - "package": "0xa46e8e45f4844aca3ded4db9a1bf2e57ef9193ab6367ada58060d191bd8ca105", + "package": "0xe176ab1e83e4de5c347124ac909f8e0b15306c041ce6ef946a3db16e00e51cd2", "module": "m", "functionName": "new", "typeArguments": [], @@ -644,7 +644,7 @@ Response: { ], "return": [ { - "repr": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65::m::Foo" + "repr": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229::m::Foo" } ] } @@ -654,7 +654,7 @@ Response: { "cursor": "eyJpIjo2LCJjIjozfQ", "node": { "__typename": "MoveCallTransaction", - "package": "0xa46e8e45f4844aca3ded4db9a1bf2e57ef9193ab6367ada58060d191bd8ca105", + "package": "0xe176ab1e83e4de5c347124ac909f8e0b15306c041ce6ef946a3db16e00e51cd2", "module": "m", "functionName": "burn", "typeArguments": [], @@ -670,7 +670,7 @@ Response: { "typeParameters": [], "parameters": [ { - "repr": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65::m::Foo" + "repr": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229::m::Foo" } ], "return": [] @@ -722,10 +722,10 @@ Response: { "dependencies": { "nodes": [ { - "digest": "12w8soicrAp7ZL6mvHSQw7z2w9atZZ2nHJJQqZMux3tp" + "digest": "4CaXvVMNtoN5TsoAr4PNVqeyNyKxsPBYfMc2xft186za" }, { - "digest": "FRXP4AWC24t9cyuvx3fLJzTendJfJDQh26PhPAa1PuRc" + "digest": "HVYsG3xnX2HB1V1Lq1yKidoskDi2SSunhXxctfUdPjHK" } ] }, @@ -745,66 +745,66 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x039e91d1a6f8f6a4c01e7ed6eea2b91e862d3f14d2b12e1f5613a5c445da07c3", + "address": "0x415d1a8f1c0f77babcffd7501d08c217793e54f7ec3671a96e30c76d363c16f8", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x039e91d1a6f8f6a4c01e7ed6eea2b91e862d3f14d2b12e1f5613a5c445da07c3", - "digest": "68MBVpk25Gx6Rern6UUZ3aTNpNYLerErHd5dT5npp1uW", + "address": "0x415d1a8f1c0f77babcffd7501d08c217793e54f7ec3671a96e30c76d363c16f8", + "digest": "BosmruMc6qKmDNAUqGKFJXYqTQXTZtN4wHVCuQX1bEwJ", "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + "repr": "0xb789be0d5527eed3ace9b7571d034f2b073dfe2d50dc34cf0688a55fd7b38229::m::Foo" }, "json": { - "id": "0x039e91d1a6f8f6a4c01e7ed6eea2b91e862d3f14d2b12e1f5613a5c445da07c3", - "balance": { - "value": "2000" - } + "id": "0x415d1a8f1c0f77babcffd7501d08c217793e54f7ec3671a96e30c76d363c16f8", + "xs": [ + "42", + "43" + ] } } } } }, { - "address": "0x087252627c8fe46ec97da80407dc35fd443eada90cf503d2ad20cab0120d8079", - "idCreated": true, + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x087252627c8fe46ec97da80407dc35fd443eada90cf503d2ad20cab0120d8079", - "digest": "3savw2P6dexfwVNPGMdQ3hbiWWWpmACn91DdcqUZ5jXQ", + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "digest": "Gf4AAahrjr98CEN5bhRjuvxk2e1TcFgAmfkrKRuk1oke", "asMoveObject": { "contents": { "type": { - "repr": "0xf1a1e05b288f8bf79d49867125e72e9480a3ccdd812aee48885097c76adb2f65::m::Foo" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x087252627c8fe46ec97da80407dc35fd443eada90cf503d2ad20cab0120d8079", - "xs": [ - "42", - "43" - ] + "id": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "balance": { + "value": "299999982036420" + } } } } } }, { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", - "idCreated": false, + "address": "0x642b7cee5f1f53933dd37aa5bf5bf33eab6e8edbec2f92a5ea9f26be5e6e3d5c", + "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", - "digest": "CRyrVBSrVHDbCLfAjhF3T89QgUd9SapXKWxKAsa9HCjr", + "address": "0x642b7cee5f1f53933dd37aa5bf5bf33eab6e8edbec2f92a5ea9f26be5e6e3d5c", + "digest": "GMF5ivkdwCQKR1dHFfe4G1QPmZsCLTJr3TYYu3LeBzwF", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "id": "0x642b7cee5f1f53933dd37aa5bf5bf33eab6e8edbec2f92a5ea9f26be5e6e3d5c", "balance": { - "value": "299999982036420" + "value": "2000" } } } @@ -815,7 +815,7 @@ Response: { }, "gasEffects": { "gasObject": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" }, "gasSummary": { "computationCost": "1000000", @@ -832,7 +832,7 @@ Response: { "sequenceNumber": 3 }, "transactionBlock": { - "digest": "7DQpTQbZ2bcCgE1y7meWquPeeMHFqVCXrxCFPtQCDCLo" + "digest": "4rfsnPECHa33SJmKgRtiG5jMUtzRfW3krDbXE6i69R1f" } }, "expiration": null @@ -855,12 +855,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "GLqTkfeipop4ekcbipD716cgbgHDDsoaKkKw3JYcmoQq", + "digest": "Ftcau3caUjCpLSVrFY939RiR71erzB8sQm4LpPMavZzq", "sender": { "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" }, "signatures": [ - "AIPfNdk697t2jLWQa7tIjCwbTYBH5ieg8cUSGV8U8sb4FLIWOChQnckdeFim2tYW3nZNGVXTL9xfwkNZckqJNQ1/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "AKQ/cyAe+zkXx7pF9PLtieLB97theSGy4d9czFOhpINndZQeRMRKzpisP9rtTsS9tcKplemlLHX3et74DExEhgB/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -869,7 +869,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" } ] }, @@ -916,7 +916,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "7DQpTQbZ2bcCgE1y7meWquPeeMHFqVCXrxCFPtQCDCLo" + "digest": "4rfsnPECHa33SJmKgRtiG5jMUtzRfW3krDbXE6i69R1f" } ] }, @@ -936,19 +936,19 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab", - "digest": "GPjGjSSHe43MD9b8C4kde7jMNymK35fn4wH2LWeE4hqf" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb", + "digest": "BK2CZS8rs1mJUeLy5fdfP4gupusdMn3HjjEYDZxnc175" } } ] }, "gasEffects": { "gasObject": { - "address": "0x53b63659f4910b0563575a85dca3254f1eb41bd6f8235cf2508ee6c18f4293ab" + "address": "0x53eaddee260f724b981b7b53658dcd981214bc2ccffe988cff73f6a04f46a9bb" }, "gasSummary": { "computationCost": "1000000", @@ -965,7 +965,7 @@ Response: { "sequenceNumber": 4 }, "transactionBlock": { - "digest": "GLqTkfeipop4ekcbipD716cgbgHDDsoaKkKw3JYcmoQq" + "digest": "Ftcau3caUjCpLSVrFY939RiR71erzB8sQm4LpPMavZzq" } }, "expiration": null diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/programmable.move b/crates/sui-graphql-e2e-tests/tests/transactions/programmable.move index ec03f7bd1bb12..39bba91810a74 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/programmable.move +++ b/crates/sui-graphql-e2e-tests/tests/transactions/programmable.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 P1=0x0 --accounts A --simulator +//# init --protocol-version 51 --addresses P0=0x0 P1=0x0 --accounts A --simulator //# publish --upgradeable --sender A module P0::m { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/random.exp b/crates/sui-graphql-e2e-tests/tests/transactions/random.exp index e1fb9cf9d5320..5dd2f349140e0 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/random.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/random.exp @@ -11,7 +11,7 @@ Response: { "data": { "epoch": { "protocolConfigs": { - "protocolVersion": 48, + "protocolVersion": 51, "randomBeacon": { "value": true } @@ -28,7 +28,7 @@ Response: { "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000008", "inner": { - "id": "0xa02463986ebfae3b6897e502c4194b64bfefa1740e56bdde09992f89c3eed995", + "id": "0xeab190dea45779ed5f2cdd9191c485333236b441d7488fb0676dac4959fbd383", "version": "1" } } diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/random.move b/crates/sui-graphql-e2e-tests/tests/transactions/random.move index 1211830cc0272..79f5ba786e3d9 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/random.move +++ b/crates/sui-graphql-e2e-tests/tests/transactions/random.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator +//# init --protocol-version 51 --simulator //# create-checkpoint diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp b/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp index 2911fad22f378..d0bf06f0906e4 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp @@ -32,7 +32,7 @@ Response: { "transactions": { "nodes": [ { - "package": "0x7278306be47498a54e3c13e217967fb85179603767c1cf5dd2c0bc82934821a0", + "package": "0x3e10a8ac7dbcff9240d654e0c753ddbf16218e4a20f7f7600a734e1d6f784928", "module": "m", "functionName": "get" } @@ -45,17 +45,17 @@ Response: { "nodes": [ { "__typename": "SharedObjectRead", - "address": "0x2472a863b869f946b47f849d192b43c6e986713f22e98d9eca1c61dcbaf126d6", + "address": "0x563d2842f82166a5603cfc2374792b4eef15b571ab3cc3066a869cd991ebf144", "version": 2, - "digest": "9BKFVpwXjU9HWxqWpLjcE4vdPu7ksxKunBkKEHiyzVbK", + "digest": "Gp5Rr2Nuy61twdaS5SLnyThvnFpQRAE8ZpaNYzaFD7Yo", "object": { "asMoveObject": { "contents": { "type": { - "repr": "0x7278306be47498a54e3c13e217967fb85179603767c1cf5dd2c0bc82934821a0::m::Foo" + "repr": "0x3e10a8ac7dbcff9240d654e0c753ddbf16218e4a20f7f7600a734e1d6f784928::m::Foo" }, "json": { - "id": "0x2472a863b869f946b47f849d192b43c6e986713f22e98d9eca1c61dcbaf126d6", + "id": "0x563d2842f82166a5603cfc2374792b4eef15b571ab3cc3066a869cd991ebf144", "x": "0" } } @@ -72,7 +72,7 @@ Response: { "transactions": { "nodes": [ { - "package": "0x7278306be47498a54e3c13e217967fb85179603767c1cf5dd2c0bc82934821a0", + "package": "0x3e10a8ac7dbcff9240d654e0c753ddbf16218e4a20f7f7600a734e1d6f784928", "module": "m", "functionName": "inc" } @@ -92,12 +92,12 @@ Response: { "transactions": { "nodes": [ { - "package": "0x7278306be47498a54e3c13e217967fb85179603767c1cf5dd2c0bc82934821a0", + "package": "0x3e10a8ac7dbcff9240d654e0c753ddbf16218e4a20f7f7600a734e1d6f784928", "module": "m", "functionName": "get" }, { - "package": "0x7278306be47498a54e3c13e217967fb85179603767c1cf5dd2c0bc82934821a0", + "package": "0x3e10a8ac7dbcff9240d654e0c753ddbf16218e4a20f7f7600a734e1d6f784928", "module": "m", "functionName": "inc" } diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/shared.move b/crates/sui-graphql-e2e-tests/tests/transactions/shared.move index 06d63e613655a..193ce19001658 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/shared.move +++ b/crates/sui-graphql-e2e-tests/tests/transactions/shared.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --addresses P0=0x0 --simulator +//# init --protocol-version 51 --addresses P0=0x0 --simulator //# publish module P0::m { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/system.exp b/crates/sui-graphql-e2e-tests/tests/transactions/system.exp index f3bc91ee125b6..b1b30792c3090 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/system.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/system.exp @@ -6,7 +6,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3", + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH", "sender": null, "signatures": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" @@ -75,6 +75,12 @@ Response: { "name": "hash" } }, + { + "cursor": "eyJuIjoibWFjcm9zIiwiYyI6MH0", + "node": { + "name": "macros" + } + }, { "cursor": "eyJuIjoib3B0aW9uIiwiYyI6MH0", "node": { @@ -93,6 +99,42 @@ Response: { "name": "type_name" } }, + { + "cursor": "eyJuIjoidTEyOCIsImMiOjB9", + "node": { + "name": "u128" + } + }, + { + "cursor": "eyJuIjoidTE2IiwiYyI6MH0", + "node": { + "name": "u16" + } + }, + { + "cursor": "eyJuIjoidTI1NiIsImMiOjB9", + "node": { + "name": "u256" + } + }, + { + "cursor": "eyJuIjoidTMyIiwiYyI6MH0", + "node": { + "name": "u32" + } + }, + { + "cursor": "eyJuIjoidTY0IiwiYyI6MH0", + "node": { + "name": "u64" + } + }, + { + "cursor": "eyJuIjoidTgiLCJjIjowfQ", + "node": { + "name": "u8" + } + }, { "cursor": "eyJuIjoidmVjdG9yIiwiYyI6MH0", "node": { @@ -382,7 +424,7 @@ Response: { "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000008", "inner": { - "id": "0x0cadcc77cc471d6360d6c8548de9656eb3fca52ef208e6e3a18123f0df9dcea7", + "id": "0xd0c662aff1cf5019e000a109cf7aa51c08e7754f04d418b177a054b24f1862ee", "version": "1" } } @@ -403,7 +445,7 @@ Response: { "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000009", "inner": { - "id": "0xfaee778daa7113ba77c9be45e1e9ab3f6f623578de2a12cc03dd2305f6df21e5", + "id": "0x0cd038f21b55a828d1f0786ecb0394deb7c5d168e2e9e3cdd1c7fe259bf5b152", "version": "1" } } @@ -485,7 +527,7 @@ Response: { "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000403", "lists": { - "id": "0xcf26b0ddc4e14d7e57f5e0b2eb6a97a2188db2df68e01707d2b109507c5c170f", + "id": "0xf0184fc03f1f00255f35002677de226d192275822cda26550f3412922eec9ad4", "size": "1" } } @@ -552,14 +594,58 @@ Response: { { "cursor": "eyJpIjoxMSwiYyI6MH0", "node": { - "address": "0x0fd69821708fd0e2b0af7e2223ecee092f745cf711c07824cad4b2c270bde85f", + "address": "0x01c299ec1664da9ebbd3a9f0d75984d51f908031374a00672d59da5e5737efe3", + "asMoveObject": { + "contents": { + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + }, + "json": { + "id": "0x01c299ec1664da9ebbd3a9f0d75984d51f908031374a00672d59da5e5737efe3", + "name": "1", + "value": { + "version": "1", + "epoch": "0", + "randomness_round": "0", + "random_bytes": [] + } + } + } + }, + "asMovePackage": null + } + }, + { + "cursor": "eyJpIjoxMiwiYyI6MH0", + "node": { + "address": "0x0335ba15e3aa99b0aa2ead1bbb1f09bd0334ca87844645728b03fd9ae60d6fb8", + "asMoveObject": { + "contents": { + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" + }, + "json": { + "id": "0x0335ba15e3aa99b0aa2ead1bbb1f09bd0334ca87844645728b03fd9ae60d6fb8", + "balance": { + "value": "30000000000000000" + } + } + } + }, + "asMovePackage": null + } + }, + { + "cursor": "eyJpIjoxMywiYyI6MH0", + "node": { + "address": "0x35ca4e5ef012362b4415a4796dbcb7b5b5c0ee6d476ea621f531924230e8a6b4", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" }, "json": { - "id": "0x0fd69821708fd0e2b0af7e2223ecee092f745cf711c07824cad4b2c270bde85f", + "id": "0x35ca4e5ef012362b4415a4796dbcb7b5b5c0ee6d476ea621f531924230e8a6b4", "name": "1", "value": { "bridge_version": "1", @@ -579,7 +665,7 @@ Response: { }, "treasury": { "treasuries": { - "id": "0xee96046998a6342cb402c45f0bedab12405cdf5a34bc951628cee80123fb919e", + "id": "0xd5c0a337b2c5eb3102cb331bcee17673705c8df9419f4793c2bc69b29423006b", "size": "0" }, "supported_tokens": { @@ -589,12 +675,12 @@ Response: { "contents": [] }, "waiting_room": { - "id": "0x1bb3d15c219f0b1424982bfe070ee5c45ec8019b853e5a97e6ee2bd9780e6b1c", + "id": "0x2e4de7fe9ca8102e6dd8cb512eb2bfa0cca027eb635f971768a7d5c90e0da587", "size": "0" } }, "token_transfer_records": { - "id": "0xff9258ea7534651c76734ba2373e6359f397ee2cf3369de5b639aa37156a8e48", + "id": "0x05352263044621c324c5ca95df3357e5475f5ab8b44274d13c9b6dad85ca47d0", "size": "0", "head": null, "tail": null @@ -652,40 +738,18 @@ Response: { } }, { - "cursor": "eyJpIjoxMiwiYyI6MH0", - "node": { - "address": "0x17b18c11d88171034e35845c9bfbcaa3e8f6669d79258668fd1fc3b370f5e2c1", - "asMoveObject": { - "contents": { - "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000003::staking_pool::StakedSui" - }, - "json": { - "id": "0x17b18c11d88171034e35845c9bfbcaa3e8f6669d79258668fd1fc3b370f5e2c1", - "pool_id": "0x512f43c885191724a825ac8ad33c39220323768bf926b55786049c0478789e2f", - "stake_activation_epoch": "0", - "principal": { - "value": "20000000000000000" - } - } - } - }, - "asMovePackage": null - } - }, - { - "cursor": "eyJpIjoxMywiYyI6MH0", + "cursor": "eyJpIjoxNCwiYyI6MH0", "node": { - "address": "0x2810a482837f11e826d31192d73dbfba1de93131395bb22c2e61a3f2a658d232", + "address": "0x433fc1353e363ad6a756ce9711eb0b38604f070fd307869d009b884db80af456", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x2810a482837f11e826d31192d73dbfba1de93131395bb22c2e61a3f2a658d232", + "id": "0x433fc1353e363ad6a756ce9711eb0b38604f070fd307869d009b884db80af456", "balance": { - "value": "30000000000000000" + "value": "300000000000000" } } } @@ -694,16 +758,16 @@ Response: { } }, { - "cursor": "eyJpIjoxNCwiYyI6MH0", + "cursor": "eyJpIjoxNSwiYyI6MH0", "node": { - "address": "0x409d22316946a7862bece71ae789662c4e2319ecf87f869281627929cb2d4a94", + "address": "0x630897c4c471214c8f1617d16530efabd294e4506af3c02d4aee2736f027d6f7", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000003::validator_cap::UnverifiedValidatorOperationCap" }, "json": { - "id": "0x409d22316946a7862bece71ae789662c4e2319ecf87f869281627929cb2d4a94", + "id": "0x630897c4c471214c8f1617d16530efabd294e4506af3c02d4aee2736f027d6f7", "authorizer_validator_address": "0xa7b032703878aa74c3126935789fd1d4d7e111d5911b09247d6963061c312b5a" } } @@ -712,7 +776,7 @@ Response: { } }, { - "cursor": "eyJpIjoxNSwiYyI6MH0", + "cursor": "eyJpIjoxNiwiYyI6MH0", "node": { "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", "asMoveObject": { @@ -725,7 +789,7 @@ Response: { "name": "1", "value": { "epoch": "0", - "protocol_version": "48", + "protocol_version": "51", "system_state_version": "1", "validators": { "total_stake": "20000000000000000", @@ -970,15 +1034,15 @@ Response: { "next_epoch_primary_address": null, "next_epoch_worker_address": null, "extra_fields": { - "id": "0x8c2ae63c5ff2e88020002081ba9a19a0f6373d13debc90539dc0af73234aa01c", + "id": "0x27cadc03c150315b25b85a37580936f58705119a9eba52d9699c5e4170f20f20", "size": "0" } }, "voting_power": "10000", - "operation_cap_id": "0x409d22316946a7862bece71ae789662c4e2319ecf87f869281627929cb2d4a94", + "operation_cap_id": "0x630897c4c471214c8f1617d16530efabd294e4506af3c02d4aee2736f027d6f7", "gas_price": "1000", "staking_pool": { - "id": "0x512f43c885191724a825ac8ad33c39220323768bf926b55786049c0478789e2f", + "id": "0x2a53a31f00aeeba15b260d54f2b45cdf308be82e4c8f4c19c63dcb982802db66", "activation_epoch": "0", "deactivation_epoch": null, "sui_balance": "20000000000000000", @@ -987,14 +1051,14 @@ Response: { }, "pool_token_balance": "20000000000000000", "exchange_rates": { - "id": "0xe4fef0a4d973d74df27c9cdcf164ade1f34434ede9a4cc2fda6d8d5456681f90", + "id": "0x1c10bbb7c2fade2e8cb69343918d220a512e15b1aa013921bc90425f0c0a36be", "size": "1" }, "pending_stake": "0", "pending_total_sui_withdraw": "0", "pending_pool_token_withdraw": "0", "extra_fields": { - "id": "0x3497436a95ed5046cff76ba61a0872386febbedfdd8f428be1d9dbf8fc585a8e", + "id": "0x90c24adbc8fec1e91c044efa396a6234dbce74d2720182425fec01b4a2420033", "size": "0" } }, @@ -1003,35 +1067,35 @@ Response: { "next_epoch_gas_price": "1000", "next_epoch_commission_rate": "200", "extra_fields": { - "id": "0xa40a0f9ab64b1c703c68c658cdd9e33a13d57524cc5a7bfaddb9065007186227", + "id": "0x637cdb5942794a433cfb4436e4a8788addcb0ff7114c225a3cd5eb1b4b4366ef", "size": "0" } } ], "pending_active_validators": { "contents": { - "id": "0xecccf6b130fb0749ffc2e22342c00b7010021312c191cd140e903f801e515b14", + "id": "0x062fe7871c4a606cab3eff31eab061647b4a70f30a0cea018b19f064f227e0d8", "size": "0" } }, "pending_removals": [], "staking_pool_mappings": { - "id": "0x149a956569f16fbc9e913db7bfda7d145176293dcd3281cde8893441e07f5f80", + "id": "0x0c6e8e8f8b71b9118f3b6be0d30a408dd11549d5541a8b5f9cb923c4df0997c4", "size": "1" }, "inactive_validators": { - "id": "0x284708ec2e6c6bf0a2181664b505173b163852721c4c1166613d33c873ebc08a", + "id": "0x514509ad914ad681508af65f278bea302598aa33653436d497faaa0dbd756f61", "size": "0" }, "validator_candidates": { - "id": "0x179563483898748260ffa71009a47272bd523dc53666fd92a1bcaf31485a1486", + "id": "0xd35b0bf556352466b8329624b4a1a8b1619bea51c4ff68380f1dc5559d877d29", "size": "0" }, "at_risk_validators": { "contents": [] }, "extra_fields": { - "id": "0x3f696efcf95b69ea5388d9babe82991e9e691d8f76037ad30e2eba3ff69e3017", + "id": "0x35edfe0365fb380135231d8f0995b03a7be1559923db4c8880a6f882b263b2b6", "size": "0" } }, @@ -1052,7 +1116,7 @@ Response: { "validator_very_low_stake_threshold": "15000000000000000", "validator_low_stake_grace_period": "7", "extra_fields": { - "id": "0x04ed7ddc7e3faa55694a1be7c39d24a07082fda0c6f614ba33cfc5146e03ac12", + "id": "0x3f2c25a2be1053fae25981507a399e4b6bd5a5d00a892571ad2ef9b597faa107", "size": "0" } }, @@ -1069,7 +1133,7 @@ Response: { "stake_subsidy_period_length": "10", "stake_subsidy_decrease_rate": 1000, "extra_fields": { - "id": "0xf6cc0bdec98dd89a83e80c5977f66866187bab4a8bec83b286d091f3fcfc9bc8", + "id": "0x7223082c9f124276c543894ac082f6a50563761000ebc5dca8743667777687e7", "size": "0" } }, @@ -1084,7 +1148,7 @@ Response: { "safe_mode_non_refundable_storage_fee": "0", "epoch_start_timestamp_ms": "0", "extra_fields": { - "id": "0x831010b19a979cfce72d0e8850bb0d390f774083cf1ffc3e9d19fe1305ee3ed7", + "id": "0x0ee18dff819ef55220f18f467782d9d7ae162394b6e92a1e370c8168c53f2876", "size": "0" } } @@ -1095,16 +1159,16 @@ Response: { } }, { - "cursor": "eyJpIjoxNiwiYyI6MH0", + "cursor": "eyJpIjoxNywiYyI6MH0", "node": { - "address": "0x6cc52a563a985be11818aaa97ad7708931e67c7b02ea9c38716b4f2e51d65db7", + "address": "0x6b90736c10c8d72d53413ef936d3293bd32335bd9b8506713dab1f80b08ea20c", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::CoinMetadata<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>" }, "json": { - "id": "0x6cc52a563a985be11818aaa97ad7708931e67c7b02ea9c38716b4f2e51d65db7", + "id": "0x6b90736c10c8d72d53413ef936d3293bd32335bd9b8506713dab1f80b08ea20c", "decimals": 9, "name": "Sui", "symbol": "SUI", @@ -1117,27 +1181,20 @@ Response: { } }, { - "cursor": "eyJpIjoxNywiYyI6MH0", + "cursor": "eyJpIjoxOCwiYyI6MH0", "node": { - "address": "0x7458cb397cb27754c23eaa5f41932c7f36e0a24a03bff4f469d0042239d90bd4", + "address": "0x938454a8d15e26afabb58f703ec6709d8831a613d30f7bfa8a17edc1327eadd7", "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000003::staking_pool::StakedSui" }, "json": { - "id": "0x7458cb397cb27754c23eaa5f41932c7f36e0a24a03bff4f469d0042239d90bd4", - "name": "0", - "value": { - "id": "0xb6335f7700beaebcb812c19d58228aac6d78a976fb1259e2b40705acf0294dc9", - "denied_count": { - "id": "0x48e875021a80af8469568d21b2c8a98240474bc50332b9ef599ab91a9c581832", - "size": "0" - }, - "denied_addresses": { - "id": "0xcff4cb1886a02780b465bdc5b96705a74213efb3fa7083d30f423523b9974c86", - "size": "0" - } + "id": "0x938454a8d15e26afabb58f703ec6709d8831a613d30f7bfa8a17edc1327eadd7", + "pool_id": "0x2a53a31f00aeeba15b260d54f2b45cdf308be82e4c8f4c19c63dcb982802db66", + "stake_activation_epoch": "0", + "principal": { + "value": "20000000000000000" } } } @@ -1146,45 +1203,23 @@ Response: { } }, { - "cursor": "eyJpIjoxOCwiYyI6MH0", + "cursor": "eyJpIjoxOSwiYyI6MH0", "node": { - "address": "0x7b4c78885861149d0096a7894e7f1e1d349dad1905a555515b9348f834e25b9d", + "address": "0x96e975051935f63e5889d40ef001dd2a0ded8d82b2ff153ec7ea0087e4164566", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field<0x0000000000000000000000000000000000000000000000000000000000000002::object::ID,address>" }, "json": { - "id": "0x7b4c78885861149d0096a7894e7f1e1d349dad1905a555515b9348f834e25b9d", - "name": "0x512f43c885191724a825ac8ad33c39220323768bf926b55786049c0478789e2f", + "id": "0x96e975051935f63e5889d40ef001dd2a0ded8d82b2ff153ec7ea0087e4164566", + "name": "0x2a53a31f00aeeba15b260d54f2b45cdf308be82e4c8f4c19c63dcb982802db66", "value": "0xa7b032703878aa74c3126935789fd1d4d7e111d5911b09247d6963061c312b5a" } } }, "asMovePackage": null } - }, - { - "cursor": "eyJpIjoxOSwiYyI6MH0", - "node": { - "address": "0xcdfd9d0501c4f8901cf1d248b98c7ae83d6252ac30bb4e889dc4ab01419aeee5", - "asMoveObject": { - "contents": { - "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" - }, - "json": { - "id": "0xcdfd9d0501c4f8901cf1d248b98c7ae83d6252ac30bb4e889dc4ab01419aeee5", - "name": "0", - "value": { - "sui_amount": "0", - "pool_token_amount": "0" - } - } - } - }, - "asMovePackage": null - } } ] } @@ -1226,7 +1261,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000001", - "digest": "7ouPcNp2CLAiGNkG5JkFoPu4KAYexFiCHxCBWajiMJBR" + "digest": "6vFRwAjpSg6pjkB9NhvNy6WV4FZUALi7nXgWYc5v3VS1" } }, { @@ -1235,7 +1270,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000002", - "digest": "nFbTAQZaeEigs57F6HBF5VWRr3ZeukAeLC6uanbYvUP" + "digest": "EffJvp8RKEJNF8iXSzVibXwgdKbRR5KWjfZQWFSXatzb" } }, { @@ -1244,7 +1279,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000003", - "digest": "4sLpmZ3dZ6UyNg8wvz7kgeR8dgCPUXAqR3hr9eaPHD6V" + "digest": "5hnu4N74u9TA1CKNHnNzzXWx7hsE9pFDfcWXypEcvDpu" } }, { @@ -1253,7 +1288,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000005", - "digest": "8pUmujoTJT83HrLAWcqg6ZoLfY72eGpeSjEnsJjj5s4k" + "digest": "9Q4iFuknh9LRDYdAgsEeWhFjnsQNooLmYBrWNsaLnmsc" } }, { @@ -1262,7 +1297,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000006", - "digest": "BhKkgu3bWk8S2KJvXtE3DefnTSCeVf1VUhiF395gPHMS" + "digest": "6LzfPnEpaYMDG8rsLsJiUaddXGn6JNEgc8BME9MBvwYq" } }, { @@ -1271,7 +1306,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000007", - "digest": "129rVVcxi3C1f7uiEsN3PSCgaqCy5VK8DR1GL4pkxPqB" + "digest": "GgdTD7RQH4CwmXPDxKk4zpJaYjD9nMrBHHURPYjpdqg9" } }, { @@ -1280,7 +1315,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000008", - "digest": "GbE1Nnk8jBF4aqpneUj1Q5BbmRoHdNmhw6SuiYosgv1c" + "digest": "CLKXcpDWf824YhYopC4T35XS2bdNyiur2LFoqnSy5WQ1" } }, { @@ -1289,7 +1324,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000009", - "digest": "AmK4bmeUwWfeQDhbDTgt41jUbpczpL3yrPtjeTSnvjyt" + "digest": "DX6TK6wfzw8wxeyDNKPNcn8y8aUo1qLFuJjZN8BNc46f" } }, { @@ -1298,7 +1333,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x000000000000000000000000000000000000000000000000000000000000000b", - "digest": "XnvVjrPY92jZdwXg4HqNbb5BCyTZrrJTxSTVm9tHkXm" + "digest": "Uzux8DMNYgeJYd7iPg76BMbb1rBoYwBSvwpHKeC62gK" } }, { @@ -1307,7 +1342,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000403", - "digest": "3y1PA1G8yJPW4jLDiNMKVEqF21mRYpXAvEBpMyew9BUB" + "digest": "FV5sLRWBqs3UADqZA56wAabd9GFQWvzY8dafRp7goFBT" } }, { @@ -1316,88 +1351,88 @@ Response: { "idDeleted": false, "outputState": { "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", - "digest": "55wbgR43VRsg4vZiXrBvnahboXXL94eTeU1mWyY3t5ph" + "digest": "APpPkFa8NUbMbBqkfwx5GjM2oP66r9aBe5dDsx8Y9gNA" } }, { - "address": "0x0fd69821708fd0e2b0af7e2223ecee092f745cf711c07824cad4b2c270bde85f", + "address": "0x01c299ec1664da9ebbd3a9f0d75984d51f908031374a00672d59da5e5737efe3", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x0fd69821708fd0e2b0af7e2223ecee092f745cf711c07824cad4b2c270bde85f", - "digest": "4vChuzBotMu4K28Wa7expEqQcPqYQmCBA7s8nkhm2Jjr" + "address": "0x01c299ec1664da9ebbd3a9f0d75984d51f908031374a00672d59da5e5737efe3", + "digest": "Y5tgkGG3pAo6jPeotX2qbQv3UwRBbVhFqkautXfJ5W7" } }, { - "address": "0x17b18c11d88171034e35845c9bfbcaa3e8f6669d79258668fd1fc3b370f5e2c1", + "address": "0x0335ba15e3aa99b0aa2ead1bbb1f09bd0334ca87844645728b03fd9ae60d6fb8", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x17b18c11d88171034e35845c9bfbcaa3e8f6669d79258668fd1fc3b370f5e2c1", - "digest": "FxciH5Lq3iPzqjvqAUdATkCgiERPJdnxzaVMo2g3hksV" + "address": "0x0335ba15e3aa99b0aa2ead1bbb1f09bd0334ca87844645728b03fd9ae60d6fb8", + "digest": "3EjPQzgKz5BX8yqKrPEYuYDxC6VKei8WPCCvRhVKX5kA" } }, { - "address": "0x2810a482837f11e826d31192d73dbfba1de93131395bb22c2e61a3f2a658d232", + "address": "0x35ca4e5ef012362b4415a4796dbcb7b5b5c0ee6d476ea621f531924230e8a6b4", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x2810a482837f11e826d31192d73dbfba1de93131395bb22c2e61a3f2a658d232", - "digest": "GD63b3mtYzD29vzWcfNo8jwsGmqYuW6BKjLA6PafuzcM" + "address": "0x35ca4e5ef012362b4415a4796dbcb7b5b5c0ee6d476ea621f531924230e8a6b4", + "digest": "3AyuwbWLB6T11sdt7Biumb9PF4SMms1M3dQooqu9ZdZk" } }, { - "address": "0x409d22316946a7862bece71ae789662c4e2319ecf87f869281627929cb2d4a94", + "address": "0x433fc1353e363ad6a756ce9711eb0b38604f070fd307869d009b884db80af456", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x409d22316946a7862bece71ae789662c4e2319ecf87f869281627929cb2d4a94", - "digest": "69YWJa8BTwBqjBBB1EsncUuW1XUMPVrdZvKqGsrnsVFb" + "address": "0x433fc1353e363ad6a756ce9711eb0b38604f070fd307869d009b884db80af456", + "digest": "2ta7AYEtAq1ErMwcyUAnjFDxDnN4uniKdkb6bDULRMT4" } }, { - "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", + "address": "0x630897c4c471214c8f1617d16530efabd294e4506af3c02d4aee2736f027d6f7", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", - "digest": "EZ7TVM2HPNeAPy9bh5RhAaSky2BiW2NGjePwN13dhker" + "address": "0x630897c4c471214c8f1617d16530efabd294e4506af3c02d4aee2736f027d6f7", + "digest": "22nQmQe7rdnMAHN8yrcxCQQ8b7skWpM5VXCnoJYyjHYd" } }, { - "address": "0x6cc52a563a985be11818aaa97ad7708931e67c7b02ea9c38716b4f2e51d65db7", + "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x6cc52a563a985be11818aaa97ad7708931e67c7b02ea9c38716b4f2e51d65db7", - "digest": "DkBifnmQmu8koX85hn5t82tN79kifD8qRRRmyXK8f2qF" + "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", + "digest": "CG3WF91129RJi3pPMj3snmV87rdStX56faFG7xiYd2Br" } }, { - "address": "0x7458cb397cb27754c23eaa5f41932c7f36e0a24a03bff4f469d0042239d90bd4", + "address": "0x6b90736c10c8d72d53413ef936d3293bd32335bd9b8506713dab1f80b08ea20c", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x7458cb397cb27754c23eaa5f41932c7f36e0a24a03bff4f469d0042239d90bd4", - "digest": "EHDLMVwxQc751KTPJRdCAXgbFfb1mTX3khmvZ2jBfmr" + "address": "0x6b90736c10c8d72d53413ef936d3293bd32335bd9b8506713dab1f80b08ea20c", + "digest": "H99D9farWxHg6uGm1peWtwZXpnDSdFxPeKoe9viZEvFf" } }, { - "address": "0x7b4c78885861149d0096a7894e7f1e1d349dad1905a555515b9348f834e25b9d", + "address": "0x938454a8d15e26afabb58f703ec6709d8831a613d30f7bfa8a17edc1327eadd7", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x7b4c78885861149d0096a7894e7f1e1d349dad1905a555515b9348f834e25b9d", - "digest": "8YYDYPtntNRDTPTt388jD5ctX35TbaBbzkuLeFeuEheK" + "address": "0x938454a8d15e26afabb58f703ec6709d8831a613d30f7bfa8a17edc1327eadd7", + "digest": "4n5C8W58gJoQXFbd8efL5Vok2MJ8cQwdXaZks771dpui" } }, { - "address": "0xcdfd9d0501c4f8901cf1d248b98c7ae83d6252ac30bb4e889dc4ab01419aeee5", + "address": "0x96e975051935f63e5889d40ef001dd2a0ded8d82b2ff153ec7ea0087e4164566", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xcdfd9d0501c4f8901cf1d248b98c7ae83d6252ac30bb4e889dc4ab01419aeee5", - "digest": "E7ohzxA6zg7gzVx5sVU7MR7oUE1cK94znE93UqzypAhe" + "address": "0x96e975051935f63e5889d40ef001dd2a0ded8d82b2ff153ec7ea0087e4164566", + "digest": "85pXigo5wDFA8hEFe7k1DjeCHaxQENwKL6EPDkMrLp6R" } } ] @@ -1419,7 +1454,7 @@ Response: { "sequenceNumber": 0 }, "transactionBlock": { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } }, "expiration": null @@ -1438,7 +1473,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "CHyKA8xirNCGtcDMLJcxBZsxGyAA7DNrzDEVodxZzNn", + "digest": "DPq7c2A5SyX36jGrNW6QNstAzSxtFPai1SZj4eF7oFDR", "sender": null, "signatures": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" @@ -1469,7 +1504,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } ] }, @@ -1484,7 +1519,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000006", - "digest": "28w3Mp2x4vt94bq4TejrbLcfMsMaevDyPz6h98sgcnw4" + "digest": "Dbu2swR7jSwhxcjbyL1iGCuQPSrKR7Kyp8PEbKxsd9Uq" } } ] @@ -1506,7 +1541,7 @@ Response: { "sequenceNumber": 1 }, "transactionBlock": { - "digest": "CHyKA8xirNCGtcDMLJcxBZsxGyAA7DNrzDEVodxZzNn" + "digest": "DPq7c2A5SyX36jGrNW6QNstAzSxtFPai1SZj4eF7oFDR" } }, "expiration": null @@ -1525,7 +1560,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "CYGnW6Q3rq3AXgaCzPTTTiLGVcTdjhZmfhCt1dYCvpcf", + "digest": "7DAjo9h158tzbXvCrom8WztDe2k7WDpQiierJWGRE4vA", "sender": null, "signatures": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" @@ -1549,7 +1584,7 @@ Response: { "node": { "__typename": "ChangeEpochTransaction", "epoch": null, - "protocolVersion": 48, + "protocolVersion": 51, "storageCharge": "0", "computationCharge": "0", "storageRebate": "0", @@ -1567,7 +1602,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "AhErVYcPUpKCUJsiQ2GAtiBZuuo2n3nVYLngQpTiuuQ3" + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" } ] }, @@ -1582,7 +1617,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000005", - "digest": "441oxSnLcbyWPDsBCmzktfZGLV1APqDWRMSgVyiJ9Lza" + "digest": "44yGox4dPivPXxAjwZNdQJofkpc43b74et5c9TDwz3cF" } }, { @@ -1591,7 +1626,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1", - "digest": "Ec6NfoAuxBRE2MnNSqbBBTQt1rqtFz2Crpniy2cEXCc5" + "digest": "4eB44q9VTd95RrSjUZwiHc19Z3aFs3ZhBL2WHwgmrPKC" } }, { @@ -1601,12 +1636,12 @@ Response: { "outputState": null }, { - "address": "0x9789a2ad1957d12af41b02502718c3e0f8af830fc7e147c9fc812a5840833e47", + "address": "0xcc0196e04903de114d3975a89f322ee2b12e2bb3e34746d88ddf2809710662d6", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x9789a2ad1957d12af41b02502718c3e0f8af830fc7e147c9fc812a5840833e47", - "digest": "HXoKKoRApN6frgKf8yp7twK9NKs9gwRHQ4ysWEDNJkUR" + "address": "0xcc0196e04903de114d3975a89f322ee2b12e2bb3e34746d88ddf2809710662d6", + "digest": "7G6MzhCdkbA1oRXfKooqioHPiVM6bHoK33ziHHRR5D7S" } } ] @@ -1628,7 +1663,7 @@ Response: { "sequenceNumber": 2 }, "transactionBlock": { - "digest": "CYGnW6Q3rq3AXgaCzPTTTiLGVcTdjhZmfhCt1dYCvpcf" + "digest": "7DAjo9h158tzbXvCrom8WztDe2k7WDpQiierJWGRE4vA" } }, "expiration": null diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/system.move b/crates/sui-graphql-e2e-tests/tests/transactions/system.move index a391aa450726f..54541c94ecacd 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/system.move +++ b/crates/sui-graphql-e2e-tests/tests/transactions/system.move @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -//# init --protocol-version 48 --simulator +//# init --protocol-version 51 --simulator // Tests for representations of all the various system transactions diff --git a/crates/sui-graphql-e2e-tests/tests/validator/validator.move b/crates/sui-graphql-e2e-tests/tests/validator/validator.move index d845b877cc135..6628fca0edeb3 100644 --- a/crates/sui-graphql-e2e-tests/tests/validator/validator.move +++ b/crates/sui-graphql-e2e-tests/tests/validator/validator.move @@ -3,7 +3,7 @@ // Test the change of APY with heavy transactions -//# init --protocol-version 48 --simulator --accounts A --addresses P0=0x0 +//# init --protocol-version 51 --simulator --accounts A --addresses P0=0x0 //# advance-epoch From 6954c2048395ac5ab31ca00f478bd9d304944cc0 Mon Sep 17 00:00:00 2001 From: pei-mysten <147538877+pei-mysten@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:03:51 -0700 Subject: [PATCH 030/163] [script] no need for GITHUB_TOKEN because sui is a public repo (#18544) ## Description Remove the Auth header because `sui` is a public repo..no need for GTIHUB_TOKEN ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- scripts/release_notes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/release_notes.py b/scripts/release_notes.py index 0ae7e38cb2059..1a23da750624c 100755 --- a/scripts/release_notes.py +++ b/scripts/release_notes.py @@ -124,7 +124,6 @@ def extract_notes_from_rebase_commit(commit): url = f"https://api.github.com/repos/MystenLabs/sui/commits/{commit}/pulls" headers = { "Accept": "application/vnd.github.v3+json", - "Authorization": f"token {os.environ['GITHUB_TOKEN']}", } req = urllib.request.Request(url, headers=headers) with urllib.request.urlopen(req) as response: From 7c143d566312377f0127b2712fb439f4805d066f Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:46:59 -0700 Subject: [PATCH 031/163] Cleanup a few Narwhal references (#18671) ## Description Cleanup a few references to Narwhal. Remove consensus protocol choice from `ConsensusConfig`. This field is unused now. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/mysten-common/src/sync/mod.rs | 2 +- crates/sui-config/src/node.rs | 9 --------- .../sui-core/src/consensus_manager/mysticeti_manager.rs | 8 +++++++- crates/sui-swarm-config/src/node_config_builder.rs | 3 +-- crates/typed-store/src/rocks/mod.rs | 3 +-- crates/x/src/lint.rs | 2 +- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/crates/mysten-common/src/sync/mod.rs b/crates/mysten-common/src/sync/mod.rs index c405ff1269755..5d8dfc5edfb86 100644 --- a/crates/mysten-common/src/sync/mod.rs +++ b/crates/mysten-common/src/sync/mod.rs @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +/// Low level utilities shared across Sui. pub mod async_once_cell; -/// Low level ultilities shared between Sui and Narwhal. pub mod notify_once; pub mod notify_read; diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index 213da423ff141..b21481c2f7913 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -426,11 +426,6 @@ pub struct ConsensusConfig { pub submit_delay_step_override_millis: Option, pub narwhal_config: ConsensusParameters, - - /// The choice of consensus protocol to run. We default to Narwhal. - #[serde(skip)] - #[serde(default = "default_consensus_protocol")] - pub protocol: ConsensusProtocol, } impl ConsensusConfig { @@ -456,10 +451,6 @@ impl ConsensusConfig { } } -pub fn default_consensus_protocol() -> ConsensusProtocol { - ConsensusProtocol::Narwhal -} - #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "kebab-case")] pub struct CheckpointExecutorConfig { diff --git a/crates/sui-core/src/consensus_manager/mysticeti_manager.rs b/crates/sui-core/src/consensus_manager/mysticeti_manager.rs index 85ecae7274d75..6debc2c4ad033 100644 --- a/crates/sui-core/src/consensus_manager/mysticeti_manager.rs +++ b/crates/sui-core/src/consensus_manager/mysticeti_manager.rs @@ -16,6 +16,7 @@ use sui_types::{ committee::EpochId, sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait, }; use tokio::sync::Mutex; +use tracing::info; use crate::{ authority::authority_per_epoch_store::AuthorityPerEpochStore, @@ -83,7 +84,12 @@ impl MysticetiManager { match type_str.to_lowercase().as_str() { "anemo" => return ConsensusNetwork::Anemo, "tonic" => return ConsensusNetwork::Tonic, - _ => {} + _ => { + info!( + "Invalid consensus network type {} in env var. Continue to use the value from protocol config.", + type_str + ); + } } } epoch_store.protocol_config().consensus_network() diff --git a/crates/sui-swarm-config/src/node_config_builder.rs b/crates/sui-swarm-config/src/node_config_builder.rs index da9324869bf02..ee5d34926a8a3 100644 --- a/crates/sui-swarm-config/src/node_config_builder.rs +++ b/crates/sui-swarm-config/src/node_config_builder.rs @@ -16,7 +16,7 @@ use sui_config::node::{ Genesis, KeyPairWithPath, StateArchiveConfig, StateSnapshotConfig, DEFAULT_GRPC_CONCURRENCY_LIMIT, }; -use sui_config::node::{default_zklogin_oauth_providers, ConsensusProtocol, RunWithRange}; +use sui_config::node::{default_zklogin_oauth_providers, RunWithRange}; use sui_config::p2p::{P2pConfig, SeedPeer, StateSyncConfig}; use sui_config::{ local_ip_utils, ConsensusConfig, NodeConfig, AUTHORITIES_DB_NAME, CONSENSUS_DB_NAME, @@ -140,7 +140,6 @@ impl ValidatorConfigBuilder { max_pending_transactions: None, max_submit_position: self.max_submit_position, submit_delay_step_override_millis: self.submit_delay_step_override_millis, - protocol: ConsensusProtocol::Narwhal, narwhal_config: narwhal_config::Parameters { network_admin_server: NetworkAdminServerParameters { primary_network_admin_server_port: local_ip_utils::get_available_port( diff --git a/crates/typed-store/src/rocks/mod.rs b/crates/typed-store/src/rocks/mod.rs index 8fa927cd35c55..30b797288a8f2 100644 --- a/crates/typed-store/src/rocks/mod.rs +++ b/crates/typed-store/src/rocks/mod.rs @@ -2429,8 +2429,7 @@ pub fn default_db_options() -> DBOptions { // the next write) may not work well. So sticking to per-db write buffer size limit for now. // // The environment variables are only meant to be emergency overrides. They may go away in future. - // If you need to modify an option, either update the default value, or override the option in - // Sui / Narwhal. + // It is preferable to update the default value, or override the option in code. opt.set_db_write_buffer_size( read_size_from_env(ENV_VAR_DB_WRITE_BUFFER_SIZE).unwrap_or(DEFAULT_DB_WRITE_BUFFER_SIZE) * 1024 diff --git a/crates/x/src/lint.rs b/crates/x/src/lint.rs index 72bea616526ce..0e510044e550e 100644 --- a/crates/x/src/lint.rs +++ b/crates/x/src/lint.rs @@ -93,7 +93,7 @@ pub fn run(args: Args) -> crate::Result<()> { &PublishedPackagesDontDependOnUnpublishedPackages, &OnlyPublishToCratesIo, &CratesInCratesDirectory, - // TODO: re-enable after moving Narwhal crates to crates/, or back to Narwhal repo. + // There are crates under consensus/, external-crates/. // &CratesOnlyInCratesDirectory, ]; From 8aa6ba9cc4433eecc99acf6f335c989cdc78fee6 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 15 Jul 2024 10:55:47 -0700 Subject: [PATCH 032/163] Store AuthorityAggregator in sui-node (#18647) ## Description This PR moves the construction of AuthorityAggregator to sui-node and stores a reference there. This will make sure that all the metrics are ever only instantiated once (to avoid double register problem). It will also allow us to use AuthorityAggregator later in ValidatorTxFinalizer. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../sui-core/src/transaction_orchestrator.rs | 27 ++++++---------- crates/sui-node/src/lib.rs | 32 +++++++++++++++++-- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/crates/sui-core/src/transaction_orchestrator.rs b/crates/sui-core/src/transaction_orchestrator.rs index ac5e0c0d305ce..1ef8bb7c86f8f 100644 --- a/crates/sui-core/src/transaction_orchestrator.rs +++ b/crates/sui-core/src/transaction_orchestrator.rs @@ -1,18 +1,18 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::authority::authority_per_epoch_store::AuthorityPerEpochStore; /* Transaction Orchestrator is a Node component that utilizes Quorum Driver to submit transactions to validators for finality, and proactively executes finalized transactions locally, when possible. */ + +use crate::authority::authority_per_epoch_store::AuthorityPerEpochStore; use crate::authority::AuthorityState; -use crate::authority_aggregator::{AuthAggMetrics, AuthorityAggregator}; +use crate::authority_aggregator::AuthorityAggregator; use crate::authority_client::{AuthorityAPI, NetworkAuthorityClient}; use crate::quorum_driver::reconfig_observer::{OnsiteReconfigObserver, ReconfigObserver}; use crate::quorum_driver::{QuorumDriverHandler, QuorumDriverHandlerBuilder, QuorumDriverMetrics}; -use crate::safe_client::SafeClientMetricsBase; use futures::future::{select, Either, Future}; use futures::FutureExt; use mysten_common::sync::notify_read::NotifyRead; @@ -25,6 +25,7 @@ use prometheus::{ register_int_gauge_vec_with_registry, register_int_gauge_with_registry, Registry, }; use std::net::SocketAddr; +use std::ops::Deref; use std::path::Path; use std::sync::Arc; use std::time::Duration; @@ -38,7 +39,6 @@ use sui_types::quorum_driver_types::{ ExecuteTransactionResponse, ExecuteTransactionResponseV3, FinalizedEffects, QuorumDriverEffectsQueueResult, QuorumDriverError, QuorumDriverResponse, QuorumDriverResult, }; -use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemState; use sui_types::sui_system_state::SuiSystemState; use sui_types::transaction::VerifiedTransaction; use tokio::sync::broadcast::error::RecvError; @@ -63,31 +63,22 @@ pub struct TransactiondOrchestrator { } impl TransactiondOrchestrator { - pub fn new_with_network_clients( - epoch_start_state: &EpochStartSystemState, + pub fn new_with_auth_aggregator( + validators: Arc>, validator_state: Arc, reconfig_channel: Receiver, parent_path: &Path, prometheus_registry: &Registry, ) -> Self { - let safe_client_metrics_base = SafeClientMetricsBase::new(prometheus_registry); - let auth_agg_metrics = AuthAggMetrics::new(prometheus_registry); - let validators = AuthorityAggregator::new_from_epoch_start_state( - epoch_start_state, - validator_state.committee_store(), - safe_client_metrics_base.clone(), - Arc::new(auth_agg_metrics.clone()), - ); - let observer = OnsiteReconfigObserver::new( reconfig_channel, validator_state.get_object_cache_reader().clone(), validator_state.clone_committee_store(), - safe_client_metrics_base, - auth_agg_metrics, + validators.safe_client_metrics_base.clone(), + validators.metrics.deref().clone(), ); TransactiondOrchestrator::new( - Arc::new(validators), + validators, validator_state, parent_path, prometheus_registry, diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index 9f10a41e091a5..78009d3f38302 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -66,7 +66,7 @@ use sui_core::authority::authority_per_epoch_store::AuthorityPerEpochStore; use sui_core::authority::authority_store_tables::AuthorityPerpetualTables; use sui_core::authority::epoch_start_configuration::EpochStartConfigTrait; use sui_core::authority::epoch_start_configuration::EpochStartConfiguration; -use sui_core::authority_aggregator::AuthorityAggregator; +use sui_core::authority_aggregator::{AuthAggMetrics, AuthorityAggregator}; use sui_core::authority_server::{ValidatorService, ValidatorServiceMetrics}; use sui_core::checkpoints::checkpoint_executor::metrics::CheckpointExecutorMetrics; use sui_core::checkpoints::checkpoint_executor::{CheckpointExecutor, StopReason}; @@ -212,6 +212,7 @@ use simulator::*; #[cfg(msim)] pub use simulator::set_jwk_injector; use sui_core::consensus_handler::ConsensusHandlerInitializer; +use sui_core::safe_client::SafeClientMetricsBase; use sui_types::execution_config_utils::to_binary_config; pub struct SuiNode { @@ -247,6 +248,12 @@ pub struct SuiNode { _state_snapshot_uploader_handle: Option>, // Channel to allow signaling upstream to shutdown sui-node shutdown_channel_tx: broadcast::Sender>, + + /// AuthorityAggregator of the network, created at start and beginning of each epoch. + /// Use ArcSwap so that we could mutate it without taking mut reference. + // TODO: Eventually we can make this auth aggregator a shared reference so that this + // update will automatically propagate to other uses. + auth_agg: ArcSwap>, } impl fmt::Debug for SuiNode { @@ -467,6 +474,17 @@ impl SuiNode { let cache_traits = build_execution_cache(&epoch_start_configuration, &prometheus_registry, &store); + let auth_agg = { + let safe_client_metrics_base = SafeClientMetricsBase::new(&prometheus_registry); + let auth_agg_metrics = Arc::new(AuthAggMetrics::new(&prometheus_registry)); + Arc::new(AuthorityAggregator::new_from_epoch_start_state( + epoch_start_configuration.epoch_start_state(), + &committee_store, + safe_client_metrics_base, + auth_agg_metrics, + )) + }; + let epoch_options = default_db_options().optimize_db_for_write_throughput(4); let epoch_store = AuthorityPerEpochStore::new( config.protocol_public_key(), @@ -692,8 +710,8 @@ impl SuiNode { let transaction_orchestrator = if is_full_node && run_with_range.is_none() { Some(Arc::new( - TransactiondOrchestrator::new_with_network_clients( - epoch_store.epoch_start_state(), + TransactiondOrchestrator::new_with_auth_aggregator( + auth_agg.clone(), state.clone(), end_of_epoch_receiver, &config.db_path(), @@ -798,6 +816,8 @@ impl SuiNode { _state_archive_handle: state_archive_handle, _state_snapshot_uploader_handle: state_snapshot_handle, shutdown_channel_tx: shutdown_channel, + + auth_agg: ArcSwap::new(auth_agg), }; info!("SuiNode started!"); @@ -1550,6 +1570,12 @@ impl SuiNode { cur_epoch_store.record_is_safe_mode_metric(latest_system_state.safe_mode()); let new_epoch_start_state = latest_system_state.into_epoch_start_state(); + self.auth_agg.store(Arc::new( + self.auth_agg + .load() + .recreate_with_new_epoch_start_state(&new_epoch_start_state), + )); + let next_epoch_committee = new_epoch_start_state.get_sui_committee(); let next_epoch = next_epoch_committee.epoch(); assert_eq!(cur_epoch_store.epoch() + 1, next_epoch); From 14a139210664be00d96dee2580da514a57805727 Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Mon, 15 Jul 2024 14:16:52 -0400 Subject: [PATCH 033/163] Add randomness-related admin handlers for disaster recovery use (#18500) --- Cargo.lock | 2 + crates/sui-network/src/randomness/mod.rs | 141 ++++++++++++++++++++- crates/sui-node/Cargo.toml | 2 + crates/sui-node/src/admin.rs | 148 ++++++++++++++++++++++- crates/sui-node/src/lib.rs | 4 + 5 files changed, 292 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c7dc83e9efe56..651e0ee3e9ac6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13456,6 +13456,8 @@ dependencies = [ "anyhow", "arc-swap", "axum", + "base64 0.21.2", + "bcs", "bin-version", "clap", "fastcrypto", diff --git a/crates/sui-network/src/randomness/mod.rs b/crates/sui-network/src/randomness/mod.rs index de570bc62b4a9..e4f507e3ef4fc 100644 --- a/crates/sui-network/src/randomness/mod.rs +++ b/crates/sui-network/src/randomness/mod.rs @@ -6,7 +6,10 @@ use anemo::PeerId; use anyhow::Result; use fastcrypto::groups::bls12381; use fastcrypto_tbls::{ - dkg, nodes::PartyId, tbls::ThresholdBls, types::ShareIndex, types::ThresholdBls12381MinSig, + dkg, + nodes::PartyId, + tbls::ThresholdBls, + types::{ShareIndex, ThresholdBls12381MinSig}, }; use mysten_metrics::spawn_monitored_task; use mysten_network::anemo_ext::NetworkExt; @@ -24,7 +27,9 @@ use sui_types::{ committee::EpochId, crypto::{RandomnessPartialSignature, RandomnessRound, RandomnessSignature}, }; -use tokio::sync::{mpsc, OnceCell}; +use tokio::sync::{ + OnceCell, {mpsc, oneshot}, +}; use tracing::{debug, error, info, instrument, warn}; mod auth; @@ -101,6 +106,54 @@ impl Handle { .expect("RandomnessEventLoop mailbox should not overflow or be closed") } + /// Admin interface handler: generates partial signatures for the given round at the + /// current epoch. + pub fn admin_get_partial_signatures( + &self, + round: RandomnessRound, + tx: oneshot::Sender>, + ) { + self.sender + .try_send(RandomnessMessage::AdminGetPartialSignatures(round, tx)) + .expect("RandomnessEventLoop mailbox should not overflow or be closed") + } + + /// Admin interface handler: injects partial signatures for the given round at the + /// current epoch, skipping validity checks. + pub fn admin_inject_partial_signatures( + &self, + authority_name: AuthorityName, + round: RandomnessRound, + sigs: Vec, + result_channel: oneshot::Sender>, + ) { + self.sender + .try_send(RandomnessMessage::AdminInjectPartialSignatures( + authority_name, + round, + sigs, + result_channel, + )) + .expect("RandomnessEventLoop mailbox should not overflow or be closed") + } + + /// Admin interface handler: injects full signature for the given round at the + /// current epoch, skipping validity checks. + pub fn admin_inject_full_signature( + &self, + round: RandomnessRound, + sig: RandomnessSignature, + result_channel: oneshot::Sender>, + ) { + self.sender + .try_send(RandomnessMessage::AdminInjectFullSignature( + round, + sig, + result_channel, + )) + .expect("RandomnessEventLoop mailbox should not overflow or be closed") + } + // For testing. pub fn new_stub() -> Self { let (sender, mut receiver) = mpsc::channel(1); @@ -120,7 +173,7 @@ impl Handle { } } -#[derive(Clone, Debug)] +#[derive(Debug)] enum RandomnessMessage { UpdateEpoch( EpochId, @@ -138,6 +191,18 @@ enum RandomnessMessage { Vec>, Option, ), + AdminGetPartialSignatures(RandomnessRound, oneshot::Sender>), + AdminInjectPartialSignatures( + AuthorityName, + RandomnessRound, + Vec, + oneshot::Sender>, + ), + AdminInjectFullSignature( + RandomnessRound, + RandomnessSignature, + oneshot::Sender>, + ), } struct RandomnessEventLoop { @@ -220,6 +285,24 @@ impl RandomnessEventLoop { self.receive_partial_signatures(peer_id, epoch, round, partial_sigs) } } + RandomnessMessage::AdminGetPartialSignatures(round, tx) => { + self.admin_get_partial_signatures(round, tx) + } + RandomnessMessage::AdminInjectPartialSignatures( + authority_name, + round, + sigs, + result_channel, + ) => { + let _ = result_channel.send(self.admin_inject_partial_signatures( + authority_name, + round, + sigs, + )); + } + RandomnessMessage::AdminInjectFullSignature(round, sig, result_channel) => { + let _ = result_channel.send(self.admin_inject_full_signature(round, sig)); + } } } @@ -875,4 +958,56 @@ impl RandomnessEventLoop { } self.metrics.set_num_rounds_pending(num_rounds_pending); } + + fn admin_get_partial_signatures(&self, round: RandomnessRound, tx: oneshot::Sender>) { + let shares = if let Some(shares) = self.dkg_output.as_ref().and_then(|d| d.shares.as_ref()) + { + shares + } else { + let _ = tx.send(Vec::new()); // no error handling needed if receiver is already dropped + return; + }; + + let partial_sigs = + ThresholdBls12381MinSig::partial_sign_batch(shares.iter(), &round.signature_message()); + // no error handling needed if receiver is already dropped + let _ = tx.send(bcs::to_bytes(&partial_sigs).expect("serialization should not fail")); + } + + fn admin_inject_partial_signatures( + &mut self, + authority_name: AuthorityName, + round: RandomnessRound, + sigs: Vec, + ) -> Result<()> { + let peer_id = self + .authority_info + .get(&authority_name) + .map(|(peer_id, _)| *peer_id) + .ok_or(anyhow::anyhow!("unknown AuthorityName {authority_name:?}"))?; + self.received_partial_sigs.insert((round, peer_id), sigs); + self.maybe_aggregate_partial_signatures(self.epoch, round); + Ok(()) + } + + fn admin_inject_full_signature( + &mut self, + round: RandomnessRound, + sig: RandomnessSignature, + ) -> Result<()> { + let vss_pk = { + let Some(dkg_output) = &self.dkg_output else { + return Err(anyhow::anyhow!( + "called admin_inject_full_signature before DKG completed" + )); + }; + &dkg_output.vss_pk + }; + + ThresholdBls12381MinSig::verify(vss_pk.c0(), &round.signature_message(), &sig) + .map_err(|e| anyhow::anyhow!("invalid full signature: {e:?}"))?; + + self.process_valid_full_signature(self.epoch, round, sig); + Ok(()) + } } diff --git a/crates/sui-node/Cargo.toml b/crates/sui-node/Cargo.toml index 51f08c4fe3679..2159ad62b713b 100644 --- a/crates/sui-node/Cargo.toml +++ b/crates/sui-node/Cargo.toml @@ -12,6 +12,8 @@ anemo-tower.workspace = true arc-swap.workspace = true axum.workspace = true anyhow.workspace = true +base64.workspace = true +bcs.workspace = true clap.workspace = true prometheus.workspace = true tokio = { workspace = true, features = ["full"] } diff --git a/crates/sui-node/src/admin.rs b/crates/sui-node/src/admin.rs index 9c6c12810b71a..50afbe772e3d0 100644 --- a/crates/sui-node/src/admin.rs +++ b/crates/sui-node/src/admin.rs @@ -8,12 +8,21 @@ use axum::{ routing::{get, post}, Router, }; +use base64::Engine; use humantime::parse_duration; use serde::Deserialize; -use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::Arc; -use sui_types::error::SuiError; +use std::{ + net::{IpAddr, Ipv4Addr, SocketAddr}, + str::FromStr, +}; +use sui_types::{ + base_types::AuthorityName, + crypto::{RandomnessPartialSignature, RandomnessRound, RandomnessSignature}, + error::SuiError, +}; use telemetry_subscribers::TracingHandle; +use tokio::sync::oneshot; use tracing::info; // Example commands: @@ -47,6 +56,18 @@ use tracing::info; // Reset tracing to the TRACE_FILTER env var. // // $ curl -X POST 'http://127.0.0.1:1337/reset-tracing' +// +// Get the node's randomness partial signatures for round 123. +// +// $ curl 'http://127.0.0.1:1337/randomness-partial-sigs?round=123' +// +// Inject a randomness partial signature from another node, bypassing validity checks. +// +// $ curl 'http://127.0.0.1:1337/randomness-inject-partial-sigs?authority_name=hexencodedname&round=123&sigs=base64encodedsigs' +// +// Inject a full signature from another node, bypassing validity checks. +// +// $ curl 'http://127.0.0.1:1337/randomness-inject-full-sig?round=123&sigs=base64encodedsig' const LOGGING_ROUTE: &str = "/logging"; const TRACING_ROUTE: &str = "/enable-tracing"; @@ -56,6 +77,9 @@ const CLEAR_BUFFER_STAKE_ROUTE: &str = "/clear-override-buffer-stake"; const FORCE_CLOSE_EPOCH: &str = "/force-close-epoch"; const CAPABILITIES: &str = "/capabilities"; const NODE_CONFIG: &str = "/node-config"; +const RANDOMNESS_PARTIAL_SIGS_ROUTE: &str = "/randomness-partial-sigs"; +const RANDOMNESS_INJECT_PARTIAL_SIGS_ROUTE: &str = "/randomness-inject-partial-sigs"; +const RANDOMNESS_INJECT_FULL_SIG_ROUTE: &str = "/randomness-inject-full-sig"; struct AppState { node: Arc, @@ -86,6 +110,15 @@ pub async fn run_admin_server(node: Arc, port: u16, tracing_handle: Tra .route(FORCE_CLOSE_EPOCH, post(force_close_epoch)) .route(TRACING_ROUTE, post(enable_tracing)) .route(TRACING_RESET_ROUTE, post(reset_tracing)) + .route(RANDOMNESS_PARTIAL_SIGS_ROUTE, get(randomness_partial_sigs)) + .route( + RANDOMNESS_INJECT_PARTIAL_SIGS_ROUTE, + post(randomness_inject_partial_sigs), + ) + .route( + RANDOMNESS_INJECT_FULL_SIG_ROUTE, + post(randomness_inject_full_sig), + ) .with_state(Arc::new(app_state)); let socket_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port); @@ -288,3 +321,114 @@ async fn force_close_epoch( Err(err) => (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()), } } + +#[derive(Deserialize)] +struct Round { + round: u64, +} + +async fn randomness_partial_sigs( + State(state): State>, + round: Query, +) -> (StatusCode, String) { + let Query(Round { round }) = round; + + let (tx, rx) = oneshot::channel(); + state + .node + .randomness_handle() + .admin_get_partial_signatures(RandomnessRound(round), tx); + + let sigs = match rx.await { + Ok(sigs) => sigs, + Err(err) => return (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()), + }; + + let output = format!( + "{}\n", + base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(sigs) + ); + + (StatusCode::OK, output) +} + +#[derive(Deserialize)] +struct PartialSigsToInject { + hex_authority_name: String, + round: u64, + base64_sigs: String, +} + +async fn randomness_inject_partial_sigs( + State(state): State>, + args: Query, +) -> (StatusCode, String) { + let Query(PartialSigsToInject { + hex_authority_name, + round, + base64_sigs, + }) = args; + + let authority_name = match AuthorityName::from_str(hex_authority_name.as_str()) { + Ok(authority_name) => authority_name, + Err(err) => return (StatusCode::BAD_REQUEST, err.to_string()), + }; + + let sigs: Vec = match base64::engine::general_purpose::URL_SAFE_NO_PAD.decode(base64_sigs) { + Ok(sigs) => sigs, + Err(err) => return (StatusCode::BAD_REQUEST, err.to_string()), + }; + + let sigs: Vec = match bcs::from_bytes(&sigs) { + Ok(sigs) => sigs, + Err(err) => return (StatusCode::BAD_REQUEST, err.to_string()), + }; + + let (tx_result, rx_result) = oneshot::channel(); + state + .node + .randomness_handle() + .admin_inject_partial_signatures(authority_name, RandomnessRound(round), sigs, tx_result); + + match rx_result.await { + Ok(Ok(())) => (StatusCode::OK, "partial signatures injected\n".to_string()), + Ok(Err(e)) => (StatusCode::BAD_REQUEST, e.to_string()), + Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()), + } +} + +#[derive(Deserialize)] +struct FullSigToInject { + round: u64, + base64_sig: String, +} + +async fn randomness_inject_full_sig( + State(state): State>, + args: Query, +) -> (StatusCode, String) { + let Query(FullSigToInject { round, base64_sig }) = args; + + let sig: Vec = match base64::engine::general_purpose::URL_SAFE_NO_PAD.decode(base64_sig) { + Ok(sig) => sig, + Err(err) => return (StatusCode::BAD_REQUEST, err.to_string()), + }; + + let sig: RandomnessSignature = match bcs::from_bytes(&sig) { + Ok(sig) => sig, + Err(err) => return (StatusCode::BAD_REQUEST, err.to_string()), + }; + + let (tx_result, rx_result) = oneshot::channel(); + state.node.randomness_handle().admin_inject_full_signature( + RandomnessRound(round), + sig, + tx_result, + ); + + match rx_result.await { + Ok(Ok(())) => (StatusCode::OK, "full signature injected\n".to_string()), + Ok(Err(e)) => (StatusCode::BAD_REQUEST, e.to_string()), + Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()), + } +} diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index 78009d3f38302..59aff2583d501 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -1806,6 +1806,10 @@ impl SuiNode { pub fn get_config(&self) -> &NodeConfig { &self.config } + + pub fn randomness_handle(&self) -> randomness::Handle { + self.randomness_handle.clone() + } } #[cfg(not(msim))] From 15acca373f829709a4e81206ae62be14688af534 Mon Sep 17 00:00:00 2001 From: jk jensen Date: Mon, 15 Jul 2024 11:54:58 -0700 Subject: [PATCH 034/163] [suiop][incidents] add --with-priority flag (#18673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description enable limiting incident results to those with a priority set via the `--with-priority`/`-p` flag. ## Test plan ``` » cargo run --bin suiop -- i r -p Finished dev [unoptimized + debuginfo] target(s) in 0.43s Running `/Users/jordankylejensen/mysten/sui/target/debug/suiop i r -p` 2433: (2d) P0 dummy incident 3135: (2d) P2 [FIRING:2] incident for something 3134: (2d) P2 [FIRING:2] redacted ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/suiop-cli/src/cli/incidents/mod.rs | 12 +++++++++--- crates/suiop-cli/src/cli/incidents/pd.rs | 11 ++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/crates/suiop-cli/src/cli/incidents/mod.rs b/crates/suiop-cli/src/cli/incidents/mod.rs index 9436c501e7737..dff7868b76ad5 100644 --- a/crates/suiop-cli/src/cli/incidents/mod.rs +++ b/crates/suiop-cli/src/cli/incidents/mod.rs @@ -30,6 +30,9 @@ pub enum IncidentsAction { /// the days to go back #[arg(short, long, default_value = "7")] days: usize, + /// limit to incidents with any priority set + #[arg(long, short = 'p', default_value = "false")] + with_priority: bool, }, /// generate Jira tasks for incident follow ups #[command(name = "generate follow up tasks", aliases=["g", "gen", "generate"])] @@ -42,9 +45,12 @@ pub enum IncidentsAction { pub async fn incidents_cmd(args: &IncidentsArgs) -> Result<()> { match &args.action { - IncidentsAction::GetRecentIncidents { long, limit, days } => { - print_recent_incidents(*long, *limit, *days).await? - } + IncidentsAction::GetRecentIncidents { + long, + limit, + days, + with_priority, + } => print_recent_incidents(*long, *limit, *days, *with_priority).await?, IncidentsAction::GenerateFollowUpTasks { input_filename } => { generate_follow_up_tasks(input_filename).await? } diff --git a/crates/suiop-cli/src/cli/incidents/pd.rs b/crates/suiop-cli/src/cli/incidents/pd.rs index 6369c9b942c2a..e588a9954400b 100644 --- a/crates/suiop-cli/src/cli/incidents/pd.rs +++ b/crates/suiop-cli/src/cli/incidents/pd.rs @@ -87,7 +87,12 @@ async fn fetch_incidents( Ok(all_incidents) } -pub async fn print_recent_incidents(long: bool, limit: usize, days: usize) -> Result<()> { +pub async fn print_recent_incidents( + long: bool, + limit: usize, + days: usize, + with_priority: bool, +) -> Result<()> { let current_time = Local::now(); let start_time = current_time - Duration::days(days as i64); let date_format_in = "%Y-%m-%dT%H:%M:%SZ"; @@ -151,6 +156,10 @@ pub async fn print_recent_incidents(long: bool, limit: usize, days: usize) -> Re Some("P4") => "P4".white(), _ => " ".white(), }; + if with_priority && priority == " ".white() { + // skip incidents without priority + continue; + } println!( "{}: ({}) {} {} ({})", incident["incident_number"] From 96a222b2261ccec16882cdc6fe0af689e8b7a113 Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Mon, 15 Jul 2024 16:14:23 -0400 Subject: [PATCH 035/163] Cancel randomness-using tx on DKG failure instead of ignoring (#18511) --- crates/sui-benchmark/tests/simtest.rs | 12 +++ .../authority/authority_per_epoch_store.rs | 41 ++++++----- .../shared_object_version_manager.rs | 73 ++++++++++++++++--- .../src/unit_tests/authority_tests.rs | 7 +- crates/sui-core/tests/staged/sui.yaml | 2 + crates/sui-types/src/base_types.rs | 6 +- crates/sui-types/src/execution_status.rs | 3 + crates/sui-types/src/transaction.rs | 30 +++++--- .../tests/staged/exec_failure_status.yaml | 1 + .../sui-adapter/src/execution_engine.rs | 27 ++++--- .../v1/sui-adapter/src/execution_engine.rs | 28 ++++--- .../v2/sui-adapter/src/execution_engine.rs | 28 ++++--- 12 files changed, 186 insertions(+), 72 deletions(-) diff --git a/crates/sui-benchmark/tests/simtest.rs b/crates/sui-benchmark/tests/simtest.rs index 6c9f4ce80a904..f0d1dfa5cbe88 100644 --- a/crates/sui-benchmark/tests/simtest.rs +++ b/crates/sui-benchmark/tests/simtest.rs @@ -500,6 +500,18 @@ mod test { test_simulated_load_with_test_config(test_cluster, 50, simulated_load_config).await; } + // Tests cluster liveness when DKG has failed. + #[sim_test(config = "test_config()")] + async fn test_simulated_load_dkg_failure() { + let _guard = ProtocolConfig::apply_overrides_for_testing(move |_, mut config| { + config.set_random_beacon_dkg_timeout_round_for_testing(0); + config + }); + + let test_cluster = build_test_cluster(4, 30_000).await; + test_simulated_load(test_cluster, 120).await; + } + #[sim_test(config = "test_config()")] async fn test_data_ingestion_pipeline() { let path = nondeterministic!(TempDir::new().unwrap()).into_path(); 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 c7c2be043f482..7e60dd8a74421 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -136,6 +136,7 @@ type JwkAggregator = GenericMultiStakeAggregator<(JwkId, JWK), true>; pub enum CancelConsensusCertificateReason { CongestionOnObjects(Vec), + DkgFailed, } pub enum ConsensusCertificateResult { @@ -2783,15 +2784,18 @@ impl AuthorityPerEpochStore { self.write_pending_checkpoint(&mut batch, &pending_checkpoint)?; // Generate pending checkpoint for user tx with randomness. - // Note if randomness is not generated for this commit, we will skip the - // checkpoint with the associated height. Therefore checkpoint heights may - // not be contiguous. + // - 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()) { let pending_checkpoint = PendingCheckpointV2::V2(PendingCheckpointV2Contents { roots: randomness_roots.into_iter().collect(), details: PendingCheckpointInfo { @@ -2864,16 +2868,17 @@ impl AuthorityPerEpochStore { let mut shared_input_next_version = HashMap::new(); for txn in transactions.iter() { - if let Some(CancelConsensusCertificateReason::CongestionOnObjects(_)) = - cancelled_txns.get(txn.digest()) - { - let assigned_versions = SharedObjVerManager::assign_versions_for_certificate( - txn, - &mut shared_input_next_version, - cancelled_txns, - ); - - version_assignment.push((*txn.digest(), assigned_versions)); + match cancelled_txns.get(txn.digest()) { + Some(CancelConsensusCertificateReason::CongestionOnObjects(_)) + | Some(CancelConsensusCertificateReason::DkgFailed) => { + let assigned_versions = SharedObjVerManager::assign_versions_for_certificate( + txn, + &mut shared_input_next_version, + cancelled_txns, + ); + version_assignment.push((*txn.digest(), assigned_versions)); + } + None => {} } } @@ -3445,12 +3450,14 @@ impl AuthorityPerEpochStore { && self.randomness_state_enabled() && certificate.transaction_data().uses_randomness() { - // TODO: Cancel these immediately instead of waiting until end of epoch. debug!( - "Ignoring randomness-using certificate for transaction {:?} because DKG failed", + "Canceling randomness-using certificate for transaction {:?} because DKG failed", certificate.digest(), ); - return Ok(ConsensusCertificateResult::Ignored); + return Ok(ConsensusCertificateResult::Cancelled(( + certificate, + CancelConsensusCertificateReason::DkgFailed, + ))); } // This certificate will be scheduled. Update object execution cost. diff --git a/crates/sui-core/src/authority/shared_object_version_manager.rs b/crates/sui-core/src/authority/shared_object_version_manager.rs index d1bec3c886a40..3ef2e2b37a919 100644 --- a/crates/sui-core/src/authority/shared_object_version_manager.rs +++ b/crates/sui-core/src/authority/shared_object_version_manager.rs @@ -130,11 +130,12 @@ impl SharedObjVerManager { let tx_digest = cert.digest(); // Check if the transaction is cancelled due to congestion. - let cancellation_info: Option> = + let cancellation_info = cancelled_txns.get(tx_digest); + let congested_objects_info: Option> = if let Some(CancelConsensusCertificateReason::CongestionOnObjects(congested_objects)) = - cancelled_txns.get(tx_digest) + &cancellation_info { - Some(congested_objects.clone().into_iter().collect()) + Some(congested_objects.iter().cloned().collect()) } else { None }; @@ -151,14 +152,29 @@ impl SharedObjVerManager { let receiving_object_keys = transaction_receiving_object_keys(cert); input_object_keys.extend(receiving_object_keys); - if let Some(congested_objects) = cancellation_info { + if txn_cancelled { // For cancelled transaction due to congestion, assign special versions to all shared objects. // Note that new lamport version does not depend on any shared objects. for SharedInputObject { id, .. } in shared_input_objects.iter() { - let assigned_version = if congested_objects.contains(id) { - SequenceNumber::CONGESTED - } else { - SequenceNumber::CANCELLED_READ + let assigned_version = match cancellation_info { + Some(CancelConsensusCertificateReason::CongestionOnObjects(_)) => { + if congested_objects_info + .as_ref() + .is_some_and(|info| info.contains(id)) + { + SequenceNumber::CONGESTED + } else { + SequenceNumber::CANCELLED_READ + } + } + Some(CancelConsensusCertificateReason::DkgFailed) => { + if id == &SUI_RANDOMNESS_STATE_OBJECT_ID { + SequenceNumber::RANDOMNESS_UNAVAILABLE + } else { + SequenceNumber::CANCELLED_READ + } + } + None => unreachable!("cancelled transaction should have cancellation info"), }; assigned_versions.push((*id, assigned_version)); is_mutable_input.push(false); @@ -433,19 +449,26 @@ mod tests { .with_starting_objects(&[shared_object_1.clone(), shared_object_2.clone()]) .build() .await; + let randomness_obj_version = authority + .epoch_store_for_testing() + .epoch_start_config() + .randomness_obj_initial_shared_version() + .unwrap(); - // Generate 4 transactions for testing. + // Generate 5 transactions for testing. // tx1: shared_object_1, shared_object_2, owned_object_version = 3 // tx2: shared_object_1, shared_object_2, owned_object_version = 5 // tx3: shared_object_1, owned_object_version = 1 // tx4: shared_object_1, shared_object_2, owned_object_version = 9 + // tx5: shared_object_1, shared_object_2, owned_object_version = 11 // - // Later, we cancel transaction 2 and 4. + // Later, we cancel transaction 2 and 4 due to congestion, and 5 due to DKG failure. // Expected outcome: // tx1: both shared objects assign version 1, lamport version = 4 // tx2: shared objects assign cancelled version, lamport version = 6 due to gas object version = 5 // tx3: shared object 1 assign version 4, lamport version = 5 // tx4: shared objects assign cancelled version, lamport version = 10 due to gas object version = 9 + // tx5: shared objects assign cancelled version, lamport version = 12 due to gas object version = 11 let certs = vec![ generate_shared_objs_tx_with_gas_version( &[ @@ -469,6 +492,17 @@ mod tests { ], 9, ), + generate_shared_objs_tx_with_gas_version( + &[ + ( + SUI_RANDOMNESS_STATE_OBJECT_ID, + randomness_obj_version, + false, + ), + (id2, init_shared_version_2, true), + ], + 11, + ), ]; let epoch_store = authority.epoch_store_for_testing(); @@ -482,6 +516,10 @@ mod tests { *certs[3].digest(), CancelConsensusCertificateReason::CongestionOnObjects(vec![id2]), ), + ( + *certs[4].digest(), + CancelConsensusCertificateReason::DkgFailed, + ), ] .into_iter() .collect(); @@ -505,8 +543,9 @@ mod tests { assert_eq!( shared_input_next_versions, HashMap::from([ - (id1, SequenceNumber::from_u64(5)), // Determined by tx3 - (id2, SequenceNumber::from_u64(4)) // Determined by tx1 + (id1, SequenceNumber::from_u64(5)), // determined by tx3 + (id2, SequenceNumber::from_u64(4)), // determined by tx1 + (SUI_RANDOMNESS_STATE_OBJECT_ID, SequenceNumber::from_u64(1)), // not mutable ]) ); @@ -533,6 +572,16 @@ mod tests { (id2, SequenceNumber::CONGESTED) ] ), + ( + certs[4].key(), + vec![ + ( + SUI_RANDOMNESS_STATE_OBJECT_ID, + SequenceNumber::RANDOMNESS_UNAVAILABLE + ), + (id2, SequenceNumber::CANCELLED_READ) + ] + ), ] ); } diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index 4fb7d5280bda4..9d438715574a4 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -6119,9 +6119,10 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() { ] ); - // Test get_congested_objects. - let congested_objects = input_objects.get_congested_objects().unwrap(); - assert_eq!(congested_objects, vec![shared_objects[0].id()]); + // Test get_cancelled_objects. + let (cancelled_objects, cancellation_reason) = input_objects.get_cancelled_objects().unwrap(); + assert_eq!(cancelled_objects, vec![shared_objects[0].id()]); + assert_eq!(cancellation_reason, SequenceNumber::CONGESTED); // Consensus commit prologue contains cancelled txn shared object version assignment. if let TransactionKind::ConsensusCommitPrologueV3(prologue_txn) = diff --git a/crates/sui-core/tests/staged/sui.yaml b/crates/sui-core/tests/staged/sui.yaml index 48f170f451eba..1df79a034ff14 100644 --- a/crates/sui-core/tests/staged/sui.yaml +++ b/crates/sui-core/tests/staged/sui.yaml @@ -477,6 +477,8 @@ ExecutionFailureStatus: CoinTypeGlobalPause: STRUCT: - coin_type: STR + 36: + ExecutionCancelledDueToRandomnessUnavailable: UNIT ExecutionStatus: ENUM: 0: diff --git a/crates/sui-types/src/base_types.rs b/crates/sui-types/src/base_types.rs index 4652ab0fa803d..e31255a7167d8 100644 --- a/crates/sui-types/src/base_types.rs +++ b/crates/sui-types/src/base_types.rs @@ -1033,6 +1033,8 @@ impl SequenceNumber { pub const MAX: SequenceNumber = SequenceNumber(0x7fff_ffff_ffff_ffff); pub const CANCELLED_READ: SequenceNumber = SequenceNumber(SequenceNumber::MAX.value() + 1); pub const CONGESTED: SequenceNumber = SequenceNumber(SequenceNumber::MAX.value() + 2); + pub const RANDOMNESS_UNAVAILABLE: SequenceNumber = + SequenceNumber(SequenceNumber::MAX.value() + 3); pub const fn new() -> Self { SequenceNumber(0) @@ -1082,7 +1084,9 @@ impl SequenceNumber { } pub fn is_cancelled(&self) -> bool { - self == &SequenceNumber::CANCELLED_READ || self == &SequenceNumber::CONGESTED + self == &SequenceNumber::CANCELLED_READ + || self == &SequenceNumber::CONGESTED + || self == &SequenceNumber::RANDOMNESS_UNAVAILABLE } pub fn is_valid(&self) -> bool { diff --git a/crates/sui-types/src/execution_status.rs b/crates/sui-types/src/execution_status.rs index 3c21d0da3644a..8b04b57efa745 100644 --- a/crates/sui-types/src/execution_status.rs +++ b/crates/sui-types/src/execution_status.rs @@ -213,6 +213,9 @@ pub enum ExecutionFailureStatus { #[error("Coin type is globally paused for use: {coin_type}")] CoinTypeGlobalPause { coin_type: String }, + + #[error("Certificate is cancelled because randomness could not be generated this epoch")] + ExecutionCancelledDueToRandomnessUnavailable, // NOTE: if you want to add a new enum, // please add it at the end for Rust SDK backward compatibility. } diff --git a/crates/sui-types/src/transaction.rs b/crates/sui-types/src/transaction.rs index 59368e5a5d434..a2e37eddbd138 100644 --- a/crates/sui-types/src/transaction.rs +++ b/crates/sui-types/src/transaction.rs @@ -3043,22 +3043,34 @@ impl InputObjects { .any(|obj| obj.is_deleted_shared_object()) } - pub fn get_congested_objects(&self) -> Option> { - let mut contains_cancelled_read = false; - let mut congested_objects = Vec::new(); + // Returns IDs of objects responsible for a tranaction being cancelled, and the corresponding + // reason for cancellation. + pub fn get_cancelled_objects(&self) -> Option<(Vec, SequenceNumber)> { + let mut contains_cancelled = false; + let mut cancel_reason = None; + let mut cancelled_objects = Vec::new(); for obj in &self.objects { if let ObjectReadResultKind::CancelledTransactionSharedObject(version) = obj.object { - contains_cancelled_read = true; - if version == SequenceNumber::CONGESTED { - congested_objects.push(obj.id()); + contains_cancelled = true; + if version == SequenceNumber::CONGESTED + || version == SequenceNumber::RANDOMNESS_UNAVAILABLE + { + // Verify we don't have multiple cancellation reasons. + assert!(cancel_reason.is_none() || cancel_reason == Some(version)); + cancel_reason = Some(version); + cancelled_objects.push(obj.id()); } } } - if !congested_objects.is_empty() { - Some(congested_objects) + if !cancelled_objects.is_empty() { + Some(( + cancelled_objects, + cancel_reason + .expect("there should be a cancel reason if there are cancelled objects"), + )) } else { - assert!(!contains_cancelled_read); + assert!(!contains_cancelled); None } } diff --git a/crates/sui-types/tests/staged/exec_failure_status.yaml b/crates/sui-types/tests/staged/exec_failure_status.yaml index 1050f2bd6179a..7481b6e8f992d 100644 --- a/crates/sui-types/tests/staged/exec_failure_status.yaml +++ b/crates/sui-types/tests/staged/exec_failure_status.yaml @@ -35,3 +35,4 @@ 33: ExecutionCancelledDueToSharedObjectCongestion 34: AddressDeniedForCoin 35: CoinTypeGlobalPause +36: ExecutionCancelledDueToRandomnessUnavailable diff --git a/sui-execution/latest/sui-adapter/src/execution_engine.rs b/sui-execution/latest/sui-adapter/src/execution_engine.rs index 94179bf8c679c..31ec7305439aa 100644 --- a/sui-execution/latest/sui-adapter/src/execution_engine.rs +++ b/sui-execution/latest/sui-adapter/src/execution_engine.rs @@ -108,7 +108,7 @@ mod checked { let receiving_objects = transaction_kind.receiving_objects(); let mut transaction_dependencies = input_objects.transaction_dependencies(); let contains_deleted_input = input_objects.contains_deleted_objects(); - let congested_objects = input_objects.get_congested_objects(); + let cancelled_objects = input_objects.get_cancelled_objects(); let mut temporary_store = TemporaryStore::new( store, @@ -143,7 +143,7 @@ mod checked { enable_expensive_checks, deny_cert, contains_deleted_input, - congested_objects, + cancelled_objects, ); let status = if let Err(error) = &execution_result { @@ -277,7 +277,7 @@ mod checked { enable_expensive_checks: bool, deny_cert: bool, contains_deleted_input: bool, - congested_objects: Option>, + cancelled_objects: Option<(Vec, SequenceNumber)>, ) -> ( GasCostSummary, Result, @@ -307,13 +307,20 @@ mod checked { ExecutionErrorKind::InputObjectDeleted, None, )) - } else if let Some(congested_objects) = congested_objects { - Err(ExecutionError::new( - ExecutionErrorKind::ExecutionCancelledDueToSharedObjectCongestion { - congested_objects: CongestedObjects(congested_objects), - }, - None, - )) + } else if let Some((cancelled_objects, reason)) = cancelled_objects { + match reason { + SequenceNumber::CONGESTED => Err(ExecutionError::new( + ExecutionErrorKind::ExecutionCancelledDueToSharedObjectCongestion { + congested_objects: CongestedObjects(cancelled_objects), + }, + None, + )), + SequenceNumber::RANDOMNESS_UNAVAILABLE => Err(ExecutionError::new( + ExecutionErrorKind::ExecutionCancelledDueToRandomnessUnavailable, + None, + )), + _ => panic!("invalid cancellation reason SequenceNumber: {reason}"), + } } else { execution_loop::( temporary_store, diff --git a/sui-execution/v1/sui-adapter/src/execution_engine.rs b/sui-execution/v1/sui-adapter/src/execution_engine.rs index 7df83fa4baa1c..67cf1c7cc533f 100644 --- a/sui-execution/v1/sui-adapter/src/execution_engine.rs +++ b/sui-execution/v1/sui-adapter/src/execution_engine.rs @@ -13,6 +13,7 @@ mod checked { BALANCE_CREATE_REWARDS_FUNCTION_NAME, BALANCE_DESTROY_REBATES_FUNCTION_NAME, BALANCE_MODULE_NAME, }; + use sui_types::base_types::SequenceNumber; use sui_types::execution_mode::{self, ExecutionMode}; use sui_types::gas_coin::GAS; use sui_types::messages_checkpoint::CheckpointTimestamp; @@ -84,7 +85,7 @@ mod checked { let receiving_objects = transaction_kind.receiving_objects(); let mut transaction_dependencies = input_objects.transaction_dependencies(); let contains_deleted_input = input_objects.contains_deleted_objects(); - let congested_objects = input_objects.get_congested_objects(); + let cancelled_objects = input_objects.get_cancelled_objects(); let mut temporary_store = TemporaryStore::new( store, @@ -118,7 +119,7 @@ mod checked { enable_expensive_checks, deny_cert, contains_deleted_input, - congested_objects, + cancelled_objects, ); let status = if let Err(error) = &execution_result { @@ -243,7 +244,7 @@ mod checked { enable_expensive_checks: bool, deny_cert: bool, contains_deleted_input: bool, - congested_objects: Option>, + cancelled_objects: Option<(Vec, SequenceNumber)>, ) -> ( GasCostSummary, Result, @@ -273,13 +274,20 @@ mod checked { ExecutionErrorKind::InputObjectDeleted, None, )) - } else if let Some(congested_objects) = congested_objects { - Err(ExecutionError::new( - ExecutionErrorKind::ExecutionCancelledDueToSharedObjectCongestion { - congested_objects: CongestedObjects(congested_objects), - }, - None, - )) + } else if let Some((cancelled_objects, reason)) = cancelled_objects { + match reason { + SequenceNumber::CONGESTED => Err(ExecutionError::new( + ExecutionErrorKind::ExecutionCancelledDueToSharedObjectCongestion { + congested_objects: CongestedObjects(cancelled_objects), + }, + None, + )), + SequenceNumber::RANDOMNESS_UNAVAILABLE => Err(ExecutionError::new( + ExecutionErrorKind::ExecutionCancelledDueToRandomnessUnavailable, + None, + )), + _ => panic!("invalid cancellation reason SequenceNumber: {reason}"), + } } else { execution_loop::( temporary_store, diff --git a/sui-execution/v2/sui-adapter/src/execution_engine.rs b/sui-execution/v2/sui-adapter/src/execution_engine.rs index 38c9347737098..2be1454ba0a26 100644 --- a/sui-execution/v2/sui-adapter/src/execution_engine.rs +++ b/sui-execution/v2/sui-adapter/src/execution_engine.rs @@ -13,6 +13,7 @@ mod checked { BALANCE_CREATE_REWARDS_FUNCTION_NAME, BALANCE_DESTROY_REBATES_FUNCTION_NAME, BALANCE_MODULE_NAME, }; + use sui_types::base_types::SequenceNumber; use sui_types::execution_mode::{self, ExecutionMode}; use sui_types::gas_coin::GAS; use sui_types::messages_checkpoint::CheckpointTimestamp; @@ -95,7 +96,7 @@ mod checked { let receiving_objects = transaction_kind.receiving_objects(); let mut transaction_dependencies = input_objects.transaction_dependencies(); let contains_deleted_input = input_objects.contains_deleted_objects(); - let congested_objects = input_objects.get_congested_objects(); + let cancelled_objects = input_objects.get_cancelled_objects(); let mut temporary_store = TemporaryStore::new( store, @@ -129,7 +130,7 @@ mod checked { enable_expensive_checks, deny_cert, contains_deleted_input, - congested_objects, + cancelled_objects, ); let status = if let Err(error) = &execution_result { @@ -262,7 +263,7 @@ mod checked { enable_expensive_checks: bool, deny_cert: bool, contains_deleted_input: bool, - congested_objects: Option>, + cancelled_objects: Option<(Vec, SequenceNumber)>, ) -> ( GasCostSummary, Result, @@ -292,13 +293,20 @@ mod checked { ExecutionErrorKind::InputObjectDeleted, None, )) - } else if let Some(congested_objects) = congested_objects { - Err(ExecutionError::new( - ExecutionErrorKind::ExecutionCancelledDueToSharedObjectCongestion { - congested_objects: CongestedObjects(congested_objects), - }, - None, - )) + } else if let Some((cancelled_objects, reason)) = cancelled_objects { + match reason { + SequenceNumber::CONGESTED => Err(ExecutionError::new( + ExecutionErrorKind::ExecutionCancelledDueToSharedObjectCongestion { + congested_objects: CongestedObjects(cancelled_objects), + }, + None, + )), + SequenceNumber::RANDOMNESS_UNAVAILABLE => Err(ExecutionError::new( + ExecutionErrorKind::ExecutionCancelledDueToRandomnessUnavailable, + None, + )), + _ => panic!("invalid cancellation reason SequenceNumber: {reason}"), + } } else { execution_loop::( temporary_store, From 77b6e6ec861786cb7857661c198614003441cb00 Mon Sep 17 00:00:00 2001 From: Adam Welc Date: Mon, 15 Jul 2024 14:11:47 -0700 Subject: [PATCH 036/163] [move-ide] Added inlay type hints for unpacks (#18650) ## Description With this PR inlay type hints work for variant unpacks (they already worked for struct unpacks): ![image](https://github.com/user-attachments/assets/5bef6232-62c3-407a-8bcb-89504efb4a40) This includes nested patterns: ![image](https://github.com/user-attachments/assets/581af7ae-9471-426c-9db5-5376674f4539) This PR also changes the way that types are displayed for type hints - the fully qualified name seemed too long (particularly for functions with multiple parameters on the same line) and not really necessary (or redundant even) since you can hover over the hint to see the full type. ## Test plan All new and existing tests must pass --- .../move-analyzer/editors/code/README.md | 2 +- .../move-analyzer/editors/code/package.json | 2 +- .../crates/move-analyzer/src/inlay_hints.rs | 2 +- .../move/crates/move-analyzer/src/symbols.rs | 19 +++++--- .../tests/inlay-hints/sources/type_hints.move | 43 +++++++++++++++++++ .../move-analyzer/tests/inlay_hints.exp | 36 ++++++++++++++-- .../move-analyzer/tests/inlay_hints.ide | 40 +++++++++++++++++ 7 files changed, 133 insertions(+), 11 deletions(-) diff --git a/external-crates/move/crates/move-analyzer/editors/code/README.md b/external-crates/move/crates/move-analyzer/editors/code/README.md index ef579845ad3e3..7810592db0adb 100644 --- a/external-crates/move/crates/move-analyzer/editors/code/README.md +++ b/external-crates/move/crates/move-analyzer/editors/code/README.md @@ -93,7 +93,7 @@ Move source file (a file with a `.move` file extension) and: - type on hover - outline view showing symbol tree for Move source files - inlay hints: - - types: local declarations and lambda parameters + - types: local declarations, lambda parameters, variant and struct pattern matching - parameter names at function calls - If the opened Move source file is located within a buildable project you can build and (locally) test this project using `Move: Build a Move package` and `Move: Test a Move package` commands from diff --git a/external-crates/move/crates/move-analyzer/editors/code/package.json b/external-crates/move/crates/move-analyzer/editors/code/package.json index 9cbb328d44653..69839e35c5720 100644 --- a/external-crates/move/crates/move-analyzer/editors/code/package.json +++ b/external-crates/move/crates/move-analyzer/editors/code/package.json @@ -5,7 +5,7 @@ "publisher": "mysten", "icon": "images/move.png", "license": "Apache-2.0", - "version": "1.0.9", + "version": "1.0.10", "preview": true, "repository": { "url": "https://github.com/MystenLabs/sui.git", diff --git a/external-crates/move/crates/move-analyzer/src/inlay_hints.rs b/external-crates/move/crates/move-analyzer/src/inlay_hints.rs index 61fd2e92d86da..d5e337e3b380c 100644 --- a/external-crates/move/crates/move-analyzer/src/inlay_hints.rs +++ b/external-crates/move/crates/move-analyzer/src/inlay_hints.rs @@ -69,7 +69,7 @@ fn inlay_type_hints_internal(symbols: &Symbols, mod_defs: &ModuleDefs, hints: &m command: None, }; let type_label = InlayHintLabelPart { - value: type_to_ide_string(t, /* verbose */ true), + value: type_to_ide_string(t, /* verbose */ false), tooltip: None, location: None, command: None, diff --git a/external-crates/move/crates/move-analyzer/src/symbols.rs b/external-crates/move/crates/move-analyzer/src/symbols.rs index e9ccd3783a614..98c97946f801e 100644 --- a/external-crates/move/crates/move-analyzer/src/symbols.rs +++ b/external-crates/move/crates/move-analyzer/src/symbols.rs @@ -375,6 +375,7 @@ pub struct ModuleDefs { /// Function definitions pub functions: BTreeMap, /// Definitions where the type is not explicitly specified + /// and should be inserted as an inlay hint pub untyped_defs: BTreeSet, /// Information about calls in this module pub call_infos: BTreeMap, @@ -2729,7 +2730,16 @@ impl<'a> ParsingSymbolicator<'a> { } }) } - MP::Name(_, chain) => self.chain_symbols(chain), + MP::Name(_, chain) => { + self.chain_symbols(chain); + assert!(self.current_mod_ident_str.is_some()); + if let Some(mod_defs) = self + .mod_outer_defs + .get_mut(&self.current_mod_ident_str.clone().unwrap()) + { + mod_defs.untyped_defs.insert(chain.loc); + }; + } MP::Or(m1, m2) => { self.match_pattern_symbols(m2); self.match_pattern_symbols(m1); @@ -2948,13 +2958,12 @@ impl<'a> ParsingSymbolicator<'a> { B::Var(_, var) => { if !explicitly_typed { assert!(self.current_mod_ident_str.is_some()); - let Some(mod_defs) = self + if let Some(mod_defs) = self .mod_outer_defs .get_mut(&self.current_mod_ident_str.clone().unwrap()) - else { - return; + { + mod_defs.untyped_defs.insert(var.loc()); }; - mod_defs.untyped_defs.insert(var.loc()); } } } diff --git a/external-crates/move/crates/move-analyzer/tests/inlay-hints/sources/type_hints.move b/external-crates/move/crates/move-analyzer/tests/inlay-hints/sources/type_hints.move index 0c4805e1d8d48..31269f6190849 100644 --- a/external-crates/move/crates/move-analyzer/tests/inlay-hints/sources/type_hints.move +++ b/external-crates/move/crates/move-analyzer/tests/inlay-hints/sources/type_hints.move @@ -28,4 +28,47 @@ module InlayHints::type_hints { baz!(s, |x_gen_struct| x_gen_struct); } + public struct AnotherStruct has drop, copy { + some_field: T, + } + + public enum SomeEnum has drop { + PositionalFields(u64, AnotherStruct), + NamedFields{ num: u64, s: AnotherStruct }, + } + + public fun unpack_test(some_struct: SomeStruct): u64 { + use InlayHints::type_hints::SomeEnum as SE; + let SomeStruct { some_field } = some_struct; + let s = AnotherStruct { some_field }; + let SomeStruct { some_field: v } = some_struct; + let e = SE::PositionalFields(v, s); + + match (e) { + SomeEnum::PositionalFields(num, s) => { + num + }, + SE::NamedFields { num: n, s } => { + n + s.some_field + }, + } + } + + public enum OuterEnum has drop { + PositionalFields(T1, T2), + NamedFields { field: T2 }, + } + + public enum InnerEnum has drop { + Left(L), + Right(R), + } + + public fun nested_match_test(e: OuterEnum>): u64 { + match (e) { + OuterEnum::PositionalFields(num, InnerEnum::Left(inner_num)) => num + inner_num, + OuterEnum::NamedFields { field: InnerEnum::Right(inner_num) } => inner_num, + _ => 42, + } + } } diff --git a/external-crates/move/crates/move-analyzer/tests/inlay_hints.exp b/external-crates/move/crates/move-analyzer/tests/inlay_hints.exp index 9550dfe97153c..38605509e3c87 100644 --- a/external-crates/move/crates/move-analyzer/tests/inlay_hints.exp +++ b/external-crates/move/crates/move-analyzer/tests/inlay_hints.exp @@ -27,7 +27,7 @@ second_param: InlayHints::param_hints::SomeStruct -- test 0 ------------------- INLAY TYPE HINT : u64 -- test 1 ------------------- -INLAY TYPE HINT : InlayHints::type_hints::SomeStruct +INLAY TYPE HINT : SomeStruct ON HOVER: ```rust public struct InlayHints::type_hints::SomeStruct has copy, drop { @@ -37,7 +37,7 @@ public struct InlayHints::type_hints::SomeStruct has copy, drop { -- test 2 ------------------- INLAY TYPE HINT : u64 -- test 3 ------------------- -INLAY TYPE HINT : InlayHints::type_hints::SomeStruct +INLAY TYPE HINT : SomeStruct ON HOVER: ```rust public struct InlayHints::type_hints::SomeStruct has copy, drop { @@ -47,10 +47,40 @@ public struct InlayHints::type_hints::SomeStruct has copy, drop { -- test 4 ------------------- INLAY TYPE HINT : u64 -- test 5 ------------------- -INLAY TYPE HINT : InlayHints::type_hints::SomeStruct +INLAY TYPE HINT : SomeStruct ON HOVER: ```rust public struct InlayHints::type_hints::SomeStruct has copy, drop { some_field: u64 } ``` +-- test 6 ------------------- +INLAY TYPE HINT : u64 +-- test 7 ------------------- +INLAY TYPE HINT : u64 +-- test 8 ------------------- +INLAY TYPE HINT : u64 +-- test 9 ------------------- +INLAY TYPE HINT : AnotherStruct +ON HOVER: +```rust +public struct InlayHints::type_hints::AnotherStruct has copy, drop { + some_field: T +} +``` +-- test 10 ------------------- +INLAY TYPE HINT : u64 +-- test 11 ------------------- +INLAY TYPE HINT : AnotherStruct +ON HOVER: +```rust +public struct InlayHints::type_hints::AnotherStruct has copy, drop { + some_field: T +} +``` +-- test 12 ------------------- +INLAY TYPE HINT : u64 +-- test 13 ------------------- +INLAY TYPE HINT : u64 +-- test 14 ------------------- +INLAY TYPE HINT : u64 diff --git a/external-crates/move/crates/move-analyzer/tests/inlay_hints.ide b/external-crates/move/crates/move-analyzer/tests/inlay_hints.ide index 5cfe965ec539c..5983f0af561f1 100644 --- a/external-crates/move/crates/move-analyzer/tests/inlay_hints.ide +++ b/external-crates/move/crates/move-analyzer/tests/inlay_hints.ide @@ -5,6 +5,7 @@ "file_tests": { // tests inlay type hints "type_hints.move": [ + // local vars { "use_line": 8, "use_col": 23 @@ -13,6 +14,7 @@ "use_line": 9, "use_col": 25 }, + // lambdas { "use_line": 25, "use_col": 24 @@ -28,6 +30,44 @@ { "use_line": 28, "use_col": 30 + }, + // struct unpacks + { + "use_line": 42, + "use_col": 36 + }, + { + "use_line": 44, + "use_col": 39 + }, + // variant unpacks + { + "use_line": 48, + "use_col": 43 + }, + { + "use_line": 48, + "use_col": 46 + }, + { + "use_line": 51, + "use_col": 37 + }, + { + "use_line": 51, + "use_col": 40 + }, + { + "use_line": 69, + "use_col": 44 + }, + { + "use_line": 69, + "use_col": 71 + }, + { + "use_line": 70, + "use_col": 71 } ], // tests inlay param hints From 6514dce4083bfc6de633902b5a80b0717d3f7209 Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:29:21 -0700 Subject: [PATCH 037/163] avoid rebuilding sui cli during tests (#18678) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/unit_tests/data/entry_point_types/Move.lock | 2 +- .../src/unit_tests/data/entry_point_vector/Move.lock | 2 +- sdk/typescript/package.json | 2 +- sdk/typescript/test/e2e/data/coin_metadata/Move.lock | 2 +- sdk/typescript/test/e2e/data/dynamic_fields/Move.lock | 2 +- sdk/typescript/test/e2e/data/id_entry_args/Move.lock | 2 +- sdk/typescript/test/e2e/data/serializer/Move.lock | 2 +- sdk/typescript/test/e2e/utils/setup.ts | 11 ++++++----- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/crates/sui-core/src/unit_tests/data/entry_point_types/Move.lock b/crates/sui-core/src/unit_tests/data/entry_point_types/Move.lock index 6fd64473f7d5c..d637193357491 100644 --- a/crates/sui-core/src/unit_tests/data/entry_point_types/Move.lock +++ b/crates/sui-core/src/unit_tests/data/entry_point_types/Move.lock @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.29.0" +compiler-version = "1.30.0" edition = "2024.beta" flavor = "sui" diff --git a/crates/sui-core/src/unit_tests/data/entry_point_vector/Move.lock b/crates/sui-core/src/unit_tests/data/entry_point_vector/Move.lock index e33f835f80703..6cca232fdf7a3 100644 --- a/crates/sui-core/src/unit_tests/data/entry_point_vector/Move.lock +++ b/crates/sui-core/src/unit_tests/data/entry_point_vector/Move.lock @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.29.0" +compiler-version = "1.30.0" edition = "2024.beta" flavor = "sui" diff --git a/sdk/typescript/package.json b/sdk/typescript/package.json index b55a13597b11d..b1d0bd037a469 100644 --- a/sdk/typescript/package.json +++ b/sdk/typescript/package.json @@ -102,7 +102,7 @@ "test:unit": "vitest run unit __tests__", "test:e2e": "wait-on http://127.0.0.1:9123 -l --timeout 180000 && vitest run e2e", "test:e2e:nowait": "vitest run e2e", - "prepare:e2e": "docker-compose down && docker-compose up -d && cargo build --bin sui --features indexer --profile dev && cross-env RUST_LOG=warn,sui=error,anemo_tower=warn,consensus=off cargo run --features indexer --bin sui -- start --with-faucet --force-regenesis --with-indexer --pg-port 5435 --pg-db-name sui_indexer_v2 --with-graphql", + "prepare:e2e": "docker-compose down && docker-compose up -d && cargo build --bin sui --features indexer --profile dev && cross-env RUST_LOG=warn,sui=error,anemo_tower=warn,consensus=off ../../target/debug/sui start --with-faucet --force-regenesis --with-indexer --pg-port 5435 --pg-db-name sui_indexer_v2 --with-graphql", "prepublishOnly": "pnpm build", "size": "size-limit", "analyze": "size-limit --why", diff --git a/sdk/typescript/test/e2e/data/coin_metadata/Move.lock b/sdk/typescript/test/e2e/data/coin_metadata/Move.lock index 244dd6e142ce2..ce2caf0923842 100644 --- a/sdk/typescript/test/e2e/data/coin_metadata/Move.lock +++ b/sdk/typescript/test/e2e/data/coin_metadata/Move.lock @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.29.0" +compiler-version = "1.30.0" edition = "2024.beta" flavor = "sui" diff --git a/sdk/typescript/test/e2e/data/dynamic_fields/Move.lock b/sdk/typescript/test/e2e/data/dynamic_fields/Move.lock index 1e028e87a1514..438df7255bad1 100644 --- a/sdk/typescript/test/e2e/data/dynamic_fields/Move.lock +++ b/sdk/typescript/test/e2e/data/dynamic_fields/Move.lock @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.29.0" +compiler-version = "1.30.0" edition = "2024.beta" flavor = "sui" diff --git a/sdk/typescript/test/e2e/data/id_entry_args/Move.lock b/sdk/typescript/test/e2e/data/id_entry_args/Move.lock index f87fdc0f07c5b..04c8672f54a02 100644 --- a/sdk/typescript/test/e2e/data/id_entry_args/Move.lock +++ b/sdk/typescript/test/e2e/data/id_entry_args/Move.lock @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.29.0" +compiler-version = "1.30.0" edition = "2024.beta" flavor = "sui" diff --git a/sdk/typescript/test/e2e/data/serializer/Move.lock b/sdk/typescript/test/e2e/data/serializer/Move.lock index 3d68ec230f855..0da12b5b3f133 100644 --- a/sdk/typescript/test/e2e/data/serializer/Move.lock +++ b/sdk/typescript/test/e2e/data/serializer/Move.lock @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.29.0" +compiler-version = "1.30.0" edition = "2024.beta" flavor = "sui" diff --git a/sdk/typescript/test/e2e/utils/setup.ts b/sdk/typescript/test/e2e/utils/setup.ts index b1af7cdd7fe74..c67bd64b2c83a 100644 --- a/sdk/typescript/test/e2e/utils/setup.ts +++ b/sdk/typescript/test/e2e/utils/setup.ts @@ -4,7 +4,7 @@ import { execSync } from 'child_process'; import { mkdtemp } from 'fs/promises'; import { tmpdir } from 'os'; -import path, { resolve } from 'path'; +import path from 'path'; import tmp from 'tmp'; import { retry } from 'ts-retry-promise'; import { expect } from 'vitest'; @@ -16,7 +16,7 @@ import type { Keypair } from '../../../src/cryptography/index.js'; import { FaucetRateLimitError, getFaucetHost, - requestSuiFromFaucetV0, + requestSuiFromFaucetV1, } from '../../../src/faucet/index.js'; import { Ed25519Keypair } from '../../../src/keypairs/ed25519/index.js'; import { Transaction, UpgradePolicy } from '../../../src/transactions/index.js'; @@ -25,7 +25,8 @@ import { SUI_TYPE_ARG } from '../../../src/utils/index.js'; const DEFAULT_FAUCET_URL = import.meta.env.VITE_FAUCET_URL ?? getFaucetHost('localnet'); const DEFAULT_FULLNODE_URL = import.meta.env.VITE_FULLNODE_URL ?? getFullnodeUrl('localnet'); -const SUI_BIN = import.meta.env.VITE_SUI_BIN ?? 'cargo run --bin sui'; +const SUI_BIN = + import.meta.env.VITE_SUI_BIN ?? path.resolve(__dirname, '../../../../../target/debug/sui'); export const DEFAULT_RECIPIENT = '0x0c567ffdf8162cb6d51af74be0199443b92e823d4ba6ced24de5c6c463797d46'; @@ -97,7 +98,7 @@ export class TestToolbox { } async mintNft(name: string = 'Test NFT') { - const packageId = await this.getPackage(resolve(__dirname, '../data/demo-bear')); + const packageId = await this.getPackage(path.resolve(__dirname, '../data/demo-bear')); return (tx: Transaction) => { return tx.moveCall({ target: `${packageId}::demo_bear::new`, @@ -132,7 +133,7 @@ export async function setupWithFundedAddress( { rpcURL }: { graphQLURL?: string; rpcURL?: string } = {}, ) { const client = getClient(rpcURL); - await retry(() => requestSuiFromFaucetV0({ host: DEFAULT_FAUCET_URL, recipient: address }), { + await retry(() => requestSuiFromFaucetV1({ host: DEFAULT_FAUCET_URL, recipient: address }), { backoff: 'EXPONENTIAL', // overall timeout in 60 seconds timeout: 1000 * 60, From 98b5d236f1226f8057f279050aee00f0e9f2098b Mon Sep 17 00:00:00 2001 From: phoenix <51927076+phoenix-o@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:01:35 -0500 Subject: [PATCH 038/163] [data ingestion] hybrid remote setup (#18677) adding support for hybrid setup, where indexer fetches checkpoint from a remote FN and falls back to a remote bucket if the FN's already pruned --- crates/sui-data-ingestion-core/src/reader.rs | 46 ++++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/crates/sui-data-ingestion-core/src/reader.rs b/crates/sui-data-ingestion-core/src/reader.rs index c85c661eb6e36..c8168da29cce8 100644 --- a/crates/sui-data-ingestion-core/src/reader.rs +++ b/crates/sui-data-ingestion-core/src/reader.rs @@ -16,6 +16,7 @@ use std::ffi::OsString; use std::fs; use std::path::PathBuf; use std::time::Duration; +use sui_rest_api::Client; use sui_storage::blob::Blob; use sui_types::full_checkpoint_content::CheckpointData; use sui_types::messages_checkpoint::CheckpointSequenceNumber; @@ -65,6 +66,7 @@ impl Default for ReaderOptions { enum RemoteStore { ObjectStore(Box), Rest(sui_rest_api::Client), + Hybrid(Box, sui_rest_api::Client), } impl CheckpointReader { @@ -99,21 +101,41 @@ impl CheckpointReader { || self.data_limiter.exceeds() } + async fn fetch_from_object_store( + store: &dyn ObjectStore, + checkpoint_number: CheckpointSequenceNumber, + ) -> Result<(CheckpointData, usize)> { + let path = Path::from(format!("{}.chk", checkpoint_number)); + let response = store.get(&path).await?; + let bytes = response.bytes().await?; + Ok((Blob::from_bytes::(&bytes)?, bytes.len())) + } + + async fn fetch_from_full_node( + client: &Client, + checkpoint_number: CheckpointSequenceNumber, + ) -> Result<(CheckpointData, usize)> { + let checkpoint = client.get_full_checkpoint(checkpoint_number).await?; + let size = bcs::serialized_size(&checkpoint)?; + Ok((checkpoint, size)) + } + async fn remote_fetch_checkpoint_internal( store: &RemoteStore, checkpoint_number: CheckpointSequenceNumber, ) -> Result<(CheckpointData, usize)> { match store { RemoteStore::ObjectStore(store) => { - let path = Path::from(format!("{}.chk", checkpoint_number)); - let response = store.get(&path).await?; - let bytes = response.bytes().await?; - Ok((Blob::from_bytes::(&bytes)?, bytes.len())) + Self::fetch_from_object_store(store, checkpoint_number).await } RemoteStore::Rest(client) => { - let checkpoint = client.get_full_checkpoint(checkpoint_number).await?; - let size = bcs::serialized_size(&checkpoint)?; - Ok((checkpoint, size)) + Self::fetch_from_full_node(client, checkpoint_number).await + } + RemoteStore::Hybrid(store, client) => { + match Self::fetch_from_full_node(client, checkpoint_number).await { + Ok(result) => Ok(result), + Err(_) => Self::fetch_from_object_store(store, checkpoint_number).await, + } } } } @@ -155,7 +177,15 @@ impl CheckpointReader { .remote_store_url .clone() .expect("remote store url must be set"); - let store = if url.ends_with("/rest") { + let store = if let Some((fn_url, remote_url)) = url.split_once('|') { + let object_store = create_remote_store_client( + remote_url.to_string(), + self.remote_store_options.clone(), + self.options.timeout_secs, + ) + .expect("failed to create remote store client"); + RemoteStore::Hybrid(object_store, sui_rest_api::Client::new(fn_url)) + } else if url.ends_with("/rest") { RemoteStore::Rest(sui_rest_api::Client::new(url)) } else { let object_store = create_remote_store_client( From 0984a6bcde7b675f65b03659d21b3365566fcdd8 Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:43:21 -0700 Subject: [PATCH 039/163] Add metrics for batch verify and overload (#18680) ## Description Add a metric for time consumed during transaction verifications in Mysticeti. Add a metric for the specific overloaded component when transactions are rejected for signing / submission. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-core/src/authority.rs | 28 +++++++++++++++++++--- crates/sui-core/src/consensus_validator.rs | 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 23198ff30a6e0..a626fd3d09f04 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -264,6 +264,8 @@ pub struct AuthorityMetrics { pub(crate) authority_overload_status: IntGauge, pub(crate) authority_load_shedding_percentage: IntGauge, + pub(crate) transaction_overload_sources: IntCounterVec, + /// Post processing metrics post_processing_total_events_emitted: IntCounter, post_processing_total_tx_indexed: IntCounter, @@ -568,6 +570,12 @@ impl AuthorityMetrics { registry, ) .unwrap(), + transaction_overload_sources: register_int_counter_vec_with_registry!( + "transaction_overload_sources", + "Number of times each source indicates transaction overload.", + &["source"], + registry) + .unwrap(), execution_driver_executed_transactions: register_int_counter_with_registry!( "execution_driver_executed_transactions", "Cumulative number of transaction executed by execution driver", @@ -970,11 +978,18 @@ impl AuthorityState { do_authority_overload_check: bool, ) -> SuiResult { if do_authority_overload_check { - self.check_authority_overload(tx_data)?; + self.check_authority_overload(tx_data).tap_err(|_| { + self.update_overload_metrics("execution_queue"); + })?; } self.transaction_manager - .check_execution_overload(self.overload_config(), tx_data)?; - consensus_adapter.check_consensus_overload()?; + .check_execution_overload(self.overload_config(), tx_data) + .tap_err(|_| { + self.update_overload_metrics("execution_pending"); + })?; + consensus_adapter.check_consensus_overload().tap_err(|_| { + self.update_overload_metrics("consensus"); + })?; Ok(()) } @@ -990,6 +1005,13 @@ impl AuthorityState { overload_monitor_accept_tx(load_shedding_percentage, tx_data.digest()) } + fn update_overload_metrics(&self, source: &str) { + self.metrics + .transaction_overload_sources + .with_label_values(&[source]) + .inc(); + } + /// Executes a transaction that's known to have correct effects. /// For such transaction, we don't have to wait for consensus to set shared object /// locks because we already know the shared object versions based on the effects. diff --git a/crates/sui-core/src/consensus_validator.rs b/crates/sui-core/src/consensus_validator.rs index d4d6321080112..6651241cd6a06 100644 --- a/crates/sui-core/src/consensus_validator.rs +++ b/crates/sui-core/src/consensus_validator.rs @@ -167,6 +167,8 @@ impl TransactionVerifier for SuiTxValidator { _protocol_config: &ProtocolConfig, batch: &[&[u8]], ) -> Result<(), ValidationError> { + let _scope = monitored_scope("ValidateBatch"); + let txs = batch .iter() .map(|tx| { From 33baaa761f30cd96c26f24f5851f2227e866e3c1 Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:58:20 -0700 Subject: [PATCH 040/163] Add more addresses checks for validator tool (#18570) ## Description as title and self-descriptive. ## Test plan tested locally. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/mysten-network/src/multiaddr.rs | 30 ++++++++++++++++++++++++++ crates/sui/src/validator_commands.rs | 13 +++++++++++ 2 files changed, 43 insertions(+) diff --git a/crates/mysten-network/src/multiaddr.rs b/crates/mysten-network/src/multiaddr.rs index 206363623786d..3137ee6a25222 100644 --- a/crates/mysten-network/src/multiaddr.rs +++ b/crates/mysten-network/src/multiaddr.rs @@ -101,6 +101,16 @@ impl Multiaddr { Ok(SocketAddr::new(ip, tcp_port)) } + // Returns true if the third component in the multiaddr is `Protocol::Tcp` + pub fn is_loosely_valid_tcp_addr(&self) -> bool { + let mut iter = self.iter(); + iter.next(); // Skip the ip/dns part + match iter.next() { + Some(Protocol::Tcp(_)) => true, + _ => false, // including `None` and `Some(other)` + } + } + /// Set the ip address to `0.0.0.0`. For instance, it converts the following address /// `/ip4/155.138.174.208/tcp/1500/http` into `/ip4/0.0.0.0/tcp/1500/http`. /// This is useful when starting a server and you want to listen on all interfaces. @@ -376,6 +386,26 @@ mod test { .expect_err("DNS is unsupported"); } + #[test] + fn test_is_loosely_valid_tcp_addr() { + let multi_addr_ipv4 = Multiaddr(multiaddr!(Ip4([127, 0, 0, 1]), Tcp(10500u16))); + assert!(multi_addr_ipv4.is_loosely_valid_tcp_addr()); + let multi_addr_ipv6 = Multiaddr(multiaddr!(Ip6([172, 0, 0, 1, 1, 1, 1, 1]), Tcp(10500u16))); + assert!(multi_addr_ipv6.is_loosely_valid_tcp_addr()); + let multi_addr_dns = Multiaddr(multiaddr!(Dnsaddr("mysten.sui"), Tcp(10500u16))); + assert!(multi_addr_dns.is_loosely_valid_tcp_addr()); + + let multi_addr_ipv4 = Multiaddr(multiaddr!(Ip4([127, 0, 0, 1]), Udp(10500u16))); + assert!(!multi_addr_ipv4.is_loosely_valid_tcp_addr()); + let multi_addr_ipv6 = Multiaddr(multiaddr!(Ip6([172, 0, 0, 1, 1, 1, 1, 1]), Udp(10500u16))); + assert!(!multi_addr_ipv6.is_loosely_valid_tcp_addr()); + let multi_addr_dns = Multiaddr(multiaddr!(Dnsaddr("mysten.sui"), Udp(10500u16))); + assert!(!multi_addr_dns.is_loosely_valid_tcp_addr()); + + let invalid_multi_addr_ipv4 = Multiaddr(multiaddr!(Ip4([127, 0, 0, 1]))); + assert!(!invalid_multi_addr_ipv4.is_loosely_valid_tcp_addr()); + } + #[test] fn test_get_hostname_port() { let multi_addr_ip4 = Multiaddr(multiaddr!(Ip4([127, 0, 0, 1]), Tcp(10500u16))); diff --git a/crates/sui/src/validator_commands.rs b/crates/sui/src/validator_commands.rs index 58570bcd602a2..1034aa3b7a317 100644 --- a/crates/sui/src/validator_commands.rs +++ b/crates/sui/src/validator_commands.rs @@ -1166,6 +1166,10 @@ async fn update_metadata( call_0x5(context, "update_validator_project_url", args, gas_budget).await } MetadataUpdate::NetworkAddress { network_address } => { + // Check the network address to be in TCP. + if !network_address.is_loosely_valid_tcp_addr() { + bail!("Network address must be a TCP address"); + } let _status = check_status(context, HashSet::from([Pending, Active])).await?; let args = vec![CallArg::Pure(bcs::to_bytes(&network_address).unwrap())]; call_0x5( @@ -1177,6 +1181,9 @@ async fn update_metadata( .await } MetadataUpdate::PrimaryAddress { primary_address } => { + primary_address.to_anemo_address().map_err(|_| { + anyhow!("Invalid primary address, it must look like `/[ip4,ip6,dns]/.../udp/port`") + })?; let _status = check_status(context, HashSet::from([Pending, Active])).await?; let args = vec![CallArg::Pure(bcs::to_bytes(&primary_address).unwrap())]; call_0x5( @@ -1188,6 +1195,9 @@ async fn update_metadata( .await } MetadataUpdate::WorkerAddress { worker_address } => { + worker_address.to_anemo_address().map_err(|_| { + anyhow!("Invalid worker address, it must look like `/[ip4,ip6,dns]/.../udp/port`") + })?; // Only an active validator can leave committee. let _status = check_status(context, HashSet::from([Pending, Active])).await?; let args = vec![CallArg::Pure(bcs::to_bytes(&worker_address).unwrap())]; @@ -1200,6 +1210,9 @@ async fn update_metadata( .await } MetadataUpdate::P2pAddress { p2p_address } => { + p2p_address.to_anemo_address().map_err(|_| { + anyhow!("Invalid p2p address, it must look like `/[ip4,ip6,dns]/.../udp/port`") + })?; let _status = check_status(context, HashSet::from([Pending, Active])).await?; let args = vec![CallArg::Pure(bcs::to_bytes(&p2p_address).unwrap())]; call_0x5( From bf94b2fb37ee212f2a7c1185df5464082e9944c8 Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:01:26 -0700 Subject: [PATCH 041/163] Re-order flags to match order in v1.28 (#18682) --- crates/sui-core/src/authority/epoch_start_configuration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/sui-core/src/authority/epoch_start_configuration.rs b/crates/sui-core/src/authority/epoch_start_configuration.rs index 2280d166dcf91..e96a10ebb1b0c 100644 --- a/crates/sui-core/src/authority/epoch_start_configuration.rs +++ b/crates/sui-core/src/authority/epoch_start_configuration.rs @@ -55,10 +55,10 @@ pub enum EpochFlag { // This flag was "burned" because it was deployed with a broken version of the code. The // new flags below are required to enable state accumulator v2 _StateAccumulatorV2EnabledDeprecated, - - ExecutedInEpochTable, StateAccumulatorV2EnabledTestnet, StateAccumulatorV2EnabledMainnet, + + ExecutedInEpochTable, } impl EpochFlag { From fedd75a7c3aa4ced553283e4dd6d9f5d7cf1cfa2 Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:02:25 -0700 Subject: [PATCH 042/163] Make EpochFlag values explicit to avoid mistakes when cherry picking (#18683) This is intended to prevent mistakes such as the one being fixed by #18682 --- .../authority/epoch_start_configuration.rs | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/crates/sui-core/src/authority/epoch_start_configuration.rs b/crates/sui-core/src/authority/epoch_start_configuration.rs index e96a10ebb1b0c..59c445f57218d 100644 --- a/crates/sui-core/src/authority/epoch_start_configuration.rs +++ b/crates/sui-core/src/authority/epoch_start_configuration.rs @@ -41,24 +41,32 @@ pub trait EpochStartConfigTrait { } } +// IMPORTANT: Assign explicit values to each variant to ensure that the values are stable. +// When cherry-picking changes from one branch to another, the value of variants must never +// change. +// +// Unlikely: If you cherry pick a change from one branch to another, and there is a collision +// in the value of some variant, the branch which has been released should take precedence. +// In this case, the picked-from branch is inconsistent with the released branch, and must +// be fixed. #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] pub enum EpochFlag { // The deprecated flags have all been in production for long enough that // we can have deleted the old code paths they were guarding. // We retain them here in order not to break deserialization. - _InMemoryCheckpointRootsDeprecated, - _PerEpochFinalizedTransactionsDeprecated, - _ObjectLockSplitTablesDeprecated, + _InMemoryCheckpointRootsDeprecated = 0, + _PerEpochFinalizedTransactionsDeprecated = 1, + _ObjectLockSplitTablesDeprecated = 2, - WritebackCacheEnabled, + WritebackCacheEnabled = 3, // This flag was "burned" because it was deployed with a broken version of the code. The // new flags below are required to enable state accumulator v2 - _StateAccumulatorV2EnabledDeprecated, - StateAccumulatorV2EnabledTestnet, - StateAccumulatorV2EnabledMainnet, + _StateAccumulatorV2EnabledDeprecated = 4, + StateAccumulatorV2EnabledTestnet = 5, + StateAccumulatorV2EnabledMainnet = 6, - ExecutedInEpochTable, + ExecutedInEpochTable = 7, } impl EpochFlag { From 7fc464ae14e66db5da110da53e8f308ba17a937f Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:17:07 -0700 Subject: [PATCH 043/163] [ts sdk] Make symbol types not unique between versions (#18639) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .changeset/late-peas-greet.md | 6 ++++++ sdk/bcs/src/bcs-type.ts | 2 +- sdk/typescript/src/client/client.ts | 6 ++---- sdk/typescript/src/transactions/Transaction.ts | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .changeset/late-peas-greet.md diff --git a/.changeset/late-peas-greet.md b/.changeset/late-peas-greet.md new file mode 100644 index 0000000000000..8e823c61d80a6 --- /dev/null +++ b/.changeset/late-peas-greet.md @@ -0,0 +1,6 @@ +--- +'@mysten/sui': patch +'@mysten/bcs': patch +--- + +Remove unique symbols from types to improve compatability between version diff --git a/sdk/bcs/src/bcs-type.ts b/sdk/bcs/src/bcs-type.ts index f8cada0cd7005..788a8b0dd2bf7 100644 --- a/sdk/bcs/src/bcs-type.ts +++ b/sdk/bcs/src/bcs-type.ts @@ -102,7 +102,7 @@ export class BcsType { } } -const SERIALIZED_BCS_BRAND = Symbol.for('@mysten/serialized-bcs'); +const SERIALIZED_BCS_BRAND = Symbol.for('@mysten/serialized-bcs') as never; export function isSerializedBcs(obj: unknown): obj is SerializedBcs { return !!obj && typeof obj === 'object' && (obj as any)[SERIALIZED_BCS_BRAND] === true; } diff --git a/sdk/typescript/src/client/client.ts b/sdk/typescript/src/client/client.ts index 157388557dcf1..530e846b1fea9 100644 --- a/sdk/typescript/src/client/client.ts +++ b/sdk/typescript/src/client/client.ts @@ -118,13 +118,11 @@ type NetworkOrTransport = url?: never; }; -const SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiClient'); +const SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiClient') as never; export function isSuiClient(client: unknown): client is SuiClient { return ( - typeof client === 'object' && - client !== null && - (client as { [SUI_CLIENT_BRAND]: unknown })[SUI_CLIENT_BRAND] === true + typeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true ); } diff --git a/sdk/typescript/src/transactions/Transaction.ts b/sdk/typescript/src/transactions/Transaction.ts index 60fbd7ae5e1d2..ab3786e3e21ae 100644 --- a/sdk/typescript/src/transactions/Transaction.ts +++ b/sdk/typescript/src/transactions/Transaction.ts @@ -86,7 +86,7 @@ function createTransactionResult(index: number) { }) as TransactionResult; } -const TRANSACTION_BRAND = Symbol.for('@mysten/transaction'); +const TRANSACTION_BRAND = Symbol.for('@mysten/transaction') as never; interface SignOptions extends BuildTransactionOptions { signer: Signer; From adaffe37f3fff7ed82cfbf5dc7cdf0b9a0833b2c Mon Sep 17 00:00:00 2001 From: Alexandros Tzimas Date: Tue, 16 Jul 2024 09:30:10 +0300 Subject: [PATCH 044/163] Deprecate Sui_Owned_Object_Pools (#18657) --- sdk/docs/pages/typescript/owned-object-pool/index.mdx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/docs/pages/typescript/owned-object-pool/index.mdx b/sdk/docs/pages/typescript/owned-object-pool/index.mdx index 889938f2e3fdf..2aff405c0c934 100644 --- a/sdk/docs/pages/typescript/owned-object-pool/index.mdx +++ b/sdk/docs/pages/typescript/owned-object-pool/index.mdx @@ -3,12 +3,11 @@ import { Callout } from 'nextra/components'; - Sui Owned Object Pools (SuiOOP) will likely be replaced by - [`ParallelTransactionExecutor`](../executors#paralleltransactionexecutor) from + Sui Owned Object Pools (SuiOOP) has been replaced by + [`ParallelTransactionExecutor`](../typescript/executors#paralleltransactionexecutor) from `@mysten/sui/transactions` - Sui Owned Object Pools (SuiOOP) is a beta library. Enhancements and changes are likely during - development. + Sui Owned Object Pools (SuiOOP) is no longer maintained. From bd45b28d68f4f7ce5780e3b74a9f3906e031d719 Mon Sep 17 00:00:00 2001 From: Anastasios Kichidis Date: Tue, 16 Jul 2024 13:48:00 +0100 Subject: [PATCH 045/163] [Consensus] disable scheduled synchronizer when commit lag (#18485) ## Description The PR disables the scheduled synchronizer when we detect local commit to lag compared to the quorum index, same as we do during block processing. It has to be noted that we do not disable the live synchronizer as this will normally be taken care of from the `authority_service` block processing path. With this change we'll avoid issues that have been observed during crash recovery (or even lagging nodes) where some blocks are received (until the commit voter finally gathers a quorum and cut off the block processing path) and trigger the block synchronization attempting to complete the causal history for the received blocks leading to a big queue of suspended & missing blocks. ## Test plan CI/PT Testing on PT environment, on the first screenshot we can see the number of pending suspended blocks in block_manager when the synchronization is not disabled during crash recovery - which is constantly increasing. On the second screenshot we see that number does not increase while node recovers and remains constant: Screenshot 2024-07-04 at 17 56 39 Screenshot 2024-07-04 at 18 05 31 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- consensus/core/src/authority_node.rs | 3 +- consensus/core/src/authority_service.rs | 7 +- consensus/core/src/metrics.rs | 7 ++ consensus/core/src/synchronizer.rs | 150 +++++++++++++++++++++++- 4 files changed, 161 insertions(+), 6 deletions(-) diff --git a/consensus/core/src/authority_node.rs b/consensus/core/src/authority_node.rs index 4cfbbccfac4b7..ff2c7d043e66b 100644 --- a/consensus/core/src/authority_node.rs +++ b/consensus/core/src/authority_node.rs @@ -244,15 +244,16 @@ where let leader_timeout_handle = LeaderTimeoutTask::start(core_dispatcher.clone(), &signals_receivers, context.clone()); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); let synchronizer = Synchronizer::start( network_client.clone(), context.clone(), core_dispatcher.clone(), + commit_vote_monitor.clone(), block_verifier.clone(), dag_state.clone(), ); - let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); let commit_syncer = CommitSyncer::new( context.clone(), core_dispatcher.clone(), diff --git a/consensus/core/src/authority_service.rs b/consensus/core/src/authority_service.rs index 8c158e249200c..feac2741570cc 100644 --- a/consensus/core/src/authority_service.rs +++ b/consensus/core/src/authority_service.rs @@ -29,6 +29,8 @@ use crate::{ CommitIndex, Round, }; +pub(crate) const COMMIT_LAG_MULTIPLIER: u32 = 5; + /// Authority's network service implementation, agnostic to the actual networking stack used. pub(crate) struct AuthorityService { context: Arc, @@ -182,7 +184,6 @@ impl NetworkService for AuthorityService { let quorum_commit_index = self.commit_vote_monitor.quorum_commit_index(); // The threshold to ignore block should be larger than commit_sync_batch_size, // to avoid excessive block rejections and synchronizations. - const COMMIT_LAG_MULTIPLIER: u32 = 5; if last_commit_index + self.context.parameters.commit_sync_batch_size * COMMIT_LAG_MULTIPLIER < quorum_commit_index @@ -693,10 +694,12 @@ mod tests { let network_client = Arc::new(FakeNetworkClient::default()); let store = Arc::new(MemStore::new()); let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store.clone()))); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); let synchronizer = Synchronizer::start( network_client, context.clone(), core_dispatcher.clone(), + commit_vote_monitor, block_verifier.clone(), dag_state.clone(), ); @@ -749,10 +752,12 @@ mod tests { let network_client = Arc::new(FakeNetworkClient::default()); let store = Arc::new(MemStore::new()); let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store.clone()))); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); let synchronizer = Synchronizer::start( network_client, context.clone(), core_dispatcher.clone(), + commit_vote_monitor, block_verifier.clone(), dag_state.clone(), ); diff --git a/consensus/core/src/metrics.rs b/consensus/core/src/metrics.rs index 58e057de50d65..af1c9a64d75a5 100644 --- a/consensus/core/src/metrics.rs +++ b/consensus/core/src/metrics.rs @@ -120,6 +120,7 @@ pub(crate) struct NodeMetrics { pub(crate) dag_state_store_read_count: IntCounterVec, pub(crate) dag_state_store_write_count: IntCounter, pub(crate) fetch_blocks_scheduler_inflight: IntGauge, + pub(crate) fetch_blocks_scheduler_skipped: IntCounterVec, pub(crate) synchronizer_fetched_blocks_by_peer: IntCounterVec, pub(crate) synchronizer_fetched_blocks_by_authority: IntCounterVec, pub(crate) invalid_blocks: IntCounterVec, @@ -302,6 +303,12 @@ impl NodeMetrics { "Designates whether the synchronizer scheduler task to fetch blocks is currently running", registry, ).unwrap(), + fetch_blocks_scheduler_skipped: register_int_counter_vec_with_registry!( + "fetch_blocks_scheduler_skipped", + "Number of times the scheduler skipped fetching blocks", + &["reason"], + registry + ).unwrap(), synchronizer_fetched_blocks_by_peer: register_int_counter_vec_with_registry!( "synchronizer_fetched_blocks_by_peer", "Number of fetched blocks per peer authority via the synchronizer and also by block authority", diff --git a/consensus/core/src/synchronizer.rs b/consensus/core/src/synchronizer.rs index 237eec4b1b436..5291a4f70fd81 100644 --- a/consensus/core/src/synchronizer.rs +++ b/consensus/core/src/synchronizer.rs @@ -24,8 +24,10 @@ use tokio::{ task::JoinSet, time::{sleep, sleep_until, timeout, Instant}, }; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info, trace, warn}; +use crate::authority_service::COMMIT_LAG_MULTIPLIER; +use crate::commit_syncer::CommitVoteMonitor; use crate::{ block::{BlockRef, SignedBlock, VerifiedBlock}, block_verifier::BlockVerifier, @@ -34,7 +36,7 @@ use crate::{ dag_state::DagState, error::{ConsensusError, ConsensusResult}, network::NetworkClient, - BlockAPI, Round, + BlockAPI, CommitIndex, Round, }; /// The number of concurrent fetch blocks requests per authority @@ -215,6 +217,7 @@ pub(crate) struct Synchronizer, fetch_block_senders: BTreeMap>, core_dispatcher: Arc, + commit_vote_monitor: Arc, dag_state: Arc>, fetch_blocks_scheduler_task: JoinSet<()>, network_client: Arc, @@ -228,6 +231,7 @@ impl Synchronizer, context: Arc, core_dispatcher: Arc, + commit_vote_monitor: Arc, block_verifier: Arc, dag_state: Arc>, ) -> Arc { @@ -279,6 +283,7 @@ impl Synchronizer Synchronizer ConsensusResult<()> { + let (commit_lagging, last_commit_index, quorum_commit_index) = self.is_commit_lagging(); + if commit_lagging { + trace!("Scheduled synchronizer temporarily disabled as local commit is falling behind from quorum {last_commit_index} << {quorum_commit_index}"); + self.context + .metrics + .node_metrics + .fetch_blocks_scheduler_skipped + .with_label_values(&["commit_lagging"]) + .inc(); + return Ok(()); + } + let missing_blocks = self .core_dispatcher .get_missing_blocks() @@ -700,6 +717,18 @@ impl Synchronizer (bool, CommitIndex, CommitIndex) { + let last_commit_index = self.dag_state.read().last_commit_index(); + let quorum_commit_index = self.commit_vote_monitor.quorum_commit_index(); + let commit_threshold = last_commit_index + + self.context.parameters.commit_sync_batch_size * COMMIT_LAG_MULTIPLIER; + ( + commit_threshold < quorum_commit_index, + last_commit_index, + quorum_commit_index, + ) + } + /// Fetches the `missing_blocks` from available peers. The method will attempt to split the load amongst multiple (random) peers. /// The method returns a vector with the fetched blocks from each peer that successfully responded and any corresponding additional ancestor blocks. /// Each element of the vector is a tuple which contains the requested missing block refs, the returned blocks and the peer authority index. @@ -822,6 +851,9 @@ mod tests { use parking_lot::RwLock; use tokio::time::sleep; + use crate::authority_service::COMMIT_LAG_MULTIPLIER; + use crate::commit::{CommitVote, TrustedCommit}; + use crate::commit_syncer::CommitVoteMonitor; use crate::{ block::{BlockDigest, BlockRef, Round, TestBlock, VerifiedBlock}, block_verifier::NoopBlockVerifier, @@ -835,6 +867,7 @@ mod tests { synchronizer::{ InflightBlocksMap, Synchronizer, FETCH_BLOCKS_CONCURRENCY, FETCH_REQUEST_TIMEOUT, }, + CommitDigest, CommitIndex, }; // TODO: create a complete Mock for thread dispatcher to be used from several tests @@ -846,8 +879,8 @@ mod tests { impl MockCoreThreadDispatcher { async fn get_add_blocks(&self) -> Vec { - let lock = self.add_blocks.lock().await; - lock.to_vec() + let mut lock = self.add_blocks.lock().await; + lock.drain(0..).collect() } async fn stub_missing_blocks(&self, block_refs: BTreeSet) { @@ -1057,11 +1090,13 @@ mod tests { let network_client = Arc::new(MockNetworkClient::default()); let store = Arc::new(MemStore::new()); let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store))); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); let handle = Synchronizer::start( network_client.clone(), context, core_dispatcher.clone(), + commit_vote_monitor, block_verifier, dag_state, ); @@ -1102,11 +1137,13 @@ mod tests { let network_client = Arc::new(MockNetworkClient::default()); let store = Arc::new(MemStore::new()); let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store))); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); let handle = Synchronizer::start( network_client.clone(), context, core_dispatcher.clone(), + commit_vote_monitor, block_verifier, dag_state, ); @@ -1158,6 +1195,7 @@ mod tests { let network_client = Arc::new(MockNetworkClient::default()); let store = Arc::new(MemStore::new()); let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store))); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); // Create some test blocks let expected_blocks = (0..10) @@ -1196,6 +1234,7 @@ mod tests { network_client.clone(), context, core_dispatcher.clone(), + commit_vote_monitor, block_verifier, dag_state, ); @@ -1213,4 +1252,107 @@ mod tests { .unwrap() .is_empty()); } + + #[tokio::test(flavor = "current_thread", start_paused = true)] + async fn synchronizer_periodic_task_skip_when_commit_lagging() { + // GIVEN + let (context, _) = Context::new_for_test(4); + let context = Arc::new(context); + let block_verifier = Arc::new(NoopBlockVerifier {}); + let core_dispatcher = Arc::new(MockCoreThreadDispatcher::default()); + let network_client = Arc::new(MockNetworkClient::default()); + let store = Arc::new(MemStore::new()); + let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store))); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); + + // AND stub some missing blocks + let expected_blocks = (0..10) + .map(|round| VerifiedBlock::new_for_test(TestBlock::new(round, 0).build())) + .collect::>(); + let missing_blocks = expected_blocks + .iter() + .map(|block| block.reference()) + .collect::>(); + core_dispatcher + .stub_missing_blocks(missing_blocks.clone()) + .await; + + // AND stub the requests for authority 1 & 2 + // Make the first authority timeout, so the second will be called. "We" are authority = 0, so + // we are skipped anyways. + network_client + .stub_fetch_blocks( + expected_blocks.clone(), + AuthorityIndex::new_for_test(1), + Some(FETCH_REQUEST_TIMEOUT), + ) + .await; + network_client + .stub_fetch_blocks( + expected_blocks.clone(), + AuthorityIndex::new_for_test(2), + None, + ) + .await; + + // Now create some blocks to simulate a commit lag + let round = context.parameters.commit_sync_batch_size * COMMIT_LAG_MULTIPLIER * 2; + let commit_index: CommitIndex = round - 1; + let blocks = (0..4) + .map(|authority| { + let commit_votes = vec![CommitVote::new(commit_index, CommitDigest::MIN)]; + let block = TestBlock::new(round, authority) + .set_commit_votes(commit_votes) + .build(); + + VerifiedBlock::new_for_test(block) + }) + .collect::>(); + + // Pass them through the commit vote monitor - so now there will be a big commit lag to prevent + // the scheduled synchronizer from running + for block in blocks { + commit_vote_monitor.observe(&block); + } + + // WHEN start the synchronizer and wait for a couple of seconds where normally the synchronizer should have kicked in. + let _handle = Synchronizer::start( + network_client.clone(), + context.clone(), + core_dispatcher.clone(), + commit_vote_monitor.clone(), + block_verifier, + dag_state.clone(), + ); + + sleep(4 * FETCH_REQUEST_TIMEOUT).await; + + // Since we should be in commit lag mode none of the missed blocks should have been fetched - hence nothing should be + // sent to core for processing. + let added_blocks = core_dispatcher.get_add_blocks().await; + assert_eq!(added_blocks, vec![]); + + // AND advance now the local commit index by adding a new commit that matches the commit index + // of quorum + { + let mut d = dag_state.write(); + for index in 1..=commit_index { + let commit = + TrustedCommit::new_for_test(index, CommitDigest::MIN, 0, BlockRef::MIN, vec![]); + + d.add_commit(commit); + } + + assert_eq!( + d.last_commit_index(), + commit_vote_monitor.quorum_commit_index() + ); + } + + sleep(2 * FETCH_REQUEST_TIMEOUT).await; + + // THEN the missing blocks should now be fetched and added to core + let added_blocks = core_dispatcher.get_add_blocks().await; + assert_eq!(added_blocks, expected_blocks); + } } From c11b6173cc738c106d9d11e70f80fc07d119aaad Mon Sep 17 00:00:00 2001 From: Daniel Leavitt <71237296+dantheman8300@users.noreply.github.com> Date: Tue, 16 Jul 2024 08:14:41 -0700 Subject: [PATCH 046/163] [docs] Update coin flip app example (#18623) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> --- .../developer/app-examples/coin-flip.mdx | 1437 +++++++++-------- 1 file changed, 772 insertions(+), 665 deletions(-) diff --git a/docs/content/guides/developer/app-examples/coin-flip.mdx b/docs/content/guides/developer/app-examples/coin-flip.mdx index 1889828081846..1989b73f28d87 100644 --- a/docs/content/guides/developer/app-examples/coin-flip.mdx +++ b/docs/content/guides/developer/app-examples/coin-flip.mdx @@ -2,45 +2,65 @@ title: Coin Flip --- -This guide demonstrates writing a module (smart contract) in Move, deploying it on Devnet, and adding a TypeScript frontend to communicate with the module. +This example walks you through building a coin flip dApp, covering the full end-to-end flow of building your Sui Move module and connecting it to your React Sui dApp. This coin flip dApp utilizes verifiable random functions (VRFs) to create a fair coin game on the Sui blockchain. The user (human) plays against the house (module) and places a bet on either heads or tails. The user then either receives double their bet, or gets nothing, depending on the outcome of the game. -Satoshi Coin Flip is a dApp that utilizes verifiable random functions (VRFs) to create a fair coin game on the Sui blockchain. The user (human) plays against the house (module) and places a bet on either heads or tails. The user then either receives double their bet, or gets nothing, depending on the outcome of the game. +The guide is split into two parts: -This guide assumes you have [installed Sui](../getting-started/sui-install.mdx) and understand Sui fundamentals. +1. [Smart Contracts](#smart-contracts): The Move code that sets up the coin flip logic. +1. [Frontend](#frontend): A UI that enables the players to place bets and take profits, and the admin to manage the house. -## Backend +:::tip Additional resources -As with all Sui dApps, a Move package on chain powers the logic of Satoshi Coin Flip. The following instruction walks you through creating and publishing the module. +Source code locations for the smart contracts and frontend: +- [Move package repository](https://github.com/MystenLabs/satoshi-coin-flip) +- [Frontend repository](https://github.com/sui-foundation/satoshi-coin-flip-frontend-example) -### House module +::: -This example uses several modules to create a package for the Satoshi Coin Flip game. The first module is `house_data.move`. You need to store the game’s data somewhere, and in this module you create a [shared object](concepts/object-ownership/shared.mdx) for all house data. +## What the guide teaches + +- **Shared objects:** The guide teaches you how to use [shared objects](concepts/object-ownership/shared.mdx), in this case to create a globally accessible `HouseData` object. +- **One-time witnesses:** The guide teaches you how to use [one-time witnesses](concepts/sui-move-concepts.mdx#one-time-witness) to ensure only a single instance of the `HouseData` object ever exists. +- **Asserts:** The guide teaches you how to use [asserts](https://move-book.com/move-basics/assert-and-abort.html?highlight=asserts#assert) to abort functions due to certain conditions not being met. +- **Address-owned objects:** The guide teaches you how to use [address-owned objects](concepts/object-ownership/address-owned.mdx) when necessary. +- **Events:** The guide teaches you how to emit [events](concepts/events.mdx) in your contracts, which can be used to track off chain. +- **Storage rebates:** The guide shows you best practices regarding [storage fee rebates](concepts/tokenomics/storage-fund.mdx#incentives). +- **MEV attack protection:** The guide introduces you to [MEV attacks](https://github.com/MystenLabs/satoshi-coin-flip?tab=readme-ov-file#mev-attack-resistant-single-player-satoshi-smart-contract-flow), how to make your contracts MEV-resistant, and the trade-offs between protection and user experience. + + +## What you need + +Before getting started, make sure you have: + +- [Installed the latest version of Sui](../getting-started/sui-install.mdx). + +## Smart contracts {#smart-contracts} + +In this part of the guide, you write the Move contracts that manage the house and set up the coin-flip logic. The first step is to [set up a Move package](../first-app/write-package.mdx) for storing your Move modules. :::info -The full source code for the Move modules, including comments and on overview of its cryptography, is available at the [Satoshi Coin Flip repository](https://github.com/MystenLabs/satoshi-coin-flip). +To follow along with this guide, set your new Move package to `satoshi_flip`. ::: -Before you get started, you must initialize a Move package. Open a terminal or console in the directory you want to store the example and run the following command to create an empty package with the name `satoshi_flip`: +### House module -```shell -sui move new satoshi_flip -``` +This example uses several modules to create a package for the Satoshi Coin Flip game. The first module is `house_data.move`. You need to store the game’s data somewhere, and in this module you create a [shared object](concepts/object-ownership/shared.mdx) for all house data. -With that done, it's time to jump into some code. Create a new file in the `sources` directory with the name `house_data.move` and populate the file with the following code: +Create a new file in the `sources` directory with the name `house_data.move` and populate the file with the following code: ```move title='house_data.move' module satoshi_flip::house_data { - use sui::balance::{Self, Balance}; - use sui::sui::SUI; - use sui::coin::{Self, Coin}; - use sui::package::{Self}; + use sui::balance::{Self, Balance}; + use sui::sui::SUI; + use sui::coin::{Self, Coin}; + use sui::package::{Self}; - // Error codes - const ECallerNotHouse: u64 = 0; - const EInsufficientBalance: u64 = 1; + // Error codes + const ECallerNotHouse: u64 = 0; + const EInsufficientBalance: u64 = 1; ``` @@ -53,38 +73,38 @@ There are few details to take note of in this code: Next, add some more code to this module: ```move title='house_data.move' - /// Configuration and Treasury object, managed by the house. - public struct HouseData has key { - id: UID, - balance: Balance, - house: address, - public_key: vector, - max_stake: u64, - min_stake: u64, - fees: Balance, - base_fee_in_bp: u16 - } - - /// A one-time use capability to initialize the house data; created and sent - /// to sender in the initializer. - public struct HouseCap has key { - id: UID - } - - /// Used as a one time witness to generate the publisher. - public struct HOUSE_DATA has drop {} - - fun init(otw: HOUSE_DATA, ctx: &mut TxContext) { - // Creating and sending the Publisher object to the sender. - package::claim_and_keep(otw, ctx); - - // Creating and sending the HouseCap object to the sender. - let house_cap = HouseCap { - id: object::new(ctx) - }; - - transfer::transfer(house_cap, ctx.sender()); - } + /// Configuration and Treasury object, managed by the house. + public struct HouseData has key { + id: UID, + balance: Balance, + house: address, + public_key: vector, + max_stake: u64, + min_stake: u64, + fees: Balance, + base_fee_in_bp: u16 + } + + /// A one-time use capability to initialize the house data; created and sent + /// to sender in the initializer. + public struct HouseCap has key { + id: UID + } + + /// Used as a one time witness to generate the publisher. + public struct HOUSE_DATA has drop {} + + fun init(otw: HOUSE_DATA, ctx: &mut TxContext) { + // Creating and sending the Publisher object to the sender. + package::claim_and_keep(otw, ctx); + + // Creating and sending the HouseCap object to the sender. + let house_cap = HouseCap { + id: object::new(ctx) + }; + + transfer::transfer(house_cap, ctx.sender()); + } ``` - The first struct, `HouseData`, stores the most essential information pertaining to the game. @@ -95,65 +115,65 @@ Next, add some more code to this module: So far, you've set up the data structures within the module. Now, create a function that initializes the house data and shares the `HouseData` object: ```move title='house_data.move' - public fun initialize_house_data(house_cap: HouseCap, coin: Coin, public_key: vector, ctx: &mut TxContext) { - assert!(coin.value() > 0, EInsufficientBalance); - - let house_data = HouseData { - id: object::new(ctx), - balance: coin.into_balance(), - house: ctx.sender(), - public_key, - max_stake: 50_000_000_000, // 50 SUI, 1 SUI = 10^9. - min_stake: 1_000_000_000, // 1 SUI. - fees: balance::zero(), - base_fee_in_bp: 100 // 1% in basis points. - }; - - let HouseCap { id } = house_cap; - object::delete(id); - - transfer::share_object(house_data); - } + public fun initialize_house_data(house_cap: HouseCap, coin: Coin, public_key: vector, ctx: &mut TxContext) { + assert!(coin.value() > 0, EInsufficientBalance); + + let house_data = HouseData { + id: object::new(ctx), + balance: coin.into_balance(), + house: ctx.sender(), + public_key, + max_stake: 50_000_000_000, // 50 SUI, 1 SUI = 10^9. + min_stake: 1_000_000_000, // 1 SUI. + fees: balance::zero(), + base_fee_in_bp: 100 // 1% in basis points. + }; + + let HouseCap { id } = house_cap; + object::delete(id); + + transfer::share_object(house_data); + } ``` With the house data initialized, you also need to add some functions that enable some important administrative tasks for the house to perform: ```move title='house_data.move' - public fun top_up(house_data: &mut HouseData, coin: Coin, _: &mut TxContext) { - coin::put(&mut house_data.balance, coin) - } + public fun top_up(house_data: &mut HouseData, coin: Coin, _: &mut TxContext) { + coin::put(&mut house_data.balance, coin) + } - public fun withdraw(house_data: &mut HouseData, ctx: &mut TxContext) { - // Only the house address can withdraw funds. - assert!(ctx.sender() == house_data.house(), ECallerNotHouse); + public fun withdraw(house_data: &mut HouseData, ctx: &mut TxContext) { + // Only the house address can withdraw funds. + assert!(ctx.sender() == house_data.house(), ECallerNotHouse); - let total_balance = balance(house_data); - let coin = coin::take(&mut house_data.balance, total_balance, ctx); - transfer::public_transfer(coin, house_data.house()); - } + let total_balance = balance(house_data); + let coin = coin::take(&mut house_data.balance, total_balance, ctx); + transfer::public_transfer(coin, house_data.house()); + } - public fun claim_fees(house_data: &mut HouseData, ctx: &mut TxContext) { - // Only the house address can withdraw fee funds. - assert!(ctx.sender() == house_data.house(), ECallerNotHouse); + public fun claim_fees(house_data: &mut HouseData, ctx: &mut TxContext) { + // Only the house address can withdraw fee funds. + assert!(ctx.sender() == house_data.house(), ECallerNotHouse); - let total_fees = fees(house_data); - let coin = coin::take(&mut house_data.fees, total_fees, ctx); - transfer::public_transfer(coin, house_data.house()); - } + let total_fees = fees(house_data); + let coin = coin::take(&mut house_data.fees, total_fees, ctx); + transfer::public_transfer(coin, house_data.house()); + } - public fun update_max_stake(house_data: &mut HouseData, max_stake: u64, ctx: &mut TxContext) { - // Only the house address can update the base fee. - assert!(ctx.sender() == house_data.house(), ECallerNotHouse); + public fun update_max_stake(house_data: &mut HouseData, max_stake: u64, ctx: &mut TxContext) { + // Only the house address can update the base fee. + assert!(ctx.sender() == house_data.house(), ECallerNotHouse); - house_data.max_stake = max_stake; - } + house_data.max_stake = max_stake; + } - public fun update_min_stake(house_data: &mut HouseData, min_stake: u64, ctx: &mut TxContext) { - // Only the house address can update the min stake. - assert!(ctx.sender() == house_data.house(), ECallerNotHouse); + public fun update_min_stake(house_data: &mut HouseData, min_stake: u64, ctx: &mut TxContext) { + // Only the house address can update the min stake. + assert!(ctx.sender() == house_data.house(), ECallerNotHouse); - house_data.min_stake = min_stake; - } + house_data.min_stake = min_stake; + } ``` All of these functions contain an `assert!` call that ensures only the house can call them: @@ -166,68 +186,68 @@ All of these functions contain an `assert!` call that ensures only the house can You have established the data structure of this module, but without the appropriate functions this data is not accessible. Now add helper functions that return mutable references, read-only references, and test-only functions: ```move title='house_data.move' - // --------------- Mutable References --------------- - - public(package) fun borrow_balance_mut(house_data: &mut HouseData): &mut Balance { - &mut house_data.balance - } - - public(package) fun borrow_fees_mut(house_data: &mut HouseData): &mut Balance { - &mut house_data.fees - } - - public(package) fun borrow_mut(house_data: &mut HouseData): &mut UID { - &mut house_data.id - } - - // --------------- Read-only References --------------- - - /// Returns a reference to the house id. - public(package) fun borrow(house_data: &HouseData): &UID { - &house_data.id - } - - /// Returns the balance of the house. - public fun balance(house_data: &HouseData): u64 { - house_data.balance.value() - } - - /// Returns the address of the house. - public fun house(house_data: &HouseData): address { - house_data.house - } - - /// Returns the public key of the house. - public fun public_key(house_data: &HouseData): vector { - house_data.public_key - } - - /// Returns the max stake of the house. - public fun max_stake(house_data: &HouseData): u64 { - house_data.max_stake - } - - /// Returns the min stake of the house. - public fun min_stake(house_data: &HouseData): u64 { - house_data.min_stake - } - - /// Returns the fees of the house. - public fun fees(house_data: &HouseData): u64 { - house_data.fees.value() - } - - /// Returns the base fee. - public fun base_fee_in_bp(house_data: &HouseData): u16 { - house_data.base_fee_in_bp - } - - // --------------- Test-only Functions --------------- - - #[test_only] - public fun init_for_testing(ctx: &mut TxContext) { - init(HOUSE_DATA {}, ctx); - } + // --------------- Mutable References --------------- + + public(package) fun borrow_balance_mut(house_data: &mut HouseData): &mut Balance { + &mut house_data.balance + } + + public(package) fun borrow_fees_mut(house_data: &mut HouseData): &mut Balance { + &mut house_data.fees + } + + public(package) fun borrow_mut(house_data: &mut HouseData): &mut UID { + &mut house_data.id + } + + // --------------- Read-only References --------------- + + /// Returns a reference to the house id. + public(package) fun borrow(house_data: &HouseData): &UID { + &house_data.id + } + + /// Returns the balance of the house. + public fun balance(house_data: &HouseData): u64 { + house_data.balance.value() + } + + /// Returns the address of the house. + public fun house(house_data: &HouseData): address { + house_data.house + } + + /// Returns the public key of the house. + public fun public_key(house_data: &HouseData): vector { + house_data.public_key + } + + /// Returns the max stake of the house. + public fun max_stake(house_data: &HouseData): u64 { + house_data.max_stake + } + + /// Returns the min stake of the house. + public fun min_stake(house_data: &HouseData): u64 { + house_data.min_stake + } + + /// Returns the fees of the house. + public fun fees(house_data: &HouseData): u64 { + house_data.fees.value() + } + + /// Returns the base fee. + public fun base_fee_in_bp(house_data: &HouseData): u16 { + house_data.base_fee_in_bp + } + + // --------------- Test-only Functions --------------- + + #[test_only] + public fun init_for_testing(ctx: &mut TxContext) { + init(HOUSE_DATA {}, ctx); + } } ``` @@ -240,28 +260,28 @@ In the same `sources` directory, now create a file named `counter_nft.move`. A ` ```move title='counter_nft.move' module satoshi_flip::counter_nft { - use sui::bcs::{Self}; + use sui::bcs::{Self}; - public struct Counter has key { - id: UID, - count: u64, - } + public struct Counter has key { + id: UID, + count: u64, + } - entry fun burn(self: Counter) { - let Counter { id, count: _ } = self; - object::delete(id); - } + entry fun burn(self: Counter) { + let Counter { id, count: _ } = self; + object::delete(id); + } - public fun mint(ctx: &mut TxContext): Counter { - Counter { - id: object::new(ctx), - count: 0 - } + public fun mint(ctx: &mut TxContext): Counter { + Counter { + id: object::new(ctx), + count: 0 } + } - public fun transfer_to_sender(counter: Counter, ctx: &mut TxContext) { - transfer::transfer(counter, tx_context::sender(ctx)); - } + public fun transfer_to_sender(counter: Counter, ctx: &mut TxContext) { + transfer::transfer(counter, tx_context::sender(ctx)); + } ``` This might look familiar from the house module. You set the module name, import functions from the standard library, and initialize the `Counter` object. The `Counter` object has the `key` ability, but does not have `store` - this prevents the object from being transferable. @@ -271,26 +291,26 @@ In addition, you create `mint` and `transfer_to_sender` functions used when the You have a `Counter` object, as well as functions that initialize and burn the object, but you need a way to increment the counter. Add the following code to the module: ```move title='counter_nft.move' - public fun get_vrf_input_and_increment(self: &mut Counter): vector { - let mut vrf_input = object::id_bytes(self); - let count_to_bytes = bcs::to_bytes(&count(self)); - vrf_input.append(count_to_bytes); - self.increment(); - vrf_input - } - - public fun count(self: &Counter): u64 { - self.count - } - - fun increment(self: &mut Counter) { - self.count = self.count + 1; - } - - #[test_only] - public fun burn_for_testing(self: Counter) { - self.burn(); - } + public fun get_vrf_input_and_increment(self: &mut Counter): vector { + let mut vrf_input = object::id_bytes(self); + let count_to_bytes = bcs::to_bytes(&count(self)); + vrf_input.append(count_to_bytes); + self.increment(); + vrf_input + } + + public fun count(self: &Counter): u64 { + self.count + } + + fun increment(self: &mut Counter) { + self.count = self.count + 1; + } + + #[test_only] + public fun burn_for_testing(self: Counter) { + self.burn(); + } } ``` @@ -306,48 +326,48 @@ Create the game module. In the `sources` directory, create a new file called `si ```move title='single_player_satoshi.move' module satoshi_flip::single_player_satoshi { - use std::string::String; - - use sui::coin::{Self, Coin}; - use sui::balance::Balance; - use sui::sui::SUI; - use sui::bls12381::bls12381_min_pk_verify; - use sui::event::emit; - use sui::hash::{blake2b256}; - use sui::dynamic_object_field::{Self as dof}; - - use satoshi_flip::counter_nft::Counter; - use satoshi_flip::house_data::HouseData; - - const EPOCHS_CANCEL_AFTER: u64 = 7; - const GAME_RETURN: u8 = 2; - const PLAYER_WON_STATE: u8 = 1; - const HOUSE_WON_STATE: u8 = 2; - const CHALLENGED_STATE: u8 = 3; - const HEADS: vector = b"H"; - const TAILS: vector = b"T"; - - const EStakeTooLow: u64 = 0; - const EStakeTooHigh: u64 = 1; - const EInvalidBlsSig: u64 = 2; - const ECanNotChallengeYet: u64 = 3; - const EInvalidGuess: u64 = 4; - const EInsufficientHouseBalance: u64 = 5; - const EGameDoesNotExist: u64 = 6; - - public struct NewGame has copy, drop { - game_id: ID, - player: address, - vrf_input: vector, - guess: String, - user_stake: u64, - fee_bp: u16 - } - - public struct Outcome has copy, drop { - game_id: ID, - status: u8 - } + use std::string::String; + + use sui::coin::{Self, Coin}; + use sui::balance::Balance; + use sui::sui::SUI; + use sui::bls12381::bls12381_min_pk_verify; + use sui::event::emit; + use sui::hash::{blake2b256}; + use sui::dynamic_object_field::{Self as dof}; + + use satoshi_flip::counter_nft::Counter; + use satoshi_flip::house_data::HouseData; + + const EPOCHS_CANCEL_AFTER: u64 = 7; + const GAME_RETURN: u8 = 2; + const PLAYER_WON_STATE: u8 = 1; + const HOUSE_WON_STATE: u8 = 2; + const CHALLENGED_STATE: u8 = 3; + const HEADS: vector = b"H"; + const TAILS: vector = b"T"; + + const EStakeTooLow: u64 = 0; + const EStakeTooHigh: u64 = 1; + const EInvalidBlsSig: u64 = 2; + const ECanNotChallengeYet: u64 = 3; + const EInvalidGuess: u64 = 4; + const EInsufficientHouseBalance: u64 = 5; + const EGameDoesNotExist: u64 = 6; + + public struct NewGame has copy, drop { + game_id: ID, + player: address, + vrf_input: vector, + guess: String, + user_stake: u64, + fee_bp: u16 + } + + public struct Outcome has copy, drop { + game_id: ID, + status: u8 + } ``` This code follows the same pattern as the others. First, you include the respective imports, although this time the imports are not only from the standard library but also include modules created previously in this example. You also create several constants (in upper case), as well as constants used for errors (Pascal case prefixed with `E`). @@ -357,15 +377,15 @@ Lastly in this section, you also create structs for two [events](concepts/events Add a struct to the module: ```move title='single_player_satoshi.move' - public struct Game has key, store { - id: UID, - guess_placed_epoch: u64, - total_stake: Balance, - guess: String, - player: address, - vrf_input: vector, - fee_bp: u16 - } + public struct Game has key, store { + id: UID, + guess_placed_epoch: u64, + total_stake: Balance, + guess: String, + player: address, + vrf_input: vector, + fee_bp: u16 + } ``` The `Game` struct represents a single game and all its information, including the epoch the player placed the bet (`guess_placed_epoch`), bet (`total_stake`), `guess`, address of the `player`, `vrf_input`, and the fee the house collects (`fee_bp`). @@ -373,55 +393,55 @@ The `Game` struct represents a single game and all its information, including th Now take a look at the main function in this game, `finish_game`: ```move title='single_player_satoshi.move' - public fun finish_game(game_id: ID, bls_sig: vector, house_data: &mut HouseData, ctx: &mut TxContext) { - // Ensure that the game exists. - assert!(game_exists(house_data, game_id), EGameDoesNotExist); - - let Game { - id, - guess_placed_epoch: _, - mut total_stake, - guess, - player, - vrf_input, - fee_bp - } = dof::remove(house_data.borrow_mut(), game_id); - - object::delete(id); - - // Step 1: Check the BLS signature, if its invalid abort. - let is_sig_valid = bls12381_min_pk_verify(&bls_sig, &house_data.public_key(), &vrf_input); - assert!(is_sig_valid, EInvalidBlsSig); - - // Hash the beacon before taking the 1st byte. - let hashed_beacon = blake2b256(&bls_sig); - // Step 2: Determine winner. - let first_byte = hashed_beacon[0]; - let player_won = map_guess(guess) == (first_byte % 2); - - // Step 3: Distribute funds based on result. - let status = if (player_won) { - // Step 3.a: If player wins transfer the game balance as a coin to the player. - // Calculate the fee and transfer it to the house. - let stake_amount = total_stake.value(); - let fee_amount = fee_amount(stake_amount, fee_bp); - let fees = total_stake.split(fee_amount); - house_data.borrow_fees_mut().join(fees); - - // Calculate the rewards and take it from the game stake. - transfer::public_transfer(total_stake.into_coin(ctx), player); - PLAYER_WON_STATE - } else { - // Step 3.b: If house wins, then add the game stake to the house_data.house_balance (no fees are taken). - house_data.borrow_balance_mut().join(total_stake); - HOUSE_WON_STATE - }; - - emit(Outcome { - game_id, - status - }); - } + public fun finish_game(game_id: ID, bls_sig: vector, house_data: &mut HouseData, ctx: &mut TxContext) { + // Ensure that the game exists. + assert!(game_exists(house_data, game_id), EGameDoesNotExist); + + let Game { + id, + guess_placed_epoch: _, + mut total_stake, + guess, + player, + vrf_input, + fee_bp + } = dof::remove(house_data.borrow_mut(), game_id); + + object::delete(id); + + // Step 1: Check the BLS signature, if its invalid abort. + let is_sig_valid = bls12381_min_pk_verify(&bls_sig, &house_data.public_key(), &vrf_input); + assert!(is_sig_valid, EInvalidBlsSig); + + // Hash the beacon before taking the 1st byte. + let hashed_beacon = blake2b256(&bls_sig); + // Step 2: Determine winner. + let first_byte = hashed_beacon[0]; + let player_won = map_guess(guess) == (first_byte % 2); + + // Step 3: Distribute funds based on result. + let status = if (player_won) { + // Step 3.a: If player wins transfer the game balance as a coin to the player. + // Calculate the fee and transfer it to the house. + let stake_amount = total_stake.value(); + let fee_amount = fee_amount(stake_amount, fee_bp); + let fees = total_stake.split(fee_amount); + house_data.borrow_fees_mut().join(fees); + + // Calculate the rewards and take it from the game stake. + transfer::public_transfer(total_stake.into_coin(ctx), player); + PLAYER_WON_STATE + } else { + // Step 3.b: If house wins, then add the game stake to the house_data.house_balance (no fees are taken). + house_data.borrow_balance_mut().join(total_stake); + HOUSE_WON_STATE + }; + + emit(Outcome { + game_id, + status + }); + } ``` - First, the function makes sure the `Game` object exists, then deletes it, as after the game concludes the metadata is no longer needed. Freeing up unnecessary storage is not only recommended, but [incentivized through rebates on storage fees](concepts/tokenomics/storage-fund.mdx#incentives). @@ -433,34 +453,34 @@ Now take a look at the main function in this game, `finish_game`: Now add a function that handles game disputes: ```move title='single_player_satoshi.move' - public fun dispute_and_win(house_data: &mut HouseData, game_id: ID, ctx: &mut TxContext) { - // Ensure that the game exists. - assert!(game_exists(house_data, game_id), EGameDoesNotExist); - - let Game { - id, - guess_placed_epoch, - total_stake, - guess: _, - player, - vrf_input: _, - fee_bp: _ - } = dof::remove(house_data.borrow_mut(), game_id); - - object::delete(id); - - let caller_epoch = ctx.epoch(); - let cancel_epoch = guess_placed_epoch + EPOCHS_CANCEL_AFTER; - // Ensure that minimum epochs have passed before user can cancel. - assert!(cancel_epoch <= caller_epoch, ECanNotChallengeYet); - - transfer::public_transfer(total_stake.into_coin(ctx), player); - - emit(Outcome { - game_id, - status: CHALLENGED_STATE - }); - } + public fun dispute_and_win(house_data: &mut HouseData, game_id: ID, ctx: &mut TxContext) { + // Ensure that the game exists. + assert!(game_exists(house_data, game_id), EGameDoesNotExist); + + let Game { + id, + guess_placed_epoch, + total_stake, + guess: _, + player, + vrf_input: _, + fee_bp: _ + } = dof::remove(house_data.borrow_mut(), game_id); + + object::delete(id); + + let caller_epoch = ctx.epoch(); + let cancel_epoch = guess_placed_epoch + EPOCHS_CANCEL_AFTER; + // Ensure that minimum epochs have passed before user can cancel. + assert!(cancel_epoch <= caller_epoch, ECanNotChallengeYet); + + transfer::public_transfer(total_stake.into_coin(ctx), player); + + emit(Outcome { + game_id, + status: CHALLENGED_STATE + }); + } ``` This function, `dispute_and_win`, ensures that no bet can live in “purgatory”. After a certain amount of time passes, the player can call this function and get all of their funds back. @@ -468,173 +488,262 @@ This function, `dispute_and_win`, ensures that no bet can live in “purgatory The rest of the functions are accessors and helper functions used to retrieve values, check if values exist, initialize the game, and so on: ```move title='single_player_satoshi.move' - // --------------- Read-only References --------------- - - public fun guess_placed_epoch(game: &Game): u64 { - game.guess_placed_epoch - } + // --------------- Read-only References --------------- + + public fun guess_placed_epoch(game: &Game): u64 { + game.guess_placed_epoch + } + + public fun stake(game: &Game): u64 { + game.total_stake.value() + } + + public fun guess(game: &Game): u8 { + map_guess(game.guess) + } + + public fun player(game: &Game): address { + game.player + } + + public fun vrf_input(game: &Game): vector { + game.vrf_input + } + + public fun fee_in_bp(game: &Game): u16 { + game.fee_bp + } + + // --------------- Helper functions --------------- + + /// Public helper function to calculate the amount of fees to be paid. + public fun fee_amount(game_stake: u64, fee_in_bp: u16): u64 { + ((((game_stake / (GAME_RETURN as u64)) as u128) * (fee_in_bp as u128) / 10_000) as u64) + } + + /// Helper function to check if a game exists. + public fun game_exists(house_data: &HouseData, game_id: ID): bool { + dof::exists_(house_data.borrow(), game_id) + } + + /// Helper function to check that a game exists and return a reference to the game Object. + /// Can be used in combination with any accessor to retrieve the desired game field. + public fun borrow_game(game_id: ID, house_data: &HouseData): &Game { + assert!(game_exists(house_data, game_id), EGameDoesNotExist); + dof::borrow(house_data.borrow(), game_id) + } + + /// Internal helper function used to create a new game. + fun internal_start_game(guess: String, counter: &mut Counter, coin: Coin, house_data: &mut HouseData, fee_bp: u16, ctx: &mut TxContext): (ID, Game) { + // Ensure guess is valid. + map_guess(guess); + let user_stake = coin.value(); + // Ensure that the stake is not higher than the max stake. + assert!(user_stake <= house_data.max_stake(), EStakeTooHigh); + // Ensure that the stake is not lower than the min stake. + assert!(user_stake >= house_data.min_stake(), EStakeTooLow); + // Ensure that the house has enough balance to play for this game. + assert!(house_data.balance() >= user_stake, EInsufficientHouseBalance); + + // Get the house's stake. + let mut total_stake = house_data.borrow_balance_mut().split(user_stake); + coin::put(&mut total_stake, coin); + + let vrf_input = counter.get_vrf_input_and_increment(); + + let id = object::new(ctx); + let game_id = object::uid_to_inner(&id); + + let new_game = Game { + id, + guess_placed_epoch: ctx.epoch(), + total_stake, + guess, + player: ctx.sender(), + vrf_input, + fee_bp + }; + + emit(NewGame { + game_id, + player: ctx.sender(), + vrf_input, + guess, + user_stake, + fee_bp + }); - public fun stake(game: &Game): u64 { - game.total_stake.value() + (game_id, new_game) + } + + /// Helper function to map (H)EADS and (T)AILS to 0 and 1 respectively. + /// H = 0 + /// T = 1 + fun map_guess(guess: String): u8 { + let heads = HEADS; + let tails = TAILS; + assert!(guess.bytes() == heads || guess.bytes() == tails, EInvalidGuess); + + if (guess.bytes() == heads) { + 0 + } else { + 1 } + } +} +``` - public fun guess(game: &Game): u8 { - map_guess(game.guess) - } +## Finished package - public fun player(game: &Game): address { - game.player - } +This represents a basic example of a coin flip backend in Move. The game module, `single_player_satoshi`, is prone to MEV attacks, but the user experience for the player is streamlined. Another example game module, `mev_attack_resistant_single_player_satoshi`, exists that is MEV-resistant, but has a slightly downgraded user experience (two player-transactions per game). - public fun vrf_input(game: &Game): vector { - game.vrf_input - } +You can read more about both versions of the game, and view the full source code for all the modules in the [Satoshi Coin Flip repository](https://github.com/MystenLabs/satoshi-coin-flip). - public fun fee_in_bp(game: &Game): u16 { - game.fee_bp - } +Now that you have written our contracts, it's time to deploy them. - // --------------- Helper functions --------------- +### Deployment {#deployment} - /// Public helper function to calculate the amount of fees to be paid. - public fun fee_amount(game_stake: u64, fee_in_bp: u16): u64 { - ((((game_stake / (GAME_RETURN as u64)) as u128) * (fee_in_bp as u128) / 10_000) as u64) - } +{@include: ../../../snippets/initialize-sui-client-cli.mdx} - /// Helper function to check if a game exists. - public fun game_exists(house_data: &HouseData, game_id: ID): bool { - dof::exists_(house_data.borrow(), game_id) - } +Next, configure the Sui CLI to use `testnet` as the active environment, as well. If you haven't already set up a `testnet` environment, do so by running the following command in a terminal or console: - /// Helper function to check that a game exists and return a reference to the game Object. - /// Can be used in combination with any accessor to retrieve the desired game field. - public fun borrow_game(game_id: ID, house_data: &HouseData): &Game { - assert!(game_exists(house_data, game_id), EGameDoesNotExist); - dof::borrow(house_data.borrow(), game_id) - } +```bash +sui client new-env --alias testnet --rpc https://fullnode.testnet.sui.io:443 +``` - /// Internal helper function used to create a new game. - fun internal_start_game(guess: String, counter: &mut Counter, coin: Coin, house_data: &mut HouseData, fee_bp: u16, ctx: &mut TxContext): (ID, Game) { - // Ensure guess is valid. - map_guess(guess); - let user_stake = coin.value(); - // Ensure that the stake is not higher than the max stake. - assert!(user_stake <= house_data.max_stake(), EStakeTooHigh); - // Ensure that the stake is not lower than the min stake. - assert!(user_stake >= house_data.min_stake(), EStakeTooLow); - // Ensure that the house has enough balance to play for this game. - assert!(house_data.balance() >= user_stake, EInsufficientHouseBalance); - - // Get the house's stake. - let mut total_stake = house_data.borrow_balance_mut().split(user_stake); - coin::put(&mut total_stake, coin); - - let vrf_input = counter.get_vrf_input_and_increment(); - - let id = object::new(ctx); - let game_id = object::uid_to_inner(&id); - - let new_game = Game { - id, - guess_placed_epoch: ctx.epoch(), - total_stake, - guess, - player: ctx.sender(), - vrf_input, - fee_bp - }; +Run the following command to activate the `testnet` environment: - emit(NewGame { - game_id, - player: ctx.sender(), - vrf_input, - guess, - user_stake, - fee_bp - }); +```bash +sui client switch --env testnet +``` - (game_id, new_game) - } +{@include: ../../../snippets/publish-to-devnet-with-coins.mdx} - /// Helper function to map (H)EADS and (T)AILS to 0 and 1 respectively. - /// H = 0 - /// T = 1 - fun map_guess(guess: String): u8 { - let heads = HEADS; - let tails = TAILS; - assert!(guess.bytes() == heads || guess.bytes() == tails, EInvalidGuess); - - if (guess.bytes() == heads) { - 0 - } else { - 1 - } - } -} +The output of this command contains a `packageID` value that you need to save to use the package. + +Partial snippet of CLI deployment output. + +```bash +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Object Changes │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Created Objects: │ +│ ┌── │ +│ │ ObjectID: 0x17e9468127384cfff5523940586f5617a75fac8fd93f143601983523ae9c9f31 │ +│ │ Sender: 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 │ +│ │ Owner: Account Address ( 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 ) │ +│ │ ObjectType: 0x2::package::UpgradeCap │ +│ │ Version: 75261540 │ +│ │ Digest: 9ahkhuGYTNYi5GucCqmUHyBuWoV2R3rRqBu553KBPVv8 │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0xa01d8d5ba121e7771547e749a787b4dd9ff8cc32e341c898bab5d12c46412a23 │ +│ │ Sender: 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 │ +│ │ Owner: Account Address ( 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 ) │ +│ │ ObjectType: 0x2::package::Publisher │ +│ │ Version: 75261540 │ +│ │ Digest: Ba9VU2dUqg3NHkwQ4t5AKDLJQuiFZnnxvty2xREQKWm9 │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0xfa1f6edad697afca055749fedbdee420b6cdba3edc2f7fd4927ed42f98a7e63a │ +│ │ Sender: 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 │ +│ │ Owner: Account Address ( 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 ) │ +│ │ ObjectType: 0x4120b39e5d94845aa539d4b830743a7433fd8511bdcf3841f98080080f327ca8::house_data::HouseCap │ +│ │ Version: 75261540 │ +│ │ Digest: 5326hf6zWgdiNgr63wvwKkhUNtnTFkp82e9vfS5QHy3n │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ObjectID: 0x0e4eb516f8899e116a26f927c8aaddae8466c8cdc3822f05c15159e3a8ff8006 │ +│ │ Sender: 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 │ +│ │ Owner: Account Address ( 0x8e8cae7791a93778800b88b6a274de5c32a86484593568d38619c7ea71999654 ) │ +│ │ ObjectType: 0x2::coin::Coin<0x2::sui::SUI> │ +│ │ Version: 75261540 │ +│ │ Digest: Ezmi94kWCfjRzgGTwnXehv9ipPvYQ7T6Z4wefPLRQPPY │ +│ └── │ +│ Published Objects: │ +│ ┌── │ +│ │ PackageID: 0x4120b39e5d94845aa539d4b830743a7433fd8511bdcf3841f98080080f327ca8 │ +│ │ Version: 1 │ +│ │ Digest: 5XbJkgx8RSccxaHoP3xinY2fMMhwKJ7qoWfp349cmZBg │ +│ │ Modules: counter_nft, house_data, single_player_satoshi │ +│ └── │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` -This represents a basic example of a coin flip backend in Move. The game module, `single_player_satoshi`, is prone to MEV attacks, but the user experience for the player is streamlined. Another example game module, `mev_attack_resistant_single_player_satoshi`, exists that is MEV-resistant, but has a slightly downgraded user experience (two player-transactions per game). - -You can read more about both versions of the game, and view the full source code for all the modules in the [Satoshi Coin Flip repository](https://github.com/MystenLabs/satoshi-coin-flip). +Save the `PackageID` and the `ObjectID` of the `HouseCap` object you receive in your own response to [connect to your frontend](#connecting-your-package). -Now that you have written our contracts, it's time to deploy them. +In this case, the `PackageID` is `0x4120b39e5d94845aa539d4b830743a7433fd8511bdcf3841f98080080f327ca8` and the `HouseCap` ID is `0xfa1f6edad697afca055749fedbdee420b6cdba3edc2f7fd4927ed42f98a7e63a`. -## Deployment +### Next steps -{@include: ../../../snippets/initialize-sui-client-cli.mdx} +Well done. You have written and deployed the Move package! 🚀 -{@include: ../../../snippets/publish-to-devnet-with-coins.mdx} +To turn this into a complete dApp, you need to [create a frontend](#frontend). -The package should successfully deploy. Now, it's time to create a frontend that can interact with it. +## Frontend {#frontend} -## Frontend +In this final part of the dApp example, you build a frontend (UI) that allows end users to place bets and take profits, and lets the admin manage the house. :::info -The full source code for the frontend is available at the [Satoshi Coin Flip Frontend Example repository](https://github.com/sui-foundation/satoshi-coin-flip-frontend-example). +To skip building the frontend and test out your newly deployed package, use the provided [Satoshi Coin Flip Frontend Example repository](https://github.com/sui-foundation/satoshi-coin-flip-frontend-example) and follow the instructions in the example's `README.md` file ::: -To expose the backend you have created to your users, you need a frontend (UI). In this section, you create a React frontend project using the [Sui Typescript SDK](https://sdk.mystenlabs.com/typescript) and the [Sui dApp Kit](https://sdk.mystenlabs.com/dapp-kit) that interacts with the deployed smart contracts. +### Prerequisites -### Initialize the project +Before getting started, make sure you have: -:::info +- [Deployed the complete `satoshi_flip` Move package](#smart-contracts) and understand its design. +- Installed [`pnpm`](https://pnpm.io/installation) or [`yarn`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) to use as the package manager. -The following instructions are using `pnpm` as the package manager. Follow the [`pnpm` install instructions](https://pnpm.io/installation), if needed. +:::tip Additional resources -::: +- Tooling: [Sui TypeScript SDK](https://sdk.mystenlabs.com/typescript) for basic usage on how to interact with Sui using TypeScript. +- Tooling: [Sui dApp Kit](https://sdk.mystenlabs.com/dapp-kit) to learn basic building blocks for developing a dApp in the Sui ecosystem with React.js. +- Tooling: [`@mysten/dapp`](https://sdk.mystenlabs.com/dapp-kit/create-dapp), used within this project to quickly scaffold a React-based Sui dApp. -First, initialize your frontend project. To do this rapidly, use the [`create-dapp` tool](https://sdk.mystenlabs.com/dapp-kit/create-dapp) to bootstrap the project using [dApp Kit](https://sdk.mystenlabs.com/dapp-kit). Run the following command in your terminal or console: - -``` -pnpm create @mysten/dapp -``` +::: -This CLI command prompts you through a couple of steps: +### Overview -1. It asks you the starter template that you want to use. Currently, there are two variants: +The UI of this example demonstrates how to use the dApp Kit instead of serving as a production-grade product, so the Player and the House features are in the same UI to simplify the process. In a production solution, your frontend would only contain functionality dedicated to the Player, with a backend service carrying out the interactions with House functions in the smart contracts. - 1. `react-client-dapp`: This starter template contains the minimum dApp Kit template code that you can start with. This variant is meant for developers already familiar with the dApp Kit and who don't want unnecessary template code. - 1. `react-e2e-counter`: This starter template contains a simple counter Sui Move smart contract with the frontend template code interacting with it. This variant is meant for developers trying to learn how to use dApp Kit. +The UI has two columns: -1. It prompts you to name your project folder. +- First column is dedicated to the Player, and all Player-related features live there +- Second column is dedicated to the House, and all House-related features live there -Done. Your project has all necessary code to get you started. Lastly, `cd` into your project folder and run `pnpm install` to install all dependencies. +### Scaffold a new app -### User interface layout design +The first step is to set up the client app. Run the following command to scaffold a new app. -The user interface (UI) of this frontend example demonstrates how to use the dApp Kit instead of serving as a production-grade product, so the Player and the House features are in the same UI to simplify the process. In a production solution, your frontend would only contain functionality dedicated to the Player, with a backend service carrying out the interactions with House functions in the smart contracts. +```bash +pnpm create @mysten/dapp --template react-client-dapp +``` -The UI has two columns: +or -- First column is dedicated to the Player, and all Player-related features live there -- Second column is dedicated to the House, and all House-related features live there +```bash +yarn create @mysten/dapp --template react-client-dapp +``` ### Project folder structure Structure the project folder according to the UI layout, meaning that all Player-related React components reside in the `containers/Player` folder, while all House-related React components reside in the `containers/House` folder. +### Connecting your deployed package {#connecting-your-package} + +Add the `packageId` value you saved from [deploying your package](#deployment) to a new `src/constants.ts` file in your project: + +```ts +export const PACKAGE_ID = + "0x4120b39e5d94845aa539d4b830743a7433fd8511bdcf3841f98080080f327ca8"; +export const HOUSECAP_ID = + "0xfa1f6edad697afca055749fedbdee420b6cdba3edc2f7fd4927ed42f98a7e63a"; +``` + ### Exploring the code The UI interacts with the [Single Player smart contract](guides/developer/app-examples/coin-flip.mdx#game-module) variant of the game. This section walks you through each step in the smart contract flow and the corresponding frontend code. @@ -657,56 +766,56 @@ import { HouseSesh } from './containers/House/HouseSesh'; import { PlayerSesh } from './containers/Player/PlayerSesh'; function App() { - const account = useCurrentAccount(); - return ( - <> - - - Satoshi Coin Flip Single Player - - - - - - - - - Package ID: {PACKAGE_ID} - - - HouseCap ID: {HOUSECAP_ID} - - - - - - - - You need to connect to wallet that publish the smart contract package - - - - {!account ? ( - - Please connect wallet to continue - - ) : ( - - - - - )} - - - ); + const account = useCurrentAccount(); + return ( + <> + + + Satoshi Coin Flip Single Player + + + + + + + + + Package ID: {PACKAGE_ID} + + + HouseCap ID: {HOUSECAP_ID} + + + + + + + + You need to connect to wallet that publish the smart contract package + + + + {!account ? ( + + Please connect wallet to continue + + ) : ( + + + + + )} + + + ); } export default App; @@ -716,8 +825,6 @@ Like other dApps, you need a "connect wallet" button to enable connecting users' `useCurrentAccount()` is a React hook the dApp Kit also provides to query the current connected wallet; returning `null` if there isn't a wallet connection. Leverage this behavior to prevent a user from proceeding further if they haven’t connected their wallet yet. -There are two constants that you need to put into `constants.ts` to make the app work – `PACKAGE_ID` and `HOUSECAP_ID`. You can get these from the terminal or console after running the Sui CLI command to publish the package. - After ensuring that the user has connected their wallet, you can display the two columns described in the previous section: `PlayerSesh` and `HouseSesh` components. Okay, that’s a good start to have an overview of the project. Time to move to initializing the `HouseData` object. All the frontend logic for calling this lives in the `HouseInitialize.tsx` component. The component includes UI code, but the logic that executes the transaction follows: @@ -819,44 +926,44 @@ import { PACKAGE_ID } from '../../constants'; // This hook is to demonstrate how to use `@mysten/dapp-kit` React hook to query data // besides using SuiClient directly export function useFetchCounterNft() { - const account = useCurrentAccount(); - - if (!account) { - return { data: [] }; - } - - // Fetch CounterNFT owned by current connected wallet - // Only fetch the 1st one - const { data, isLoading, isError, error, refetch } = useSuiClientQuery( - 'getOwnedObjects', - { - owner: account.address, - limit: 1, - filter: { - MatchAll: [ - { - StructType: `${PACKAGE_ID}::counter_nft::Counter`, - }, - { - AddressOwner: account.address, - }, - ], - }, - options: { - showOwner: true, - showType: true, - }, - }, - { queryKey: ['CounterNFT'] }, - ); - - return { - data: data && data.data.length > 0 ? data?.data : [], - isLoading, - isError, - error, - refetch, - }; + const account = useCurrentAccount(); + + if (!account) { + return { data: [] }; + } + + // Fetch CounterNFT owned by current connected wallet + // Only fetch the 1st one + const { data, isLoading, isError, error, refetch } = useSuiClientQuery( + 'getOwnedObjects', + { + owner: account.address, + limit: 1, + filter: { + MatchAll: [ + { + StructType: `${PACKAGE_ID}::counter_nft::Counter`, + }, + { + AddressOwner: account.address, + }, + ], + }, + options: { + showOwner: true, + showType: true, + }, + }, + { queryKey: ['CounterNFT'] }, + ); + + return { + data: data && data.data.length > 0 ? data?.data : [], + isLoading, + isError, + error, + refetch, + }; } ``` @@ -870,39 +977,39 @@ That’s it, now put the hook into the UI component `PlayerListCounterNft.tsx` a ```typescript title='containers/Player/PlayerListCounterNft.tsx' export function PlayerListCounterNft() { - const { data, isLoading, error, refetch } = useFetchCounterNft(); - const { mutate: execCreateCounterNFT } = useSignAndExecuteTransaction(); - - return ( - - - Counter NFTs - - - {error && Error: {error.message}} - - - {data.length > 0 ? ( - data.map((it) => { - return ( - - - Object ID: - - {it.data?.objectId} - - Object Type: - - {it.data?.type} - - ); - }) - ) : ( - No CounterNFT Owned - )} - - - ); + const { data, isLoading, error, refetch } = useFetchCounterNft(); + const { mutate: execCreateCounterNFT } = useSignAndExecuteTransaction(); + + return ( + + + Counter NFTs + + + {error && Error: {error.message}} + + + {data.length > 0 ? ( + data.map((it) => { + return ( + + + Object ID: + + {it.data?.objectId} + + Object Type: + + {it.data?.type} + + ); + }) + ) : ( + No CounterNFT Owned + )} + + + ); } ``` @@ -913,26 +1020,26 @@ As you might recall with `Transaction`, outputs from the transaction can be inpu ```typescript title='containers/Player/PlayerListCounterNft.tsx' const txb = new Transaction(); const [counterNft] = txb.moveCall({ - target: `${PACKAGE_ID}::counter_nft::mint`, + target: `${PACKAGE_ID}::counter_nft::mint`, }); txb.moveCall({ - target: `${PACKAGE_ID}::counter_nft::transfer_to_sender`, - arguments: [counterNft], + target: `${PACKAGE_ID}::counter_nft::transfer_to_sender`, + arguments: [counterNft], }); execCreateCounterNFT( - { - transaction: txb, - }, - { - onError: (err) => { - toast.error(err.message); - }, - onSuccess: (result) => { - toast.success(`Digest: ${result.digest}`); - refetch?.(); - }, - }, + { + transaction: txb, + }, + { + onError: (err) => { + toast.error(err.message); + }, + onSuccess: (result) => { + toast.success(`Digest: ${result.digest}`); + refetch?.(); + }, + }, ); ``` @@ -947,27 +1054,27 @@ const [stakeCoin] = txb.splitCoins(txb.gas, [MIST_PER_SUI * BigInt(stake)]); // Create the game with CounterNFT txb.moveCall({ - target: `${PACKAGE_ID}::single_player_satoshi::start_game`, - arguments: [ - txb.pure.string(guess), - txb.object(counterNFTData[0].data?.objectId!), - stakeCoin, - txb.object(houseDataId), - ], + target: `${PACKAGE_ID}::single_player_satoshi::start_game`, + arguments: [ + txb.pure.string(guess), + txb.object(counterNFTData[0].data?.objectId!), + stakeCoin, + txb.object(houseDataId), + ], }); execCreateGame( - { - transaction: txb, - }, - { - onError: (err) => { - toast.error(err.message); - }, - onSuccess: (result: SuiTransactionBlockResponse) => { - toast.success(`Digest: ${result.digest}`); - }, - }, + { + transaction: txb, + }, + { + onError: (err) => { + toast.error(err.message); + }, + onSuccess: (result: SuiTransactionBlockResponse) => { + toast.success(`Digest: ${result.digest}`); + }, + }, ); ``` @@ -981,70 +1088,70 @@ All of this logic is in `HouseFinishGame.tsx`: ```typescript title='containers/House/HouseFinishGame.tsx' // This component will help the House to automatically finish the game whenever new game is started export function HouseFinishGame() { - const suiClient = useSuiClient(); - const { mutate: execFinishGame } = useSignAndExecuteTransactionBlock(); - - const [housePrivHex] = useContext(HouseKeypairContext); - const [houseDataId] = useContext(HouseDataContext); - - useEffect(() => { - // Subscribe to NewGame event - const unsub = suiClient.subscribeEvent({ - filter: { - MoveEventType: `${PACKAGE_ID}::single_player_satoshi::NewGame`, - }, - onMessage(event) { - console.log(event); - const { game_id, vrf_input } = event.parsedJson as { - game_id: string; - vrf_input: number[]; - }; - - toast.info(`NewGame started ID: ${game_id}`); - - console.log(housePrivHex); - - try { - const houseSignedInput = bls.sign( - new Uint8Array(vrf_input), - curveUtils.hexToBytes(housePrivHex), - ); - - // Finish the game immediately after new game started - const txb = new Transaction(); - txb.moveCall({ - target: `${PACKAGE_ID}::single_player_satoshi::finish_game`, - arguments: [ - txb.pure.id(game_id), - txb.pure(bcs.vector(bcs.U8).serialize(houseSignedInput)), - txb.object(houseDataId), - ], - }); - execFinishGame( - { - transaction: txb, - }, - { - onError: (err) => { - toast.error(err.message); - }, - onSuccess: (result: SuiTransactionBlockResponse) => { - toast.success(`Digest: ${result.digest}`); - }, - }, - ); - } catch (err) { - console.error(err); - } - }, - }); - - return () => { - (async () => (await unsub)())(); - }; - }, [housePrivHex, houseDataId, suiClient]); - - return null; + const suiClient = useSuiClient(); + const { mutate: execFinishGame } = useSignAndExecuteTransactionBlock(); + + const [housePrivHex] = useContext(HouseKeypairContext); + const [houseDataId] = useContext(HouseDataContext); + + useEffect(() => { + // Subscribe to NewGame event + const unsub = suiClient.subscribeEvent({ + filter: { + MoveEventType: `${PACKAGE_ID}::single_player_satoshi::NewGame`, + }, + onMessage(event) { + console.log(event); + const { game_id, vrf_input } = event.parsedJson as { + game_id: string; + vrf_input: number[]; + }; + + toast.info(`NewGame started ID: ${game_id}`); + + console.log(housePrivHex); + + try { + const houseSignedInput = bls.sign( + new Uint8Array(vrf_input), + curveUtils.hexToBytes(housePrivHex), + ); + + // Finish the game immediately after new game started + const txb = new Transaction(); + txb.moveCall({ + target: `${PACKAGE_ID}::single_player_satoshi::finish_game`, + arguments: [ + txb.pure.id(game_id), + txb.pure(bcs.vector(bcs.U8).serialize(houseSignedInput)), + txb.object(houseDataId), + ], + }); + execFinishGame( + { + transaction: txb, + }, + { + onError: (err) => { + toast.error(err.message); + }, + onSuccess: (result: SuiTransactionBlockResponse) => { + toast.success(`Digest: ${result.digest}`); + }, + }, + ); + } catch (err) { + console.error(err); + } + }, + }); + + return () => { + (async () => (await unsub)())(); + }; + }, [housePrivHex, houseDataId, suiClient]); + + return null; } ``` From cb2f63e6f31cbc37a68447bc991f6198d6f2ed07 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Tue, 16 Jul 2024 09:14:04 -0700 Subject: [PATCH 047/163] Fix flaky validator_tx_finalizer tests (#18688) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-core/src/validator_tx_finalizer.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index fd55c7c13a432..6e1438290859d 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -114,9 +114,7 @@ impl ValidatorTxFinalizer { agg, tx_finalization_delay, finalization_timeout, - metrics: Arc::new(ValidatorTxFinalizerMetrics::new( - prometheus::default_registry(), - )), + metrics: Arc::new(ValidatorTxFinalizerMetrics::new(&Registry::new())), } } } From 3731f2887c9619751677255ec1325a5467b341b7 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Sat, 13 Jul 2024 14:52:49 +0100 Subject: [PATCH 048/163] [chore][GraphQL/Limits] Separate QueryLimitChecker extension/factory (#18660) ## Description Split up the extension factory from the extension itself, similar to what we did for `Timeout` before. This avoids the confusion of the single type being created with defaulted fields to act as the factory and then creating new versions of itself to act as the extension. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/extensions/query_limits_checker.rs | 206 +++++++++--------- crates/sui-graphql-rpc/src/server/builder.rs | 8 +- 2 files changed, 106 insertions(+), 108 deletions(-) diff --git a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs index 98acec0add6f4..882be3edeb07f 100644 --- a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs +++ b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs @@ -25,6 +25,9 @@ use tokio::sync::Mutex; use tracing::info; use uuid::Uuid; +/// Extension factory for adding checks that the query is within configurable limits. +pub(crate) struct QueryLimitsChecker; + /// Only display usage information if this header was in the request. pub(crate) struct ShowUsage; @@ -39,7 +42,7 @@ struct ValidationRes { } #[derive(Debug, Default)] -pub(crate) struct QueryLimitsChecker { +struct QueryLimitsCheckerExt { validation_result: Mutex>, } @@ -64,7 +67,7 @@ impl headers::Header for ShowUsage { impl ExtensionFactory for QueryLimitsChecker { fn create(&self) -> Arc { - Arc::new(QueryLimitsChecker { + Arc::new(QueryLimitsCheckerExt { validation_result: Mutex::new(None), }) } @@ -90,7 +93,7 @@ impl std::ops::Add for ComponentCost { } #[async_trait::async_trait] -impl Extension for QueryLimitsChecker { +impl Extension for QueryLimitsCheckerExt { async fn request(&self, ctx: &ExtensionContext<'_>, next: NextRequest<'_>) -> Response { let resp = next.run(ctx).await; let validation_result = self.validation_result.lock().await.take(); @@ -179,7 +182,7 @@ impl Extension for QueryLimitsChecker { } running_costs.depth = 0; - self.analyze_selection_set( + analyze_selection_set( &cfg.limits, &doc.fragments, sel_set, @@ -220,118 +223,113 @@ impl Extension for QueryLimitsChecker { } } -impl QueryLimitsChecker { - /// Parse the selected fields in one operation and check if it conforms to configured limits. - fn analyze_selection_set( - &self, - limits: &Limits, - fragment_defs: &HashMap>, - sel_set: &Positioned, - cost: &mut ComponentCost, - variables: &Variables, - ctx: &ExtensionContext<'_>, - ) -> ServerResult<()> { - // Use BFS to analyze the query and count the number of nodes and the depth of the query - struct ToVisit<'s> { - selection: &'s Positioned, - parent_node_count: u32, - } +/// Parse the selected fields in one operation and check if it conforms to configured limits. +fn analyze_selection_set( + limits: &Limits, + fragment_defs: &HashMap>, + sel_set: &Positioned, + cost: &mut ComponentCost, + variables: &Variables, + ctx: &ExtensionContext<'_>, +) -> ServerResult<()> { + // Use BFS to analyze the query and count the number of nodes and the depth of the query + struct ToVisit<'s> { + selection: &'s Positioned, + parent_node_count: u32, + } - // Queue to store the nodes at each level - let mut que = VecDeque::new(); + // Queue to store the nodes at each level + let mut que = VecDeque::new(); - for selection in sel_set.node.items.iter() { - que.push_back(ToVisit { - selection, - parent_node_count: 1, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(selection.pos), ctx)?; - } + for selection in sel_set.node.items.iter() { + que.push_back(ToVisit { + selection, + parent_node_count: 1, + }); + cost.input_nodes += 1; + check_limits(limits, cost, Some(selection.pos), ctx)?; + } - // Track the number of nodes at first level if any - let mut level_len = que.len(); - - while !que.is_empty() { - // Signifies the start of a new level - cost.depth += 1; - check_limits(limits, cost, None, ctx)?; - while level_len > 0 { - // Ok to unwrap since we checked for empty queue - // and level_len > 0 - let ToVisit { - selection, - parent_node_count, - } = que.pop_front().unwrap(); - - match &selection.node { - Selection::Field(f) => { - check_directives(&f.node.directives)?; - - let current_count = estimate_output_nodes_for_curr_node( - f, - variables, - limits.default_page_size, - ) * parent_node_count; - - cost.output_nodes += current_count; - - for field_sel in f.node.selection_set.node.items.iter() { - que.push_back(ToVisit { - selection: field_sel, - parent_node_count: current_count, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(field_sel.pos), ctx)?; - } + // Track the number of nodes at first level if any + let mut level_len = que.len(); + + while !que.is_empty() { + // Signifies the start of a new level + cost.depth += 1; + check_limits(limits, cost, None, ctx)?; + while level_len > 0 { + // Ok to unwrap since we checked for empty queue + // and level_len > 0 + let ToVisit { + selection, + parent_node_count, + } = que.pop_front().unwrap(); + + match &selection.node { + Selection::Field(f) => { + check_directives(&f.node.directives)?; + + let current_count = + estimate_output_nodes_for_curr_node(f, variables, limits.default_page_size) + * parent_node_count; + + cost.output_nodes += current_count; + + for field_sel in f.node.selection_set.node.items.iter() { + que.push_back(ToVisit { + selection: field_sel, + parent_node_count: current_count, + }); + cost.input_nodes += 1; + check_limits(limits, cost, Some(field_sel.pos), ctx)?; } + } - Selection::FragmentSpread(fs) => { - let frag_name = &fs.node.fragment_name.node; - let frag_def = fragment_defs.get(frag_name).ok_or_else(|| { - graphql_error_at_pos( - code::INTERNAL_SERVER_ERROR, - format!( - "Fragment {} not found but present in fragment list", - frag_name - ), - fs.pos, - ) - })?; - - // TODO: this is inefficient as we might loop over same fragment multiple times - // Ideally web should cache the costs of fragments we've seen before - // Will do as enhancement - check_directives(&frag_def.node.directives)?; - for selection in frag_def.node.selection_set.node.items.iter() { - que.push_back(ToVisit { - selection, - parent_node_count, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(selection.pos), ctx)?; - } + Selection::FragmentSpread(fs) => { + let frag_name = &fs.node.fragment_name.node; + let frag_def = fragment_defs.get(frag_name).ok_or_else(|| { + graphql_error_at_pos( + code::INTERNAL_SERVER_ERROR, + format!( + "Fragment {} not found but present in fragment list", + frag_name + ), + fs.pos, + ) + })?; + + // TODO: this is inefficient as we might loop over same fragment multiple times + // Ideally web should cache the costs of fragments we've seen before + // Will do as enhancement + check_directives(&frag_def.node.directives)?; + for selection in frag_def.node.selection_set.node.items.iter() { + que.push_back(ToVisit { + selection, + parent_node_count, + }); + cost.input_nodes += 1; + check_limits(limits, cost, Some(selection.pos), ctx)?; } + } - Selection::InlineFragment(fs) => { - check_directives(&fs.node.directives)?; - for selection in fs.node.selection_set.node.items.iter() { - que.push_back(ToVisit { - selection, - parent_node_count, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(selection.pos), ctx)?; - } + Selection::InlineFragment(fs) => { + check_directives(&fs.node.directives)?; + for selection in fs.node.selection_set.node.items.iter() { + que.push_back(ToVisit { + selection, + parent_node_count, + }); + cost.input_nodes += 1; + check_limits(limits, cost, Some(selection.pos), ctx)?; } } - level_len -= 1; } - level_len = que.len(); + level_len -= 1; } - - Ok(()) + level_len = que.len(); } + + Ok(()) } fn check_limits( diff --git a/crates/sui-graphql-rpc/src/server/builder.rs b/crates/sui-graphql-rpc/src/server/builder.rs index 5cd601de9039d..f2ef3f408567b 100644 --- a/crates/sui-graphql-rpc/src/server/builder.rs +++ b/crates/sui-graphql-rpc/src/server/builder.rs @@ -476,7 +476,7 @@ impl ServerBuilder { builder = builder.extension(Logger::default()); } if config.internal_features.query_limits_checker { - builder = builder.extension(QueryLimitsChecker::default()); + builder = builder.extension(QueryLimitsChecker); } if config.internal_features.query_timeout { builder = builder.extension(Timeout); @@ -864,7 +864,7 @@ pub mod tests { }; let schema = prep_schema(None, Some(service_config)) - .extension(QueryLimitsChecker::default()) + .extension(QueryLimitsChecker) .build_schema(); schema.execute(query).await } @@ -922,7 +922,7 @@ pub mod tests { }; let schema = prep_schema(None, Some(service_config)) - .extension(QueryLimitsChecker::default()) + .extension(QueryLimitsChecker) .build_schema(); schema.execute(query).await } @@ -1042,7 +1042,7 @@ pub mod tests { let server_builder = prep_schema(None, None); let metrics = server_builder.state.metrics.clone(); let schema = server_builder - .extension(QueryLimitsChecker::default()) // QueryLimitsChecker is where we actually set the metrics + .extension(QueryLimitsChecker) // QueryLimitsChecker is where we actually set the metrics .build_schema(); schema From 77dc88eb2824fd5700c2548da2c8e98d7e95efff Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Tue, 16 Jul 2024 13:13:01 +0100 Subject: [PATCH 049/163] [GraphQL/Limits] BUGFIX: directives test error type (#18661) ## Description Passing an unsupported directive should be a user input error, not an internal error. ## Test plan ``` sui-graphql-e2e-tests$ cargo nextest run --features pg_integration -- limits/directives ``` ## Stack - #18660 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [x] GraphQL: Passing an unsupported directive to the service will be treated as a `BAD_USER_INPUT` rather than an `INTERNAL_SERVER_ERROR`. - [ ] CLI: - [ ] Rust SDK: --- crates/sui-graphql-e2e-tests/tests/limits/directives.exp | 4 ++-- crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp index 27c666b948b9e..477b9a62a96b0 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp +++ b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp @@ -16,7 +16,7 @@ Response: { } ], "extensions": { - "code": "INTERNAL_SERVER_ERROR" + "code": "BAD_USER_INPUT" } } ] @@ -35,7 +35,7 @@ Response: { } ], "extensions": { - "code": "INTERNAL_SERVER_ERROR" + "code": "BAD_USER_INPUT" } } ] diff --git a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs index 882be3edeb07f..9f9f731c90880 100644 --- a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs +++ b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs @@ -408,7 +408,7 @@ fn check_directives(directives: &[Positioned]) -> ServerResult<()> { for directive in directives { if !allowed_directives().contains(&directive.node.name.node.as_str()) { return Err(graphql_error_at_pos( - code::INTERNAL_SERVER_ERROR, + code::BAD_USER_INPUT, format!( "Directive `@{}` is not supported. Supported directives are {}", directive.node.name.node, From 0ab05e42b7a40a11eb653c7741d04ce371224016 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Tue, 16 Jul 2024 13:13:09 +0100 Subject: [PATCH 050/163] [chore][GraphQL/Limits] Clean up headers (#18662) ## Description Two header related clean-ups: - The version header should no longer be part of the CORS configuration, because we don't expect versions to be configured by (request) header. - The `ShowUsage` type doesn't need to implement `Header` because we only care about comparing its name. ## Test plan CI ## Stack - #18660 - #18661 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [x] GraphQL: `x-sui-rpc-version` is no longer an accepted request header, as versions are now selected by modifying the path. - [ ] CLI: - [ ] Rust SDK: --- .../src/extensions/query_limits_checker.rs | 17 ++--------------- crates/sui-graphql-rpc/src/server/builder.rs | 10 +++------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs index 9f9f731c90880..6159cd8405c8b 100644 --- a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs +++ b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs @@ -12,9 +12,7 @@ use async_graphql::parser::types::{ }; use async_graphql::{value, Name, Pos, Positioned, Response, ServerResult, Value, Variables}; use async_graphql_value::Value as GqlValue; -use axum::headers; use axum::http::HeaderName; -use axum::http::HeaderValue; use once_cell::sync::Lazy; use std::collections::{BTreeSet, HashMap, VecDeque}; use std::net::SocketAddr; @@ -48,21 +46,10 @@ struct QueryLimitsCheckerExt { pub(crate) const CONNECTION_FIELDS: [&str; 2] = ["edges", "nodes"]; -impl headers::Header for ShowUsage { - fn name() -> &'static HeaderName { +impl ShowUsage { + pub(crate) fn name() -> &'static HeaderName { &LIMITS_HEADER } - - fn decode<'i, I>(_: &mut I) -> Result - where - I: Iterator, - { - Ok(ShowUsage) - } - - fn encode>(&self, _: &mut E) { - unimplemented!() - } } impl ExtensionFactory for QueryLimitsChecker { diff --git a/crates/sui-graphql-rpc/src/server/builder.rs b/crates/sui-graphql-rpc/src/server/builder.rs index f2ef3f408567b..c2429bac1f41d 100644 --- a/crates/sui-graphql-rpc/src/server/builder.rs +++ b/crates/sui-graphql-rpc/src/server/builder.rs @@ -44,7 +44,7 @@ use axum::middleware::{self}; use axum::response::IntoResponse; use axum::routing::{get, post, MethodRouter, Route}; use axum::Extension; -use axum::{headers::Header, Router}; +use axum::Router; use chrono::Utc; use http::{HeaderValue, Method, Request}; use hyper::server::conn::AddrIncoming as HyperAddrIncoming; @@ -57,7 +57,7 @@ use std::net::TcpStream; use std::sync::Arc; use std::time::Duration; use std::{any::Any, net::SocketAddr, time::Instant}; -use sui_graphql_rpc_headers::{LIMITS_HEADER, VERSION_HEADER}; +use sui_graphql_rpc_headers::LIMITS_HEADER; use sui_package_resolver::{PackageStoreWithLruCache, Resolver}; use sui_sdk::SuiClientBuilder; use tokio::join; @@ -309,11 +309,7 @@ impl ServerBuilder { .allow_methods([Method::POST]) // Allow requests from any origin .allow_origin(acl) - .allow_headers([ - hyper::header::CONTENT_TYPE, - VERSION_HEADER.clone(), - LIMITS_HEADER.clone(), - ]); + .allow_headers([hyper::header::CONTENT_TYPE, LIMITS_HEADER.clone()]); Ok(cors) } From 6756fa78b101c6a1501093c255f2b5d535949fb1 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Tue, 16 Jul 2024 13:33:29 +0100 Subject: [PATCH 051/163] [chore][GraphQL/Limits] Standardise query_limits_checker file order (#18663) ## Description This is a file order change only, with no other meaningful changes. It standardises the order to: - Constants - Types - Impls - Trait Impls - Free functions ## Test plan CI ## Stack - #18660 - #18661 - #18662 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/extensions/query_limits_checker.rs | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs index 6159cd8405c8b..715241653542b 100644 --- a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs +++ b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs @@ -23,9 +23,16 @@ use tokio::sync::Mutex; use tracing::info; use uuid::Uuid; +pub(crate) const CONNECTION_FIELDS: [&str; 2] = ["edges", "nodes"]; + /// Extension factory for adding checks that the query is within configurable limits. pub(crate) struct QueryLimitsChecker; +#[derive(Debug, Default)] +struct QueryLimitsCheckerExt { + validation_result: Mutex>, +} + /// Only display usage information if this header was in the request. pub(crate) struct ShowUsage; @@ -39,13 +46,13 @@ struct ValidationRes { query_payload: u32, } -#[derive(Debug, Default)] -struct QueryLimitsCheckerExt { - validation_result: Mutex>, +#[derive(Debug)] +struct ComponentCost { + pub input_nodes: u32, + pub output_nodes: u32, + pub depth: u32, } -pub(crate) const CONNECTION_FIELDS: [&str; 2] = ["edges", "nodes"]; - impl ShowUsage { pub(crate) fn name() -> &'static HeaderName { &LIMITS_HEADER @@ -60,25 +67,6 @@ impl ExtensionFactory for QueryLimitsChecker { } } -#[derive(Debug)] -struct ComponentCost { - pub input_nodes: u32, - pub output_nodes: u32, - pub depth: u32, -} - -impl std::ops::Add for ComponentCost { - type Output = Self; - - fn add(self, rhs: Self) -> Self::Output { - Self { - input_nodes: self.input_nodes + rhs.input_nodes, - output_nodes: self.output_nodes + rhs.output_nodes, - depth: self.depth + rhs.depth, - } - } -} - #[async_trait::async_trait] impl Extension for QueryLimitsCheckerExt { async fn request(&self, ctx: &ExtensionContext<'_>, next: NextRequest<'_>) -> Response { @@ -210,6 +198,18 @@ impl Extension for QueryLimitsCheckerExt { } } +impl std::ops::Add for ComponentCost { + type Output = Self; + + fn add(self, rhs: Self) -> Self::Output { + Self { + input_nodes: self.input_nodes + rhs.input_nodes, + output_nodes: self.output_nodes + rhs.output_nodes, + depth: self.depth + rhs.depth, + } + } +} + /// Parse the selected fields in one operation and check if it conforms to configured limits. fn analyze_selection_set( limits: &Limits, From e397c2f23a0498446032b0fa5cd6f7572f928bc5 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Tue, 16 Jul 2024 15:00:02 +0100 Subject: [PATCH 052/163] [GraphQL/Limits] Separate out directive checks (#18664) ## Description Trying to do the directive checks at the same time as the query checks complicates both implementations. Split out the directive check into its own extension. Also fix the directive checks not looking at directives on variable definitions. ## Test plan ``` sui-graphql-e2e-tests$ cargo nextest run \ --features pg_integration \ -- limits/directives.move ``` ## Stack - #18660 - #18661 - #18662 - #18663 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [x] GraphQL: The service now detects unsupported directives on query variable definitions. - [ ] CLI: - [ ] Rust SDK: --- .../tests/limits/directives.exp | 31 ++++-- .../tests/limits/directives.move | 10 +- crates/sui-graphql-rpc/src/config.rs | 2 + .../src/extensions/directive_checker.rs | 99 +++++++++++++++++++ crates/sui-graphql-rpc/src/extensions/mod.rs | 3 +- .../src/extensions/query_limits_checker.rs | 38 +------ crates/sui-graphql-rpc/src/server/builder.rs | 10 ++ 7 files changed, 149 insertions(+), 44 deletions(-) create mode 100644 crates/sui-graphql-rpc/src/extensions/directive_checker.rs diff --git a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp index 477b9a62a96b0..2e9dcb11238d8 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp +++ b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp @@ -1,4 +1,4 @@ -processed 7 tasks +processed 8 tasks init: A: object(0,0) @@ -31,7 +31,7 @@ Response: { "locations": [ { "line": 1, - "column": 29 + "column": 28 } ], "extensions": { @@ -41,26 +41,45 @@ Response: { ] } -task 3 'run-graphql'. lines 44-48: +task 3 'run-graphql'. lines 44-50: +Response: { + "data": null, + "errors": [ + { + "message": "Directive `@deprecated` is not supported. Supported directives are `@include`, `@skip`", + "locations": [ + { + "line": 1, + "column": 24 + } + ], + "extensions": { + "code": "BAD_USER_INPUT" + } + } + ] +} + +task 4 'run-graphql'. lines 52-56: Response: { "data": {} } -task 4 'run-graphql'. lines 50-54: +task 5 'run-graphql'. lines 58-62: Response: { "data": { "chainIdentifier": "3989ac57" } } -task 5 'run-graphql'. lines 56-60: +task 6 'run-graphql'. lines 64-68: Response: { "data": { "chainIdentifier": "3989ac57" } } -task 6 'run-graphql'. lines 62-66: +task 7 'run-graphql'. lines 70-74: Response: { "data": {} } diff --git a/crates/sui-graphql-e2e-tests/tests/limits/directives.move b/crates/sui-graphql-e2e-tests/tests/limits/directives.move index d3b0fbad6c8b4..21dadb4cfc0f4 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/directives.move +++ b/crates/sui-graphql-e2e-tests/tests/limits/directives.move @@ -11,7 +11,7 @@ //# run-graphql -fragment Modules on Object @deprecated { +fragment Modules on Object @deprecated { address asMovePackage { module(name: "m") { @@ -43,6 +43,14 @@ fragment Modules on Object @deprecated { //# run-graphql +query($id: SuiAddress! @deprecated) { + object(id: $id) { + address + } +} + +//# run-graphql + { chainIdentifier @skip(if: true) } diff --git a/crates/sui-graphql-rpc/src/config.rs b/crates/sui-graphql-rpc/src/config.rs index 320653bcbaa3d..71590683d308f 100644 --- a/crates/sui-graphql-rpc/src/config.rs +++ b/crates/sui-graphql-rpc/src/config.rs @@ -159,6 +159,7 @@ pub struct Experiments { #[GraphQLConfig] pub struct InternalFeatureConfig { pub(crate) query_limits_checker: bool, + pub(crate) directive_checker: bool, pub(crate) feature_gate: bool, pub(crate) logger: bool, pub(crate) query_timeout: bool, @@ -459,6 +460,7 @@ impl Default for InternalFeatureConfig { fn default() -> Self { Self { query_limits_checker: true, + directive_checker: true, feature_gate: true, logger: true, query_timeout: true, diff --git a/crates/sui-graphql-rpc/src/extensions/directive_checker.rs b/crates/sui-graphql-rpc/src/extensions/directive_checker.rs new file mode 100644 index 0000000000000..11e6ce6e80044 --- /dev/null +++ b/crates/sui-graphql-rpc/src/extensions/directive_checker.rs @@ -0,0 +1,99 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use std::sync::Arc; + +use async_graphql::{ + extensions::{Extension, ExtensionContext, ExtensionFactory, NextParseQuery}, + parser::types::{Directive, ExecutableDocument, Selection}, + Positioned, ServerResult, +}; +use async_graphql_value::Variables; +use async_trait::async_trait; + +use crate::error::{code, graphql_error_at_pos}; + +const ALLOWED_DIRECTIVES: [&str; 2] = ["include", "skip"]; + +/// Extension factory to add a check that all the directives used in the query are accepted and +/// understood by the service. +pub(crate) struct DirectiveChecker; + +struct DirectiveCheckerExt; + +impl ExtensionFactory for DirectiveChecker { + fn create(&self) -> Arc { + Arc::new(DirectiveCheckerExt) + } +} + +#[async_trait] +impl Extension for DirectiveCheckerExt { + async fn parse_query( + &self, + ctx: &ExtensionContext<'_>, + query: &str, + variables: &Variables, + next: NextParseQuery<'_>, + ) -> ServerResult { + let doc = next.run(ctx, query, variables).await?; + + let mut selection_sets = vec![]; + for fragment in doc.fragments.values() { + check_directives(&fragment.node.directives)?; + selection_sets.push(&fragment.node.selection_set); + } + + for (_name, op) in doc.operations.iter() { + check_directives(&op.node.directives)?; + + for var in &op.node.variable_definitions { + check_directives(&var.node.directives)?; + } + + selection_sets.push(&op.node.selection_set); + } + + while let Some(selection_set) = selection_sets.pop() { + for selection in &selection_set.node.items { + match &selection.node { + Selection::Field(field) => { + check_directives(&field.node.directives)?; + selection_sets.push(&field.node.selection_set); + } + Selection::FragmentSpread(spread) => { + check_directives(&spread.node.directives)?; + } + Selection::InlineFragment(fragment) => { + check_directives(&fragment.node.directives)?; + selection_sets.push(&fragment.node.selection_set); + } + } + } + } + + Ok(doc) + } +} + +fn check_directives(directives: &[Positioned]) -> ServerResult<()> { + for directive in directives { + let name = &directive.node.name.node; + if !ALLOWED_DIRECTIVES.contains(&name.as_str()) { + let supported: Vec<_> = ALLOWED_DIRECTIVES + .iter() + .map(|s| format!("`@{s}`")) + .collect(); + + return Err(graphql_error_at_pos( + code::BAD_USER_INPUT, + format!( + "Directive `@{name}` is not supported. Supported directives are {}", + supported.join(", "), + ), + directive.pos, + )); + } + } + Ok(()) +} diff --git a/crates/sui-graphql-rpc/src/extensions/mod.rs b/crates/sui-graphql-rpc/src/extensions/mod.rs index 9c282b5ae958e..f3b8aa792a0fe 100644 --- a/crates/sui-graphql-rpc/src/extensions/mod.rs +++ b/crates/sui-graphql-rpc/src/extensions/mod.rs @@ -1,7 +1,8 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +pub(crate) mod directive_checker; pub(crate) mod feature_gate; pub(crate) mod logger; -pub mod query_limits_checker; +pub(crate) mod query_limits_checker; pub(crate) mod timeout; diff --git a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs index 715241653542b..79054f833e93a 100644 --- a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs +++ b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs @@ -8,13 +8,12 @@ use async_graphql::extensions::NextParseQuery; use async_graphql::extensions::NextRequest; use async_graphql::extensions::{Extension, ExtensionContext, ExtensionFactory}; use async_graphql::parser::types::{ - Directive, ExecutableDocument, Field, FragmentDefinition, Selection, SelectionSet, + ExecutableDocument, Field, FragmentDefinition, Selection, SelectionSet, }; use async_graphql::{value, Name, Pos, Positioned, Response, ServerResult, Value, Variables}; use async_graphql_value::Value as GqlValue; use axum::http::HeaderName; -use once_cell::sync::Lazy; -use std::collections::{BTreeSet, HashMap, VecDeque}; +use std::collections::{HashMap, VecDeque}; use std::net::SocketAddr; use std::sync::Arc; use std::time::Instant; @@ -254,8 +253,6 @@ fn analyze_selection_set( match &selection.node { Selection::Field(f) => { - check_directives(&f.node.directives)?; - let current_count = estimate_output_nodes_for_curr_node(f, variables, limits.default_page_size) * parent_node_count; @@ -288,7 +285,6 @@ fn analyze_selection_set( // TODO: this is inefficient as we might loop over same fragment multiple times // Ideally web should cache the costs of fragments we've seen before // Will do as enhancement - check_directives(&frag_def.node.directives)?; for selection in frag_def.node.selection_set.node.items.iter() { que.push_back(ToVisit { selection, @@ -300,7 +296,6 @@ fn analyze_selection_set( } Selection::InlineFragment(fs) => { - check_directives(&fs.node.directives)?; for selection in fs.node.selection_set.node.items.iter() { que.push_back(ToVisit { selection, @@ -383,35 +378,6 @@ fn check_limits( Ok(()) } -// TODO: make this configurable -fn allowed_directives() -> &'static BTreeSet<&'static str> { - static DIRECTIVES: Lazy> = - Lazy::new(|| BTreeSet::from_iter(["skip", "include"])); - - Lazy::force(&DIRECTIVES) -} - -fn check_directives(directives: &[Positioned]) -> ServerResult<()> { - for directive in directives { - if !allowed_directives().contains(&directive.node.name.node.as_str()) { - return Err(graphql_error_at_pos( - code::BAD_USER_INPUT, - format!( - "Directive `@{}` is not supported. Supported directives are {}", - directive.node.name.node, - allowed_directives() - .iter() - .map(|s| format!("`@{}`", s)) - .collect::>() - .join(", ") - ), - directive.pos, - )); - } - } - Ok(()) -} - /// Given a node, estimate the number of output nodes it will produce. fn estimate_output_nodes_for_curr_node( f: &Positioned, diff --git a/crates/sui-graphql-rpc/src/server/builder.rs b/crates/sui-graphql-rpc/src/server/builder.rs index c2429bac1f41d..01f70dd20d390 100644 --- a/crates/sui-graphql-rpc/src/server/builder.rs +++ b/crates/sui-graphql-rpc/src/server/builder.rs @@ -11,6 +11,7 @@ use crate::config::{ }; use crate::data::package_resolver::{DbPackageStore, PackageResolver}; use crate::data::{DataLoader, Db}; +use crate::extensions::directive_checker::DirectiveChecker; use crate::metrics::Metrics; use crate::mutation::Mutation; use crate::types::datatype::IMoveDatatype; @@ -468,18 +469,27 @@ impl ServerBuilder { if config.internal_features.feature_gate { builder = builder.extension(FeatureGate); } + if config.internal_features.logger { builder = builder.extension(Logger::default()); } + if config.internal_features.query_limits_checker { builder = builder.extension(QueryLimitsChecker); } + + if config.internal_features.directive_checker { + builder = builder.extension(DirectiveChecker); + } + if config.internal_features.query_timeout { builder = builder.extension(Timeout); } + if config.internal_features.tracing { builder = builder.extension(Tracing); } + if config.internal_features.apollo_tracing { builder = builder.extension(ApolloTracing); } From 4ba06ed7463743fa46f6b5879b7cd1f4b76da2dc Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Tue, 16 Jul 2024 17:02:40 +0100 Subject: [PATCH 053/163] [GraphQL/Limits] Reimplement QueryLimitsChecker (#18666) ## Description Rewriting query limits checker to land a number of improvements and fixes: - Avoid issues with overflows by counting down from a predefined budget, rather than counting up to the limit and protecting multiplications using `checked_mul`. - Improve detection of paginated fields: - Previously we treated all connections-related fields as appearing as many times as the page size (including the field that introduced the connection, and the `pageInfo` field). This was over-approximated the output size by a large margin. The new approach counts exactly the number of nodes in the output: The connection's root field, and any non-`edges` or `nodes` field will not get multiplied by the page size. - The checker now also detects connections-related fields even if they are obscured by fragment or inline fragment spreads. - Tighter `__schema` query detection: Previously we would skip requests that started with a `__schema` introspection query. Now it's required to be the only operation in the request (not just the first). - Fix metrics collection after limits are hit: Previously, if a limit was hit, we would not observe validation-related metrics in prometheus. Now we will always record such metrics, and if a limit has been hit, it will register as being "at" the limit. ## Test plan ``` sui-graphql-e2e-tests$ cargo nextest run --features pg_integration -- limits/ ``` ## Stack - #18660 - #18661 - #18662 - #18663 - #18664 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [x] GraphQL: Output node estimation has been made more accurate -- the estimate should now track the theoretical max number of nodes on the JSON `data` output. - [ ] CLI: - [ ] Rust SDK: --- .../tests/limits/output_node_estimation.exp | 103 ++- .../tests/limits/output_node_estimation.move | 262 ++++--- .../src/extensions/query_limits_checker.rs | 682 +++++++++--------- crates/sui-graphql-rpc/src/server/builder.rs | 20 +- 4 files changed, 588 insertions(+), 479 deletions(-) diff --git a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp index 90b87a03faaf2..3305ac5a56ce1 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp +++ b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp @@ -1,4 +1,4 @@ -processed 14 tasks +processed 16 tasks task 1 'run-graphql'. lines 6-14: Response: { @@ -16,7 +16,7 @@ Response: { "depth": 3, "variables": 0, "fragments": 0, - "queryPayload": 132 + "queryPayload": 254 } } } @@ -37,11 +37,11 @@ Response: { "extensions": { "usage": { "inputNodes": 4, - "outputNodes": 80, + "outputNodes": 42, "depth": 4, "variables": 0, "fragments": 0, - "queryPayload": 163 + "queryPayload": 359 } } } @@ -68,11 +68,11 @@ Response: { "extensions": { "usage": { "inputNodes": 6, - "outputNodes": 1640, + "outputNodes": 842, "depth": 6, "variables": 0, "fragments": 0, - "queryPayload": 206 + "queryPayload": 484 } } } @@ -108,11 +108,11 @@ Response: { "extensions": { "usage": { "inputNodes": 10, - "outputNodes": 1720, + "outputNodes": 922, "depth": 6, "variables": 0, "fragments": 0, - "queryPayload": 306 + "queryPayload": 735 } } } @@ -142,11 +142,11 @@ Response: { "extensions": { "usage": { "inputNodes": 10, - "outputNodes": 1640, + "outputNodes": 882, "depth": 6, "variables": 0, "fragments": 0, - "queryPayload": 308 + "queryPayload": 733 } } } @@ -171,7 +171,7 @@ Response: { "depth": 4, "variables": 0, "fragments": 0, - "queryPayload": 145 + "queryPayload": 323 } } } @@ -196,7 +196,7 @@ Response: { "depth": 4, "variables": 0, "fragments": 0, - "queryPayload": 143 + "queryPayload": 322 } } } @@ -219,16 +219,16 @@ Response: { "extensions": { "usage": { "inputNodes": 14, - "outputNodes": 3320, + "outputNodes": 1762, "depth": 8, "variables": 0, "fragments": 0, - "queryPayload": 501 + "queryPayload": 1077 } } } -task 9 'run-graphql'. lines 144-170: +task 9 'run-graphql'. lines 144-171: Response: { "data": { "transactionBlocks": { @@ -244,16 +244,16 @@ Response: { "extensions": { "usage": { "inputNodes": 13, - "outputNodes": 3300, + "outputNodes": 1742, "depth": 7, "variables": 0, "fragments": 0, - "queryPayload": 533 + "queryPayload": 1030 } } } -task 10 'run-graphql'. lines 172-221: +task 10 'run-graphql'. lines 173-222: Response: { "data": { "transactionBlocks": { @@ -274,16 +274,16 @@ Response: { "extensions": { "usage": { "inputNodes": 24, - "outputNodes": 86340, + "outputNodes": 46424, "depth": 11, "variables": 0, "fragments": 0, - "queryPayload": 1395 + "queryPayload": 2093 } } } -task 11 'run-graphql'. lines 223-248: +task 11 'run-graphql'. lines 224-249: Response: { "data": { "transactionBlocks": { @@ -300,26 +300,56 @@ Response: { "extensions": { "usage": { "inputNodes": 12, - "outputNodes": 33300, + "outputNodes": 17302, "depth": 11, "variables": 0, "fragments": 0, - "queryPayload": 704 + "queryPayload": 1029 } } } -task 12 'run-graphql'. lines 250-260: +task 12 'run-graphql'. lines 251-272: +Response: { + "data": { + "fragmentSpread": { + "nodes": [ + { + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" + } + ] + }, + "inlineFragment": { + "nodes": [ + { + "digest": "EoFwLKRy23XKLkWZbBLiqjTV2vsKPsmpW6dV2caK8ZDH" + } + ] + } + }, + "extensions": { + "usage": { + "inputNodes": 8, + "outputNodes": 44, + "depth": 4, + "variables": 0, + "fragments": 1, + "queryPayload": 562 + } + } +} + +task 13 'run-graphql'. lines 274-286: Response: { "data": null, "extensions": { "usage": { "inputNodes": 4, - "outputNodes": 80, + "outputNodes": 62, "depth": 4, "variables": 0, "fragments": 0, - "queryPayload": 154 + "queryPayload": 394 } }, "errors": [ @@ -327,7 +357,7 @@ Response: { "message": "'first' and 'last' must not be used together", "locations": [ { - "line": 3, + "line": 4, "column": 3 } ], @@ -341,17 +371,17 @@ Response: { ] } -task 13 'run-graphql'. lines 262-272: +task 14 'run-graphql'. lines 288-298: Response: { "data": null, "extensions": { "usage": { "inputNodes": 4, - "outputNodes": 80, + "outputNodes": 42, "depth": 4, "variables": 0, "fragments": 0, - "queryPayload": 147 + "queryPayload": 141 } }, "errors": [ @@ -366,3 +396,16 @@ Response: { } ] } + +task 15 'run-graphql'. lines 300-310: +Response: { + "data": null, + "errors": [ + { + "message": "Estimated output nodes exceeds 100000", + "extensions": { + "code": "BAD_USER_INPUT" + } + } + ] +} diff --git a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move index 2d23f48fd7c71..62dcb8dbd6b97 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move +++ b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.move @@ -6,9 +6,9 @@ //# run-graphql --show-usage # pageInfo does not inherit connection's weights { - transactionBlocks(first: 20) { - pageInfo { - hasPreviousPage + transactionBlocks(first: 20) { # 1 + pageInfo { # 1 + hasPreviousPage # 1 } } } @@ -16,10 +16,10 @@ //# run-graphql --show-usage # if connection does not have 'first' or 'last' set, use default_page_size (20) { - transactionBlocks { - edges { - node { - digest + transactionBlocks { # 1 + edges { # 1 + node { # 20 + digest # 20 } } } @@ -28,12 +28,12 @@ //# run-graphql --show-usage # build on previous example with nested connection { - checkpoints { - nodes { - transactionBlocks { - edges { - txns: node { - digest + checkpoints { # 1 + nodes { # 1 + transactionBlocks { # 20 + edges { # 20 + txns: node { # 400 + digest # 400 } } } @@ -44,19 +44,19 @@ //# run-graphql --show-usage # handles 1 { - checkpoints { - nodes { - notOne: transactionBlocks { - edges { - txns: node { - digest + checkpoints { # 1 + nodes { # 1 + notOne: transactionBlocks { # 20 + edges { # 20 + txns: node { # 400 + digest # 400 } } } - isOne: transactionBlocks(first: 1) { - edges { - txns: node { - digest + isOne: transactionBlocks(first: 1) { # 20 + edges { # 20 + txns: node { # 20 + digest # 20 } } } @@ -67,19 +67,19 @@ //# run-graphql --show-usage # handles 0 { - checkpoints { - nodes { - notZero: transactionBlocks { - edges { - txns: node { - digest + checkpoints { # 1 + nodes { # 1 + notZero: transactionBlocks { # 20 + edges { # 20 + txns: node { # 400 + digest # 400 } } } - isZero: transactionBlocks(first: 0) { - edges { - txns: node { - digest + isZero: transactionBlocks(first: 0) { # 20 + edges { # 20 + txns: node { # 0 + digest # 0 } } } @@ -90,10 +90,10 @@ //# run-graphql --show-usage # if connection does have 'first' set, use it { - transactionBlocks(first: 1) { - edges { - txns: node { - digest + transactionBlocks(first: 1) { # 1 + edges { # 1 + txns: node { # 1 + digest # 1 } } } @@ -102,10 +102,10 @@ //# run-graphql --show-usage # if connection does have 'last' set, use it { - transactionBlocks(last: 1) { - edges { - txns: node { - digest + transactionBlocks(last: 1) { # 1 + edges { # 1 + txns: node { # 1 + digest # 1 } } } @@ -114,24 +114,24 @@ //# run-graphql --show-usage # first and last should behave the same { - transactionBlocks { - edges { - txns: node { - digest - first: expiration { - checkpoints(first: 20) { - edges { - node { - sequenceNumber + transactionBlocks { # 1 + edges { # 1 + txns: node { # 20 + digest # 20 + first: expiration { # 20 + checkpoints(first: 20) { # 20 + edges { # 20 + node { # 400 + sequenceNumber # 400 } } } } - last: expiration { - checkpoints(last: 20) { - edges { - node { - sequenceNumber + last: expiration { # 20 + checkpoints(last: 20) { # 20 + edges { # 20 + node { # 400 + sequenceNumber # 400 } } } @@ -142,28 +142,29 @@ } //# run-graphql --show-usage -# edges incur additional cost over nodes +# edges incur additional cost over nodes, because of the extra level +# of nesting { - transactionBlocks { - nodes { - digest - first: expiration { # 80 cumulative - checkpoints(first: 20) { - edges { - node { - sequenceNumber + transactionBlocks { # 1 + nodes { # 1 + digest # 20 + first: expiration { # 20 + checkpoints(first: 20) { # 20 + edges { # 20 + node { # 400 + sequenceNumber # 400 } } } - } # 1680 cumulative - last: expiration { # 20 + 1680 = 1700 cumulative - checkpoints(last: 20) { - edges { - node { - sequenceNumber + } + last: expiration { # 20 + checkpoints(last: 20) { # 20 + edges { # 20 + node { # 400 + sequenceNumber # 400 } } - } # another 1600, 3300 cumulative + } } } } @@ -174,18 +175,18 @@ # https://docs.github.com/en/graphql/overview/rate-limits-and-node-limits-for-the-graphql-api#node-limit # our costing will be different since we consider all nodes { - transactionBlocks(first: 50) { # 50, 50 - edges { # 50, 100 - txns: node { # 50, 150 - digest # 50, 200 - a: expiration { # 50, 250 - checkpoints(last: 20) { # 50 * 20 = 1000, 1250 - edges { # 1000, 2250 - node { # 1000, 3250 - transactionBlocks(first: 10) { # 50 * 20 * 10 = 10000, 13250 - edges { # 10000, 23250 - node { # 10000, 33250 - digest # 10000, 43250 + transactionBlocks(first: 50) { # 1 + edges { # 1 + txns: node { # 50 + digest # 50 + a: expiration { # 50 + checkpoints(last: 20) { # 50 + edges { # 50 + node { # 50 * 20 + transactionBlocks(first: 10) { # 50 * 20 + edges { # 50 * 20 + node { # 50 * 20 * 10 + digest # 50 * 20 * 10 } } } @@ -193,14 +194,14 @@ } } } - b: expiration { # 50, 43300 - checkpoints(first: 20) { # 50 * 20 = 1000, 44300 - edges { # 1000, 45300 - node { # 1000, 46300 - transactionBlocks(last: 10) { # 50 * 20 * 10 = 10000, 56300 - edges { # 10000, 66300 - node { # 10000, 76300 - digest # 10000, 86300 + b: expiration { # 50 + checkpoints(first: 20) { # 50 + edges { # 50 + node { # 50 * 20 + transactionBlocks(last: 10) { # 50 * 20 + edges { # 50 * 20 + node { # 50 * 20 * 10 + digest # 50 * 20 * 10 } } } @@ -211,30 +212,30 @@ } } } - events(last: 10) { # 10 - edges { - node { - timestamp + events(last: 10) { # 1 + edges { # 1 + node { # 10 + timestamp # 10 } } - } # 40, 86340 + } } //# run-graphql --show-usage # Null value for variable passed to limit will use default_page_size query NullVariableForLimit($howMany: Int) { - transactionBlocks(last: $howMany) { # 20, 20 - edges { # 20, 40 - node { # 20, 60 - digest # 20, 80 - a: expiration { # 20, 100 - checkpoints { # 20 * 20, 500 - edges { # 400, 900 - node { # 400, 1300 - transactionBlocks(first: $howMany) { # 20 * 20 * 20 = 8000, 9300 - edges { # 8000, 17300 - node { # 8000, 25300 - digest # 8000, 33300 + transactionBlocks(last: $howMany) { # 1 + edges { # 1 + node { # 20 + digest # 20 + a: expiration { # 20 + checkpoints { # 20 + edges { # 20 + node { # 400 + transactionBlocks(first: $howMany) { # 400 + edges { # 400 + node { # 8000 + digest # 8000 } } } @@ -248,9 +249,46 @@ query NullVariableForLimit($howMany: Int) { } //# run-graphql --show-usage -# error state - can't use first and last together +# Connection detection needs to be resilient to connection fields +# being obscured by fragments. +fragment Nodes on TransactionBlockConnection { + nodes { + digest + } +} + +{ + fragmentSpread: transactionBlocks { # 1 + ...Nodes # 1 + 20 + } + + inlineFragment: transactionBlocks { # 1 + ... on TransactionBlockConnection { + nodes { # 1 + digest # 20 + } + } + } +} + +//# run-graphql --show-usage + +# error state - can't use first and last together, but we will use the +# max of the two for output node estimation +{ + transactionBlocks(first: 20, last: 30) { # 1 + edges { # 1 + node { # 30 + digest # 30 + } + } + } +} + +//# run-graphql --show-usage +# error state - overflow u64 { - transactionBlocks(first: 20, last: 30) { + transactionBlocks(first: 36893488147419103000) { edges { node { digest @@ -260,9 +298,9 @@ query NullVariableForLimit($howMany: Int) { } //# run-graphql --show-usage -# error state - exceed max integer +# error state, overflow u32 { - transactionBlocks(first: 36893488147419103000) { + transactionBlocks(first: 4294967297) { edges { node { digest diff --git a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs index 79054f833e93a..12fcfa7ca711a 100644 --- a/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs +++ b/crates/sui-graphql-rpc/src/extensions/query_limits_checker.rs @@ -8,17 +8,20 @@ use async_graphql::extensions::NextParseQuery; use async_graphql::extensions::NextRequest; use async_graphql::extensions::{Extension, ExtensionContext, ExtensionFactory}; use async_graphql::parser::types::{ - ExecutableDocument, Field, FragmentDefinition, Selection, SelectionSet, + DocumentOperations, ExecutableDocument, Field, FragmentDefinition, OperationDefinition, + Selection, }; -use async_graphql::{value, Name, Pos, Positioned, Response, ServerResult, Value, Variables}; -use async_graphql_value::Value as GqlValue; +use async_graphql::{value, Name, Positioned, Response, ServerError, ServerResult, Variables}; +use async_graphql_value::{ConstValue, Value}; +use async_trait::async_trait; use axum::http::HeaderName; -use std::collections::{HashMap, VecDeque}; +use serde::Serialize; +use std::collections::HashMap; +use std::mem; use std::net::SocketAddr; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; use std::time::Instant; use sui_graphql_rpc_headers::LIMITS_HEADER; -use tokio::sync::Mutex; use tracing::info; use uuid::Uuid; @@ -29,60 +32,365 @@ pub(crate) struct QueryLimitsChecker; #[derive(Debug, Default)] struct QueryLimitsCheckerExt { - validation_result: Mutex>, + usage: Mutex>, } /// Only display usage information if this header was in the request. pub(crate) struct ShowUsage; -#[derive(Clone, Debug, Default)] -struct ValidationRes { +/// State for traversing a document to check for limits. Holds on to environments for looking up +/// variables and fragments, limits, and the remainder of the limit that can be used. +struct LimitsTraversal<'a> { + // Environments for resolving lookups in the document + fragments: &'a HashMap>, + variables: &'a Variables, + + // Relevant limits from the service configuration + default_page_size: u32, + max_input_nodes: u32, + max_output_nodes: u32, + max_depth: u32, + + // Remaining budget for the traversal + input_budget: u32, + output_budget: u32, + depth_seen: u32, +} + +#[derive(Clone, Debug, Default, Serialize)] +#[serde(rename_all = "camelCase")] +struct Usage { input_nodes: u32, output_nodes: u32, depth: u32, - num_variables: u32, - num_fragments: u32, + variables: u32, + fragments: u32, query_payload: u32, } -#[derive(Debug)] -struct ComponentCost { - pub input_nodes: u32, - pub output_nodes: u32, - pub depth: u32, -} - impl ShowUsage { pub(crate) fn name() -> &'static HeaderName { &LIMITS_HEADER } } +impl<'a> LimitsTraversal<'a> { + fn new( + limits: &Limits, + fragments: &'a HashMap>, + variables: &'a Variables, + ) -> Self { + Self { + fragments, + variables, + default_page_size: limits.default_page_size, + max_input_nodes: limits.max_query_nodes, + max_output_nodes: limits.max_output_nodes, + max_depth: limits.max_query_depth, + input_budget: limits.max_query_nodes, + output_budget: limits.max_output_nodes, + depth_seen: 0, + } + } + + /// Main entrypoint for checking all limits. + fn check_document(&mut self, doc: &ExecutableDocument) -> ServerResult<()> { + for (_name, op) in doc.operations.iter() { + self.check_input_limits(op)?; + self.check_output_limits(op)?; + } + Ok(()) + } + + /// Test that the operation meets input limits (number of nodes and depth). + fn check_input_limits(&mut self, op: &Positioned) -> ServerResult<()> { + let mut next_level = vec![]; + let mut curr_level = vec![]; + let mut depth_budget = self.max_depth; + + next_level.extend(&op.node.selection_set.node.items); + while let Some(next) = next_level.first() { + if depth_budget == 0 { + return Err(graphql_error_at_pos( + code::BAD_USER_INPUT, + format!("Query nesting is over {}", self.max_depth), + next.pos, + )); + } else { + depth_budget -= 1; + } + + mem::swap(&mut next_level, &mut curr_level); + + for selection in curr_level.drain(..) { + if self.input_budget == 0 { + return Err(graphql_error_at_pos( + code::BAD_USER_INPUT, + format!("Query has over {} nodes", self.max_input_nodes), + selection.pos, + )); + } else { + self.input_budget -= 1; + } + + match &selection.node { + Selection::Field(f) => { + next_level.extend(&f.node.selection_set.node.items); + } + + Selection::InlineFragment(f) => { + next_level.extend(&f.node.selection_set.node.items); + } + + Selection::FragmentSpread(fs) => { + let name = &fs.node.fragment_name.node; + let def = self.fragments.get(name).ok_or_else(|| { + graphql_error_at_pos( + code::INTERNAL_SERVER_ERROR, + format!("Fragment {name} referred to but not found in document"), + fs.pos, + ) + })?; + + next_level.extend(&def.node.selection_set.node.items); + } + } + } + } + + self.depth_seen = self.depth_seen.max(self.max_depth - depth_budget); + Ok(()) + } + + /// Check that the operation's output node estimate will not exceed the service's limit. + /// + /// This check must be done after the input limit check, because it relies on the query depth + /// being bounded to protect it from recursing too deeply. + fn check_output_limits(&mut self, op: &Positioned) -> ServerResult<()> { + for selection in &op.node.selection_set.node.items { + self.traverse_selection_for_output(selection, 1, None)?; + } + Ok(()) + } + + /// Account for the estimated output size of this selection and its children. + /// + /// `multiplicity` is the number of times this selection will be output, on account of being + /// nested within paginated ancestors. + /// + /// If this field is inside a connection, but not inside one of its fields, `page_size` is the + /// size of the connection's page. + fn traverse_selection_for_output( + &mut self, + selection: &Positioned, + multiplicity: u32, + page_size: Option, + ) -> ServerResult<()> { + match &selection.node { + Selection::Field(f) => { + if multiplicity > self.output_budget { + return Err(self.output_node_error()); + } else { + self.output_budget -= multiplicity; + } + + // If the field being traversed is a connection field, increase multiplicity by a + // factor of page size. This operation can fail due to overflow, which will be + // treated as a limits check failure, even if the resulting value does not get used + // for anything. + let name = &f.node.name.node; + let multiplicity = 'm: { + if !CONNECTION_FIELDS.contains(&name.as_str()) { + break 'm multiplicity; + } + + let Some(page_size) = page_size else { + break 'm multiplicity; + }; + + multiplicity + .checked_mul(page_size) + .ok_or_else(|| self.output_node_error())? + }; + + let page_size = self.connection_page_size(f)?; + for selection in &f.node.selection_set.node.items { + self.traverse_selection_for_output(selection, multiplicity, page_size)?; + } + } + + // Just recurse through fragments, because they are inlined into their "call site". + Selection::InlineFragment(f) => { + for selection in f.node.selection_set.node.items.iter() { + self.traverse_selection_for_output(selection, multiplicity, page_size)?; + } + } + + Selection::FragmentSpread(fs) => { + let name = &fs.node.fragment_name.node; + let def = self.fragments.get(name).ok_or_else(|| { + graphql_error_at_pos( + code::INTERNAL_SERVER_ERROR, + format!("Fragment {name} referred to but not found in document"), + fs.pos, + ) + })?; + + for selection in def.node.selection_set.node.items.iter() { + self.traverse_selection_for_output(selection, multiplicity, page_size)?; + } + } + } + + Ok(()) + } + + /// If the field `f` is a connection, extract its page size, otherwise return `None`. + /// Returns an error if the page size cannot be represented as a `u32`. + fn connection_page_size(&mut self, f: &Positioned) -> ServerResult> { + if !self.is_connection(f) { + return Ok(None); + } + + let first = f.node.get_argument("first"); + let last = f.node.get_argument("last"); + + let page_size = match (self.resolve_u64(first), self.resolve_u64(last)) { + (Some(f), Some(l)) => f.max(l), + (Some(p), _) | (_, Some(p)) => p, + (None, None) => self.default_page_size as u64, + }; + + Ok(Some( + page_size.try_into().map_err(|_| self.output_node_error())?, + )) + } + + /// Checks if the given field corresponds to a connection based on whether it contains a + /// selection for `edges` or `nodes`. That selection could be immediately in that field's + /// selection set, or nested within a fragment or inline fragment spread. + fn is_connection(&self, f: &Positioned) -> bool { + f.node + .selection_set + .node + .items + .iter() + .any(|s| self.has_connection_fields(s)) + } + + /// Look for fields that suggest the container for this selection is a connection. Recurses + /// through fragment and inline fragment applications, but does not look recursively through + /// fields, as only the fields requested from the immediate parent are relevant. + fn has_connection_fields(&self, s: &Positioned) -> bool { + match &s.node { + Selection::Field(f) => { + let name = &f.node.name.node; + CONNECTION_FIELDS.contains(&name.as_str()) + } + + Selection::InlineFragment(f) => f + .node + .selection_set + .node + .items + .iter() + .any(|s| self.has_connection_fields(s)), + + Selection::FragmentSpread(fs) => { + let name = &fs.node.fragment_name.node; + let Some(def) = self.fragments.get(name) else { + return false; + }; + + def.node + .selection_set + .node + .items + .iter() + .any(|s| self.has_connection_fields(s)) + } + } + } + + /// Translate a GraphQL value into a u64, if possible, resolving variables if necessary. + fn resolve_u64(&self, value: Option<&Positioned>) -> Option { + match &value?.node { + Value::Number(num) => num, + + Value::Variable(var) => { + if let ConstValue::Number(num) = self.variables.get(var)? { + num + } else { + return None; + } + } + + _ => return None, + } + .as_u64() + } + + /// Error returned if output node estimate exceeds limit. Also sets the output budget to zero, + /// to indicate that it has been spent (This is done because unlike other budgets, the output + /// budget is not decremented one unit at a time, so we can have hit the limit previously but + /// still have budget left over). + fn output_node_error(&mut self) -> ServerError { + self.output_budget = 0; + graphql_error( + code::BAD_USER_INPUT, + format!("Estimated output nodes exceeds {}", self.max_output_nodes), + ) + } + + /// Finish the traversal and report its usage. + fn finish(self, query_payload: u32) -> Usage { + Usage { + input_nodes: self.max_input_nodes - self.input_budget, + output_nodes: self.max_output_nodes - self.output_budget, + depth: self.depth_seen, + variables: self.variables.len() as u32, + fragments: self.fragments.len() as u32, + query_payload, + } + } +} + +impl Usage { + fn report(&self, metrics: &Metrics) { + metrics + .request_metrics + .input_nodes + .observe(self.input_nodes as f64); + metrics + .request_metrics + .output_nodes + .observe(self.output_nodes as f64); + metrics + .request_metrics + .query_depth + .observe(self.depth as f64); + metrics + .request_metrics + .query_payload_size + .observe(self.query_payload as f64); + } +} + impl ExtensionFactory for QueryLimitsChecker { fn create(&self) -> Arc { Arc::new(QueryLimitsCheckerExt { - validation_result: Mutex::new(None), + usage: Mutex::new(None), }) } } -#[async_trait::async_trait] +#[async_trait] impl Extension for QueryLimitsCheckerExt { async fn request(&self, ctx: &ExtensionContext<'_>, next: NextRequest<'_>) -> Response { let resp = next.run(ctx).await; - let validation_result = self.validation_result.lock().await.take(); - if let Some(validation_result) = validation_result { - resp.extension( - "usage", - value! ({ - "inputNodes": validation_result.input_nodes, - "outputNodes": validation_result.output_nodes, - "depth": validation_result.depth, - "variables": validation_result.num_variables, - "fragments": validation_result.num_fragments, - "queryPayload": validation_result.query_payload, - }), - ) + let usage = self.usage.lock().unwrap().take(); + if let Some(usage) = usage { + resp.extension("usage", value!(usage)) } else { resp } @@ -100,10 +408,9 @@ impl Extension for QueryLimitsCheckerExt { let query_id: &Uuid = ctx.data_unchecked(); let session_id: &SocketAddr = ctx.data_unchecked(); let metrics: &Metrics = ctx.data_unchecked(); + let cfg: &ServiceConfig = ctx.data_unchecked(); let instant = Instant::now(); - let cfg = ctx - .data::() - .expect("No service config provided in schema data"); + if query.len() > cfg.limits.max_query_payload_size as usize { metrics .request_metrics @@ -129,298 +436,31 @@ impl Extension for QueryLimitsCheckerExt { // Document layout of the query let doc = next.run(ctx, query, variables).await?; - // TODO: Limit the complexity of fragments early on - - let mut running_costs = ComponentCost { - depth: 0, - input_nodes: 0, - output_nodes: 0, - }; - let mut max_depth_seen = 0; - - // An operation is a query, mutation or subscription consisting of a set of selections - for (count, (_name, oper)) in doc.operations.iter().enumerate() { - let sel_set = &oper.node.selection_set; - - // If the query is pure introspection, we don't need to check the limits. - // Pure introspection queries are queries that only have one operation with one field - // and that field is a `__schema` query - if (count == 0) && (sel_set.node.items.len() == 1) { - if let Some(node) = sel_set.node.items.first() { - if let Selection::Field(field) = &node.node { - if field.node.name.node == "__schema" { - continue; - } + // If the query is pure introspection, we don't need to check the limits. Pure introspection + // queries are queries that only have one operation with one field and that field is a + // `__schema` query + if let DocumentOperations::Single(op) = &doc.operations { + if let [field] = &op.node.selection_set.node.items[..] { + if let Selection::Field(f) = &field.node { + if f.node.name.node == "__schema" { + return Ok(doc); } } } - - running_costs.depth = 0; - analyze_selection_set( - &cfg.limits, - &doc.fragments, - sel_set, - &mut running_costs, - variables, - ctx, - )?; - max_depth_seen = max_depth_seen.max(running_costs.depth); } - if ctx.data_opt::().is_some() { - *self.validation_result.lock().await = Some(ValidationRes { - input_nodes: running_costs.input_nodes, - output_nodes: running_costs.output_nodes, - depth: running_costs.depth, - query_payload: query.len() as u32, - num_variables: variables.len() as u32, - num_fragments: doc.fragments.len() as u32, - }); - } - metrics.query_validation_latency(instant.elapsed()); - metrics - .request_metrics - .input_nodes - .observe(running_costs.input_nodes as f64); - metrics - .request_metrics - .output_nodes - .observe(running_costs.output_nodes as f64); - metrics - .request_metrics - .query_depth - .observe(running_costs.depth as f64); - metrics - .request_metrics - .query_payload_size - .observe(query.len() as f64); - Ok(doc) - } -} - -impl std::ops::Add for ComponentCost { - type Output = Self; - - fn add(self, rhs: Self) -> Self::Output { - Self { - input_nodes: self.input_nodes + rhs.input_nodes, - output_nodes: self.output_nodes + rhs.output_nodes, - depth: self.depth + rhs.depth, - } - } -} - -/// Parse the selected fields in one operation and check if it conforms to configured limits. -fn analyze_selection_set( - limits: &Limits, - fragment_defs: &HashMap>, - sel_set: &Positioned, - cost: &mut ComponentCost, - variables: &Variables, - ctx: &ExtensionContext<'_>, -) -> ServerResult<()> { - // Use BFS to analyze the query and count the number of nodes and the depth of the query - struct ToVisit<'s> { - selection: &'s Positioned, - parent_node_count: u32, - } - - // Queue to store the nodes at each level - let mut que = VecDeque::new(); - - for selection in sel_set.node.items.iter() { - que.push_back(ToVisit { - selection, - parent_node_count: 1, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(selection.pos), ctx)?; - } - // Track the number of nodes at first level if any - let mut level_len = que.len(); - - while !que.is_empty() { - // Signifies the start of a new level - cost.depth += 1; - check_limits(limits, cost, None, ctx)?; - while level_len > 0 { - // Ok to unwrap since we checked for empty queue - // and level_len > 0 - let ToVisit { - selection, - parent_node_count, - } = que.pop_front().unwrap(); - - match &selection.node { - Selection::Field(f) => { - let current_count = - estimate_output_nodes_for_curr_node(f, variables, limits.default_page_size) - * parent_node_count; - - cost.output_nodes += current_count; - - for field_sel in f.node.selection_set.node.items.iter() { - que.push_back(ToVisit { - selection: field_sel, - parent_node_count: current_count, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(field_sel.pos), ctx)?; - } - } - - Selection::FragmentSpread(fs) => { - let frag_name = &fs.node.fragment_name.node; - let frag_def = fragment_defs.get(frag_name).ok_or_else(|| { - graphql_error_at_pos( - code::INTERNAL_SERVER_ERROR, - format!( - "Fragment {} not found but present in fragment list", - frag_name - ), - fs.pos, - ) - })?; - - // TODO: this is inefficient as we might loop over same fragment multiple times - // Ideally web should cache the costs of fragments we've seen before - // Will do as enhancement - for selection in frag_def.node.selection_set.node.items.iter() { - que.push_back(ToVisit { - selection, - parent_node_count, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(selection.pos), ctx)?; - } - } + let mut traversal = LimitsTraversal::new(&cfg.limits, &doc.fragments, variables); + let res = traversal.check_document(&doc); + let usage = traversal.finish(query.len() as u32); + metrics.query_validation_latency(instant.elapsed()); + usage.report(metrics); - Selection::InlineFragment(fs) => { - for selection in fs.node.selection_set.node.items.iter() { - que.push_back(ToVisit { - selection, - parent_node_count, - }); - cost.input_nodes += 1; - check_limits(limits, cost, Some(selection.pos), ctx)?; - } - } + res.map(|()| { + if ctx.data_opt::().is_some() { + *self.usage.lock().unwrap() = Some(usage); } - level_len -= 1; - } - level_len = que.len(); - } - - Ok(()) -} - -fn check_limits( - limits: &Limits, - cost: &ComponentCost, - pos: Option, - ctx: &ExtensionContext<'_>, -) -> ServerResult<()> { - let query_id: &Uuid = ctx.data_unchecked(); - let session_id: &SocketAddr = ctx.data_unchecked(); - let error_code = code::BAD_USER_INPUT; - if cost.input_nodes > limits.max_query_nodes { - info!( - query_id = %query_id, - session_id = %session_id, - error_code, - "Query has too many nodes: {}", cost.input_nodes - ); - return Err(graphql_error_at_pos( - error_code, - format!( - "Query has too many nodes {}. The maximum allowed is {}", - cost.input_nodes, limits.max_query_nodes - ), - pos.unwrap_or_default(), - )); - } - if cost.depth > limits.max_query_depth { - info!( - query_id = %query_id, - session_id = %session_id, - error_code, - "Query has too many levels of nesting: {}", cost.depth - ); - return Err(graphql_error_at_pos( - error_code, - format!( - "Query has too many levels of nesting {}. The maximum allowed is {}", - cost.depth, limits.max_query_depth - ), - pos.unwrap_or_default(), - )); - } - - if cost.output_nodes > limits.max_output_nodes { - info!( - query_id = %query_id, - session_id = %session_id, - error_code, - "Query will result in too many output nodes: {}", - cost.output_nodes - ); - return Err(graphql_error_at_pos( - error_code, - format!( - "Query will result in too many output nodes. The maximum allowed is {}, estimated {}", - limits.max_output_nodes, cost.output_nodes - ), - pos.unwrap_or_default(), - )); - } - - Ok(()) -} - -/// Given a node, estimate the number of output nodes it will produce. -fn estimate_output_nodes_for_curr_node( - f: &Positioned, - variables: &Variables, - default_page_size: u32, -) -> u32 { - if !is_connection(f) { - 1 - } else { - // If the args 'first' or 'last' is set, then we should use that as the count - let first_arg = f.node.get_argument("first"); - let last_arg = f.node.get_argument("last"); - - extract_limit(first_arg, variables) - .or_else(|| extract_limit(last_arg, variables)) - .unwrap_or(default_page_size) - } -} - -/// Try to extract a u32 value from the given argument, or return None on failure. -fn extract_limit(value: Option<&Positioned>, variables: &Variables) -> Option { - if let GqlValue::Variable(var) = &value?.node { - return match variables.get(var) { - Some(Value::Number(num)) => num.as_u64().map(|v| v as u32), - _ => None, - }; - } - - let GqlValue::Number(value) = &value?.node else { - return None; - }; - value.as_u64().map(|v| v as u32) -} - -/// Checks if the given field is a connection field by whether it has 'edges' or 'nodes' selected. -/// This should typically not require checking more than the first element of the selection set -fn is_connection(f: &Positioned) -> bool { - for field_sel in f.node.selection_set.node.items.iter() { - if let Selection::Field(field) = &field_sel.node { - if CONNECTION_FIELDS.contains(&field.node.name.node.as_str()) { - return true; - } - } + doc + }) } - false } diff --git a/crates/sui-graphql-rpc/src/server/builder.rs b/crates/sui-graphql-rpc/src/server/builder.rs index 01f70dd20d390..b0afb65b57cd5 100644 --- a/crates/sui-graphql-rpc/src/server/builder.rs +++ b/crates/sui-graphql-rpc/src/server/builder.rs @@ -897,10 +897,7 @@ pub mod tests { .map(|e| e.message) .collect(); - assert_eq!( - errs, - vec!["Query has too many levels of nesting 1. The maximum allowed is 0".to_string()] - ); + assert_eq!(errs, vec!["Query nesting is over 0".to_string()]); let errs: Vec<_> = exec_query_depth_limit( 2, "{ chainIdentifier protocolConfig { configs { value key }} }", @@ -911,10 +908,7 @@ pub mod tests { .into_iter() .map(|e| e.message) .collect(); - assert_eq!( - errs, - vec!["Query has too many levels of nesting 3. The maximum allowed is 2".to_string()] - ); + assert_eq!(errs, vec!["Query nesting is over 2".to_string()]); } pub async fn test_query_node_limit_impl() { @@ -954,10 +948,7 @@ pub mod tests { .into_iter() .map(|e| e.message) .collect(); - assert_eq!( - err, - vec!["Query has too many nodes 1. The maximum allowed is 0".to_string()] - ); + assert_eq!(err, vec!["Query has over 0 nodes".to_string()]); let err: Vec<_> = exec_query_node_limit( 4, @@ -969,10 +960,7 @@ pub mod tests { .into_iter() .map(|e| e.message) .collect(); - assert_eq!( - err, - vec!["Query has too many nodes 5. The maximum allowed is 4".to_string()] - ); + assert_eq!(err, vec!["Query has over 4 nodes".to_string()]); } pub async fn test_query_default_page_limit_impl(connection_config: ConnectionConfig) { From 39a4eb01b675c11040551cdc8f79345a8426e2bc Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Tue, 16 Jul 2024 14:38:01 -0700 Subject: [PATCH 054/163] [move][move-ide] Colon/Alias Autocompletion (#18108) ## Description This records autocomplete information for alias resolution positions. ## Test plan Updated test expectations --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../crates/move-analyzer/src/compiler_info.rs | 13 +- .../move-compiler/src/diagnostics/codes.rs | 3 +- .../move-compiler/src/diagnostics/mod.rs | 4 +- .../move-compiler/src/expansion/aliases.rs | 49 +++++- .../src/expansion/legacy_aliases.rs | 4 +- .../crates/move-compiler/src/expansion/mod.rs | 2 +- .../src/expansion/path_expander.rs | 103 ++++++++++-- .../move-compiler/src/expansion/translate.rs | 17 +- .../crates/move-compiler/src/shared/ide.rs | 148 ++++++++++++++++-- .../crates/move-compiler/src/shared/mod.rs | 16 +- .../crates/move-compiler/src/typing/expand.rs | 3 +- .../move-compiler/src/typing/translate.rs | 6 +- .../move_2024/ide_mode/dot_incomplete.exp | 18 ++- .../move_2024/ide_mode/dot_incomplete.ide.exp | 52 +++--- .../move_2024/ide_mode/dot_incomplete.move | 1 + .../move_2024/ide_mode/ellipsis_expansion.exp | 12 ++ .../ide_mode/ellipsis_expansion.ide.exp | 52 +++--- .../ide_mode/ellipsis_expansion.move | 1 + .../move_2024/ide_mode/index_autocomplete.exp | 12 ++ .../ide_mode/index_autocomplete.ide.exp | 101 +++++------- .../ide_mode/index_autocomplete.move | 2 +- .../method_and_field_autocomplete.exp | 6 + .../method_and_field_autocomplete.ide.exp | 36 ++--- .../method_and_field_autocomplete.move | 2 +- .../ide_mode/method_autocomplete.exp | 6 + .../ide_mode/method_autocomplete.ide.exp | 28 ++-- .../ide_mode/method_autocomplete.move | 2 +- .../move_2024/ide_mode/missing_match_bool.exp | 24 ++- .../ide_mode/missing_match_bool.ide.exp | 26 +-- .../ide_mode/missing_match_bool.move | 1 + .../move_2024/ide_mode/missing_match_enum.exp | 32 ++-- .../ide_mode/missing_match_enum.ide.exp | 54 +++---- .../ide_mode/missing_match_enum.move | 1 + .../move_2024/ide_mode/missing_match_lit.exp | 24 ++- .../ide_mode/missing_match_lit.ide.exp | 26 +-- .../move_2024/ide_mode/missing_match_lit.move | 1 + .../ide_mode/missing_match_struct.exp | 24 ++- .../ide_mode/missing_match_struct.ide.exp | 18 +-- .../ide_mode/missing_match_struct.move | 1 + .../ide_mode/missing_match_untyped.exp | 40 +++-- .../ide_mode/missing_match_untyped.ide.exp | 42 ++--- .../ide_mode/missing_match_untyped.move | 1 + .../ide_mode/named_struct_autocomplete.exp | 14 +- .../named_struct_autocomplete.ide.exp | 32 ++-- .../ide_mode/named_struct_autocomplete.move | 1 + .../named_struct_middle_autocomplete.exp | 10 +- .../named_struct_middle_autocomplete.ide.exp | 12 +- .../named_struct_middle_autocomplete.move | 1 + .../positional_struct_autocomplete.exp | 24 +-- .../positional_struct_autocomplete.ide.exp | 44 +++--- .../positional_struct_autocomplete.move | 1 + .../ide_mode/struct_method_autocomplete.exp | 14 +- .../struct_method_autocomplete.ide.exp | 24 +-- .../ide_mode/struct_method_autocomplete.move | 1 + .../struct_method_invalid_autocomplete.exp | 20 ++- ...struct_method_invalid_autocomplete.ide.exp | 24 +-- .../struct_method_invalid_autocomplete.move | 2 + .../ide_mode/struct_scoped_autocomplete.exp | 20 ++- .../struct_scoped_autocomplete.ide.exp | 32 ++-- .../ide_mode/struct_scoped_autocomplete.move | 2 + .../ide_mode/type_param_autocomplete.ide.exp | 40 ++++- .../type_param_no_autocomplete.ide.exp | 40 ++++- .../ide_mode/use_fun_autocomplete.exp | 6 + .../ide_mode/use_fun_autocomplete.ide.exp | 16 +- .../ide_mode/use_fun_autocomplete.move | 1 + .../ide_mode/named_struct_autocomplete.exp | 18 +++ .../ide_mode/named_struct_autocomplete.ide | 0 .../named_struct_autocomplete.ide.exp | 72 +++++++++ .../ide_mode/named_struct_autocomplete.move | 16 ++ .../ide_mode/struct_method_autocomplete.exp | 42 ----- .../ide_mode/struct_method_autocomplete.move | 21 --- 71 files changed, 1040 insertions(+), 524 deletions(-) create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide create mode 100644 external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.move delete mode 100644 external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.exp delete mode 100644 external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.move diff --git a/external-crates/move/crates/move-analyzer/src/compiler_info.rs b/external-crates/move/crates/move-analyzer/src/compiler_info.rs index 4989c4eb75336..583ad6a464fb4 100644 --- a/external-crates/move/crates/move-analyzer/src/compiler_info.rs +++ b/external-crates/move/crates/move-analyzer/src/compiler_info.rs @@ -11,7 +11,7 @@ use move_ir_types::location::Loc; pub struct CompilerInfo { pub macro_info: BTreeMap, pub expanded_lambdas: BTreeSet, - pub autocomplete_info: BTreeMap>, + pub dot_autocomplete_info: BTreeMap>, /// Locations of binders in enum variants that are expanded from an ellipsis (and should /// not be displayed in any way by the IDE) pub ellipsis_binders: BTreeSet, @@ -43,11 +43,11 @@ impl CompilerInfo { CI::IDEAnnotation::ExpandedLambda => { self.expanded_lambdas.insert(loc); } - CI::IDEAnnotation::AutocompleteInfo(info) => { + CI::IDEAnnotation::DotAutocompleteInfo(info) => { // TODO: what if we find two autocomplete info sets? Intersection may be better // than union, as it's likely in a lambda body. if let Some(_old) = self - .autocomplete_info + .dot_autocomplete_info .entry(loc.file_hash()) .or_default() .insert(loc, *info) @@ -61,6 +61,9 @@ impl CompilerInfo { CI::IDEAnnotation::EllipsisMatchEntries(_) => { self.ellipsis_binders.insert(loc); } + CI::IDEAnnotation::PathAutocompleteInfo(_) => { + // TODO: Integrate this into the provided compiler information. + } } } } @@ -77,8 +80,8 @@ impl CompilerInfo { &self, fhash: FileHash, loc: &Loc, - ) -> Option<&CI::AutocompleteInfo> { - self.autocomplete_info.get(&fhash).and_then(|a| { + ) -> Option<&CI::DotAutocompleteInfo> { + self.dot_autocomplete_info.get(&fhash).and_then(|a| { a.iter().find_map(|(aloc, ainfo)| { if aloc.contains(loc) { Some(ainfo) diff --git a/external-crates/move/crates/move-compiler/src/diagnostics/codes.rs b/external-crates/move/crates/move-compiler/src/diagnostics/codes.rs index 5ecc42160c971..a3d73b45893f9 100644 --- a/external-crates/move/crates/move-compiler/src/diagnostics/codes.rs +++ b/external-crates/move/crates/move-compiler/src/diagnostics/codes.rs @@ -378,11 +378,12 @@ codes!( AddressAdd: { msg: "move 2024 migration: address add", severity: NonblockingError }, ], IDE: [ - Autocomplete: { msg: "IDE autocomplete", severity: Note }, + DotAutocomplete: { msg: "IDE dot autocomplete", severity: Note }, MacroCallInfo: { msg: "IDE macro call info", severity: Note }, ExpandedLambda: { msg: "IDE expanded lambda", severity: Note }, MissingMatchArms: { msg: "IDE missing match arms", severity: Note }, EllipsisExpansion: { msg: "IDE ellipsis expansion", severity: Note }, + PathAutocomplete: { msg: "IDE path autocomplete", severity: Note }, ], ); diff --git a/external-crates/move/crates/move-compiler/src/diagnostics/mod.rs b/external-crates/move/crates/move-compiler/src/diagnostics/mod.rs index 582182f137934..aba6a32541993 100644 --- a/external-crates/move/crates/move-compiler/src/diagnostics/mod.rs +++ b/external-crates/move/crates/move-compiler/src/diagnostics/mod.rs @@ -882,9 +882,9 @@ impl UnprefixedWarningFilters { fn is_filtered_by_info(&self, info: &DiagnosticInfo) -> bool { match self { - Self::All => info.severity() == Severity::Warning, + Self::All => info.severity() <= Severity::Warning, Self::Specified { categories, codes } => { - info.severity() == Severity::Warning + info.severity() <= Severity::Warning && (categories.contains_key(&info.category()) || codes.contains_key(&(info.category(), info.code()))) } diff --git a/external-crates/move/crates/move-compiler/src/expansion/aliases.rs b/external-crates/move/crates/move-compiler/src/expansion/aliases.rs index 53d93cc1af964..f94dd7e478fcf 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/aliases.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/aliases.rs @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 use move_ir_types::location::Loc; +use move_symbol_pool::Symbol; use crate::{ diagnostics::Diagnostic, @@ -10,7 +11,10 @@ use crate::{ ice, shared::{unique_map::UniqueMap, unique_set::UniqueSet, *}, }; -use std::{collections::BTreeSet, fmt}; +use std::{ + collections::{BTreeMap, BTreeSet}, + fmt, +}; #[derive(Clone, Debug)] pub struct AliasSet { @@ -26,6 +30,9 @@ pub struct AliasMap { // For now, this excludes local variables because the only case where this can overlap is with // macro lambdas, but those have to have a leading `$` and cannot conflict with module members module_members: UniqueMap, + // These are for caching resolution for IDE information. + all_leading_names: Option>, + all_module_members: Option>, previous: Option>, } @@ -102,6 +109,8 @@ impl AliasMap { unused: BTreeSet::new(), leading_access: UniqueMap::new(), module_members: UniqueMap::new(), + all_leading_names: None, + all_module_members: None, previous: None, } } @@ -203,6 +212,8 @@ impl AliasMap { unused, leading_access, module_members, + all_leading_names: None, + all_module_members: None, previous: None, }; @@ -250,6 +261,40 @@ impl AliasMap { } result } + + /// Gets a map of all in-scope leading names, subject to shadowing, either from a cached value + /// or generated fresh. + pub fn get_all_leading_names(&mut self) -> &BTreeMap { + if self.all_leading_names.is_none() { + let mut cur: Option<&Self> = Some(self); + let mut leading_names = BTreeMap::new(); + while let Some(map) = cur { + for (name, entry) in map.leading_access.key_cloned_iter() { + leading_names.entry(name.value).or_insert(*entry); + } + cur = map.previous.as_deref(); + } + self.all_leading_names = Some(leading_names); + } + self.all_leading_names.as_ref().unwrap() + } + + /// Gets a map of all in-scope member names, subject to shadowing, either from a cached value + /// or generated fresh. + pub fn get_all_member_names(&mut self) -> &BTreeMap { + if self.all_module_members.is_none() { + let mut cur: Option<&Self> = Some(self); + let mut members = BTreeMap::new(); + while let Some(map) = cur { + for (name, entry) in map.module_members.key_cloned_iter() { + members.entry(name.value).or_insert(*entry); + } + cur = map.previous.as_deref(); + } + self.all_module_members = Some(members); + } + self.all_module_members.as_ref().unwrap() + } } //************************************************************************************************** @@ -262,6 +307,8 @@ impl fmt::Debug for AliasMap { unused, leading_access, module_members, + all_leading_names: _, + all_module_members: _, previous, } = self; writeln!(f, "AliasMap(\n unused: [")?; diff --git a/external-crates/move/crates/move-compiler/src/expansion/legacy_aliases.rs b/external-crates/move/crates/move-compiler/src/expansion/legacy_aliases.rs index 9f0e586fc6637..cc6ba5880be30 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/legacy_aliases.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/legacy_aliases.rs @@ -19,8 +19,8 @@ type ScopeDepth = usize; #[derive(Clone, Debug)] pub struct AliasMap { - modules: UniqueMap, ModuleIdent)>, - members: UniqueMap, (ModuleIdent, Name))>, + pub modules: UniqueMap, ModuleIdent)>, + pub members: UniqueMap, (ModuleIdent, Name))>, // essentially a mapping from ScopeDepth => AliasSet, which are the unused aliases at that depth unused: Vec, } diff --git a/external-crates/move/crates/move-compiler/src/expansion/mod.rs b/external-crates/move/crates/move-compiler/src/expansion/mod.rs index c4fcd115c3ec3..ddff273766cdb 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/mod.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/mod.rs @@ -2,7 +2,7 @@ // Copyright (c) The Move Contributors // SPDX-License-Identifier: Apache-2.0 -mod alias_map_builder; +pub(crate) mod alias_map_builder; mod aliases; pub mod ast; mod byte_string; diff --git a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs index 557b4bde680ea..cff37e83d4049 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs @@ -8,7 +8,7 @@ use crate::{ diagnostics::Diagnostic, editions::{create_feature_error, Edition, FeatureGate}, expansion::{ - alias_map_builder::{AliasEntry, AliasMapBuilder, NameSpace}, + alias_map_builder::{AliasEntry, AliasMapBuilder, NameSpace, UnnecessaryAlias}, aliases::{AliasMap, AliasSet}, ast::{self as E, Address, ModuleIdent, ModuleIdent_}, legacy_aliases, @@ -22,7 +22,10 @@ use crate::{ ast::{self as P, ModuleName, NameAccess, NamePath, PathEntry, Type}, syntax::make_loc, }, - shared::*, + shared::{ + ide::{AliasAutocompleteInfo, IDEAnnotation}, + *, + }, }; use move_ir_types::location::{sp, Loc, Spanned}; @@ -125,8 +128,6 @@ macro_rules! access_result { pub(crate) use access_result; -use super::alias_map_builder::UnnecessaryAlias; - //************************************************************************************************** // Move 2024 Path Expander //************************************************************************************************** @@ -215,7 +216,7 @@ impl Move2024PathExpander { ) -> AccessChainNameResult { use AccessChainFailure as NF; use AccessChainNameResult as NR; - + self.ide_autocomplete_suggestion(context, &namespace, name.loc); match self.aliases.resolve(namespace, &name) { Some(AliasEntry::Member(_, mident, sp!(_, mem))) => { // We are preserving the name's original location, rather than referring to where @@ -476,6 +477,22 @@ impl Move2024PathExpander { } } } + + fn ide_autocomplete_suggestion( + &mut self, + context: &mut DefnContext, + namespace: &NameSpace, + loc: Loc, + ) { + if context.env.ide_mode() { + let info: AliasAutocompleteInfo = match namespace { + NameSpace::LeadingAccess => self.aliases.get_all_leading_names().into(), + NameSpace::ModuleMembers => self.aliases.get_all_member_names().into(), + }; + let annotation = IDEAnnotation::PathAutocompleteInfo(Box::new(info)); + context.env.add_ide_annotation(loc, annotation) + } + } } impl PathExpander for Move2024PathExpander { @@ -831,6 +848,12 @@ pub struct LegacyPathExpander { old_alias_maps: Vec, } +enum LegacyPositionKind { + Address, + Module, + Member, +} + impl LegacyPathExpander { pub fn new() -> LegacyPathExpander { LegacyPathExpander { @@ -838,6 +861,37 @@ impl LegacyPathExpander { old_alias_maps: vec![], } } + + fn ide_autocomplete_suggestion( + &mut self, + context: &mut DefnContext, + position_kind: LegacyPositionKind, + loc: Loc, + ) { + if context.env.ide_mode() && context.is_source_definition { + let mut info = AliasAutocompleteInfo::new(); + + match position_kind { + LegacyPositionKind::Address => { + for (name, addr) in context.named_address_mapping.unwrap().iter() { + info.addresses.insert((*name, *addr)); + } + } + LegacyPositionKind::Module => { + for (_, name, (_, mident)) in self.aliases.modules.iter() { + info.modules.insert((*name, *mident)); + } + } + LegacyPositionKind::Member => { + for (_, name, (_, (mident, member))) in self.aliases.members.iter() { + info.members.insert((*name, *mident, *member)); + } + } + } + let annotation = IDEAnnotation::PathAutocompleteInfo(Box::new(info)); + context.env.add_ide_annotation(loc, annotation) + } + } } impl PathExpander for LegacyPathExpander { @@ -882,6 +936,7 @@ impl PathExpander for LegacyPathExpander { PV::ModuleAccess(sp!(ident_loc, single_entry!(name, tyargs, is_macro))) if self.aliases.module_alias_get(&name).is_some() => { + self.ide_autocomplete_suggestion(context, LegacyPositionKind::Module, loc); ice_assert!(context.env, tyargs.is_none(), loc, "Found tyargs"); ice_assert!(context.env, is_macro.is_none(), loc, "Found macro"); let sp!(_, mident_) = self.aliases.module_alias_get(&name).unwrap(); @@ -973,6 +1028,7 @@ impl PathExpander for LegacyPathExpander { if access == Access::Type { ice_assert!(context.env, is_macro.is_none(), loc, "Found macro"); } + self.ide_autocomplete_suggestion(context, LegacyPositionKind::Member, loc); let access = match self.aliases.member_alias_get(&name) { Some((mident, mem)) => EN::ModuleAccess(mident, mem), None => EN::Name(name), @@ -982,6 +1038,7 @@ impl PathExpander for LegacyPathExpander { (Access::Term, single_entry!(name, tyargs, is_macro)) if is_valid_datatype_or_constant_name(name.value.as_str()) => { + self.ide_autocomplete_suggestion(context, LegacyPositionKind::Member, loc); let access = match self.aliases.member_alias_get(&name) { Some((mident, mem)) => EN::ModuleAccess(mident, mem), None => EN::Name(name), @@ -1023,15 +1080,13 @@ impl PathExpander for LegacyPathExpander { return None; } // Others - (sp!(_, LN::Name(n1)), [n2]) => match self.aliases.module_alias_get(n1) { - None => { - context.env.add_diag(diag!( - NameResolution::UnboundModule, - (n1.loc, format!("Unbound module alias '{}'", n1)) - )); - return None; - } - Some(mident) => { + (sp!(_, LN::Name(n1)), [n2]) => { + self.ide_autocomplete_suggestion( + context, + LegacyPositionKind::Module, + n1.loc, + ); + if let Some(mident) = self.aliases.module_alias_get(n1) { let n2_name = n2.name; let (tyargs, is_macro) = if !(path.has_tyargs_last()) { let mut diag = diag!( @@ -1051,9 +1106,20 @@ impl PathExpander for LegacyPathExpander { tyargs, is_macro.copied(), ) + } else { + context.env.add_diag(diag!( + NameResolution::UnboundModule, + (n1.loc, format!("Unbound module alias '{}'", n1)) + )); + return None; } - }, + } (ln, [n2, n3]) => { + self.ide_autocomplete_suggestion( + context, + LegacyPositionKind::Address, + ln.loc, + ); let ident_loc = make_loc( ln.loc.file_hash(), ln.loc.start() as usize, @@ -1081,7 +1147,12 @@ impl PathExpander for LegacyPathExpander { context.env.add_diag(diag); return None; } - (_ln, [_n1, _n2, ..]) => { + (ln, [_n1, _n2, ..]) => { + self.ide_autocomplete_suggestion( + context, + LegacyPositionKind::Address, + ln.loc, + ); let mut diag = diag!(Syntax::InvalidName, (loc, "Too many name segments")); diag.add_note("Names may only have 0, 1, or 2 segments separated by '::'"); context.env.add_diag(diag); diff --git a/external-crates/move/crates/move-compiler/src/expansion/translate.rs b/external-crates/move/crates/move-compiler/src/expansion/translate.rs index 4b2622dfc9527..bb3ee58ac946d 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/translate.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/translate.rs @@ -61,12 +61,12 @@ pub(super) struct DefnContext<'env, 'map> { pub(super) env: &'env mut CompilationEnv, pub(super) address_conflicts: BTreeSet, pub(super) current_package: Option, + pub(super) is_source_definition: bool, } struct Context<'env, 'map> { defn_context: DefnContext<'env, 'map>, address: Option
, - is_source_definition: bool, // Cached warning filters for all available prefixes. Used by non-source defs // and dependency packages all_filter_alls: WarningFilters, @@ -91,11 +91,11 @@ impl<'env, 'map> Context<'env, 'map> { address_conflicts, module_members, current_package: None, + is_source_definition: false, }; Context { defn_context, address: None, - is_source_definition: false, all_filter_alls, path_expander: None, } @@ -424,6 +424,7 @@ pub fn program( module_members: UniqueMap::new(), address_conflicts, current_package: None, + is_source_definition: false, }; let module_members = { @@ -467,7 +468,7 @@ pub fn program( let mut context = Context::new(compilation_env, module_members, address_conflicts); - context.is_source_definition = true; + context.defn_context.is_source_definition = true; for P::PackageDefinition { package, named_address_map, @@ -502,7 +503,7 @@ pub fn program( } } - context.is_source_definition = false; + context.defn_context.is_source_definition = false; for P::PackageDefinition { package, named_address_map, @@ -875,7 +876,7 @@ fn module_( P::ModuleMember::Use(_) => unreachable!(), P::ModuleMember::Friend(f) => friend(context, &mut friends, f), P::ModuleMember::Function(mut f) => { - if !context.is_source_definition && f.macro_.is_none() { + if !context.defn_context.is_source_definition && f.macro_.is_none() { f.body.value = P::FunctionBody_::Native } function( @@ -896,7 +897,7 @@ fn module_( context.pop_alias_scope(Some(&mut use_funs)); - let target_kind = if !context.is_source_definition { + let target_kind = if !context.defn_context.is_source_definition { TargetKind::External } else { let is_root_package = !context.env().package_config(package_name).is_dependency; @@ -1197,7 +1198,7 @@ fn attribute( /// dependency packages) fn module_warning_filter(context: &mut Context, attributes: &E::Attributes) -> WarningFilters { let filters = warning_filter(context, attributes); - let is_dep = !context.is_source_definition || { + let is_dep = !context.defn_context.is_source_definition || { let pkg = context.current_package(); context.env().package_config(pkg).is_dependency }; @@ -1781,7 +1782,7 @@ fn duplicate_module_member(context: &mut Context, old_loc: Loc, alias: Name) { } fn unused_alias(context: &mut Context, _kind: &str, alias: Name) { - if !context.is_source_definition { + if !context.defn_context.is_source_definition { return; } let mut diag = diag!( diff --git a/external-crates/move/crates/move-compiler/src/shared/ide.rs b/external-crates/move/crates/move-compiler/src/shared/ide.rs index 9b324fec3094f..829cdf8b1cac2 100644 --- a/external-crates/move/crates/move-compiler/src/shared/ide.rs +++ b/external-crates/move/crates/move-compiler/src/shared/ide.rs @@ -1,16 +1,30 @@ // Copyright (c) The Move Contributors // SPDX-License-Identifier: Apache-2.0 -use std::fmt; - use crate::{ - debug_display, diag, diagnostics::Diagnostic, expansion::ast as E, naming::ast as N, - parser::ast as P, shared::string_utils::format_oxford_list, shared::Name, typing::ast as T, + debug_display, diag, + diagnostics::Diagnostic, + expansion::{ + alias_map_builder::{LeadingAccessEntry, MemberEntry}, + ast as E, + }, + naming::ast as N, + parser::ast as P, + shared::string_utils::format_oxford_list, + shared::Name, + typing::ast as T, + unit_test::filter_test_members::UNIT_TEST_POISON_FUN_NAME, }; +use move_command_line_common::address::NumericalAddress; use move_ir_types::location::Loc; use move_symbol_pool::Symbol; +use std::{ + collections::{BTreeMap, BTreeSet}, + fmt, +}; + //************************************************************************************************* // Types //************************************************************************************************* @@ -28,7 +42,9 @@ pub enum IDEAnnotation { /// An expanded lambda site. ExpandedLambda, /// Autocomplete information. - AutocompleteInfo(Box), + DotAutocompleteInfo(Box), + /// Autocomplete information. + PathAutocompleteInfo(Box), /// Match Missing Arm. MissingMatchArms(Box), /// Ellipsis Match Arm. @@ -56,13 +72,25 @@ pub struct AutocompleteMethod { } #[derive(Debug, Clone)] -pub struct AutocompleteInfo { +pub struct DotAutocompleteInfo { /// Methods that are valid auto-completes pub methods: Vec, /// Fields that are valid auto-completes (e.g., for a struct) along with their types pub fields: Vec<(Symbol, N::Type)>, } +#[derive(Default, Debug, Clone)] +pub struct AliasAutocompleteInfo { + /// Numerical addresses that are valid autocompletes + pub addresses: BTreeSet<(Symbol, NumericalAddress)>, + /// Modules that are valid autocompletes + pub modules: BTreeSet<(Symbol, E::ModuleIdent)>, + /// Members that are valid autocompletes + pub members: BTreeSet<(Symbol, E::ModuleIdent, Name)>, + /// Type parameters that are valid autocompletes + pub type_params: BTreeSet, +} + #[derive(Debug, Clone)] pub struct MissingMatchArmsInfo { /// A vector of arm patterns that can be inserted to make the match complete. @@ -167,6 +195,78 @@ impl IntoIterator for IDEInfo { } } +impl AliasAutocompleteInfo { + pub fn new() -> Self { + Self::default() + } +} + +impl From<&BTreeMap> for AliasAutocompleteInfo { + fn from(names: &BTreeMap) -> Self { + let mut addresses: BTreeSet<(Symbol, NumericalAddress)> = BTreeSet::new(); + let mut modules: BTreeSet<(Symbol, E::ModuleIdent)> = BTreeSet::new(); + let mut members: BTreeSet<(Symbol, E::ModuleIdent, Name)> = BTreeSet::new(); + let mut type_params: BTreeSet = BTreeSet::new(); + + for (symbol, entry) in names + .iter() + .filter(|(symbol, _)| symbol.to_string() != UNIT_TEST_POISON_FUN_NAME.to_string()) + { + match entry { + LeadingAccessEntry::Address(addr) => { + addresses.insert((*symbol, *addr)); + } + LeadingAccessEntry::Module(mident) => { + modules.insert((*symbol, *mident)); + } + LeadingAccessEntry::Member(mident, name) => { + members.insert((*symbol, *mident, *name)); + } + LeadingAccessEntry::TypeParam => { + type_params.insert(*symbol); + } + } + } + + AliasAutocompleteInfo { + members, + modules, + addresses, + type_params, + } + } +} + +impl From<&BTreeMap> for AliasAutocompleteInfo { + fn from(names: &BTreeMap) -> Self { + let addresses: BTreeSet<(Symbol, NumericalAddress)> = BTreeSet::new(); + let modules: BTreeSet<(Symbol, E::ModuleIdent)> = BTreeSet::new(); + let mut members: BTreeSet<(Symbol, E::ModuleIdent, Name)> = BTreeSet::new(); + let mut type_params: BTreeSet = BTreeSet::new(); + + for (symbol, entry) in names + .iter() + .filter(|(symbol, _)| symbol.to_string() != UNIT_TEST_POISON_FUN_NAME.to_string()) + { + match entry { + MemberEntry::Member(mident, name) => { + members.insert((*symbol, *mident, *name)); + } + MemberEntry::TypeParam => { + type_params.insert(*symbol); + } + } + } + + AliasAutocompleteInfo { + members, + modules, + addresses, + type_params, + } + } +} + impl From<(Loc, IDEAnnotation)> for Diagnostic { fn from((loc, ann): (Loc, IDEAnnotation)) -> Self { match ann { @@ -196,8 +296,36 @@ impl From<(Loc, IDEAnnotation)> for Diagnostic { IDEAnnotation::ExpandedLambda => { diag!(IDE::ExpandedLambda, (loc, "expanded lambda")) } - IDEAnnotation::AutocompleteInfo(info) => { - let AutocompleteInfo { methods, fields } = *info; + IDEAnnotation::PathAutocompleteInfo(info) => { + let AliasAutocompleteInfo { + members, + modules, + addresses, + type_params, + } = *info; + let names = members + .into_iter() + .map(|(name, m, f)| format!("{name} -> {m}::{f}")) + .chain( + modules + .into_iter() + .map(|(name, m)| format!("{name} -> {m}")), + ) + .chain( + addresses + .into_iter() + .map(|(name, a)| format!("{name} -> {a}")), + ) + .chain(type_params.into_iter().map(|p| format!("{p}"))) + .collect::>(); + let msg = format!( + "Possible in-scope names: {}", + format_oxford_list!("or", "'{}'", names) + ); + diag!(IDE::PathAutocomplete, (loc, msg)) + } + IDEAnnotation::DotAutocompleteInfo(info) => { + let DotAutocompleteInfo { methods, fields } = *info; let names = methods .into_iter() .map( @@ -209,10 +337,10 @@ impl From<(Loc, IDEAnnotation)> for Diagnostic { .chain(fields.into_iter().map(|(n, _)| format!("{n}"))) .collect::>(); let msg = format!( - "Autocompletes to: {}", + "Possible dot names: {}", format_oxford_list!("or", "'{}'", names) ); - diag!(IDE::Autocomplete, (loc, msg)) + diag!(IDE::DotAutocomplete, (loc, msg)) } IDEAnnotation::MissingMatchArms(info) => { let MissingMatchArmsInfo { arms } = *info; diff --git a/external-crates/move/crates/move-compiler/src/shared/mod.rs b/external-crates/move/crates/move-compiler/src/shared/mod.rs index d6210daa0a5d2..445c78c3e7e21 100644 --- a/external-crates/move/crates/move-compiler/src/shared/mod.rs +++ b/external-crates/move/crates/move-compiler/src/shared/mod.rs @@ -191,6 +191,8 @@ pub const FILTER_UNUSED_MUT_PARAM: &str = "unused_mut_parameter"; pub const FILTER_IMPLICIT_CONST_COPY: &str = "implicit_const_copy"; pub const FILTER_DUPLICATE_ALIAS: &str = "duplicate_alias"; pub const FILTER_DEPRECATED: &str = "deprecated_usage"; +pub const FILTER_IDE_PATH_AUTOCOMPLETE: &str = "ide_path_autocomplete"; +pub const FILTER_IDE_DOT_AUTOCOMPLETE: &str = "ide_dot_autocomplete"; pub type NamedAddressMap = BTreeMap; @@ -282,12 +284,12 @@ impl CompilationEnv { package_configs: BTreeMap, default_config: Option, ) -> Self { - use crate::diagnostics::codes::{TypeSafety, UnusedItem}; + use crate::diagnostics::codes::{TypeSafety, UnusedItem, IDE}; visitors.extend([ sui_mode::id_leak::IDLeakVerifier.visitor(), sui_mode::typing::SuiTypeChecks.visitor(), ]); - let known_filters_: BTreeMap> = BTreeMap::from([ + let mut known_filters_: BTreeMap> = BTreeMap::from([ ( FILTER_ALL.into(), BTreeSet::from([WarningFilter::All(None)]), @@ -334,6 +336,12 @@ impl CompilationEnv { known_code_filter!(FILTER_DUPLICATE_ALIAS, Declarations::DuplicateAlias), known_code_filter!(FILTER_DEPRECATED, TypeSafety::DeprecatedUsage), ]); + if flags.ide_mode() { + known_filters_.extend([ + known_code_filter!(FILTER_IDE_PATH_AUTOCOMPLETE, IDE::PathAutocomplete), + known_code_filter!(FILTER_IDE_DOT_AUTOCOMPLETE, IDE::DotAutocomplete), + ]); + } let known_filters: BTreeMap>> = BTreeMap::from([(None, known_filters_)]); @@ -669,7 +677,7 @@ impl CompilationEnv { if self.flags().ide_test_mode() { for entry in info.annotations.iter() { let diag = entry.clone().into(); - self.diags.add(diag); + self.add_diag(diag); } } self.ide_information.extend(info); @@ -678,7 +686,7 @@ impl CompilationEnv { pub fn add_ide_annotation(&mut self, loc: Loc, info: IDEAnnotation) { if self.flags().ide_test_mode() { let diag = (loc, info.clone()).into(); - self.diags.add(diag); + self.add_diag(diag); } self.ide_information.add_ide_annotation(loc, info); } diff --git a/external-crates/move/crates/move-compiler/src/typing/expand.rs b/external-crates/move/crates/move-compiler/src/typing/expand.rs index 17fb01d59aefd..2fd127861672a 100644 --- a/external-crates/move/crates/move-compiler/src/typing/expand.rs +++ b/external-crates/move/crates/move-compiler/src/typing/expand.rs @@ -524,12 +524,13 @@ pub fn ide_annotation(context: &mut Context, annotation: &mut IDEAnnotation) { } } IDEAnnotation::ExpandedLambda => (), - IDEAnnotation::AutocompleteInfo(info) => { + IDEAnnotation::DotAutocompleteInfo(info) => { for (_, t) in info.fields.iter_mut() { type_(context, t); } } IDEAnnotation::MissingMatchArms(_) => (), IDEAnnotation::EllipsisMatchEntries(_) => (), + IDEAnnotation::PathAutocompleteInfo(_) => (), } } diff --git a/external-crates/move/crates/move-compiler/src/typing/translate.rs b/external-crates/move/crates/move-compiler/src/typing/translate.rs index 93ac4a264e6ce..e144b900f99e6 100644 --- a/external-crates/move/crates/move-compiler/src/typing/translate.rs +++ b/external-crates/move/crates/move-compiler/src/typing/translate.rs @@ -20,7 +20,7 @@ use crate::{ VariantName, }, shared::{ - ide::{AutocompleteInfo, IDEAnnotation, MacroCallInfo}, + ide::{DotAutocompleteInfo, IDEAnnotation, MacroCallInfo}, known_attributes::{SyntaxAttribute, TestingAttribute}, process_binops, program_info::{ConstantInfo, DatatypeKind, TypingProgramInfo}, @@ -3736,8 +3736,8 @@ fn ide_report_autocomplete(context: &mut Context, at_loc: &Loc, in_ty: &Type) { }; let methods = context.find_all_methods(&tn); let fields = context.find_all_fields(&tn); - let info = AutocompleteInfo { methods, fields }; - context.add_ide_info(*at_loc, IDEAnnotation::AutocompleteInfo(Box::new(info))); + let info = DotAutocompleteInfo { methods, fields }; + context.add_ide_info(*at_loc, IDEAnnotation::DotAutocompleteInfo(Box::new(info))); } //************************************************************************************************** diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.exp index b109e75964879..36785ef26fcbb 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.exp @@ -1,25 +1,31 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:13:24 + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:24 │ -13 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) +14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:26 + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:26 │ -14 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:9 + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:9 │ -16 │ let _tmp4 = _s. +17 │ let _tmp4 = _s. │ ^^^ │ │ │ Unexpected 'let' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.ide.exp index d96459d3fed3d..56ddd626b81cc 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.ide.exp @@ -1,55 +1,55 @@ -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:13:23 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:23 │ -13 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) - │ ^ Autocompletes to: 'a' +14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) + │ ^ Possible dot names: 'a' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:13:24 + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:24 │ -13 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) +14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:24 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:24 │ -14 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) - │ ^ Autocompletes to: 'a' +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) + │ ^ Possible dot names: 'a' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:25 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:25 │ -14 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) - │ ^ Autocompletes to: 'x' +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) + │ ^ Possible dot names: 'x' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:26 + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:26 │ -14 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:24 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:24 │ -15 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) - │ ^ Autocompletes to: 'a' +16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) + │ ^ Possible dot names: 'a' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:25 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:25 │ -15 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) - │ ^ Autocompletes to: 'x' +16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) + │ ^ Possible dot names: 'x' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:9 + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:9 │ -16 │ let _tmp4 = _s. +17 │ let _tmp4 = _s. │ ^^^ │ │ │ Unexpected 'let' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.move index 63e3904dcf811..cc4f58430eba5 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module a::m { public struct A has copy, drop { diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.exp new file mode 100644 index 0000000000000..59a9ec67cee3f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.exp @@ -0,0 +1,12 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.ide.exp index 0106b83dbcd66..2dc3cd67fe374 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.ide.exp @@ -1,78 +1,78 @@ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:16:15 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:17:15 │ -16 │ let A(.., _q) = a; +17 │ let A(.., _q) = a; │ ^^ Ellipsis expansion: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:17:19 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:18:19 │ -17 │ let A(_q, ..) = a; +18 │ let A(_q, ..) = a; │ ^^ Ellipsis expansion: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:18:15 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:19:15 │ -18 │ let A(..) = a; +19 │ let A(..) = a; │ ^^ Ellipsis expansion: _, _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:20:24 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:21:24 │ -20 │ let B { q: _q, .. } = b; +21 │ let B { q: _q, .. } = b; │ ^^ Ellipsis expansion: a: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:21:24 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:22:24 │ -21 │ let B { a: _a, .. } = b; +22 │ let B { a: _a, .. } = b; │ ^^ Ellipsis expansion: q: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:22:17 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:23:17 │ -22 │ let B { .. } = b; +23 │ let B { .. } = b; │ ^^ Ellipsis expansion: a: _, q: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:25:22 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:26:22 │ -25 │ C::X(_q, ..) => (), +26 │ C::X(_q, ..) => (), │ ^^ Ellipsis expansion: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:26:18 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:27:18 │ -26 │ C::X(.., _z) => (), +27 │ C::X(.., _z) => (), │ ^^ Ellipsis expansion: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:27:18 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:28:18 │ -27 │ C::X(..) => (), +28 │ C::X(..) => (), │ ^^ Ellipsis expansion: _, _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:29:27 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:30:27 │ -29 │ C::Y { y: _y, .. } => (), +30 │ C::Y { y: _y, .. } => (), │ ^^ Ellipsis expansion: z: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:30:20 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:31:20 │ -30 │ C::Y { .., y: _y } => (), +31 │ C::Y { .., y: _y } => (), │ ^^ Ellipsis expansion: z: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:31:20 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:32:20 │ -31 │ C::Y { .., z: _z } => (), +32 │ C::Y { .., z: _z } => (), │ ^^ Ellipsis expansion: y: _ note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:32:20 + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:33:20 │ -32 │ C::Y { .. } => () +33 │ C::Y { .. } => () │ ^^ Ellipsis expansion: y: _, z: _ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.move index 3bad59791ddb3..3d8b9ed62e33c 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete,ide_dot_autocomplete)] module a::m { public struct A(u64, u64) has copy, drop; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.exp index 61909830de20a..3ac1c59ec96e8 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.exp @@ -1,3 +1,15 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:9:9 + │ +9 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:9:31 + │ +9 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + warning[W09002]: unused variable ┌─ tests/move_2024/ide_mode/index_autocomplete.move:16:22 │ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp index 63b342f3755d4..af370e963d960 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp @@ -1,3 +1,38 @@ +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:2:1 + │ +2 │ ╭ module std::vector { +3 │ │ #[syntax(index)] +4 │ │ native public fun vborrow(v: &vector, i: u64): ∈ +5 │ │ #[syntax(index)] +6 │ │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; +7 │ │ } + │ ╰─^ Possible in-scope names: 'Option -> std::option::Option', 'Self -> std::vector', 'option -> std::option', 'vector -> std::vector', 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:51 + │ +4 │ native public fun vborrow(v: &vector, i: u64): ∈ + │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:71 + │ +4 │ native public fun vborrow(v: &vector, i: u64): ∈ + │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:59 + │ +6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; + │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:83 + │ +6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; + │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + warning[W09009]: unused struct field ┌─ tests/move_2024/ide_mode/index_autocomplete.move:14:23 │ @@ -14,24 +49,6 @@ warning[W09009]: unused struct field │ = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:21 - │ -17 │ let _ = &in.0.0[1]. ; - │ ^ Autocompletes to: 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:23 - │ -17 │ let _ = &in.0.0[1]. ; - │ ^ Autocompletes to: '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:27 - │ -17 │ let _ = &in.0.0[1]. ; - │ ^ Autocompletes to: '0' - error[E01002]: unexpected token ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:29 │ @@ -41,30 +58,6 @@ error[E01002]: unexpected token │ Unexpected ';' │ Expected an identifier or a decimal number -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:21 - │ -21 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:23 - │ -21 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:28 - │ -21 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:32 - │ -21 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: - error[E01002]: unexpected token ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:34 │ @@ -74,30 +67,6 @@ error[E01002]: unexpected token │ Unexpected ';' │ Expected an identifier or a decimal number -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:21 - │ -25 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:23 - │ -25 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:28 - │ -25 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: '0' - -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:32 - │ -25 │ let _ = &in.0.0[1].0[0]. ; - │ ^ Autocompletes to: 'c' or 'd' - error[E01002]: unexpected token ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:34 │ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.move index 8dc2c95243b85..5fb4f89c8efe0 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.move @@ -1,4 +1,3 @@ - #[defines_primitive(vector)] module std::vector { #[syntax(index)] @@ -7,6 +6,7 @@ module std::vector { native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; } +#[allow(ide_path_autocomplete,ide_dot_autocomplete)] module a::m { public struct A(vector) has drop; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.exp new file mode 100644 index 0000000000000..0045ad9736ea8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.exp @@ -0,0 +1,6 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.ide.exp index 81b45eb261833..6f487bfc65053 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.ide.exp @@ -6,57 +6,57 @@ warning[W09009]: unused struct field │ = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:21 │ 16 │ let _ = &in.0.0; - │ ^ Autocompletes to: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:23 │ 16 │ let _ = &in.0.0; - │ ^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:21 │ 20 │ let _ = &in.0.0.0 ; - │ ^ Autocompletes to: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:23 │ 20 │ let _ = &in.0.0.0 ; - │ ^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:25 │ 20 │ let _ = &in.0.0.0 ; - │ ^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:21 │ 24 │ let _ = &in.0.0.0.d ; - │ ^ Autocompletes to: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:23 │ 24 │ let _ = &in.0.0.0.d ; - │ ^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:25 │ 24 │ let _ = &in.0.0.0.d ; - │ ^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:27 │ 24 │ let _ = &in.0.0.0.d ; - │ ^ Autocompletes to: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' + │ ^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.move index c8d03a1d616eb..3082862f82c1a 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.move @@ -1,4 +1,4 @@ - +#[allow(ide_path_autocomplete)] module a::m { public struct A(T) has drop; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.exp new file mode 100644 index 0000000000000..8f98f2f3e539f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.exp @@ -0,0 +1,6 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.ide.exp index eb74b0159ee4a..b8ffa86589335 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.ide.exp @@ -14,45 +14,45 @@ warning[W09009]: unused struct field │ = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_autocomplete.move:16:12 │ 16 │ in.for_b_0() - │ ^^^^^^^ Autocompletes to: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + │ ^^^^^^^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:12 │ 20 │ in.0.for_a_0(); - │ ^ Autocompletes to: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:14 │ 20 │ in.0.for_a_0(); - │ ^^^^^^^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^^^^^^^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:12 │ 24 │ in.0.0.0.for_c_0(); - │ ^ Autocompletes to: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:14 │ 24 │ in.0.0.0.for_c_0(); - │ ^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:16 │ 24 │ in.0.0.0.for_c_0(); - │ ^ Autocompletes to: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:18 │ 24 │ in.0.0.0.for_c_0(); - │ ^^^^^^^ Autocompletes to: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' + │ ^^^^^^^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.move index 864fa244233f7..d70d6a0d434df 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.move @@ -1,4 +1,4 @@ - +#[allow(ide_path_autocomplete)] module a::m { public struct A(T) has drop; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.exp index 36fe238ae8383..ae9f6d8f7b728 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.exp @@ -1,12 +1,24 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:16 │ -3 │ match (true) { +4 │ match (true) { │ ^^^^ Pattern 'false' not covered error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:9:16 - │ -9 │ match (true) { - │ ^^^^ Pattern '_' not covered + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:16 + │ +10 │ match (true) { + │ ^^^^ Pattern '_' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.ide.exp index 19f2377c524e7..487a7ad81adce 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.ide.exp @@ -1,29 +1,29 @@ error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:16 │ -3 │ match (true) { +4 │ match (true) { │ ^^^^ Pattern 'false' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:3:22 + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:22 │ -3 │ match (true) { +4 │ match (true) { │ ╭──────────────────────^ -4 │ │ true => 0 -5 │ │ } +5 │ │ true => 0 +6 │ │ } │ ╰─────────^ Missing arms: 'false' error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:9:16 - │ -9 │ match (true) { - │ ^^^^ Pattern '_' not covered + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:16 + │ +10 │ match (true) { + │ ^^^^ Pattern '_' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:9:22 + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:22 │ - 9 │ match (true) { +10 │ match (true) { │ ╭──────────────────────^ -10 │ │ } +11 │ │ } │ ╰─────────^ Missing arms: 'false' and 'true' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.move index 9ab53a80abc69..e7980884506a7 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete,ide_dot_autocomplete)] module 0x42::m { public fun t0(): u64 { match (true) { diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.exp index 1397f8bc75e91..fbaa6d07f3135 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.exp @@ -1,24 +1,36 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:9:16 +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:1:31 │ -9 │ match (e) { - │ ^ Pattern '_' not covered +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:16 + │ +10 │ match (e) { + │ ^ Pattern '_' not covered error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:14:16 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:16 │ -14 │ match (e) { +15 │ match (e) { │ ^ Pattern 'E::One' not covered error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:20:16 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:16 │ -20 │ match (e) { +21 │ match (e) { │ ^ Pattern 'E::Three { x: _ }' not covered error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:27:16 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:16 │ -27 │ match (e) { +28 │ match (e) { │ ^ Pattern 'E::One' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.ide.exp index 45a6cd1579e95..5ad9bc654d155 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.ide.exp @@ -1,61 +1,61 @@ error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:9:16 - │ -9 │ match (e) { - │ ^ Pattern '_' not covered + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:16 + │ +10 │ match (e) { + │ ^ Pattern '_' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:9:19 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:19 │ - 9 │ match (e) { +10 │ match (e) { │ ╭───────────────────^ -10 │ │ } +11 │ │ } │ ╰─────────^ Missing arms: '0x42::m::E::One', '0x42::m::E::Two(_)', and '0x42::m::E::Three { x }' error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:14:16 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:16 │ -14 │ match (e) { +15 │ match (e) { │ ^ Pattern 'E::One' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:14:19 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:19 │ -14 │ match (e) { +15 │ match (e) { │ ╭───────────────────^ -15 │ │ E::Two(n) => *n -16 │ │ } +16 │ │ E::Two(n) => *n +17 │ │ } │ ╰─────────^ Missing arms: '0x42::m::E::One' and '0x42::m::E::Three { x }' error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:20:16 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:16 │ -20 │ match (e) { +21 │ match (e) { │ ^ Pattern 'E::Three { x: _ }' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:20:19 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:19 │ -20 │ match (e) { +21 │ match (e) { │ ╭───────────────────^ -21 │ │ E::One => 0, -22 │ │ E::Two(n) => *n -23 │ │ } +22 │ │ E::One => 0, +23 │ │ E::Two(n) => *n +24 │ │ } │ ╰─────────^ Missing arms: '0x42::m::E::Three { x }' error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:27:16 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:16 │ -27 │ match (e) { +28 │ match (e) { │ ^ Pattern 'E::One' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:27:19 + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:19 │ -27 │ match (e) { +28 │ match (e) { │ ╭───────────────────^ -28 │ │ E::Three { x } => *x, -29 │ │ E::Two(n) => *n -30 │ │ } +29 │ │ E::Three { x } => *x, +30 │ │ E::Two(n) => *n +31 │ │ } │ ╰─────────^ Missing arms: '0x42::m::E::One' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.move index 1167abdc14efd..bec4e8a16d075 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete,ide_dot_autocomplete)] module 0x42::m { public enum E { One, diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.exp index 8f4c416615466..40c28103c3dbb 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.exp @@ -1,14 +1,26 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:16 │ -3 │ match (0) { +4 │ match (0) { │ ^ Pattern '_0' not covered │ = When '_0' is not 1 error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:9:16 - │ -9 │ match (0) { - │ ^ Pattern '_' not covered + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:16 + │ +10 │ match (0) { + │ ^ Pattern '_' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.ide.exp index de854bc098331..cc5792f3addca 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.ide.exp @@ -1,31 +1,31 @@ error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:16 │ -3 │ match (0) { +4 │ match (0) { │ ^ Pattern '_0' not covered │ = When '_0' is not 1 note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:3:19 + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:19 │ -3 │ match (0) { +4 │ match (0) { │ ╭───────────────────^ -4 │ │ 1 => 0 -5 │ │ } +5 │ │ 1 => 0 +6 │ │ } │ ╰─────────^ Missing arms: '_' error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:9:16 - │ -9 │ match (0) { - │ ^ Pattern '_' not covered + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:16 + │ +10 │ match (0) { + │ ^ Pattern '_' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:9:19 + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:19 │ - 9 │ match (0) { +10 │ match (0) { │ ╭───────────────────^ -10 │ │ } +11 │ │ } │ ╰─────────^ Missing arms: '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.move index 954da3c36d494..cde0c9b98c683 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete,ide_dot_autocomplete)] module 0x42::m { public fun t0(): u64 { match (0) { diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.exp index 8331eef2fbb4f..9b008476e2f78 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.exp @@ -1,18 +1,30 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:6:16 + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:16 │ -6 │ match (s) { +7 │ match (s) { │ ^ Pattern '_' not covered error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:12:13 + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 │ -12 │ S { } => 0 +13 │ S { } => 0 │ ^^^^^ Missing pattern for field 'x' in '0x42::m::S' error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:12:13 + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 │ -12 │ S { } => 0 +13 │ S { } => 0 │ ^^^^^ Missing pattern for field 'y' in '0x42::m::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.ide.exp index 2da8127bc1dec..acb8d4b3d403e 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.ide.exp @@ -1,26 +1,26 @@ error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:6:16 + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:16 │ -6 │ match (s) { +7 │ match (s) { │ ^ Pattern '_' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:6:19 + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:19 │ -6 │ match (s) { +7 │ match (s) { │ ╭───────────────────^ -7 │ │ } +8 │ │ } │ ╰─────────^ Missing arms: '0x42::m::S { x , y }' error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:12:13 + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 │ -12 │ S { } => 0 +13 │ S { } => 0 │ ^^^^^ Missing pattern for field 'x' in '0x42::m::S' error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:12:13 + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 │ -12 │ S { } => 0 +13 │ S { } => 0 │ ^^^^^ Missing pattern for field 'y' in '0x42::m::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.move index 31295e25fba01..555a1903a6484 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete,ide_dot_autocomplete)] module 0x42::m { public struct S { x: u64 , y: u64 } diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.exp index 73618d10a35a0..fd4aee181cc54 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.exp @@ -1,30 +1,42 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 │ -3 │ match (e) { +4 │ match (e) { │ ^ Unbound variable 'e' error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 │ -3 │ match (e) { +4 │ match (e) { │ ^ Pattern '_' not covered error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:8:16 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:16 │ -8 │ match (e) { +9 │ match (e) { │ ^ Unbound variable 'e' error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:13 - │ -9 │ E::Two(n) => n - │ ^ Could not resolve the name 'E' + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:13 + │ +10 │ E::Two(n) => n + │ ^ Could not resolve the name 'E' error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:26 - │ -9 │ E::Two(n) => n - │ ^ Unbound variable 'n' + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:26 + │ +10 │ E::Two(n) => n + │ ^ Unbound variable 'n' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.ide.exp index 14684076faba5..d6b885a93845e 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.ide.exp @@ -1,47 +1,47 @@ error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 │ -3 │ match (e) { +4 │ match (e) { │ ^ Unbound variable 'e' error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:3:16 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 │ -3 │ match (e) { +4 │ match (e) { │ ^ Pattern '_' not covered note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:3:19 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:19 │ -3 │ match (e) { +4 │ match (e) { │ ╭───────────────────^ -4 │ │ } +5 │ │ } │ ╰─────────^ Missing arms: '_' error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:8:16 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:16 │ -8 │ match (e) { +9 │ match (e) { │ ^ Unbound variable 'e' note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:8:19 + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:19 │ - 8 │ match (e) { + 9 │ match (e) { │ ╭───────────────────^ - 9 │ │ E::Two(n) => n -10 │ │ } +10 │ │ E::Two(n) => n +11 │ │ } │ ╰─────────^ Missing arms: '_' error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:13 - │ -9 │ E::Two(n) => n - │ ^ Could not resolve the name 'E' + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:13 + │ +10 │ E::Two(n) => n + │ ^ Could not resolve the name 'E' error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:26 - │ -9 │ E::Two(n) => n - │ ^ Unbound variable 'n' + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:26 + │ +10 │ E::Two(n) => n + │ ^ Unbound variable 'n' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.move index cf33202cc09e9..8e73a1e9513d6 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete,ide_dot_autocomplete)] module 0x42::m { public fun t0(): u64 { match (e) { diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.exp index 9c31cb3b2c1db..069200c09440f 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.exp @@ -1,16 +1,22 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:13:24 + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:24 │ -13 │ let _tmp1 = _s.; +14 │ let _tmp1 = _s.; │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:26 + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:26 │ -14 │ let _tmp2 = _s.a.; +15 │ let _tmp2 = _s.a.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.ide.exp index 188a409d02f20..32142840025e1 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.ide.exp @@ -1,34 +1,34 @@ -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:13:23 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:23 │ -13 │ let _tmp1 = _s.; - │ ^ Autocompletes to: 'a' +14 │ let _tmp1 = _s.; + │ ^ Possible dot names: 'a' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:13:24 + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:24 │ -13 │ let _tmp1 = _s.; +14 │ let _tmp1 = _s.; │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:24 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:24 │ -14 │ let _tmp2 = _s.a.; - │ ^ Autocompletes to: 'a' +15 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'a' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:25 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:25 │ -14 │ let _tmp2 = _s.a.; - │ ^ Autocompletes to: 'x' +15 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'x' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:26 + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:26 │ -14 │ let _tmp2 = _s.a.; +15 │ let _tmp2 = _s.a.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.move index 9db6af2600bd8..c8e74b0ed74c6 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module a::m { public struct A has copy, drop { diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.exp index d3df20bb9b674..80ce40f3f9785 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.exp @@ -1,6 +1,12 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + error[E03010]: unbound field - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:13:21 + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:21 │ -13 │ let _tmp2 = _s.b.x; +14 │ let _tmp2 = _s.b.x; │ ^^^^ Unbound field 'b' in 'a::m::B' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.ide.exp index 6f256e3520f95..9efccbe1276d3 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.ide.exp @@ -1,12 +1,12 @@ error[E03010]: unbound field - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:13:21 + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:21 │ -13 │ let _tmp2 = _s.b.x; +14 │ let _tmp2 = _s.b.x; │ ^^^^ Unbound field 'b' in 'a::m::B' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:13:24 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:24 │ -13 │ let _tmp2 = _s.b.x; - │ ^ Autocompletes to: 'a' +14 │ let _tmp2 = _s.b.x; + │ ^ Possible dot names: 'a' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.move index db51b835715d7..4b58ea16506c3 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module a::m { public struct A has copy, drop { diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.exp index e206d634ed1fa..1c1361119e93f 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.exp @@ -1,16 +1,22 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:9:24 +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:1:9 │ -9 │ let _tmp1 = _s.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:10:24 + │ +10 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:10:26 + ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:11:26 │ -10 │ let _tmp2 = _s.0.; +11 │ let _tmp2 = _s.0.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.ide.exp index 89f23434e6cbd..9a0b8f3f40634 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.ide.exp @@ -1,34 +1,34 @@ -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:9:23 - │ -9 │ let _tmp1 = _s.; - │ ^ Autocompletes to: '0' +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:10:23 + │ +10 │ let _tmp1 = _s.; + │ ^ Possible dot names: '0' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:9:24 - │ -9 │ let _tmp1 = _s.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -note[I15001]: IDE autocomplete ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:10:24 │ -10 │ let _tmp2 = _s.0.; - │ ^ Autocompletes to: '0' +10 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:11:24 + │ +11 │ let _tmp2 = _s.0.; + │ ^ Possible dot names: '0' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:10:25 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:11:25 │ -10 │ let _tmp2 = _s.0.; - │ ^ Autocompletes to: '0' +11 │ let _tmp2 = _s.0.; + │ ^ Possible dot names: '0' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:10:26 + ┌─ tests/move_2024/ide_mode/positional_struct_autocomplete.move:11:26 │ -10 │ let _tmp2 = _s.0.; +11 │ let _tmp2 = _s.0.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.move index efc784849cc94..e57638cd63bef 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/positional_struct_autocomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module a::m { public struct A(u64) has copy, drop; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.exp index ff2accbd13835..9fbfcf947d8a3 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.exp @@ -1,16 +1,22 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:18:24 + ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:19:24 │ -18 │ let _tmp1 = _a.; +19 │ let _tmp1 = _a.; │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:19:24 + ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:20:24 │ -19 │ let _tmp2 = _b.; +20 │ let _tmp2 = _b.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.ide.exp index 2c045a84b0baa..71f04b933eaeb 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.ide.exp @@ -1,28 +1,28 @@ -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:18:23 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:19:23 │ -18 │ let _tmp1 = _a.; - │ ^ Autocompletes to: 'a::m::t0', 'a::m::t1', or 'a::m::t2' +19 │ let _tmp1 = _a.; + │ ^ Possible dot names: 'a::m::t0', 'a::m::t1', or 'a::m::t2' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:18:24 + ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:19:24 │ -18 │ let _tmp1 = _a.; +19 │ let _tmp1 = _a.; │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:19:23 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:20:23 │ -19 │ let _tmp2 = _b.; - │ ^ Autocompletes to: 'a::m::t3', 'a::m::t4', or 'a::m::t5' +20 │ let _tmp2 = _b.; + │ ^ Possible dot names: 'a::m::t3', 'a::m::t4', or 'a::m::t5' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:19:24 + ┌─ tests/move_2024/ide_mode/struct_method_autocomplete.move:20:24 │ -19 │ let _tmp2 = _b.; +20 │ let _tmp2 = _b.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.move index ef48e17c95ffe..d09d4eb7e7a8e 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_autocomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module a::m { public struct A has copy, drop { } diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.exp index 3abe62afc1629..f79185f8deee9 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.exp @@ -1,16 +1,28 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:16:13 + │ +16 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + error[E04023]: invalid method call - ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:18:21 + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:20:21 │ -18 │ let _tmp1 = _a.t7(); +20 │ let _tmp1 = _a.t7(); │ ^^^^^^^ │ │ │ │ │ No local 'use fun' alias was found for 'a::m::A.t7', and no function 't7' was found in the defining module 'a::m' │ Invalid method call. No known method 't7' on type 'a::m::A' error[E04023]: invalid method call - ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:19:21 + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:21:21 │ -19 │ let _tmp2 = _b.t8(); +21 │ let _tmp2 = _b.t8(); │ ^^^^^^^ │ │ │ │ │ No local 'use fun' alias was found for 'a::m::B.t8', and no function 't8' was found in the defining module 'a::m' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.ide.exp index 88911cf437903..ad1bed3a378bb 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.ide.exp @@ -1,30 +1,30 @@ error[E04023]: invalid method call - ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:18:21 + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:20:21 │ -18 │ let _tmp1 = _a.t7(); +20 │ let _tmp1 = _a.t7(); │ ^^^^^^^ │ │ │ │ │ No local 'use fun' alias was found for 'a::m::A.t7', and no function 't7' was found in the defining module 'a::m' │ Invalid method call. No known method 't7' on type 'a::m::A' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:18:24 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:20:24 │ -18 │ let _tmp1 = _a.t7(); - │ ^^ Autocompletes to: 'a::m::t0', 'a::m::t1', or 'a::m::t2' +20 │ let _tmp1 = _a.t7(); + │ ^^ Possible dot names: 'a::m::t0', 'a::m::t1', or 'a::m::t2' error[E04023]: invalid method call - ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:19:21 + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:21:21 │ -19 │ let _tmp2 = _b.t8(); +21 │ let _tmp2 = _b.t8(); │ ^^^^^^^ │ │ │ │ │ No local 'use fun' alias was found for 'a::m::B.t8', and no function 't8' was found in the defining module 'a::m' │ Invalid method call. No known method 't8' on type 'a::m::B' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:19:24 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move:21:24 │ -19 │ let _tmp2 = _b.t8(); - │ ^^ Autocompletes to: 'a::m::t3', 'a::m::t4', or 'a::m::t5' +21 │ let _tmp2 = _b.t8(); + │ ^^ Possible dot names: 'a::m::t3', 'a::m::t4', or 'a::m::t5' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move index 340a5f652f77d..3dbdb988c3f85 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_method_invalid_autocomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module a::m { public struct A has copy, drop { } @@ -12,6 +13,7 @@ module a::m { public fun t4(_s: &B): u64 { abort 0 } public fun t5(_s: &B): u64 { abort 0 } + #[allow(ide_path_autocomplete)] public fun foo() { let _a = A {}; let _b = B(); diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.exp index 8ec4654f627f8..5bb7dd97ec577 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.exp @@ -1,16 +1,28 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:14:9 + │ +14 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:17:24 + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:19:24 │ -17 │ let _tmp1 = _a.; +19 │ let _tmp1 = _a.; │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:18:24 + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:20:24 │ -18 │ let _tmp2 = _b.; +20 │ let _tmp2 = _b.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.ide.exp index c5f9b0a9d0edd..8d4ebad9289be 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.ide.exp @@ -1,44 +1,44 @@ warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:3:21 + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:4:21 │ -3 │ public struct A(u64) has copy, drop; +4 │ public struct A(u64) has copy, drop; │ ^^^ The '0' field of the 'A' type is unused │ = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:6:9 + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:7:9 │ -6 │ a: A +7 │ a: A │ ^ The 'a' field of the 'B' type is unused │ = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:17:23 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:19:23 │ -17 │ let _tmp1 = _a.; - │ ^ Autocompletes to: 'a::m::t0' +19 │ let _tmp1 = _a.; + │ ^ Possible dot names: 'a::m::t0' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:17:24 + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:19:24 │ -17 │ let _tmp1 = _a.; +19 │ let _tmp1 = _a.; │ ^ │ │ │ Unexpected ';' │ Expected an identifier or a decimal number -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:18:23 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:20:23 │ -18 │ let _tmp2 = _b.; - │ ^ Autocompletes to: 'a::m::t1' +20 │ let _tmp2 = _b.; + │ ^ Possible dot names: 'a::m::t1' error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:18:24 + ┌─ tests/move_2024/ide_mode/struct_scoped_autocomplete.move:20:24 │ -18 │ let _tmp2 = _b.; +20 │ let _tmp2 = _b.; │ ^ │ │ │ Unexpected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.move index c82c196abcf94..7b58d341b5c61 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/struct_scoped_autocomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module a::m { public struct A(u64) has copy, drop; @@ -10,6 +11,7 @@ module a::m { public fun t1(_s: B): u64 { abort 0 } } +#[allow(ide_path_autocomplete)] module a::n { use a::m::{A,B}; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp index a1235b2ead8ae..c2d26e9d021f5 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp @@ -1,3 +1,39 @@ +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:1:1 + │ +1 │ ╭ module 0x42::m; +2 │ │ +3 │ │ public struct Action { inner: T } +4 │ │ +5 │ │ public fun make_action_ref(action: &mut Action): &mut T { +6 │ │ &mut action.inner.bar +7 │ │ } + │ ╰─^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'Self -> 0x42::m', 'option -> std::option', 'vector -> std::vector', 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:3:34 + │ +3 │ public struct Action { inner: T } + │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:44 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^^^^^^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:51 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:61 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + error[E04009]: expected specific type ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:10 │ @@ -6,9 +42,9 @@ error[E04009]: expected specific type 6 │ &mut action.inner.bar │ ^^^^^^^^^^^^^^^^ Unbound field 'bar' -note[I15001]: IDE autocomplete +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:17 │ 6 │ &mut action.inner.bar - │ ^^^^^ Autocompletes to: '0x42::m::make_action_ref' or 'inner' + │ ^^^^^ Possible dot names: '0x42::m::make_action_ref' or 'inner' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp index 4536b3457c490..1a86fceabb78d 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp @@ -1,6 +1,42 @@ -note[I15001]: IDE autocomplete +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:1:1 + │ +1 │ ╭ module 0x42::m; +2 │ │ +3 │ │ public struct Action { inner: T } +4 │ │ +5 │ │ public fun make_action_ref(action: &mut Action): &mut T { +6 │ │ &mut action.inner +7 │ │ } + │ ╰─^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'Self -> 0x42::m', 'option -> std::option', 'vector -> std::vector', 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:3:34 + │ +3 │ public struct Action { inner: T } + │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:44 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^^^^^^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:51 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:61 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + +note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:17 │ 6 │ &mut action.inner - │ ^^^^^ Autocompletes to: '0x42::m::make_action_ref' or 'inner' + │ ^^^^^ Possible dot names: '0x42::m::make_action_ref' or 'inner' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.exp new file mode 100644 index 0000000000000..70061d1a0a87d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.exp @@ -0,0 +1,6 @@ +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.ide.exp index 6ecd246cdf93f..3d2a42795af61 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.ide.exp @@ -1,12 +1,12 @@ -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:11:11 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:12:11 │ -11 │ s.bak(); // autocompletion to `bak` and `foo` - │ ^^^ Autocompletes to: '0x42::m1::bak', '0x42::m1::foo', '0x42::m1::test1', or '0x42::m1::test2' +12 │ s.bak(); // autocompletion to `bak` and `foo` + │ ^^^ Possible dot names: '0x42::m1::bak', '0x42::m1::foo', '0x42::m1::test1', or '0x42::m1::test2' -note[I15001]: IDE autocomplete - ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:16:11 +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:17:11 │ -16 │ s.bar(); // auto-completion to only one (shadowed) `bar` - │ ^^^ Autocompletes to: '0x42::m1::bar', '0x42::m1::test1', or '0x42::m1::test2' +17 │ s.bar(); // auto-completion to only one (shadowed) `bar` + │ ^^^ Possible dot names: '0x42::m1::bar', '0x42::m1::test1', or '0x42::m1::test2' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.move index 730d42501a912..d6d0d9c0ddfaa 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.move @@ -1,3 +1,4 @@ +#[allow(ide_path_autocomplete)] module 0x42::m1 { public struct S {} has drop; diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.exp new file mode 100644 index 0000000000000..2e92c1dc8adfc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.exp @@ -0,0 +1,18 @@ +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:24 + │ +13 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:26 + │ +14 │ let _tmp2 = _s.a.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp new file mode 100644 index 0000000000000..ae348b9e60474 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp @@ -0,0 +1,72 @@ +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:1:1 + │ + 1 │ ╭ module a::m { + 2 │ │ + 3 │ │ struct A has copy, drop { + 4 │ │ x: u64 + · │ +15 │ │ } +16 │ │ } + │ ╰─^ Possible in-scope names: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:4:12 + │ +4 │ x: u64 + │ ^^^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:8:12 + │ +8 │ a: A + │ ^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:18 + │ +12 │ let _s = B { a: A { x: 0 } }; + │ ^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:25 + │ +12 │ let _s = B { a: A { x: 0 } }; + │ ^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:23 + │ +13 │ let _tmp1 = _s.; + │ ^ Possible dot names: 'a' + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:24 + │ +13 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:24 + │ +14 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:25 + │ +14 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'x' + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:26 + │ +14 │ let _tmp2 = _s.a.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.move new file mode 100644 index 0000000000000..77c3b6ddd86e8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.move @@ -0,0 +1,16 @@ +module a::m { + + struct A has copy, drop { + x: u64 + } + + struct B has copy, drop { + a: A + } + + public fun foo() { + let _s = B { a: A { x: 0 } }; + let _tmp1 = _s.; + let _tmp2 = _s.a.; + } +} diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.exp deleted file mode 100644 index 1cef3d8aae539..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/ide_mode/struct_method_autocomplete.move:5:13 - │ -5 │ struct B() has copy, drop; - │ ^ Positional fields are not supported by current edition 'legacy', only '2024.alpha' and '2024.beta' support this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/ide_mode/struct_method_autocomplete.move:5:16 - │ -5 │ struct B() has copy, drop; - │ ^^^ Postfix abilities are not supported by current edition 'legacy', only '2024.alpha' and '2024.beta' support this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/ide_mode/struct_method_autocomplete.move:17:18 - │ -17 │ let _b = B(); - │ ^^^ Positional fields are not supported by current edition 'legacy', only '2024.alpha' and '2024.beta' support this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/struct_method_autocomplete.move:18:24 - │ -18 │ let _tmp1 = _a.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/struct_method_autocomplete.move:19:24 - │ -19 │ let _tmp2 = _b.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.move b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.move deleted file mode 100644 index 25ede0a590d40..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/struct_method_autocomplete.move +++ /dev/null @@ -1,21 +0,0 @@ -module a::m { - - struct A has copy, drop { } - - struct B() has copy, drop; - - public fun t0(_s: A): u64 { abort 0 } - public fun t1(_s: &A): u64 { abort 0 } - public fun t2(_s: &A): u64 { abort 0 } - - public fun t3(_s: B): u64 { abort 0 } - public fun t4(_s: &B): u64 { abort 0 } - public fun t5(_s: &B): u64 { abort 0 } - - fun foo() { - let _a = A {}; - let _b = B(); - let _tmp1 = _a.; - let _tmp2 = _b.; - } -} From 0252a76d7d574318b19146da66fa34c42828a0de Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Tue, 16 Jul 2024 15:20:52 -0700 Subject: [PATCH 055/163] Add a metric to track per object cost in consensus commit for congestion control (#18676) ## Description Also some chore to add txn execution status in workloads. ## Test plan Unit test --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/workloads/batch_payment.rs | 2 +- .../sui-benchmark/src/workloads/delegation.rs | 2 +- .../src/workloads/shared_counter.rs | 2 +- .../src/workloads/shared_object_deletion.rs | 5 ++++- .../src/workloads/transfer_object.rs | 2 +- crates/sui-core/src/authority.rs | 7 +++++++ .../authority/authority_per_epoch_store.rs | 8 ++++++++ .../shared_object_congestion_tracker.rs | 19 +++++++++++++++++++ 8 files changed, 42 insertions(+), 5 deletions(-) diff --git a/crates/sui-benchmark/src/workloads/batch_payment.rs b/crates/sui-benchmark/src/workloads/batch_payment.rs index 71d678d77af46..771dee09c0d88 100644 --- a/crates/sui-benchmark/src/workloads/batch_payment.rs +++ b/crates/sui-benchmark/src/workloads/batch_payment.rs @@ -55,7 +55,7 @@ impl Payload for BatchPaymentTestPayload { fn make_new_payload(&mut self, effects: &ExecutionEffects) { if !effects.is_ok() { effects.print_gas_summary(); - error!("Batch payment failed..."); + error!("Batch payment failed... Status: {:?}", effects.status()); } self.state.update(effects); diff --git a/crates/sui-benchmark/src/workloads/delegation.rs b/crates/sui-benchmark/src/workloads/delegation.rs index de274663b31e8..8f55acf807b23 100644 --- a/crates/sui-benchmark/src/workloads/delegation.rs +++ b/crates/sui-benchmark/src/workloads/delegation.rs @@ -41,7 +41,7 @@ impl Payload for DelegationTestPayload { fn make_new_payload(&mut self, effects: &ExecutionEffects) { if !effects.is_ok() { effects.print_gas_summary(); - error!("Delegation tx failed..."); + error!("Delegation tx failed... Status: {:?}", effects.status()); } let coin = match self.coin { diff --git a/crates/sui-benchmark/src/workloads/shared_counter.rs b/crates/sui-benchmark/src/workloads/shared_counter.rs index e95fe2ca18a75..6ce393c1f2d47 100644 --- a/crates/sui-benchmark/src/workloads/shared_counter.rs +++ b/crates/sui-benchmark/src/workloads/shared_counter.rs @@ -48,7 +48,7 @@ impl Payload for SharedCounterTestPayload { fn make_new_payload(&mut self, effects: &ExecutionEffects) { if !effects.is_ok() { effects.print_gas_summary(); - error!("Shared counter tx failed..."); + error!("Shared counter tx failed... Status: {:?}", effects.status()); } self.gas.0 = effects.gas_object().0; } diff --git a/crates/sui-benchmark/src/workloads/shared_object_deletion.rs b/crates/sui-benchmark/src/workloads/shared_object_deletion.rs index cf6cebeac47d6..725a45bbfc935 100644 --- a/crates/sui-benchmark/src/workloads/shared_object_deletion.rs +++ b/crates/sui-benchmark/src/workloads/shared_object_deletion.rs @@ -50,7 +50,10 @@ impl Payload for SharedCounterDeletionTestPayload { fn make_new_payload(&mut self, effects: &ExecutionEffects) { if !effects.is_ok() && !self.is_counter_deleted { effects.print_gas_summary(); - warn!("Shared counter deletion tx failed: {}", effects.status()); + warn!( + "Shared counter deletion tx failed... Status: {:?}", + effects.status() + ); } self.gas.0 = effects.gas_object().0; diff --git a/crates/sui-benchmark/src/workloads/transfer_object.rs b/crates/sui-benchmark/src/workloads/transfer_object.rs index ed9d5c2b5879b..3bea7713ca98e 100644 --- a/crates/sui-benchmark/src/workloads/transfer_object.rs +++ b/crates/sui-benchmark/src/workloads/transfer_object.rs @@ -41,7 +41,7 @@ impl Payload for TransferObjectTestPayload { fn make_new_payload(&mut self, effects: &ExecutionEffects) { if !effects.is_ok() { effects.print_gas_summary(); - error!("Transfer tx failed..."); + error!("Transfer tx failed... Status: {:?}", effects.status()); } let recipient = self.gas.iter().find(|x| x.1 != self.transfer_to).unwrap().1; diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index a626fd3d09f04..53e86ebe831fe 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -280,6 +280,7 @@ pub struct AuthorityMetrics { pub consensus_handler_deferred_transactions: IntCounter, pub consensus_handler_congested_transactions: IntCounter, pub consensus_handler_cancelled_transactions: IntCounter, + pub consensus_handler_max_object_costs: IntGaugeVec, pub consensus_committed_subdags: IntCounterVec, pub consensus_committed_messages: IntGaugeVec, pub consensus_committed_user_transactions: IntGaugeVec, @@ -684,6 +685,12 @@ impl AuthorityMetrics { "Number of transactions cancelled by consensus handler", registry, ).unwrap(), + consensus_handler_max_object_costs: register_int_gauge_vec_with_registry!( + "consensus_handler_max_congestion_control_object_costs", + "Max object costs for congestion control in the current consensus commit", + &["commit_type"], + registry, + ).unwrap(), consensus_committed_subdags: register_int_counter_vec_with_registry!( "consensus_committed_subdags", "Number of committed subdags, sliced by author", 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 7e60dd8a74421..8d2ce96aae175 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -3185,6 +3185,14 @@ impl AuthorityPerEpochStore { authority_metrics .consensus_handler_cancelled_transactions .inc_by(cancelled_txns.len() as u64); + authority_metrics + .consensus_handler_max_object_costs + .with_label_values(&["regular_commit"]) + .set(shared_object_congestion_tracker.max_cost() as i64); + authority_metrics + .consensus_handler_max_object_costs + .with_label_values(&["randomness_commit"]) + .set(shared_object_using_randomness_congestion_tracker.max_cost() as i64); if randomness_state_updated { if let Some(randomness_manager) = randomness_manager.as_mut() { diff --git a/crates/sui-core/src/authority/shared_object_congestion_tracker.rs b/crates/sui-core/src/authority/shared_object_congestion_tracker.rs index 46ea4775ca21f..68f95e21fec4b 100644 --- a/crates/sui-core/src/authority/shared_object_congestion_tracker.rs +++ b/crates/sui-core/src/authority/shared_object_congestion_tracker.rs @@ -147,6 +147,15 @@ impl SharedObjectCongestionTracker { } } } + + // Returns the maximum cost of all objects. + pub fn max_cost(&self) -> u64 { + self.object_execution_cost + .values() + .max() + .copied() + .unwrap_or(0) + } } #[cfg(test)] @@ -466,6 +475,7 @@ mod object_cost_tests { &[(object_id_0, 5), (object_id_1, 10)], mode, ); + assert_eq!(shared_object_congestion_tracker.max_cost(), 10); // Read two objects should not change the object execution cost. let cert = build_transaction(&[(object_id_0, false), (object_id_1, false)], 10); @@ -477,6 +487,7 @@ mod object_cost_tests { mode ) ); + assert_eq!(shared_object_congestion_tracker.max_cost(), 10); // Write to object 0 should only bump object 0's execution cost. The start cost should be object 1's cost. let cert = build_transaction(&[(object_id_0, true), (object_id_1, false)], 10); @@ -493,6 +504,10 @@ mod object_cost_tests { mode ) ); + assert_eq!( + shared_object_congestion_tracker.max_cost(), + expected_object_0_cost + ); // Write to all objects should bump all objects' execution cost, including objects that are seen for the first time. let cert = build_transaction( @@ -520,5 +535,9 @@ mod object_cost_tests { mode ) ); + assert_eq!( + shared_object_congestion_tracker.max_cost(), + expected_object_cost + ); } } From 5ec703d6bf9a8731e3f0ebb3d984f4520e1e3ed9 Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:13:28 -0700 Subject: [PATCH 056/163] change protocol version 54 to 53 (#18695) ## Description the next version should be 53 instead of 54. Also update MAX_VERSION ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-open-rpc/spec/openrpc.json | 2 +- crates/sui-protocol-config/src/lib.rs | 6 +- ...ocol_config__test__Mainnet_version_53.snap | 283 ++++++++++++++++ ...ocol_config__test__Testnet_version_53.snap | 292 +++++++++++++++++ ...sui_protocol_config__test__version_53.snap | 302 ++++++++++++++++++ ...ests__genesis_config_snapshot_matches.snap | 2 +- ..._populated_genesis_snapshot_matches-2.snap | 30 +- sdk/graphql-transport/src/methods.ts | 1 + 8 files changed, 898 insertions(+), 20 deletions(-) create mode 100644 crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap create mode 100644 crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap create mode 100644 crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 5f4a0bf063329..b3be07a01d874 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -1293,7 +1293,7 @@ "name": "Result", "value": { "minSupportedProtocolVersion": "1", - "maxSupportedProtocolVersion": "52", + "maxSupportedProtocolVersion": "53", "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 f5a528c30efbe..824ea99ae9df8 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -16,7 +16,7 @@ use tracing::{info, warn}; /// The minimum and maximum protocol versions supported by this build. const MIN_PROTOCOL_VERSION: u64 = 1; -const MAX_PROTOCOL_VERSION: u64 = 52; +const MAX_PROTOCOL_VERSION: u64 = 53; // Record history of protocol version allocations here: // @@ -161,7 +161,7 @@ const MAX_PROTOCOL_VERSION: u64 = 52; // Enable enums on testnet. // Add support for passkey in devnet. // Enable deny list v2 on testnet and mainnet. -// Version 54: Add feature flag to decide whether to attempt to finalize bridge committee +// Version 53: Add feature flag to decide whether to attempt to finalize bridge committee #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -2490,7 +2490,7 @@ impl ProtocolConfig { } cfg.feature_flags.enable_coin_deny_list_v2 = true; } - 54 => { + 53 => { // Do not allow bridge committee to finalize on mainnet. cfg.bridge_should_try_to_finalize_committee = Some(chain != Chain::Mainnet); } diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap new file mode 100644 index 0000000000000..dae3269f827e8 --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap @@ -0,0 +1,283 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 53 +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 + 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 + 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 + fresh_vm_on_framework_upgrade: true + mysticeti_num_leaders_per_round: 1 + enable_coin_deny_list_v2: true +max_tx_size_bytes: 131072 +max_input_objects: 2048 +max_size_written_objects: 5000000 +max_size_written_objects_system_tx: 50000000 +max_serialized_tx_effects_size_bytes: 524288 +max_serialized_tx_effects_size_bytes_system_tx: 8388608 +max_gas_payment_objects: 256 +max_modules_in_publish: 64 +max_package_dependencies: 32 +max_arguments: 512 +max_type_arguments: 16 +max_type_argument_depth: 16 +max_pure_argument_size: 16384 +max_programmable_tx_commands: 1024 +move_binary_format_version: 6 +min_move_binary_format_version: 6 +binary_module_handles: 100 +binary_struct_handles: 300 +binary_function_handles: 1500 +binary_function_instantiations: 750 +binary_signatures: 1000 +binary_constant_pool: 4000 +binary_identifiers: 10000 +binary_address_identifiers: 100 +binary_struct_defs: 200 +binary_struct_def_instantiations: 100 +binary_function_defs: 1000 +binary_field_handles: 500 +binary_field_instantiations: 250 +binary_friend_decls: 100 +max_move_object_size: 256000 +max_move_package_size: 102400 +max_publish_or_upgrade_per_ptb: 5 +max_tx_gas: 50000000000 +max_gas_price: 100000 +max_gas_computation_bucket: 5000000 +gas_rounding_step: 1000 +max_loop_depth: 5 +max_generic_instantiation_length: 32 +max_function_parameters: 128 +max_basic_blocks: 1024 +max_value_stack_size: 1024 +max_type_nodes: 256 +max_push_size: 10000 +max_struct_definitions: 200 +max_function_definitions: 1000 +max_fields_in_struct: 32 +max_dependency_depth: 100 +max_num_event_emit: 1024 +max_num_new_move_object_ids: 2048 +max_num_new_move_object_ids_system_tx: 32768 +max_num_deleted_move_object_ids: 2048 +max_num_deleted_move_object_ids_system_tx: 32768 +max_num_transferred_move_object_ids: 2048 +max_num_transferred_move_object_ids_system_tx: 32768 +max_event_emit_size: 256000 +max_event_emit_size_total: 65536000 +max_move_vector_len: 262144 +max_move_identifier_len: 128 +max_move_value_depth: 128 +max_back_edges_per_function: 10000 +max_back_edges_per_module: 10000 +max_verifier_meter_ticks_per_function: 16000000 +max_meter_ticks_per_module: 16000000 +max_meter_ticks_per_package: 16000000 +object_runtime_max_num_cached_objects: 1000 +object_runtime_max_num_cached_objects_system_tx: 16000 +object_runtime_max_num_store_entries: 1000 +object_runtime_max_num_store_entries_system_tx: 16000 +base_tx_cost_fixed: 1000 +package_publish_cost_fixed: 1000 +base_tx_cost_per_byte: 0 +package_publish_cost_per_byte: 80 +obj_access_cost_read_per_byte: 15 +obj_access_cost_mutate_per_byte: 40 +obj_access_cost_delete_per_byte: 40 +obj_access_cost_verify_per_byte: 200 +gas_model_version: 8 +obj_data_cost_refundable: 100 +obj_metadata_cost_non_refundable: 50 +storage_rebate_rate: 9900 +storage_fund_reinvest_rate: 500 +reward_slashing_rate: 10000 +storage_gas_price: 76 +max_transactions_per_checkpoint: 10000 +max_checkpoint_size_bytes: 31457280 +buffer_stake_for_protocol_upgrade_bps: 5000 +address_from_bytes_cost_base: 52 +address_to_u256_cost_base: 52 +address_from_u256_cost_base: 52 +config_read_setting_impl_cost_base: 100 +config_read_setting_impl_cost_per_byte: 40 +dynamic_field_hash_type_and_key_cost_base: 100 +dynamic_field_hash_type_and_key_type_cost_per_byte: 2 +dynamic_field_hash_type_and_key_value_cost_per_byte: 2 +dynamic_field_hash_type_and_key_type_tag_cost_per_byte: 2 +dynamic_field_add_child_object_cost_base: 100 +dynamic_field_add_child_object_type_cost_per_byte: 10 +dynamic_field_add_child_object_value_cost_per_byte: 10 +dynamic_field_add_child_object_struct_tag_cost_per_byte: 10 +dynamic_field_borrow_child_object_cost_base: 100 +dynamic_field_borrow_child_object_child_ref_cost_per_byte: 10 +dynamic_field_borrow_child_object_type_cost_per_byte: 10 +dynamic_field_remove_child_object_cost_base: 100 +dynamic_field_remove_child_object_child_cost_per_byte: 2 +dynamic_field_remove_child_object_type_cost_per_byte: 2 +dynamic_field_has_child_object_cost_base: 100 +dynamic_field_has_child_object_with_ty_cost_base: 100 +dynamic_field_has_child_object_with_ty_type_cost_per_byte: 2 +dynamic_field_has_child_object_with_ty_type_tag_cost_per_byte: 2 +event_emit_cost_base: 52 +event_emit_value_size_derivation_cost_per_byte: 2 +event_emit_tag_size_derivation_cost_per_byte: 5 +event_emit_output_cost_per_byte: 10 +object_borrow_uid_cost_base: 52 +object_delete_impl_cost_base: 52 +object_record_new_uid_cost_base: 52 +transfer_transfer_internal_cost_base: 52 +transfer_freeze_object_cost_base: 52 +transfer_share_object_cost_base: 52 +transfer_receive_object_cost_base: 52 +tx_context_derive_id_cost_base: 52 +types_is_one_time_witness_cost_base: 52 +types_is_one_time_witness_type_tag_cost_per_byte: 2 +types_is_one_time_witness_type_cost_per_byte: 2 +validator_validate_metadata_cost_base: 52 +validator_validate_metadata_data_cost_per_byte: 2 +crypto_invalid_arguments_cost: 100 +bls12381_bls12381_min_sig_verify_cost_base: 52 +bls12381_bls12381_min_sig_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_sig_verify_msg_cost_per_block: 2 +bls12381_bls12381_min_pk_verify_cost_base: 52 +bls12381_bls12381_min_pk_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_pk_verify_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_keccak256_cost_base: 52 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_sha256_cost_base: 52 +ecdsa_k1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_k1_decompress_pubkey_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_k1_secp256k1_verify_sha256_cost_base: 52 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_keccak256_cost_base: 52 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_sha256_cost_base: 52 +ecdsa_r1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_keccak256_cost_base: 52 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_sha256_cost_base: 52 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_block: 2 +ecvrf_ecvrf_verify_cost_base: 52 +ecvrf_ecvrf_verify_alpha_string_cost_per_byte: 2 +ecvrf_ecvrf_verify_alpha_string_cost_per_block: 2 +ed25519_ed25519_verify_cost_base: 52 +ed25519_ed25519_verify_msg_cost_per_byte: 2 +ed25519_ed25519_verify_msg_cost_per_block: 2 +groth16_prepare_verifying_key_bls12381_cost_base: 52 +groth16_prepare_verifying_key_bn254_cost_base: 52 +groth16_verify_groth16_proof_internal_bls12381_cost_base: 52 +groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input: 2 +groth16_verify_groth16_proof_internal_bn254_cost_base: 52 +groth16_verify_groth16_proof_internal_bn254_cost_per_public_input: 2 +groth16_verify_groth16_proof_internal_public_input_cost_per_byte: 2 +hash_blake2b256_cost_base: 52 +hash_blake2b256_data_cost_per_byte: 2 +hash_blake2b256_data_cost_per_block: 2 +hash_keccak256_cost_base: 52 +hash_keccak256_data_cost_per_byte: 2 +hash_keccak256_data_cost_per_block: 2 +group_ops_bls12381_decode_scalar_cost: 52 +group_ops_bls12381_decode_g1_cost: 52 +group_ops_bls12381_decode_g2_cost: 52 +group_ops_bls12381_decode_gt_cost: 52 +group_ops_bls12381_scalar_add_cost: 52 +group_ops_bls12381_g1_add_cost: 52 +group_ops_bls12381_g2_add_cost: 52 +group_ops_bls12381_gt_add_cost: 52 +group_ops_bls12381_scalar_sub_cost: 52 +group_ops_bls12381_g1_sub_cost: 52 +group_ops_bls12381_g2_sub_cost: 52 +group_ops_bls12381_gt_sub_cost: 52 +group_ops_bls12381_scalar_mul_cost: 52 +group_ops_bls12381_g1_mul_cost: 52 +group_ops_bls12381_g2_mul_cost: 52 +group_ops_bls12381_gt_mul_cost: 52 +group_ops_bls12381_scalar_div_cost: 52 +group_ops_bls12381_g1_div_cost: 52 +group_ops_bls12381_g2_div_cost: 52 +group_ops_bls12381_gt_div_cost: 52 +group_ops_bls12381_g1_hash_to_base_cost: 52 +group_ops_bls12381_g2_hash_to_base_cost: 52 +group_ops_bls12381_g1_hash_to_cost_per_byte: 2 +group_ops_bls12381_g2_hash_to_cost_per_byte: 2 +group_ops_bls12381_g1_msm_base_cost: 52 +group_ops_bls12381_g2_msm_base_cost: 52 +group_ops_bls12381_g1_msm_base_cost_per_input: 52 +group_ops_bls12381_g2_msm_base_cost_per_input: 52 +group_ops_bls12381_msm_max_len: 32 +group_ops_bls12381_pairing_cost: 52 +hmac_hmac_sha3_256_cost_base: 52 +hmac_hmac_sha3_256_input_cost_per_byte: 2 +hmac_hmac_sha3_256_input_cost_per_block: 2 +check_zklogin_id_cost_base: 200 +check_zklogin_issuer_cost_base: 200 +scoring_decision_mad_divisor: 2.3 +scoring_decision_cutoff_value: 2.5 +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_dkg_version: 1 +consensus_max_transaction_size_bytes: 262144 +consensus_max_transactions_in_block_bytes: 6291456 +max_deferral_rounds_for_congestion_control: 10 +min_checkpoint_interval_ms: 200 +checkpoint_summary_version_specific_data: 1 +bridge_should_try_to_finalize_committee: false + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap new file mode 100644 index 0000000000000..12aebd0da3f6d --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap @@ -0,0 +1,292 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 53 +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 + 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 +max_tx_size_bytes: 131072 +max_input_objects: 2048 +max_size_written_objects: 5000000 +max_size_written_objects_system_tx: 50000000 +max_serialized_tx_effects_size_bytes: 524288 +max_serialized_tx_effects_size_bytes_system_tx: 8388608 +max_gas_payment_objects: 256 +max_modules_in_publish: 64 +max_package_dependencies: 32 +max_arguments: 512 +max_type_arguments: 16 +max_type_argument_depth: 16 +max_pure_argument_size: 16384 +max_programmable_tx_commands: 1024 +move_binary_format_version: 7 +min_move_binary_format_version: 6 +binary_module_handles: 100 +binary_struct_handles: 300 +binary_function_handles: 1500 +binary_function_instantiations: 750 +binary_signatures: 1000 +binary_constant_pool: 4000 +binary_identifiers: 10000 +binary_address_identifiers: 100 +binary_struct_defs: 200 +binary_struct_def_instantiations: 100 +binary_function_defs: 1000 +binary_field_handles: 500 +binary_field_instantiations: 250 +binary_friend_decls: 100 +max_move_object_size: 256000 +max_move_package_size: 102400 +max_publish_or_upgrade_per_ptb: 5 +max_tx_gas: 50000000000 +max_gas_price: 100000 +max_gas_computation_bucket: 5000000 +gas_rounding_step: 1000 +max_loop_depth: 5 +max_generic_instantiation_length: 32 +max_function_parameters: 128 +max_basic_blocks: 1024 +max_value_stack_size: 1024 +max_type_nodes: 256 +max_push_size: 10000 +max_struct_definitions: 200 +max_function_definitions: 1000 +max_fields_in_struct: 32 +max_dependency_depth: 100 +max_num_event_emit: 1024 +max_num_new_move_object_ids: 2048 +max_num_new_move_object_ids_system_tx: 32768 +max_num_deleted_move_object_ids: 2048 +max_num_deleted_move_object_ids_system_tx: 32768 +max_num_transferred_move_object_ids: 2048 +max_num_transferred_move_object_ids_system_tx: 32768 +max_event_emit_size: 256000 +max_event_emit_size_total: 65536000 +max_move_vector_len: 262144 +max_move_identifier_len: 128 +max_move_value_depth: 128 +max_back_edges_per_function: 10000 +max_back_edges_per_module: 10000 +max_verifier_meter_ticks_per_function: 16000000 +max_meter_ticks_per_module: 16000000 +max_meter_ticks_per_package: 16000000 +object_runtime_max_num_cached_objects: 1000 +object_runtime_max_num_cached_objects_system_tx: 16000 +object_runtime_max_num_store_entries: 1000 +object_runtime_max_num_store_entries_system_tx: 16000 +base_tx_cost_fixed: 1000 +package_publish_cost_fixed: 1000 +base_tx_cost_per_byte: 0 +package_publish_cost_per_byte: 80 +obj_access_cost_read_per_byte: 15 +obj_access_cost_mutate_per_byte: 40 +obj_access_cost_delete_per_byte: 40 +obj_access_cost_verify_per_byte: 200 +gas_model_version: 8 +obj_data_cost_refundable: 100 +obj_metadata_cost_non_refundable: 50 +storage_rebate_rate: 9900 +storage_fund_reinvest_rate: 500 +reward_slashing_rate: 10000 +storage_gas_price: 76 +max_transactions_per_checkpoint: 10000 +max_checkpoint_size_bytes: 31457280 +buffer_stake_for_protocol_upgrade_bps: 5000 +address_from_bytes_cost_base: 52 +address_to_u256_cost_base: 52 +address_from_u256_cost_base: 52 +config_read_setting_impl_cost_base: 100 +config_read_setting_impl_cost_per_byte: 40 +dynamic_field_hash_type_and_key_cost_base: 100 +dynamic_field_hash_type_and_key_type_cost_per_byte: 2 +dynamic_field_hash_type_and_key_value_cost_per_byte: 2 +dynamic_field_hash_type_and_key_type_tag_cost_per_byte: 2 +dynamic_field_add_child_object_cost_base: 100 +dynamic_field_add_child_object_type_cost_per_byte: 10 +dynamic_field_add_child_object_value_cost_per_byte: 10 +dynamic_field_add_child_object_struct_tag_cost_per_byte: 10 +dynamic_field_borrow_child_object_cost_base: 100 +dynamic_field_borrow_child_object_child_ref_cost_per_byte: 10 +dynamic_field_borrow_child_object_type_cost_per_byte: 10 +dynamic_field_remove_child_object_cost_base: 100 +dynamic_field_remove_child_object_child_cost_per_byte: 2 +dynamic_field_remove_child_object_type_cost_per_byte: 2 +dynamic_field_has_child_object_cost_base: 100 +dynamic_field_has_child_object_with_ty_cost_base: 100 +dynamic_field_has_child_object_with_ty_type_cost_per_byte: 2 +dynamic_field_has_child_object_with_ty_type_tag_cost_per_byte: 2 +event_emit_cost_base: 52 +event_emit_value_size_derivation_cost_per_byte: 2 +event_emit_tag_size_derivation_cost_per_byte: 5 +event_emit_output_cost_per_byte: 10 +object_borrow_uid_cost_base: 52 +object_delete_impl_cost_base: 52 +object_record_new_uid_cost_base: 52 +transfer_transfer_internal_cost_base: 52 +transfer_freeze_object_cost_base: 52 +transfer_share_object_cost_base: 52 +transfer_receive_object_cost_base: 52 +tx_context_derive_id_cost_base: 52 +types_is_one_time_witness_cost_base: 52 +types_is_one_time_witness_type_tag_cost_per_byte: 2 +types_is_one_time_witness_type_cost_per_byte: 2 +validator_validate_metadata_cost_base: 52 +validator_validate_metadata_data_cost_per_byte: 2 +crypto_invalid_arguments_cost: 100 +bls12381_bls12381_min_sig_verify_cost_base: 52 +bls12381_bls12381_min_sig_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_sig_verify_msg_cost_per_block: 2 +bls12381_bls12381_min_pk_verify_cost_base: 52 +bls12381_bls12381_min_pk_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_pk_verify_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_keccak256_cost_base: 52 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_sha256_cost_base: 52 +ecdsa_k1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_k1_decompress_pubkey_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_k1_secp256k1_verify_sha256_cost_base: 52 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_keccak256_cost_base: 52 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_sha256_cost_base: 52 +ecdsa_r1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_keccak256_cost_base: 52 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_sha256_cost_base: 52 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_block: 2 +ecvrf_ecvrf_verify_cost_base: 52 +ecvrf_ecvrf_verify_alpha_string_cost_per_byte: 2 +ecvrf_ecvrf_verify_alpha_string_cost_per_block: 2 +ed25519_ed25519_verify_cost_base: 52 +ed25519_ed25519_verify_msg_cost_per_byte: 2 +ed25519_ed25519_verify_msg_cost_per_block: 2 +groth16_prepare_verifying_key_bls12381_cost_base: 52 +groth16_prepare_verifying_key_bn254_cost_base: 52 +groth16_verify_groth16_proof_internal_bls12381_cost_base: 52 +groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input: 2 +groth16_verify_groth16_proof_internal_bn254_cost_base: 52 +groth16_verify_groth16_proof_internal_bn254_cost_per_public_input: 2 +groth16_verify_groth16_proof_internal_public_input_cost_per_byte: 2 +hash_blake2b256_cost_base: 52 +hash_blake2b256_data_cost_per_byte: 2 +hash_blake2b256_data_cost_per_block: 2 +hash_keccak256_cost_base: 52 +hash_keccak256_data_cost_per_byte: 2 +hash_keccak256_data_cost_per_block: 2 +group_ops_bls12381_decode_scalar_cost: 52 +group_ops_bls12381_decode_g1_cost: 52 +group_ops_bls12381_decode_g2_cost: 52 +group_ops_bls12381_decode_gt_cost: 52 +group_ops_bls12381_scalar_add_cost: 52 +group_ops_bls12381_g1_add_cost: 52 +group_ops_bls12381_g2_add_cost: 52 +group_ops_bls12381_gt_add_cost: 52 +group_ops_bls12381_scalar_sub_cost: 52 +group_ops_bls12381_g1_sub_cost: 52 +group_ops_bls12381_g2_sub_cost: 52 +group_ops_bls12381_gt_sub_cost: 52 +group_ops_bls12381_scalar_mul_cost: 52 +group_ops_bls12381_g1_mul_cost: 52 +group_ops_bls12381_g2_mul_cost: 52 +group_ops_bls12381_gt_mul_cost: 52 +group_ops_bls12381_scalar_div_cost: 52 +group_ops_bls12381_g1_div_cost: 52 +group_ops_bls12381_g2_div_cost: 52 +group_ops_bls12381_gt_div_cost: 52 +group_ops_bls12381_g1_hash_to_base_cost: 52 +group_ops_bls12381_g2_hash_to_base_cost: 52 +group_ops_bls12381_g1_hash_to_cost_per_byte: 2 +group_ops_bls12381_g2_hash_to_cost_per_byte: 2 +group_ops_bls12381_g1_msm_base_cost: 52 +group_ops_bls12381_g2_msm_base_cost: 52 +group_ops_bls12381_g1_msm_base_cost_per_input: 52 +group_ops_bls12381_g2_msm_base_cost_per_input: 52 +group_ops_bls12381_msm_max_len: 32 +group_ops_bls12381_pairing_cost: 52 +hmac_hmac_sha3_256_cost_base: 52 +hmac_hmac_sha3_256_input_cost_per_byte: 2 +hmac_hmac_sha3_256_input_cost_per_block: 2 +check_zklogin_id_cost_base: 200 +check_zklogin_issuer_cost_base: 200 +scoring_decision_mad_divisor: 2.3 +scoring_decision_cutoff_value: 2.5 +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: 1600 +random_beacon_dkg_timeout_round: 3000 +random_beacon_min_round_interval_ms: 200 +random_beacon_dkg_version: 1 +consensus_max_transaction_size_bytes: 262144 +consensus_max_transactions_in_block_bytes: 6291456 +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 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap new file mode 100644 index 0000000000000..07d831bf9ee1d --- /dev/null +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap @@ -0,0 +1,302 @@ +--- +source: crates/sui-protocol-config/src/lib.rs +expression: "ProtocolConfig::get_for_version(cur, *chain_id)" +--- +version: 53 +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 +max_tx_size_bytes: 131072 +max_input_objects: 2048 +max_size_written_objects: 5000000 +max_size_written_objects_system_tx: 50000000 +max_serialized_tx_effects_size_bytes: 524288 +max_serialized_tx_effects_size_bytes_system_tx: 8388608 +max_gas_payment_objects: 256 +max_modules_in_publish: 64 +max_package_dependencies: 32 +max_arguments: 512 +max_type_arguments: 16 +max_type_argument_depth: 16 +max_pure_argument_size: 16384 +max_programmable_tx_commands: 1024 +move_binary_format_version: 7 +min_move_binary_format_version: 6 +binary_module_handles: 100 +binary_struct_handles: 300 +binary_function_handles: 1500 +binary_function_instantiations: 750 +binary_signatures: 1000 +binary_constant_pool: 4000 +binary_identifiers: 10000 +binary_address_identifiers: 100 +binary_struct_defs: 200 +binary_struct_def_instantiations: 100 +binary_function_defs: 1000 +binary_field_handles: 500 +binary_field_instantiations: 250 +binary_friend_decls: 100 +max_move_object_size: 256000 +max_move_package_size: 102400 +max_publish_or_upgrade_per_ptb: 5 +max_tx_gas: 50000000000 +max_gas_price: 100000 +max_gas_computation_bucket: 5000000 +gas_rounding_step: 1000 +max_loop_depth: 5 +max_generic_instantiation_length: 32 +max_function_parameters: 128 +max_basic_blocks: 1024 +max_value_stack_size: 1024 +max_type_nodes: 256 +max_push_size: 10000 +max_struct_definitions: 200 +max_function_definitions: 1000 +max_fields_in_struct: 32 +max_dependency_depth: 100 +max_num_event_emit: 1024 +max_num_new_move_object_ids: 2048 +max_num_new_move_object_ids_system_tx: 32768 +max_num_deleted_move_object_ids: 2048 +max_num_deleted_move_object_ids_system_tx: 32768 +max_num_transferred_move_object_ids: 2048 +max_num_transferred_move_object_ids_system_tx: 32768 +max_event_emit_size: 256000 +max_event_emit_size_total: 65536000 +max_move_vector_len: 262144 +max_move_identifier_len: 128 +max_move_value_depth: 128 +max_back_edges_per_function: 10000 +max_back_edges_per_module: 10000 +max_verifier_meter_ticks_per_function: 16000000 +max_meter_ticks_per_module: 16000000 +max_meter_ticks_per_package: 16000000 +object_runtime_max_num_cached_objects: 1000 +object_runtime_max_num_cached_objects_system_tx: 16000 +object_runtime_max_num_store_entries: 1000 +object_runtime_max_num_store_entries_system_tx: 16000 +base_tx_cost_fixed: 1000 +package_publish_cost_fixed: 1000 +base_tx_cost_per_byte: 0 +package_publish_cost_per_byte: 80 +obj_access_cost_read_per_byte: 15 +obj_access_cost_mutate_per_byte: 40 +obj_access_cost_delete_per_byte: 40 +obj_access_cost_verify_per_byte: 200 +gas_model_version: 8 +obj_data_cost_refundable: 100 +obj_metadata_cost_non_refundable: 50 +storage_rebate_rate: 9900 +storage_fund_reinvest_rate: 500 +reward_slashing_rate: 10000 +storage_gas_price: 76 +max_transactions_per_checkpoint: 10000 +max_checkpoint_size_bytes: 31457280 +buffer_stake_for_protocol_upgrade_bps: 5000 +address_from_bytes_cost_base: 52 +address_to_u256_cost_base: 52 +address_from_u256_cost_base: 52 +config_read_setting_impl_cost_base: 100 +config_read_setting_impl_cost_per_byte: 40 +dynamic_field_hash_type_and_key_cost_base: 100 +dynamic_field_hash_type_and_key_type_cost_per_byte: 2 +dynamic_field_hash_type_and_key_value_cost_per_byte: 2 +dynamic_field_hash_type_and_key_type_tag_cost_per_byte: 2 +dynamic_field_add_child_object_cost_base: 100 +dynamic_field_add_child_object_type_cost_per_byte: 10 +dynamic_field_add_child_object_value_cost_per_byte: 10 +dynamic_field_add_child_object_struct_tag_cost_per_byte: 10 +dynamic_field_borrow_child_object_cost_base: 100 +dynamic_field_borrow_child_object_child_ref_cost_per_byte: 10 +dynamic_field_borrow_child_object_type_cost_per_byte: 10 +dynamic_field_remove_child_object_cost_base: 100 +dynamic_field_remove_child_object_child_cost_per_byte: 2 +dynamic_field_remove_child_object_type_cost_per_byte: 2 +dynamic_field_has_child_object_cost_base: 100 +dynamic_field_has_child_object_with_ty_cost_base: 100 +dynamic_field_has_child_object_with_ty_type_cost_per_byte: 2 +dynamic_field_has_child_object_with_ty_type_tag_cost_per_byte: 2 +event_emit_cost_base: 52 +event_emit_value_size_derivation_cost_per_byte: 2 +event_emit_tag_size_derivation_cost_per_byte: 5 +event_emit_output_cost_per_byte: 10 +object_borrow_uid_cost_base: 52 +object_delete_impl_cost_base: 52 +object_record_new_uid_cost_base: 52 +transfer_transfer_internal_cost_base: 52 +transfer_freeze_object_cost_base: 52 +transfer_share_object_cost_base: 52 +transfer_receive_object_cost_base: 52 +tx_context_derive_id_cost_base: 52 +types_is_one_time_witness_cost_base: 52 +types_is_one_time_witness_type_tag_cost_per_byte: 2 +types_is_one_time_witness_type_cost_per_byte: 2 +validator_validate_metadata_cost_base: 52 +validator_validate_metadata_data_cost_per_byte: 2 +crypto_invalid_arguments_cost: 100 +bls12381_bls12381_min_sig_verify_cost_base: 52 +bls12381_bls12381_min_sig_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_sig_verify_msg_cost_per_block: 2 +bls12381_bls12381_min_pk_verify_cost_base: 52 +bls12381_bls12381_min_pk_verify_msg_cost_per_byte: 2 +bls12381_bls12381_min_pk_verify_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_keccak256_cost_base: 52 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_k1_ecrecover_sha256_cost_base: 52 +ecdsa_k1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_k1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_k1_decompress_pubkey_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_cost_base: 52 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_k1_secp256k1_verify_sha256_cost_base: 52 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_k1_secp256k1_verify_sha256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_keccak256_cost_base: 52 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_keccak256_msg_cost_per_block: 2 +ecdsa_r1_ecrecover_sha256_cost_base: 52 +ecdsa_r1_ecrecover_sha256_msg_cost_per_byte: 2 +ecdsa_r1_ecrecover_sha256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_keccak256_cost_base: 52 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_keccak256_msg_cost_per_block: 2 +ecdsa_r1_secp256r1_verify_sha256_cost_base: 52 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_byte: 2 +ecdsa_r1_secp256r1_verify_sha256_msg_cost_per_block: 2 +ecvrf_ecvrf_verify_cost_base: 52 +ecvrf_ecvrf_verify_alpha_string_cost_per_byte: 2 +ecvrf_ecvrf_verify_alpha_string_cost_per_block: 2 +ed25519_ed25519_verify_cost_base: 52 +ed25519_ed25519_verify_msg_cost_per_byte: 2 +ed25519_ed25519_verify_msg_cost_per_block: 2 +groth16_prepare_verifying_key_bls12381_cost_base: 52 +groth16_prepare_verifying_key_bn254_cost_base: 52 +groth16_verify_groth16_proof_internal_bls12381_cost_base: 52 +groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input: 2 +groth16_verify_groth16_proof_internal_bn254_cost_base: 52 +groth16_verify_groth16_proof_internal_bn254_cost_per_public_input: 2 +groth16_verify_groth16_proof_internal_public_input_cost_per_byte: 2 +hash_blake2b256_cost_base: 52 +hash_blake2b256_data_cost_per_byte: 2 +hash_blake2b256_data_cost_per_block: 2 +hash_keccak256_cost_base: 52 +hash_keccak256_data_cost_per_byte: 2 +hash_keccak256_data_cost_per_block: 2 +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 +scoring_decision_mad_divisor: 2.3 +scoring_decision_cutoff_value: 2.5 +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: 1600 +random_beacon_dkg_timeout_round: 3000 +random_beacon_min_round_interval_ms: 200 +random_beacon_dkg_version: 1 +consensus_max_transaction_size_bytes: 262144 +consensus_max_transactions_in_block_bytes: 6291456 +max_accumulated_txn_cost_per_object_in_checkpoint: 100 +max_deferral_rounds_for_congestion_control: 10 +min_checkpoint_interval_ms: 200 +checkpoint_summary_version_specific_data: 1 +max_soft_bundle_size: 5 +bridge_should_try_to_finalize_committee: true + 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 ffa8e0a9f3fcf..efd127f0aa8f0 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: 52 + protocol_version: 53 allow_insertion_of_extra_objects: true epoch_duration_ms: 86400000 stake_subsidy_start_epoch: 0 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 1a36da8c67c4d..f6754250664f3 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: 52 +protocol_version: 53 system_state_version: 1 validators: total_stake: 20000000000000000 @@ -240,13 +240,13 @@ validators: next_epoch_worker_address: ~ extra_fields: id: - id: "0x9b1e8b1a15ccd17c09ae424fc47a14f716373b08269e1c1e598cadec2e07240b" + id: "0x68e2fb2256436f2df5a9410d9e219b97eaa5765cabd2969c23d8083836a5ba79" size: 0 voting_power: 10000 - operation_cap_id: "0x6e28694371b8e2c3f36681a4b938b2a2d7281a9461bccba1fd11d901ce8bc001" + operation_cap_id: "0x9af5ab9c8057218b799125d1b5cbaeb044b585ff66bd3e944a28a23f2873333e" gas_price: 1000 staking_pool: - id: "0xc927ee6a889965f9690090b29ca298a6d1fbf8d57bcbe02d34c283ab5474ec39" + id: "0x872082092168ee3579ef4abe820d2dc56b6b1ceab95f4c894bde019aa229dccb" activation_epoch: 0 deactivation_epoch: ~ sui_balance: 20000000000000000 @@ -254,14 +254,14 @@ validators: value: 0 pool_token_balance: 20000000000000000 exchange_rates: - id: "0xf0955c636b47d9ba39c0dcafb9ad965d89de3130f3f8d85396b6a1ea56f9ce1c" + id: "0x7b6a8b50a9137072addd7c6751d40f60695ca6095f37620642c6c8d108319abb" size: 1 pending_stake: 0 pending_total_sui_withdraw: 0 pending_pool_token_withdraw: 0 extra_fields: id: - id: "0x4e46b841cc00ff236d0c67cd1de9dcce455e64415d4a8930c619e4a0d12ba51f" + id: "0x294aab97d986bc780637eab36f9d840a1dcc5c386cc5b1fe426a2057d6d918b5" size: 0 commission_rate: 200 next_epoch_stake: 20000000000000000 @@ -269,27 +269,27 @@ validators: next_epoch_commission_rate: 200 extra_fields: id: - id: "0xfef9d3595af515df663174cf3ee9ecef9cef89bdb909892140150af1ddecfb02" + id: "0xbe42bcfc164349cc63f5793998d8fdced1c3c270b44b39f20a7f6c07d9911533" size: 0 pending_active_validators: contents: - id: "0x9c9703b0156037363e47a1341019b14aa3cdc8e1252bf73a7254258906710019" + id: "0x2669d3abbacd114f098a6d9beb9e58be32156043cc4a9106d9c3e6ec8ef465f0" size: 0 pending_removals: [] staking_pool_mappings: - id: "0x2a2847658bdaa311e2efa462a848274be34447a35c1df4e525f3f52dc7a6c0fd" + id: "0x8a232136668f3855addb49f6b94382511fa2d9b43e6bb1facfccca20b763fa2b" size: 1 inactive_validators: - id: "0xbb254ad1bbd8fd7d19cbe93ddc57753bb638c7c5d57d18bbf0fc8613bcca022e" + id: "0xbadbf4e81386838963b4cd6dbc0f7ccf674483b29f2fb9cbdf8f777bc54bd411" size: 0 validator_candidates: - id: "0xb5088156c17c3345b93b528970280b30f9712b1c14c89b7c37bfff962a638cda" + id: "0x20466198424f3999e695e1de69ce4717a1e9ea2a35470c1c4d0dc4aff0a4e17e" size: 0 at_risk_validators: contents: [] extra_fields: id: - id: "0xeaa05e04d4c7ba6c54c9980b3496cd7e741451732b6c2b8f39d7d02e7bdcfe5f" + id: "0x0ca591b7872ccc03715ea3acba3e36dcf7d92bf016bc7f6b270e94424508cb83" size: 0 storage_fund: total_object_storage_rebates: @@ -306,7 +306,7 @@ parameters: validator_low_stake_grace_period: 7 extra_fields: id: - id: "0x872127d0b69e8d603bc3f3f90fec0135b2302e05232f5b0d0725adb3ea2e291c" + id: "0x1790455a80f35cd81783a20e3cb078b7fc6f8d6feb4825c4d23577ea7a38682d" size: 0 reference_gas_price: 1000 validator_report_records: @@ -320,7 +320,7 @@ stake_subsidy: stake_subsidy_decrease_rate: 1000 extra_fields: id: - id: "0x61942a1be2a46e69ab0ee34a6b527b07535edc2ffc44dcb449955cbae3162bd6" + id: "0x6b15ef4e5abf6d83d7689d748c6e235749e9500ad456af501740a05fa8e86660" size: 0 safe_mode: false safe_mode_storage_rewards: @@ -332,6 +332,6 @@ safe_mode_non_refundable_storage_fee: 0 epoch_start_timestamp_ms: 10 extra_fields: id: - id: "0xc6f265d024184f8afe7d510f675a0424874492c52a83b924149e0974a704d446" + id: "0x3a28788f0c093f4750c2f1766056930b486fd6154073e4fb69358d0f3296e523" size: 0 diff --git a/sdk/graphql-transport/src/methods.ts b/sdk/graphql-transport/src/methods.ts index 412284be0e7f1..8957d70289e53 100644 --- a/sdk/graphql-transport/src/methods.ts +++ b/sdk/graphql-transport/src/methods.ts @@ -1361,6 +1361,7 @@ export const RPC_METHODS: { binary_field_instantiations: 'u16', binary_friend_decls: 'u16', max_package_dependencies: 'u32', + bridge_should_try_to_finalize_committee: 'bool', }; for (const { key, value } of protocolConfig.configs) { From 2a55a068d89851214016d28f64efd33b24fb1401 Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:13:54 -0700 Subject: [PATCH 057/163] Add tic-tac-toe example to workspace (#18616) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- examples/tic-tac-toe/ui/README.md | 4 +- examples/tic-tac-toe/ui/index.html | 104 +- examples/tic-tac-toe/ui/package.json | 74 +- examples/tic-tac-toe/ui/pnpm-lock.yaml | 4523 ----------------- examples/tic-tac-toe/ui/prettier.config.cjs | 6 - examples/tic-tac-toe/ui/src/App.tsx | 2 +- .../ui/src/components/NewMultiSigGame.tsx | 2 +- examples/tic-tac-toe/ui/src/env.devnet.ts | 4 +- examples/tic-tac-toe/ui/src/env.localnet.ts | 4 +- examples/tic-tac-toe/ui/src/env.mainnet.ts | 4 +- examples/tic-tac-toe/ui/src/env.testnet.ts | 4 +- .../tic-tac-toe/ui/src/hooks/useGameQuery.ts | 4 +- .../ui/src/hooks/useObjectQuery.ts | 4 +- .../ui/src/hooks/useTrophyQuery.ts | 5 +- examples/tic-tac-toe/ui/src/pages/Game.tsx | 12 +- examples/tic-tac-toe/ui/tsconfig.json | 44 +- examples/tic-tac-toe/ui/tsconfig.node.json | 16 +- examples/tic-tac-toe/ui/vite.config.ts | 8 +- pnpm-lock.yaml | 191 +- pnpm-workspace.yaml | 1 - sdk/typescript/test/e2e/object-vector.test.ts | 13 +- 21 files changed, 296 insertions(+), 4733 deletions(-) delete mode 100644 examples/tic-tac-toe/ui/pnpm-lock.yaml delete mode 100644 examples/tic-tac-toe/ui/prettier.config.cjs diff --git a/examples/tic-tac-toe/ui/README.md b/examples/tic-tac-toe/ui/README.md index e5c99538405ae..1b7059fc22d37 100644 --- a/examples/tic-tac-toe/ui/README.md +++ b/examples/tic-tac-toe/ui/README.md @@ -6,8 +6,8 @@ owned objects and multi-sigs functionality. This part of the demo illustrates how to: -- Set-up an application to interact with a blockchain, using the Sui - TypeScript SDK and dApp-kit, including deploying its Move packages. +- Set-up an application to interact with a blockchain, using the Sui TypeScript + SDK and dApp-kit, including deploying its Move packages. - Build UIs that represent on-chain data, and update in response to running transactions. - Interact with multi-sig accounts. diff --git a/examples/tic-tac-toe/ui/index.html b/examples/tic-tac-toe/ui/index.html index c8cc615bf2590..6faa0408d168f 100644 --- a/examples/tic-tac-toe/ui/index.html +++ b/examples/tic-tac-toe/ui/index.html @@ -1,59 +1,59 @@ - - - - - Tic Tac Toe + + + + + Tic Tac Toe - - - -
- - + *, + *::before, + *::after { + box-sizing: border-box; + } + * { + margin: 0; + } + body { + line-height: 1.5; + -webkit-font-smoothing: antialiased; + } + img, + picture, + video, + canvas, + svg { + display: block; + max-width: 100%; + } + input, + button, + textarea, + select { + font: inherit; + } + p, + h1, + h2, + h3, + h4, + h5, + h6 { + overflow-wrap: break-word; + } + #root, + #__next { + isolation: isolate; + } + + + +
+ + diff --git a/examples/tic-tac-toe/ui/package.json b/examples/tic-tac-toe/ui/package.json index 06c528cfb551b..7e89ad6677b2a 100644 --- a/examples/tic-tac-toe/ui/package.json +++ b/examples/tic-tac-toe/ui/package.json @@ -1,39 +1,39 @@ { - "name": "tic-tac-toe", - "private": true, - "version": "0.0.0", - "type": "module", - "license": "Apache-2.0", - "scripts": { - "dev": "vite", - "build": "tsc && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" - }, - "dependencies": { - "@mysten/dapp-kit": "0.14.9", - "@mysten/sui": "1.1.2", - "@radix-ui/colors": "^3.0.0", - "@radix-ui/react-icons": "^1.3.0", - "@radix-ui/themes": "^3.0.0", - "@tanstack/react-query": "^5.0.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-hot-toast": "^2.4.1" - }, - "devDependencies": { - "@tanstack/react-query-devtools": "^5.0.0", - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7", - "@typescript-eslint/eslint-plugin": "^6.1.0", - "@typescript-eslint/parser": "^6.1.0", - "@vitejs/plugin-react-swc": "^3.3.2", - "eslint": "^8.45.0", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.3", - "prettier": "^3.0.0", - "typescript": "^5.3.3", - "vite": "^4.4.4", - "vite-tsconfig-paths": "^4.3.2" - } + "name": "tic-tac-toe", + "private": true, + "version": "0.0.0", + "type": "module", + "license": "Apache-2.0", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" + }, + "dependencies": { + "@mysten/dapp-kit": "workspace:*", + "@mysten/sui": "workspace:*", + "@radix-ui/colors": "^3.0.0", + "@radix-ui/react-icons": "^1.3.0", + "@radix-ui/themes": "^3.1.1", + "@tanstack/react-query": "^5.50.1", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-hot-toast": "^2.4.1" + }, + "devDependencies": { + "@tanstack/react-query-devtools": "^5.0.0", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^6.1.0", + "@typescript-eslint/parser": "^6.1.0", + "@vitejs/plugin-react-swc": "^3.7.0", + "eslint": "^8.45.0", + "eslint-plugin-react-hooks": "^4.6.2", + "eslint-plugin-react-refresh": "^0.4.7", + "prettier": "^3.3.2", + "typescript": "^5.5.3", + "vite": "^5.3.3", + "vite-tsconfig-paths": "^4.3.2" + } } diff --git a/examples/tic-tac-toe/ui/pnpm-lock.yaml b/examples/tic-tac-toe/ui/pnpm-lock.yaml deleted file mode 100644 index 48e4c3dbb2555..0000000000000 --- a/examples/tic-tac-toe/ui/pnpm-lock.yaml +++ /dev/null @@ -1,4523 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@mysten/dapp-kit': - specifier: 0.14.9 - version: 0.14.9(@tanstack/react-query@5.40.0(react@18.3.1))(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(svelte@4.2.17)(typescript@5.4.5) - '@mysten/sui': - specifier: 1.1.2 - version: 1.1.2(svelte@4.2.17)(typescript@5.4.5) - '@radix-ui/colors': - specifier: ^3.0.0 - version: 3.0.0 - '@radix-ui/react-icons': - specifier: ^1.3.0 - version: 1.3.0(react@18.3.1) - '@radix-ui/themes': - specifier: ^3.0.0 - version: 3.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@tanstack/react-query': - specifier: ^5.0.0 - version: 5.40.0(react@18.3.1) - react: - specifier: ^18.2.0 - version: 18.3.1 - react-dom: - specifier: ^18.2.0 - version: 18.3.1(react@18.3.1) - react-hot-toast: - specifier: ^2.4.1 - version: 2.4.1(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - devDependencies: - '@tanstack/react-query-devtools': - specifier: ^5.0.0 - version: 5.49.2(@tanstack/react-query@5.40.0(react@18.3.1))(react@18.3.1) - '@types/react': - specifier: ^18.2.15 - version: 18.3.3 - '@types/react-dom': - specifier: ^18.2.7 - version: 18.3.0 - '@typescript-eslint/eslint-plugin': - specifier: ^6.1.0 - version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': - specifier: ^6.1.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.4.5) - '@vitejs/plugin-react-swc': - specifier: ^3.3.2 - version: 3.7.0(vite@4.5.3) - eslint: - specifier: ^8.45.0 - version: 8.57.0 - eslint-plugin-react-hooks: - specifier: ^4.6.0 - version: 4.6.2(eslint@8.57.0) - eslint-plugin-react-refresh: - specifier: ^0.4.3 - version: 0.4.7(eslint@8.57.0) - prettier: - specifier: ^3.0.0 - version: 3.2.5 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - vite: - specifier: ^4.4.4 - version: 4.5.3 - vite-tsconfig-paths: - specifier: ^4.3.2 - version: 4.3.2(typescript@5.4.5)(vite@4.5.3) - -packages: - - '@0no-co/graphql.web@1.0.7': - resolution: {integrity: sha512-E3Qku4mTzdrlwVWGPxklDnME5ANrEGetvYw4i2GCRlppWXXE4QD66j7pwb8HelZwS6LnqEChhrSOGCXpbiu6MQ==} - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 - peerDependenciesMeta: - graphql: - optional: true - - '@0no-co/graphqlsp@1.12.5': - resolution: {integrity: sha512-YS9s8sf3XLaVdBt33u1mbUdfUSLiarQW1SFd3ITh2CLWz1nVnVTN0oCrpepuFHUJ7rt+b6Gk14sgjP4ONdeZfQ==} - peerDependencies: - graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 - typescript: ^5.0.0 - - '@ampproject/remapping@2.3.0': - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} - engines: {node: '>=6.0.0'} - - '@babel/helper-string-parser@7.24.6': - resolution: {integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.24.6': - resolution: {integrity: sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.24.6': - resolution: {integrity: sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/runtime@7.24.6': - resolution: {integrity: sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.24.6': - resolution: {integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==} - engines: {node: '>=6.9.0'} - - '@emotion/hash@0.9.1': - resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} - - '@esbuild/android-arm64@0.18.20': - resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm@0.18.20': - resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - - '@esbuild/android-x64@0.18.20': - resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - - '@esbuild/darwin-arm64@0.18.20': - resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-x64@0.18.20': - resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - - '@esbuild/freebsd-arm64@0.18.20': - resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.18.20': - resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - - '@esbuild/linux-arm64@0.18.20': - resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm@0.18.20': - resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.18.20': - resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-loong64@0.18.20': - resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-mips64el@0.18.20': - resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-ppc64@0.18.20': - resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-riscv64@0.18.20': - resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-s390x@0.18.20': - resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-x64@0.18.20': - resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - - '@esbuild/netbsd-x64@0.18.20': - resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - - '@esbuild/openbsd-x64@0.18.20': - resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - - '@esbuild/sunos-x64@0.18.20': - resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - - '@esbuild/win32-arm64@0.18.20': - resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-ia32@0.18.20': - resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-x64@0.18.20': - resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - - '@eslint-community/regexpp@4.10.0': - resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - '@eslint/js@8.57.0': - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - '@floating-ui/core@1.6.2': - resolution: {integrity: sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==} - - '@floating-ui/dom@1.6.5': - resolution: {integrity: sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==} - - '@floating-ui/react-dom@2.1.0': - resolution: {integrity: sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==} - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' - - '@floating-ui/utils@0.2.2': - resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} - - '@gql.tada/cli-utils@1.3.9': - resolution: {integrity: sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==} - peerDependencies: - graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 - typescript: ^5.0.0 - - '@gql.tada/internal@1.0.0': - resolution: {integrity: sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==} - peerDependencies: - graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 - typescript: ^5.0.0 - - '@graphql-typed-document-node/core@3.2.0': - resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - - '@humanwhocodes/config-array@0.11.14': - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} - - '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} - engines: {node: '>=6.0.0'} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} - - '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - - '@mysten/bcs@1.0.2': - resolution: {integrity: sha512-haHT0km/9yIIe8lwo8gDFxGLnoxfRF4WmEVCz4lDXbEVQRsZkF0zB97kukiwMjDuFBaGVUhrOMCLz6td8tSMaQ==} - - '@mysten/dapp-kit@0.14.9': - resolution: {integrity: sha512-QatDVBkstuYpKw7mXgeyzXfTzHUAqE9KLhHrD/hcX/zkJ7e2x7XFZbbFQzr7PU6IYuuswAE+aemQEiQoRDiwww==} - peerDependencies: - '@tanstack/react-query': ^5.0.0 - react: '*' - - '@mysten/sui@1.1.2': - resolution: {integrity: sha512-S1MfGvbkUxKGd39bfA6G21UVwJSSgJW8uKHinSByjt86+YKvSZxlF5zr6RVKcP4Rn8gl5ytMbZQfCPn+0nuGTg==} - engines: {node: '>=18'} - - '@mysten/wallet-standard@0.12.9': - resolution: {integrity: sha512-7UDiu11VkA8phWf/EVjZMSQqqQ6KzaZGr5OiqG1RsbrnVmAz3DApNLxHbBiH3rOJZL8CG0c+V6mHlenCVLrSDg==} - - '@mysten/zksend@0.9.9': - resolution: {integrity: sha512-8xUz4Alz4s8c0p36AlHiGzJkiedYK1CjZG5FojEoZY7v3Vu+0nvOIjS9fixCTGlUGHvBKpQuIKuuX3bEl6XESA==} - - '@noble/curves@1.4.0': - resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} - - '@noble/hashes@1.4.0': - resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} - engines: {node: '>= 16'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@radix-ui/colors@3.0.0': - resolution: {integrity: sha512-FUOsGBkHrYJwCSEtWRCIfQbZG7q1e6DgxCIOe1SUQzDe/7rXXeA47s8yCn6fuTNQAj1Zq4oTFi9Yjp3wzElcxg==} - - '@radix-ui/number@1.1.0': - resolution: {integrity: sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==} - - '@radix-ui/primitive@1.0.1': - resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==} - - '@radix-ui/primitive@1.1.0': - resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} - - '@radix-ui/react-accessible-icon@1.1.0': - resolution: {integrity: sha512-i9Zg4NOSXlfUva0agzI2DjWrvFJm9uO4L6CMW7nmMa5CIOOX/Yin894W7WwjodFQWPwe5kmAJ4JF33R8slKI2g==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-alert-dialog@1.1.1': - resolution: {integrity: sha512-wmCoJwj7byuVuiLKqDLlX7ClSUU0vd9sdCeM+2Ls+uf13+cpSJoMgwysHq1SGVVkJj5Xn0XWi1NoRCdkMpr6Mw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-arrow@1.0.3': - resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-arrow@1.1.0': - resolution: {integrity: sha512-FmlW1rCg7hBpEBwFbjHwCW6AmWLQM6g/v0Sn8XbP9NvmSZ2San1FpQeyPtufzOMSIx7Y4dzjlHoifhp+7NkZhw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-aspect-ratio@1.1.0': - resolution: {integrity: sha512-dP87DM/Y7jFlPgUZTlhx6FF5CEzOiaxp2rBCKlaXlpH5Ip/9Fg5zZ9lDOQ5o/MOfUlf36eak14zoWYpgcgGoOg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-avatar@1.1.0': - resolution: {integrity: sha512-Q/PbuSMk/vyAd/UoIShVGZ7StHHeRFYU7wXmi5GV+8cLXflZAEpHL/F697H1klrzxKXNtZ97vWiC0q3RKUH8UA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-checkbox@1.1.0': - resolution: {integrity: sha512-3+kSzVfMONtP3B6CvaOrXLVTyGYws7tGmG5kOY0AfyH9sexkLytIwciNwjZhY0RoGOEbxI7bMS21XYB8H5itWQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-collection@1.0.3': - resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-collection@1.1.0': - resolution: {integrity: sha512-GZsZslMJEyo1VKm5L1ZJY8tGDxZNPAoUeQUIbKeJfoi7Q4kmig5AsgLMYYuyYbfjd8fBmFORAIwYAkXMnXZgZw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-compose-refs@1.0.1': - resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-compose-refs@1.1.0': - resolution: {integrity: sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-context-menu@2.2.1': - resolution: {integrity: sha512-wvMKKIeb3eOrkJ96s722vcidZ+2ZNfcYZWBPRHIB1VWrF+fiF851Io6LX0kmK5wTDQFKdulCCKJk2c3SBaQHvA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-context@1.0.1': - resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-context@1.1.0': - resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-dialog@1.0.5': - resolution: {integrity: sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-dialog@1.1.1': - resolution: {integrity: sha512-zysS+iU4YP3STKNS6USvFVqI4qqx8EpiwmT5TuCApVEBca+eRCbONi4EgzfNSuVnOXvC5UPHHMjs8RXO6DH9Bg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-direction@1.0.1': - resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-direction@1.1.0': - resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-dismissable-layer@1.0.5': - resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-dismissable-layer@1.1.0': - resolution: {integrity: sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-dropdown-menu@2.0.6': - resolution: {integrity: sha512-i6TuFOoWmLWq+M/eCLGd/bQ2HfAX1RJgvrBQ6AQLmzfvsLdefxbWu8G9zczcPFfcSPehz9GcpF6K9QYreFV8hA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-dropdown-menu@2.1.1': - resolution: {integrity: sha512-y8E+x9fBq9qvteD2Zwa4397pUVhYsh9iq44b5RD5qu1GMJWBCBuVg1hMyItbc6+zH00TxGRqd9Iot4wzf3OoBQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-focus-guards@1.0.1': - resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-focus-guards@1.1.0': - resolution: {integrity: sha512-w6XZNUPVv6xCpZUqb/yN9DL6auvpGX3C/ee6Hdi16v2UUy25HV2Q5bcflsiDyT/g5RwbPQ/GIT1vLkeRb+ITBw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-focus-scope@1.0.4': - resolution: {integrity: sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-focus-scope@1.1.0': - resolution: {integrity: sha512-200UD8zylvEyL8Bx+z76RJnASR2gRMuxlgFCPAe/Q/679a/r0eK3MBVYMb7vZODZcffZBdob1EGnky78xmVvcA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-form@0.1.0': - resolution: {integrity: sha512-1/oVYPDjbFILOLIarcGcMKo+y6SbTVT/iUKVEw59CF4offwZgBgC3ZOeSBewjqU0vdA6FWTPWTN63obj55S/tQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-hover-card@1.1.1': - resolution: {integrity: sha512-IwzAOP97hQpDADYVKrEEHUH/b2LA+9MgB0LgdmnbFO2u/3M5hmEofjjr2M6CyzUblaAqJdFm6B7oFtU72DPXrA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-icons@1.3.0': - resolution: {integrity: sha512-jQxj/0LKgp+j9BiTXz3O3sgs26RNet2iLWmsPyRz2SIcR4q/4SbazXfnYwbAr+vLYKSfc7qxzyGQA1HLlYiuNw==} - peerDependencies: - react: ^16.x || ^17.x || ^18.x - - '@radix-ui/react-id@1.0.1': - resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-id@1.1.0': - resolution: {integrity: sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-label@2.1.0': - resolution: {integrity: sha512-peLblDlFw/ngk3UWq0VnYaOLy6agTZZ+MUO/WhVfm14vJGML+xH4FAl2XQGLqdefjNb7ApRg6Yn7U42ZhmYXdw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-menu@2.0.6': - resolution: {integrity: sha512-BVkFLS+bUC8HcImkRKPSiVumA1VPOOEC5WBMiT+QAVsPzW1FJzI9KnqgGxVDPBcql5xXrHkD3JOVoXWEXD8SYA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-menu@2.1.1': - resolution: {integrity: sha512-oa3mXRRVjHi6DZu/ghuzdylyjaMXLymx83irM7hTxutQbD+7IhPKdMdRHD26Rm+kHRrWcrUkkRPv5pd47a2xFQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-navigation-menu@1.2.0': - resolution: {integrity: sha512-OQ8tcwAOR0DhPlSY3e4VMXeHiol7la4PPdJWhhwJiJA+NLX0SaCaonOkRnI3gCDHoZ7Fo7bb/G6q25fRM2Y+3Q==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-popover@1.1.1': - resolution: {integrity: sha512-3y1A3isulwnWhvTTwmIreiB8CF4L+qRjZnK1wYLO7pplddzXKby/GnZ2M7OZY3qgnl6p9AodUIHRYGXNah8Y7g==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-popper@1.1.3': - resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-popper@1.2.0': - resolution: {integrity: sha512-ZnRMshKF43aBxVWPWvbj21+7TQCvhuULWJ4gNIKYpRlQt5xGRhLx66tMp8pya2UkGHTSlhpXwmjqltDYHhw7Vg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-portal@1.0.4': - resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-portal@1.1.1': - resolution: {integrity: sha512-A3UtLk85UtqhzFqtoC8Q0KvR2GbXF3mtPgACSazajqq6A41mEQgo53iPzY4i6BwDxlIFqWIhiQ2G729n+2aw/g==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-presence@1.0.1': - resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-presence@1.1.0': - resolution: {integrity: sha512-Gq6wuRN/asf9H/E/VzdKoUtT8GC9PQc9z40/vEr0VCJ4u5XvvhWIrSsCB6vD2/cH7ugTdSfYq9fLJCcM00acrQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-primitive@1.0.3': - resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-primitive@2.0.0': - resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-progress@1.1.0': - resolution: {integrity: sha512-aSzvnYpP725CROcxAOEBVZZSIQVQdHgBr2QQFKySsaD14u8dNT0batuXI+AAGDdAHfXH8rbnHmjYFqVJ21KkRg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-radio-group@1.2.0': - resolution: {integrity: sha512-yv+oiLaicYMBpqgfpSPw6q+RyXlLdIpQWDHZbUKURxe+nEh53hFXPPlfhfQQtYkS5MMK/5IWIa76SksleQZSzw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-roving-focus@1.0.4': - resolution: {integrity: sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-roving-focus@1.1.0': - resolution: {integrity: sha512-EA6AMGeq9AEeQDeSH0aZgG198qkfHSbvWTf1HvoDmOB5bBG/qTxjYMWUKMnYiV6J/iP/J8MEFSuB2zRU2n7ODA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-scroll-area@1.1.0': - resolution: {integrity: sha512-9ArIZ9HWhsrfqS765h+GZuLoxaRHD/j0ZWOWilsCvYTpYJp8XwCqNG7Dt9Nu/TItKOdgLGkOPCodQvDc+UMwYg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-select@2.1.1': - resolution: {integrity: sha512-8iRDfyLtzxlprOo9IicnzvpsO1wNCkuwzzCM+Z5Rb5tNOpCdMvcc2AkzX0Fz+Tz9v6NJ5B/7EEgyZveo4FBRfQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-slider@1.2.0': - resolution: {integrity: sha512-dAHCDA4/ySXROEPaRtaMV5WHL8+JB/DbtyTbJjYkY0RXmKMO2Ln8DFZhywG5/mVQ4WqHDBc8smc14yPXPqZHYA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-slot@1.0.2': - resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-slot@1.1.0': - resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-switch@1.1.0': - resolution: {integrity: sha512-OBzy5WAj641k0AOSpKQtreDMe+isX0MQJ1IVyF03ucdF3DunOnROVrjWs8zsXUxC3zfZ6JL9HFVCUlMghz9dJw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-tabs@1.1.0': - resolution: {integrity: sha512-bZgOKB/LtZIij75FSuPzyEti/XBhJH52ExgtdVqjCIh+Nx/FW+LhnbXtbCzIi34ccyMsyOja8T0thCzoHFXNKA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-toggle-group@1.1.0': - resolution: {integrity: sha512-PpTJV68dZU2oqqgq75Uzto5o/XfOVgkrJ9rulVmfTKxWp3HfUjHE6CP/WLRR4AzPX9HWxw7vFow2me85Yu+Naw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-toggle@1.1.0': - resolution: {integrity: sha512-gwoxaKZ0oJ4vIgzsfESBuSgJNdc0rv12VhHgcqN0TEJmmZixXG/2XpsLK8kzNWYcnaoRIEEQc0bEi3dIvdUpjw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-tooltip@1.1.1': - resolution: {integrity: sha512-LLE8nzNE4MzPMw3O2zlVlkLFid3y9hMUs7uCbSHyKSo+tCN4yMCf+ZCCcfrYgsOC0TiHBPQ1mtpJ2liY3ZT3SQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-use-callback-ref@1.0.1': - resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-callback-ref@1.1.0': - resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-controllable-state@1.0.1': - resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-controllable-state@1.1.0': - resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-escape-keydown@1.0.3': - resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-escape-keydown@1.1.0': - resolution: {integrity: sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-layout-effect@1.0.1': - resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-layout-effect@1.1.0': - resolution: {integrity: sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-previous@1.1.0': - resolution: {integrity: sha512-Z/e78qg2YFnnXcW88A4JmTtm4ADckLno6F7OXotmkQfeuCVaKuYzqAATPhVzl3delXE7CxIV8shofPn3jPc5Og==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-rect@1.0.1': - resolution: {integrity: sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-rect@1.1.0': - resolution: {integrity: sha512-0Fmkebhr6PiseyZlYAOtLS+nb7jLmpqTrJyv61Pe68MKYW6OWdRE2kI70TaYY27u7H0lajqM3hSMMLFq18Z7nQ==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-size@1.0.1': - resolution: {integrity: sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-use-size@1.1.0': - resolution: {integrity: sha512-XW3/vWuIXHa+2Uwcc2ABSfcCledmXhhQPlGbfcRXbiUQI5Icjcg19BGCZVKKInYbvUCut/ufbbLLPFC5cbb1hw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - - '@radix-ui/react-visually-hidden@1.1.0': - resolution: {integrity: sha512-N8MDZqtgCgG5S3aV60INAB475osJousYpZ4cTJ2cFbMpdHS5Y6loLTH8LPtkj2QN0x93J30HT/M3qJXM0+lyeQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/rect@1.0.1': - resolution: {integrity: sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==} - - '@radix-ui/rect@1.1.0': - resolution: {integrity: sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg==} - - '@radix-ui/themes@3.1.1': - resolution: {integrity: sha512-G+j+x+7kyqQXnn+ftlNPgk1DdZ8h/vVZnLsG4hZB0Mxw4fdKCh1tThQuXDSBNWhFt/vTG79BMzRMiflovENrmA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: 16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: 16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@scure/base@1.1.6': - resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} - - '@scure/bip32@1.4.0': - resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==} - - '@scure/bip39@1.3.0': - resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==} - - '@suchipi/femver@1.0.0': - resolution: {integrity: sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==} - - '@swc/core-darwin-arm64@1.5.24': - resolution: {integrity: sha512-M7oLOcC0sw+UTyAuL/9uyB9GeO4ZpaBbH76JSH6g1m0/yg7LYJZGRmplhDmwVSDAR5Fq4Sjoi1CksmmGkgihGA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - - '@swc/core-darwin-x64@1.5.24': - resolution: {integrity: sha512-MfcFjGGYognpSBSos2pYUNYJSmqEhuw5ceGr6qAdME7ddbjGXliza4W6FggsM+JnWwpqa31+e7/R+GetW4WkaQ==} - engines: {node: '>=10'} - cpu: [x64] - os: [darwin] - - '@swc/core-linux-arm-gnueabihf@1.5.24': - resolution: {integrity: sha512-amI2pwtcWV3E/m/nf+AQtn1LWDzKLZyjCmWd3ms7QjEueWYrY8cU1Y4Wp7wNNsxIoPOi8zek1Uj2wwFD/pttNQ==} - engines: {node: '>=10'} - cpu: [arm] - os: [linux] - - '@swc/core-linux-arm64-gnu@1.5.24': - resolution: {integrity: sha512-sTSvmqMmgT1ynH/nP75Pc51s+iT4crZagHBiDOf5cq+kudUYjda9lWMs7xkXB/TUKFHPCRK0HGunl8bkwiIbuw==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - - '@swc/core-linux-arm64-musl@1.5.24': - resolution: {integrity: sha512-vd2/hfOBGbrX21FxsFdXCUaffjkHvlZkeE2UMRajdXifwv79jqOHIJg3jXG1F3ZrhCghCzirFts4tAZgcG8XWg==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - - '@swc/core-linux-x64-gnu@1.5.24': - resolution: {integrity: sha512-Zrdzi7NqzQxm2BvAG5KyOSBEggQ7ayrxh599AqqevJmsUXJ8o2nMiWQOBvgCGp7ye+Biz3pvZn1EnRzAp+TpUg==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - - '@swc/core-linux-x64-musl@1.5.24': - resolution: {integrity: sha512-1F8z9NRi52jdZQCGc5sflwYSctL6omxiVmIFVp8TC9nngjQKc00TtX/JC2Eo2HwvgupkFVl5YQJidAck9YtmJw==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - - '@swc/core-win32-arm64-msvc@1.5.24': - resolution: {integrity: sha512-cKpP7KvS6Xr0jFSTBXY53HZX/YfomK5EMQYpCVDOvfsZeYHN20sQSKXfpVLvA/q2igVt1zzy1XJcOhpJcgiKLg==} - engines: {node: '>=10'} - cpu: [arm64] - os: [win32] - - '@swc/core-win32-ia32-msvc@1.5.24': - resolution: {integrity: sha512-IoPWfi0iwqjZuf7gE223+B97/ZwkKbu7qL5KzGP7g3hJrGSKAvv7eC5Y9r2iKKtLKyv5R/T6Ho0kFR/usi7rHw==} - engines: {node: '>=10'} - cpu: [ia32] - os: [win32] - - '@swc/core-win32-x64-msvc@1.5.24': - resolution: {integrity: sha512-zHgF2k1uVJL8KIW+PnVz1To4a3Cz9THbh2z2lbehaF/gKHugH4c3djBozU4das1v35KOqf5jWIEviBLql2wDLQ==} - engines: {node: '>=10'} - cpu: [x64] - os: [win32] - - '@swc/core@1.5.24': - resolution: {integrity: sha512-Eph9zvO4xvqWZGVzTdtdEJ0Vqf0VIML/o/e4Qd2RLOqtfgnlRi7avmMu5C0oqciJ0tk+hqdUKVUZ4JPoPaiGvQ==} - engines: {node: '>=10'} - peerDependencies: - '@swc/helpers': '*' - peerDependenciesMeta: - '@swc/helpers': - optional: true - - '@swc/counter@0.1.3': - resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} - - '@swc/types@0.1.7': - resolution: {integrity: sha512-scHWahbHF0eyj3JsxG9CFJgFdFNaVQCNAimBlT6PzS3n/HptxqREjsm4OH6AN3lYcffZYSPxXW8ua2BEHp0lJQ==} - - '@tanstack/query-core@5.40.0': - resolution: {integrity: sha512-eD8K8jsOIq0Z5u/QbvOmfvKKE/XC39jA7yv4hgpl/1SRiU+J8QCIwgM/mEHuunQsL87dcvnHqSVLmf9pD4CiaA==} - - '@tanstack/query-devtools@5.49.1': - resolution: {integrity: sha512-9mBtuq76fp+OE780ImoNG109bM7lucZ9MLPLzAkQ2OMx+X6s3BfVATySTxm1Mrtui3qJIFo05ZI4zv9A44+GAg==} - - '@tanstack/react-query-devtools@5.49.2': - resolution: {integrity: sha512-ARQ8GXaTcwXyXIv215sfFqT9s87Jj8vP8jAc9LlC28M+4RbexfBRvm+cra3Cn/xlXJrUEjijf+vUf1Ju9F1XJQ==} - peerDependencies: - '@tanstack/react-query': ^5.49.2 - react: ^18 || ^19 - - '@tanstack/react-query@5.40.0': - resolution: {integrity: sha512-iv/W0Axc4aXhFzkrByToE1JQqayxTPNotCoSCnarR/A1vDIHaoKpg7FTIfP3Ev2mbKn1yrxq0ZKYUdLEJxs6Tg==} - peerDependencies: - react: ^18.0.0 - - '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - - '@types/prop-types@15.7.12': - resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} - - '@types/react-dom@18.3.0': - resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} - - '@types/react@18.3.3': - resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} - - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - - '@typescript-eslint/eslint-plugin@6.21.0': - resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/parser@6.21.0': - resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/scope-manager@6.21.0': - resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} - engines: {node: ^16.0.0 || >=18.0.0} - - '@typescript-eslint/type-utils@6.21.0': - resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/types@6.21.0': - resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} - engines: {node: ^16.0.0 || >=18.0.0} - - '@typescript-eslint/typescript-estree@6.21.0': - resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/utils@6.21.0': - resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - - '@typescript-eslint/visitor-keys@6.21.0': - resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} - engines: {node: ^16.0.0 || >=18.0.0} - - '@ungap/structured-clone@1.2.0': - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - - '@vanilla-extract/css@1.15.2': - resolution: {integrity: sha512-Bi61iCAtojCuqvV+FYaF5i69vBjuMQJpHPdpgKYyQvx+e2Hp79V0ELglyYOdcyg9Wh0k0MFwgCDipVd7EloTXQ==} - - '@vanilla-extract/dynamic@2.1.1': - resolution: {integrity: sha512-iqf736036ujEIKsIq28UsBEMaLC2vR2DhwKyrG3NDb/fRy9qL9FKl1TqTtBV4daU30Uh3saeik4vRzN8bzQMbw==} - - '@vanilla-extract/private@1.0.5': - resolution: {integrity: sha512-6YXeOEKYTA3UV+RC8DeAjFk+/okoNz/h88R+McnzA2zpaVqTR/Ep+vszkWYlGBcMNO7vEkqbq5nT/JMMvhi+tw==} - - '@vanilla-extract/recipes@0.5.3': - resolution: {integrity: sha512-SPREq1NmaoKuvJeOV0pppOkwy3pWZUoDufsyQ6iHrbkHhAU7XQqG9o0iZSmg5JoVgDLIiOr9djQb0x9wuxig7A==} - peerDependencies: - '@vanilla-extract/css': ^1.0.0 - - '@vitejs/plugin-react-swc@3.7.0': - resolution: {integrity: sha512-yrknSb3Dci6svCd/qhHqhFPDSw0QtjumcqdKMoNNzmOl5lMXTTiqzjWtG4Qask2HdvvzaNgSunbQGet8/GrKdA==} - peerDependencies: - vite: ^4 || ^5 - - '@volar/language-core@2.2.5': - resolution: {integrity: sha512-2htyAuxRrAgETmFeUhT4XLELk3LiEcqoW/B8YUXMF6BrGWLMwIR09MFaZYvrA2UhbdAeSyeQ726HaWSWkexUcQ==} - - '@volar/source-map@2.2.5': - resolution: {integrity: sha512-wrOEIiZNf4E+PWB0AxyM4tfhkfldPsb3bxg8N6FHrxJH2ohar7aGu48e98bp3pR9HUA7P/pR9VrLmkTrgCCnWQ==} - - '@vue/compiler-core@3.4.27': - resolution: {integrity: sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==} - - '@vue/compiler-dom@3.4.27': - resolution: {integrity: sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw==} - - '@vue/language-core@2.0.19': - resolution: {integrity: sha512-A9EGOnvb51jOvnCYoRLnMP+CcoPlbZVxI9gZXE/y2GksRWM6j/PrLEIC++pnosWTN08tFpJgxhSS//E9v/Sg+Q==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@vue/shared@3.4.27': - resolution: {integrity: sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==} - - '@wallet-standard/app@1.0.1': - resolution: {integrity: sha512-LnLYq2Vy2guTZ8GQKKSXQK3+FRGPil75XEdkZqE6fiLixJhZJoJa5hT7lXxwe0ykVTt9LEThdTbOpT7KadS26Q==} - engines: {node: '>=16'} - - '@wallet-standard/base@1.0.1': - resolution: {integrity: sha512-1To3ekMfzhYxe0Yhkpri+Fedq0SYcfrOfJi3vbLjMwF2qiKPjTGLwZkf2C9ftdQmxES+hmxhBzTwF4KgcOwf8w==} - engines: {node: '>=16'} - - '@wallet-standard/core@1.0.3': - resolution: {integrity: sha512-Jb33IIjC1wM1HoKkYD7xQ6d6PZ8EmMZvyc8R7dFgX66n/xkvksVTW04g9yLvQXrLFbcIjHrCxW6TXMhvpsAAzg==} - engines: {node: '>=16'} - - '@wallet-standard/features@1.0.3': - resolution: {integrity: sha512-m8475I6W5LTatTZuUz5JJNK42wFRgkJTB0I9tkruMwfqBF2UN2eomkYNVf9RbrsROelCRzSFmugqjKZBFaubsA==} - engines: {node: '>=16'} - - '@wallet-standard/wallet@1.0.1': - resolution: {integrity: sha512-qkhJeuQU2afQTZ02yMZE5SFc91Fo3hyFjFkpQglHudENNyiSG0oUKcIjky8X32xVSaumgTZSQUAzpXnCTWHzKQ==} - engines: {node: '>=16'} - - acorn-jsx@5.3.2: - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - aria-hidden@1.2.4: - resolution: {integrity: sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==} - engines: {node: '>=10'} - - aria-query@5.3.0: - resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} - - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - - axobject-query@4.0.0: - resolution: {integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base-x@4.0.0: - resolution: {integrity: sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==} - - bech32@2.0.0: - resolution: {integrity: sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - bs58@5.0.0: - resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==} - - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - classnames@2.3.2: - resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} - - clsx@2.1.1: - resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} - engines: {node: '>=6'} - - code-red@1.0.4: - resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - computeds@0.0.1: - resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} - engines: {node: '>= 8'} - - css-tree@2.3.1: - resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - - css-what@6.1.0: - resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} - engines: {node: '>= 6'} - - cssesc@3.0.0: - resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} - engines: {node: '>=4'} - hasBin: true - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - de-indent@1.0.2: - resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - dedent-js@1.0.1: - resolution: {integrity: sha512-OUepMozQULMLUmhxS95Vudo0jb0UchLimi3+pQ2plj61Fcy8axbP9hbiD4Sz6DPqn6XG3kfmziVfQ1rSys5AJQ==} - - dedent@1.5.3: - resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} - peerDependencies: - babel-plugin-macros: ^3.1.0 - peerDependenciesMeta: - babel-plugin-macros: - optional: true - - deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - - deep-object-diff@1.1.9: - resolution: {integrity: sha512-Rn+RuwkmkDwCi2/oXOFS9Gsr5lJZu/yTGpK7wAaAIE75CC+LCGEZHpY6VQJa/RoJcrmaA/docWJZvYohlNkWPA==} - - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - - dequal@2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} - - detect-node-es@1.1.0: - resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} - - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - - doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - - entities@4.5.0: - resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} - engines: {node: '>=0.12'} - - esbuild@0.18.20: - resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} - engines: {node: '>=12'} - hasBin: true - - escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - - eslint-plugin-react-hooks@4.6.2: - resolution: {integrity: sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==} - engines: {node: '>=10'} - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - - eslint-plugin-react-refresh@0.4.7: - resolution: {integrity: sha512-yrj+KInFmwuQS2UQcg1SF83ha1tuHC1jMQbRNyuWtlEzzKRDgAl7L4Yp4NlDUZTZNlWvHEzOtJhMi40R7JxcSw==} - peerDependencies: - eslint: '>=7' - - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} - engines: {node: '>=0.10'} - - esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - - estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - estree-walker@3.0.3: - resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - - fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} - - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} - - flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - - get-nonce@1.0.1: - resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} - engines: {node: '>=6'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} - - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - - globrex@0.1.2: - resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} - - goober@2.1.14: - resolution: {integrity: sha512-4UpC0NdGyAFqLNPnhCT2iHpza2q+RAY3GV85a/mRPdzyPQMsj0KmMMuetdIkzWRbJ+Hgau1EZztq8ImmiMGhsg==} - peerDependencies: - csstype: ^3.0.10 - - gql.tada@1.7.5: - resolution: {integrity: sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==} - hasBin: true - peerDependencies: - typescript: ^5.0.0 - - graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - - graphql@16.8.1: - resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} - engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - he@1.2.0: - resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} - hasBin: true - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} - engines: {node: '>=6'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - invariant@2.2.4: - resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - - is-reference@3.0.2: - resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - - json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - - json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - - keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - - levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - - locate-character@3.0.0: - resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - - locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} - - lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - lower-case@2.0.2: - resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} - - magic-string@0.30.10: - resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} - - mdn-data@2.0.30: - resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - - media-query-parser@2.0.2: - resolution: {integrity: sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w==} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} - - minimatch@9.0.4: - resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} - engines: {node: '>=16 || 14 >=14.17'} - - mitt@3.0.1: - resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} - - modern-ahocorasick@1.0.1: - resolution: {integrity: sha512-yoe+JbhTClckZ67b2itRtistFKf8yPYelHLc7e5xAwtNAXxM6wJTUx2C7QeVSJFDzKT7bCIFyBVybPMKvmB9AA==} - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - muggle-string@0.4.1: - resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - nanostores@0.9.5: - resolution: {integrity: sha512-Z+p+g8E7yzaWwOe5gEUB2Ox0rCEeXWYIZWmYvw/ajNYX8DlXdMvMDj8DWfM/subqPAcsf8l8Td4iAwO1DeIIRQ==} - engines: {node: ^16.0.0 || ^18.0.0 || >=20.0.0} - - natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - - no-case@3.0.4: - resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} - - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - - p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - - pascal-case@3.1.2: - resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} - - path-browserify@1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - - periscopic@3.1.0: - resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - postcss@8.4.38: - resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} - engines: {node: ^10 || ^12 || >=14} - - prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - - prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} - engines: {node: '>=14'} - hasBin: true - - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react-hot-toast@2.4.1: - resolution: {integrity: sha512-j8z+cQbWIM5LY37pR6uZR6D4LfseplqnuAO4co4u8917hBUvXlEqyP1ZzqVLcqoyUesZZv/ImreoCeHVDpE5pQ==} - engines: {node: '>=10'} - peerDependencies: - react: '>=16' - react-dom: '>=16' - - react-remove-scroll-bar@2.3.4: - resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - react-remove-scroll-bar@2.3.6: - resolution: {integrity: sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - react-remove-scroll@2.5.5: - resolution: {integrity: sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - react-remove-scroll@2.5.7: - resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - react-style-singleton@2.2.1: - resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - regenerator-runtime@0.14.1: - resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - rollup@3.29.4: - resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} - hasBin: true - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - svelte2tsx@0.7.9: - resolution: {integrity: sha512-Rm+0LAwg9wT4H2IsR8EaM9EWErTzi9LmuZKxkH5b1ua94XjQmwHstBP4VabLgA9AE6XmwBg+xK7Cjzwfm6ustQ==} - peerDependencies: - svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0 - typescript: ^4.9.4 || ^5.0.0 - - svelte@4.2.17: - resolution: {integrity: sha512-N7m1YnoXtRf5wya5Gyx3TWuTddI4nAyayyIWFojiWV5IayDYNV5i2mRp/7qNGol4DtxEYxljmrbgp1HM6hUbmQ==} - engines: {node: '>=16'} - - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} - engines: {node: '>=16'} - peerDependencies: - typescript: '>=4.2.0' - - tsconfck@3.1.1: - resolution: {integrity: sha512-00eoI6WY57SvZEVjm13stEVE90VkEdJAFGgpFLTsZbJyW/LwFQ7uQxJHWpZ2hzSWgCPKc9AnBnNP+0X7o3hAmQ==} - engines: {node: ^18 || >=20} - hasBin: true - peerDependencies: - typescript: ^5.0.0 - peerDependenciesMeta: - typescript: - optional: true - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - tweetnacl@1.0.3: - resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==} - - type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - - type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - - use-callback-ref@1.3.2: - resolution: {integrity: sha512-elOQwe6Q8gqZgDA8mrh44qRTQqpIHDcZ3hXTLjBe1i4ph8XpNJnO+aQf3NaG+lriLopI4HMx9VjQLfPQ6vhnoA==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - use-sidecar@1.1.2: - resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.9.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - use-sync-external-store@1.2.0: - resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - - valibot@0.25.0: - resolution: {integrity: sha512-cmD0ca15oyAbT75iYLNW6uU6doAeIwYfOshpXka/E1Bx4frzbkrgb7gvkI7K0YK/DVOksei4FfxWfRoBP3NFTg==} - - vite-tsconfig-paths@4.3.2: - resolution: {integrity: sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==} - peerDependencies: - vite: '*' - peerDependenciesMeta: - vite: - optional: true - - vite@4.5.3: - resolution: {integrity: sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==} - engines: {node: ^14.18.0 || >=16.0.0} - hasBin: true - peerDependencies: - '@types/node': '>= 14' - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - - vue-template-compiler@2.7.16: - resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - - zustand@4.5.2: - resolution: {integrity: sha512-2cN1tPkDVkwCy5ickKrI7vijSjPksFRfqS6237NzT0vqSsztTNnQdHw9mmN7uBdk3gceVXU0a+21jFzFzAc9+g==} - engines: {node: '>=12.7.0'} - peerDependencies: - '@types/react': '>=16.8' - immer: '>=9.0.6' - react: '>=16.8' - peerDependenciesMeta: - '@types/react': - optional: true - immer: - optional: true - react: - optional: true - -snapshots: - - '@0no-co/graphql.web@1.0.7(graphql@16.8.1)': - optionalDependencies: - graphql: 16.8.1 - - '@0no-co/graphqlsp@1.12.5(graphql@16.8.1)(typescript@5.4.5)': - dependencies: - '@gql.tada/internal': 1.0.0(graphql@16.8.1)(typescript@5.4.5) - graphql: 16.8.1 - typescript: 5.4.5 - - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - - '@babel/helper-string-parser@7.24.6': {} - - '@babel/helper-validator-identifier@7.24.6': {} - - '@babel/parser@7.24.6': - dependencies: - '@babel/types': 7.24.6 - - '@babel/runtime@7.24.6': - dependencies: - regenerator-runtime: 0.14.1 - - '@babel/types@7.24.6': - dependencies: - '@babel/helper-string-parser': 7.24.6 - '@babel/helper-validator-identifier': 7.24.6 - to-fast-properties: 2.0.0 - - '@emotion/hash@0.9.1': {} - - '@esbuild/android-arm64@0.18.20': - optional: true - - '@esbuild/android-arm@0.18.20': - optional: true - - '@esbuild/android-x64@0.18.20': - optional: true - - '@esbuild/darwin-arm64@0.18.20': - optional: true - - '@esbuild/darwin-x64@0.18.20': - optional: true - - '@esbuild/freebsd-arm64@0.18.20': - optional: true - - '@esbuild/freebsd-x64@0.18.20': - optional: true - - '@esbuild/linux-arm64@0.18.20': - optional: true - - '@esbuild/linux-arm@0.18.20': - optional: true - - '@esbuild/linux-ia32@0.18.20': - optional: true - - '@esbuild/linux-loong64@0.18.20': - optional: true - - '@esbuild/linux-mips64el@0.18.20': - optional: true - - '@esbuild/linux-ppc64@0.18.20': - optional: true - - '@esbuild/linux-riscv64@0.18.20': - optional: true - - '@esbuild/linux-s390x@0.18.20': - optional: true - - '@esbuild/linux-x64@0.18.20': - optional: true - - '@esbuild/netbsd-x64@0.18.20': - optional: true - - '@esbuild/openbsd-x64@0.18.20': - optional: true - - '@esbuild/sunos-x64@0.18.20': - optional: true - - '@esbuild/win32-arm64@0.18.20': - optional: true - - '@esbuild/win32-ia32@0.18.20': - optional: true - - '@esbuild/win32-x64@0.18.20': - optional: true - - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': - dependencies: - eslint: 8.57.0 - eslint-visitor-keys: 3.4.3 - - '@eslint-community/regexpp@4.10.0': {} - - '@eslint/eslintrc@2.1.4': - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 9.6.1 - globals: 13.24.0 - ignore: 5.3.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/js@8.57.0': {} - - '@floating-ui/core@1.6.2': - dependencies: - '@floating-ui/utils': 0.2.2 - - '@floating-ui/dom@1.6.5': - dependencies: - '@floating-ui/core': 1.6.2 - '@floating-ui/utils': 0.2.2 - - '@floating-ui/react-dom@2.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@floating-ui/dom': 1.6.5 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - - '@floating-ui/utils@0.2.2': {} - - '@gql.tada/cli-utils@1.3.9(graphql@16.8.1)(svelte@4.2.17)(typescript@5.4.5)': - dependencies: - '@0no-co/graphqlsp': 1.12.5(graphql@16.8.1)(typescript@5.4.5) - '@gql.tada/internal': 1.0.0(graphql@16.8.1)(typescript@5.4.5) - '@vue/compiler-dom': 3.4.27 - '@vue/language-core': 2.0.19(typescript@5.4.5) - graphql: 16.8.1 - svelte2tsx: 0.7.9(svelte@4.2.17)(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - svelte - - '@gql.tada/internal@1.0.0(graphql@16.8.1)(typescript@5.4.5)': - dependencies: - '@0no-co/graphql.web': 1.0.7(graphql@16.8.1) - graphql: 16.8.1 - typescript: 5.4.5 - - '@graphql-typed-document-node/core@3.2.0(graphql@16.8.1)': - dependencies: - graphql: 16.8.1 - - '@humanwhocodes/config-array@0.11.14': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - - '@humanwhocodes/module-importer@1.0.1': {} - - '@humanwhocodes/object-schema@2.0.3': {} - - '@jridgewell/gen-mapping@0.3.5': - dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.25 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/set-array@1.2.1': {} - - '@jridgewell/sourcemap-codec@1.4.15': {} - - '@jridgewell/trace-mapping@0.3.25': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - - '@mysten/bcs@1.0.2': - dependencies: - bs58: 5.0.0 - - '@mysten/dapp-kit@0.14.9(@tanstack/react-query@5.40.0(react@18.3.1))(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(svelte@4.2.17)(typescript@5.4.5)': - dependencies: - '@mysten/sui': 1.1.2(svelte@4.2.17)(typescript@5.4.5) - '@mysten/wallet-standard': 0.12.9(svelte@4.2.17)(typescript@5.4.5) - '@mysten/zksend': 0.9.9(svelte@4.2.17)(typescript@5.4.5) - '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-dropdown-menu': 2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) - '@tanstack/react-query': 5.40.0(react@18.3.1) - '@vanilla-extract/css': 1.15.2 - '@vanilla-extract/dynamic': 2.1.1 - '@vanilla-extract/recipes': 0.5.3(@vanilla-extract/css@1.15.2) - clsx: 2.1.1 - react: 18.3.1 - zustand: 4.5.2(@types/react@18.3.3)(react@18.3.1) - transitivePeerDependencies: - - '@types/react' - - '@types/react-dom' - - babel-plugin-macros - - immer - - react-dom - - svelte - - typescript - - '@mysten/sui@1.1.2(svelte@4.2.17)(typescript@5.4.5)': - dependencies: - '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) - '@mysten/bcs': 1.0.2 - '@noble/curves': 1.4.0 - '@noble/hashes': 1.4.0 - '@scure/bip32': 1.4.0 - '@scure/bip39': 1.3.0 - '@suchipi/femver': 1.0.0 - bech32: 2.0.0 - gql.tada: 1.7.5(graphql@16.8.1)(svelte@4.2.17)(typescript@5.4.5) - graphql: 16.8.1 - tweetnacl: 1.0.3 - valibot: 0.25.0 - transitivePeerDependencies: - - svelte - - typescript - - '@mysten/wallet-standard@0.12.9(svelte@4.2.17)(typescript@5.4.5)': - dependencies: - '@mysten/sui': 1.1.2(svelte@4.2.17)(typescript@5.4.5) - '@wallet-standard/core': 1.0.3 - transitivePeerDependencies: - - svelte - - typescript - - '@mysten/zksend@0.9.9(svelte@4.2.17)(typescript@5.4.5)': - dependencies: - '@mysten/sui': 1.1.2(svelte@4.2.17)(typescript@5.4.5) - '@mysten/wallet-standard': 0.12.9(svelte@4.2.17)(typescript@5.4.5) - mitt: 3.0.1 - nanostores: 0.9.5 - valibot: 0.25.0 - transitivePeerDependencies: - - svelte - - typescript - - '@noble/curves@1.4.0': - dependencies: - '@noble/hashes': 1.4.0 - - '@noble/hashes@1.4.0': {} - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@radix-ui/colors@3.0.0': {} - - '@radix-ui/number@1.1.0': {} - - '@radix-ui/primitive@1.0.1': - dependencies: - '@babel/runtime': 7.24.6 - - '@radix-ui/primitive@1.1.0': {} - - '@radix-ui/react-accessible-icon@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-alert-dialog@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dialog': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-arrow@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-arrow@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-aspect-ratio@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-avatar@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-checkbox@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-collection@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-collection@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-compose-refs@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-context-menu@2.2.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-menu': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-context@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-context@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-dialog@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.5(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-dialog@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-direction@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-direction@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-dismissable-layer@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-dropdown-menu@2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-menu': 2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-dropdown-menu@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-menu': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-focus-guards@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-focus-guards@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-focus-scope@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-focus-scope@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-form@0.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-label': 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-hover-card@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-icons@1.3.0(react@18.3.1)': - dependencies: - react: 18.3.1 - - '@radix-ui/react-id@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-id@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-label@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-menu@2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.5(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-menu@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-navigation-menu@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-popover@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-popper@1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@floating-ui/react-dom': 2.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-arrow': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-rect': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-size': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/rect': 1.0.1 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-popper@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@floating-ui/react-dom': 2.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-arrow': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-rect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/rect': 1.1.0 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-portal@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-portal@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-presence@1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-presence@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-primitive@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-progress@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-radio-group@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-roving-focus@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-roving-focus@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-scroll-area@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-select@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-slider@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-slot@1.0.2(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-slot@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-switch@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-tabs@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-toggle-group@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-toggle': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-toggle@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-tooltip@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-escape-keydown@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-previous@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-rect@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/rect': 1.0.1 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-rect@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@radix-ui/rect': 1.1.0 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-size@1.0.1(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.24.6 - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-use-size@1.1.0(@types/react@18.3.3)(react@18.3.1)': - dependencies: - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.3 - - '@radix-ui/react-visually-hidden@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/rect@1.0.1': - dependencies: - '@babel/runtime': 7.24.6 - - '@radix-ui/rect@1.1.0': {} - - '@radix-ui/themes@3.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/colors': 3.0.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-accessible-icon': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-alert-dialog': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-aspect-ratio': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-avatar': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-checkbox': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-context-menu': 2.2.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-dialog': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dropdown-menu': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-form': 0.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-hover-card': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-navigation-menu': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-popover': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-progress': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-radio-group': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-scroll-area': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-select': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slider': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-switch': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-tabs': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-toggle-group': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-tooltip': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - classnames: 2.3.2 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll-bar: 2.3.4(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@scure/base@1.1.6': {} - - '@scure/bip32@1.4.0': - dependencies: - '@noble/curves': 1.4.0 - '@noble/hashes': 1.4.0 - '@scure/base': 1.1.6 - - '@scure/bip39@1.3.0': - dependencies: - '@noble/hashes': 1.4.0 - '@scure/base': 1.1.6 - - '@suchipi/femver@1.0.0': {} - - '@swc/core-darwin-arm64@1.5.24': - optional: true - - '@swc/core-darwin-x64@1.5.24': - optional: true - - '@swc/core-linux-arm-gnueabihf@1.5.24': - optional: true - - '@swc/core-linux-arm64-gnu@1.5.24': - optional: true - - '@swc/core-linux-arm64-musl@1.5.24': - optional: true - - '@swc/core-linux-x64-gnu@1.5.24': - optional: true - - '@swc/core-linux-x64-musl@1.5.24': - optional: true - - '@swc/core-win32-arm64-msvc@1.5.24': - optional: true - - '@swc/core-win32-ia32-msvc@1.5.24': - optional: true - - '@swc/core-win32-x64-msvc@1.5.24': - optional: true - - '@swc/core@1.5.24': - dependencies: - '@swc/counter': 0.1.3 - '@swc/types': 0.1.7 - optionalDependencies: - '@swc/core-darwin-arm64': 1.5.24 - '@swc/core-darwin-x64': 1.5.24 - '@swc/core-linux-arm-gnueabihf': 1.5.24 - '@swc/core-linux-arm64-gnu': 1.5.24 - '@swc/core-linux-arm64-musl': 1.5.24 - '@swc/core-linux-x64-gnu': 1.5.24 - '@swc/core-linux-x64-musl': 1.5.24 - '@swc/core-win32-arm64-msvc': 1.5.24 - '@swc/core-win32-ia32-msvc': 1.5.24 - '@swc/core-win32-x64-msvc': 1.5.24 - - '@swc/counter@0.1.3': {} - - '@swc/types@0.1.7': - dependencies: - '@swc/counter': 0.1.3 - - '@tanstack/query-core@5.40.0': {} - - '@tanstack/query-devtools@5.49.1': {} - - '@tanstack/react-query-devtools@5.49.2(@tanstack/react-query@5.40.0(react@18.3.1))(react@18.3.1)': - dependencies: - '@tanstack/query-devtools': 5.49.1 - '@tanstack/react-query': 5.40.0(react@18.3.1) - react: 18.3.1 - - '@tanstack/react-query@5.40.0(react@18.3.1)': - dependencies: - '@tanstack/query-core': 5.40.0 - react: 18.3.1 - - '@types/estree@1.0.5': {} - - '@types/json-schema@7.0.15': {} - - '@types/prop-types@15.7.12': {} - - '@types/react-dom@18.3.0': - dependencies: - '@types/react': 18.3.3 - - '@types/react@18.3.3': - dependencies: - '@types/prop-types': 15.7.12 - csstype: 3.1.3 - - '@types/semver@7.5.8': {} - - '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 - eslint: 8.57.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare: 1.4.0 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 - eslint: 8.57.0 - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/scope-manager@6.21.0': - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - - '@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4 - eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/types@6.21.0': {} - - '@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5)': - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - eslint: 8.57.0 - semver: 7.6.2 - transitivePeerDependencies: - - supports-color - - typescript - - '@typescript-eslint/visitor-keys@6.21.0': - dependencies: - '@typescript-eslint/types': 6.21.0 - eslint-visitor-keys: 3.4.3 - - '@ungap/structured-clone@1.2.0': {} - - '@vanilla-extract/css@1.15.2': - dependencies: - '@emotion/hash': 0.9.1 - '@vanilla-extract/private': 1.0.5 - css-what: 6.1.0 - cssesc: 3.0.0 - csstype: 3.1.3 - dedent: 1.5.3 - deep-object-diff: 1.1.9 - deepmerge: 4.3.1 - media-query-parser: 2.0.2 - modern-ahocorasick: 1.0.1 - picocolors: 1.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - '@vanilla-extract/dynamic@2.1.1': - dependencies: - '@vanilla-extract/private': 1.0.5 - - '@vanilla-extract/private@1.0.5': {} - - '@vanilla-extract/recipes@0.5.3(@vanilla-extract/css@1.15.2)': - dependencies: - '@vanilla-extract/css': 1.15.2 - - '@vitejs/plugin-react-swc@3.7.0(vite@4.5.3)': - dependencies: - '@swc/core': 1.5.24 - vite: 4.5.3 - transitivePeerDependencies: - - '@swc/helpers' - - '@volar/language-core@2.2.5': - dependencies: - '@volar/source-map': 2.2.5 - - '@volar/source-map@2.2.5': - dependencies: - muggle-string: 0.4.1 - - '@vue/compiler-core@3.4.27': - dependencies: - '@babel/parser': 7.24.6 - '@vue/shared': 3.4.27 - entities: 4.5.0 - estree-walker: 2.0.2 - source-map-js: 1.2.0 - - '@vue/compiler-dom@3.4.27': - dependencies: - '@vue/compiler-core': 3.4.27 - '@vue/shared': 3.4.27 - - '@vue/language-core@2.0.19(typescript@5.4.5)': - dependencies: - '@volar/language-core': 2.2.5 - '@vue/compiler-dom': 3.4.27 - '@vue/shared': 3.4.27 - computeds: 0.0.1 - minimatch: 9.0.4 - path-browserify: 1.0.1 - vue-template-compiler: 2.7.16 - optionalDependencies: - typescript: 5.4.5 - - '@vue/shared@3.4.27': {} - - '@wallet-standard/app@1.0.1': - dependencies: - '@wallet-standard/base': 1.0.1 - - '@wallet-standard/base@1.0.1': {} - - '@wallet-standard/core@1.0.3': - dependencies: - '@wallet-standard/app': 1.0.1 - '@wallet-standard/base': 1.0.1 - '@wallet-standard/features': 1.0.3 - '@wallet-standard/wallet': 1.0.1 - - '@wallet-standard/features@1.0.3': - dependencies: - '@wallet-standard/base': 1.0.1 - - '@wallet-standard/wallet@1.0.1': - dependencies: - '@wallet-standard/base': 1.0.1 - - acorn-jsx@5.3.2(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn@8.11.3: {} - - ajv@6.12.6: - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - - ansi-regex@5.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - argparse@2.0.1: {} - - aria-hidden@1.2.4: - dependencies: - tslib: 2.6.2 - - aria-query@5.3.0: - dependencies: - dequal: 2.0.3 - - array-union@2.1.0: {} - - axobject-query@4.0.0: - dependencies: - dequal: 2.0.3 - - balanced-match@1.0.2: {} - - base-x@4.0.0: {} - - bech32@2.0.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - brace-expansion@2.0.1: - dependencies: - balanced-match: 1.0.2 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - bs58@5.0.0: - dependencies: - base-x: 4.0.0 - - callsites@3.1.0: {} - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - classnames@2.3.2: {} - - clsx@2.1.1: {} - - code-red@1.0.4: - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - '@types/estree': 1.0.5 - acorn: 8.11.3 - estree-walker: 3.0.3 - periscopic: 3.1.0 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - computeds@0.0.1: {} - - concat-map@0.0.1: {} - - cross-spawn@7.0.3: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - css-tree@2.3.1: - dependencies: - mdn-data: 2.0.30 - source-map-js: 1.2.0 - - css-what@6.1.0: {} - - cssesc@3.0.0: {} - - csstype@3.1.3: {} - - de-indent@1.0.2: {} - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - dedent-js@1.0.1: {} - - dedent@1.5.3: {} - - deep-is@0.1.4: {} - - deep-object-diff@1.1.9: {} - - deepmerge@4.3.1: {} - - dequal@2.0.3: {} - - detect-node-es@1.1.0: {} - - dir-glob@3.0.1: - dependencies: - path-type: 4.0.0 - - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - - entities@4.5.0: {} - - esbuild@0.18.20: - optionalDependencies: - '@esbuild/android-arm': 0.18.20 - '@esbuild/android-arm64': 0.18.20 - '@esbuild/android-x64': 0.18.20 - '@esbuild/darwin-arm64': 0.18.20 - '@esbuild/darwin-x64': 0.18.20 - '@esbuild/freebsd-arm64': 0.18.20 - '@esbuild/freebsd-x64': 0.18.20 - '@esbuild/linux-arm': 0.18.20 - '@esbuild/linux-arm64': 0.18.20 - '@esbuild/linux-ia32': 0.18.20 - '@esbuild/linux-loong64': 0.18.20 - '@esbuild/linux-mips64el': 0.18.20 - '@esbuild/linux-ppc64': 0.18.20 - '@esbuild/linux-riscv64': 0.18.20 - '@esbuild/linux-s390x': 0.18.20 - '@esbuild/linux-x64': 0.18.20 - '@esbuild/netbsd-x64': 0.18.20 - '@esbuild/openbsd-x64': 0.18.20 - '@esbuild/sunos-x64': 0.18.20 - '@esbuild/win32-arm64': 0.18.20 - '@esbuild/win32-ia32': 0.18.20 - '@esbuild/win32-x64': 0.18.20 - - escape-string-regexp@4.0.0: {} - - eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): - dependencies: - eslint: 8.57.0 - - eslint-plugin-react-refresh@0.4.7(eslint@8.57.0): - dependencies: - eslint: 8.57.0 - - eslint-scope@7.2.2: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-visitor-keys@3.4.3: {} - - eslint@8.57.0: - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4 - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 - ignore: 5.3.1 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - - espree@9.6.1: - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 - - esquery@1.5.0: - dependencies: - estraverse: 5.3.0 - - esrecurse@4.3.0: - dependencies: - estraverse: 5.3.0 - - estraverse@5.3.0: {} - - estree-walker@2.0.2: {} - - estree-walker@3.0.3: - dependencies: - '@types/estree': 1.0.5 - - esutils@2.0.3: {} - - fast-deep-equal@3.1.3: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fast-json-stable-stringify@2.1.0: {} - - fast-levenshtein@2.0.6: {} - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - file-entry-cache@6.0.1: - dependencies: - flat-cache: 3.2.0 - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up@5.0.0: - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - - flat-cache@3.2.0: - dependencies: - flatted: 3.3.1 - keyv: 4.5.4 - rimraf: 3.0.2 - - flatted@3.3.1: {} - - fs.realpath@1.0.0: {} - - fsevents@2.3.3: - optional: true - - get-nonce@1.0.1: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob-parent@6.0.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globals@13.24.0: - dependencies: - type-fest: 0.20.2 - - globby@11.1.0: - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.1 - merge2: 1.4.1 - slash: 3.0.0 - - globrex@0.1.2: {} - - goober@2.1.14(csstype@3.1.3): - dependencies: - csstype: 3.1.3 - - gql.tada@1.7.5(graphql@16.8.1)(svelte@4.2.17)(typescript@5.4.5): - dependencies: - '@0no-co/graphql.web': 1.0.7(graphql@16.8.1) - '@gql.tada/cli-utils': 1.3.9(graphql@16.8.1)(svelte@4.2.17)(typescript@5.4.5) - '@gql.tada/internal': 1.0.0(graphql@16.8.1)(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - graphql - - svelte - - graphemer@1.4.0: {} - - graphql@16.8.1: {} - - has-flag@4.0.0: {} - - he@1.2.0: {} - - ignore@5.3.1: {} - - import-fresh@3.3.0: - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - - imurmurhash@0.1.4: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - invariant@2.2.4: - dependencies: - loose-envify: 1.4.0 - - is-extglob@2.1.1: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-path-inside@3.0.3: {} - - is-reference@3.0.2: - dependencies: - '@types/estree': 1.0.5 - - isexe@2.0.0: {} - - js-tokens@4.0.0: {} - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - json-buffer@3.0.1: {} - - json-schema-traverse@0.4.1: {} - - json-stable-stringify-without-jsonify@1.0.1: {} - - keyv@4.5.4: - dependencies: - json-buffer: 3.0.1 - - levn@0.4.1: - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - - locate-character@3.0.0: {} - - locate-path@6.0.0: - dependencies: - p-locate: 5.0.0 - - lodash.merge@4.6.2: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - lower-case@2.0.2: - dependencies: - tslib: 2.6.2 - - magic-string@0.30.10: - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - - mdn-data@2.0.30: {} - - media-query-parser@2.0.2: - dependencies: - '@babel/runtime': 7.24.6 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minimatch@9.0.3: - dependencies: - brace-expansion: 2.0.1 - - minimatch@9.0.4: - dependencies: - brace-expansion: 2.0.1 - - mitt@3.0.1: {} - - modern-ahocorasick@1.0.1: {} - - ms@2.1.2: {} - - muggle-string@0.4.1: {} - - nanoid@3.3.7: {} - - nanostores@0.9.5: {} - - natural-compare@1.4.0: {} - - no-case@3.0.4: - dependencies: - lower-case: 2.0.2 - tslib: 2.6.2 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - optionator@0.9.4: - dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.5 - - p-limit@3.1.0: - dependencies: - yocto-queue: 0.1.0 - - p-locate@5.0.0: - dependencies: - p-limit: 3.1.0 - - parent-module@1.0.1: - dependencies: - callsites: 3.1.0 - - pascal-case@3.1.2: - dependencies: - no-case: 3.0.4 - tslib: 2.6.2 - - path-browserify@1.0.1: {} - - path-exists@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-key@3.1.1: {} - - path-type@4.0.0: {} - - periscopic@3.1.0: - dependencies: - '@types/estree': 1.0.5 - estree-walker: 3.0.3 - is-reference: 3.0.2 - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - postcss@8.4.38: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - prelude-ls@1.2.1: {} - - prettier@3.2.5: {} - - punycode@2.3.1: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react-hot-toast@2.4.1(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - goober: 2.1.14(csstype@3.1.3) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - transitivePeerDependencies: - - csstype - - react-remove-scroll-bar@2.3.4(@types/react@18.3.3)(react@18.3.1): - dependencies: - react: 18.3.1 - react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) - tslib: 2.6.2 - optionalDependencies: - '@types/react': 18.3.3 - - react-remove-scroll-bar@2.3.6(@types/react@18.3.3)(react@18.3.1): - dependencies: - react: 18.3.1 - react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) - tslib: 2.6.2 - optionalDependencies: - '@types/react': 18.3.3 - - react-remove-scroll@2.5.5(@types/react@18.3.3)(react@18.3.1): - dependencies: - react: 18.3.1 - react-remove-scroll-bar: 2.3.6(@types/react@18.3.3)(react@18.3.1) - react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) - tslib: 2.6.2 - use-callback-ref: 1.3.2(@types/react@18.3.3)(react@18.3.1) - use-sidecar: 1.1.2(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - - react-remove-scroll@2.5.7(@types/react@18.3.3)(react@18.3.1): - dependencies: - react: 18.3.1 - react-remove-scroll-bar: 2.3.6(@types/react@18.3.3)(react@18.3.1) - react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) - tslib: 2.6.2 - use-callback-ref: 1.3.2(@types/react@18.3.3)(react@18.3.1) - use-sidecar: 1.1.2(@types/react@18.3.3)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - - react-style-singleton@2.2.1(@types/react@18.3.3)(react@18.3.1): - dependencies: - get-nonce: 1.0.1 - invariant: 2.2.4 - react: 18.3.1 - tslib: 2.6.2 - optionalDependencies: - '@types/react': 18.3.3 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - regenerator-runtime@0.14.1: {} - - resolve-from@4.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - rollup@3.29.4: - optionalDependencies: - fsevents: 2.3.3 - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@7.6.2: {} - - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - - slash@3.0.0: {} - - source-map-js@1.2.0: {} - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-json-comments@3.1.1: {} - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - svelte2tsx@0.7.9(svelte@4.2.17)(typescript@5.4.5): - dependencies: - dedent-js: 1.0.1 - pascal-case: 3.1.2 - svelte: 4.2.17 - typescript: 5.4.5 - - svelte@4.2.17: - dependencies: - '@ampproject/remapping': 2.3.0 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.25 - '@types/estree': 1.0.5 - acorn: 8.11.3 - aria-query: 5.3.0 - axobject-query: 4.0.0 - code-red: 1.0.4 - css-tree: 2.3.1 - estree-walker: 3.0.3 - is-reference: 3.0.2 - locate-character: 3.0.0 - magic-string: 0.30.10 - periscopic: 3.1.0 - - text-table@0.2.0: {} - - to-fast-properties@2.0.0: {} - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - ts-api-utils@1.3.0(typescript@5.4.5): - dependencies: - typescript: 5.4.5 - - tsconfck@3.1.1(typescript@5.4.5): - optionalDependencies: - typescript: 5.4.5 - - tslib@2.6.2: {} - - tweetnacl@1.0.3: {} - - type-check@0.4.0: - dependencies: - prelude-ls: 1.2.1 - - type-fest@0.20.2: {} - - typescript@5.4.5: {} - - uri-js@4.4.1: - dependencies: - punycode: 2.3.1 - - use-callback-ref@1.3.2(@types/react@18.3.3)(react@18.3.1): - dependencies: - react: 18.3.1 - tslib: 2.6.2 - optionalDependencies: - '@types/react': 18.3.3 - - use-sidecar@1.1.2(@types/react@18.3.3)(react@18.3.1): - dependencies: - detect-node-es: 1.1.0 - react: 18.3.1 - tslib: 2.6.2 - optionalDependencies: - '@types/react': 18.3.3 - - use-sync-external-store@1.2.0(react@18.3.1): - dependencies: - react: 18.3.1 - - valibot@0.25.0: {} - - vite-tsconfig-paths@4.3.2(typescript@5.4.5)(vite@4.5.3): - dependencies: - debug: 4.3.4 - globrex: 0.1.2 - tsconfck: 3.1.1(typescript@5.4.5) - optionalDependencies: - vite: 4.5.3 - transitivePeerDependencies: - - supports-color - - typescript - - vite@4.5.3: - dependencies: - esbuild: 0.18.20 - postcss: 8.4.38 - rollup: 3.29.4 - optionalDependencies: - fsevents: 2.3.3 - - vue-template-compiler@2.7.16: - dependencies: - de-indent: 1.0.2 - he: 1.2.0 - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - word-wrap@1.2.5: {} - - wrappy@1.0.2: {} - - yocto-queue@0.1.0: {} - - zustand@4.5.2(@types/react@18.3.3)(react@18.3.1): - dependencies: - use-sync-external-store: 1.2.0(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - react: 18.3.1 diff --git a/examples/tic-tac-toe/ui/prettier.config.cjs b/examples/tic-tac-toe/ui/prettier.config.cjs deleted file mode 100644 index 7a8fc06f2bf84..0000000000000 --- a/examples/tic-tac-toe/ui/prettier.config.cjs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -module.exports = { - proseWrap: "always", -}; diff --git a/examples/tic-tac-toe/ui/src/App.tsx b/examples/tic-tac-toe/ui/src/App.tsx index bafb401192946..59892a25f40e3 100644 --- a/examples/tic-tac-toe/ui/src/App.tsx +++ b/examples/tic-tac-toe/ui/src/App.tsx @@ -6,7 +6,7 @@ import './App.css'; import { ConnectButton, useCurrentAccount, useSuiClientContext } from '@mysten/dapp-kit'; import { isValidSuiObjectId, normalizeSuiObjectId } from '@mysten/sui/utils'; import { FrameIcon } from '@radix-ui/react-icons'; -import { Box, Container, Flex, Heading, Link, Text } from '@radix-ui/themes'; +import { Box, Container, Flex, Heading, Link } from '@radix-ui/themes'; import { Error } from 'components/Error'; import { networkConfig, useNetworkVariable } from 'config'; import Game from 'pages/Game'; diff --git a/examples/tic-tac-toe/ui/src/components/NewMultiSigGame.tsx b/examples/tic-tac-toe/ui/src/components/NewMultiSigGame.tsx index fc37d6cafabfa..d1770005093ef 100644 --- a/examples/tic-tac-toe/ui/src/components/NewMultiSigGame.tsx +++ b/examples/tic-tac-toe/ui/src/components/NewMultiSigGame.tsx @@ -130,7 +130,7 @@ function parsePublicKey(key?: string): PublicKey | null { } key = key.trim(); - if (key == '') { + if (key === '') { return null; } diff --git a/examples/tic-tac-toe/ui/src/env.devnet.ts b/examples/tic-tac-toe/ui/src/env.devnet.ts index 233779ffc0f33..905a036e2703a 100644 --- a/examples/tic-tac-toe/ui/src/env.devnet.ts +++ b/examples/tic-tac-toe/ui/src/env.devnet.ts @@ -1,7 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export default { +const env = { packageId: null, upgradeCap: null, }; + +export default env; diff --git a/examples/tic-tac-toe/ui/src/env.localnet.ts b/examples/tic-tac-toe/ui/src/env.localnet.ts index 233779ffc0f33..905a036e2703a 100644 --- a/examples/tic-tac-toe/ui/src/env.localnet.ts +++ b/examples/tic-tac-toe/ui/src/env.localnet.ts @@ -1,7 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export default { +const env = { packageId: null, upgradeCap: null, }; + +export default env; diff --git a/examples/tic-tac-toe/ui/src/env.mainnet.ts b/examples/tic-tac-toe/ui/src/env.mainnet.ts index 233779ffc0f33..905a036e2703a 100644 --- a/examples/tic-tac-toe/ui/src/env.mainnet.ts +++ b/examples/tic-tac-toe/ui/src/env.mainnet.ts @@ -1,7 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export default { +const env = { packageId: null, upgradeCap: null, }; + +export default env; diff --git a/examples/tic-tac-toe/ui/src/env.testnet.ts b/examples/tic-tac-toe/ui/src/env.testnet.ts index 9c47a9a46aa39..9d26724bd1f75 100644 --- a/examples/tic-tac-toe/ui/src/env.testnet.ts +++ b/examples/tic-tac-toe/ui/src/env.testnet.ts @@ -1,7 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export default { +const env = { packageId: '0x1812951b018fcd9f2262d160acdaff5b432011c58fae80eb981c7be3370167da', upgradeCap: '0x71a69d9d7319c0c86e0a5266746f85481840064e19fdb491ce83843851f5fe9d', }; + +export default env; diff --git a/examples/tic-tac-toe/ui/src/hooks/useGameQuery.ts b/examples/tic-tac-toe/ui/src/hooks/useGameQuery.ts index e0660f1fe7e9f..4cf1c2ce0c341 100644 --- a/examples/tic-tac-toe/ui/src/hooks/useGameQuery.ts +++ b/examples/tic-tac-toe/ui/src/hooks/useGameQuery.ts @@ -68,7 +68,7 @@ export function useGameQuery(id: string): [UseGameQueryResult, InvalidateGameQue ); // Wait for the query to succeed before doing any further work. - if (response.status != 'success') { + if (response.status !== 'success') { return [response as UseGameQueryResult, invalidate]; } @@ -81,7 +81,7 @@ export function useGameQuery(id: string): [UseGameQueryResult, InvalidateGameQue const { type, content } = data; let mType; - if (!type || !(mType = type.match(reType)) || !content || content.dataType != 'moveObject') { + if (!type || !(mType = type.match(reType)) || !content || content.dataType !== 'moveObject') { return [toError(response, 'Object is not a Game'), invalidate]; } diff --git a/examples/tic-tac-toe/ui/src/hooks/useObjectQuery.ts b/examples/tic-tac-toe/ui/src/hooks/useObjectQuery.ts index f565e4c710377..31b4282ac7e6f 100644 --- a/examples/tic-tac-toe/ui/src/hooks/useObjectQuery.ts +++ b/examples/tic-tac-toe/ui/src/hooks/useObjectQuery.ts @@ -22,7 +22,9 @@ export function useObjectQuery( const response = useSuiClientQuery('getObject', params, options); const invalidate = async () => { - await client.invalidateQueries({ queryKey: [ctx.network, 'getObject', params] }); + await client.invalidateQueries({ + queryKey: [ctx.network, 'getObject', params], + }); }; return [response, invalidate]; diff --git a/examples/tic-tac-toe/ui/src/hooks/useTrophyQuery.ts b/examples/tic-tac-toe/ui/src/hooks/useTrophyQuery.ts index 49a31dde04c3f..d014e935d40d9 100644 --- a/examples/tic-tac-toe/ui/src/hooks/useTrophyQuery.ts +++ b/examples/tic-tac-toe/ui/src/hooks/useTrophyQuery.ts @@ -36,6 +36,7 @@ export function useTrophyQuery(game?: Game): [UseTrophyQueryResponse, Invalidate const response = useQuery({ enabled: !!game, refetchInterval: REFETCH_INTERVAL, + // eslint-disable-next-line @tanstack/query/exhaustive-deps queryKey: ['game-end-state', game?.id], queryFn: async () => { const { results } = await client.devInspectTransactionBlock({ @@ -54,7 +55,9 @@ export function useTrophyQuery(game?: Game): [UseTrophyQueryResponse, Invalidate }); const invalidate = async () => { - await queryClient.invalidateQueries({ queryKey: ['game-end-state', game?.id] }); + await queryClient.invalidateQueries({ + queryKey: ['game-end-state', game?.id], + }); }; return [response, invalidate]; diff --git a/examples/tic-tac-toe/ui/src/pages/Game.tsx b/examples/tic-tac-toe/ui/src/pages/Game.tsx index 37dd9c89cee55..6265b079cc435 100644 --- a/examples/tic-tac-toe/ui/src/pages/Game.tsx +++ b/examples/tic-tac-toe/ui/src/pages/Game.tsx @@ -118,14 +118,14 @@ function SharedGame({ const tx = useTransactions()!!; const { id, board, turn, x, o } = game; - const [mark, curr, next] = turn % 2 == 0 ? [Mark.X, x, o] : [Mark.O, o, x]; + const [mark, curr, next] = turn % 2 === 0 ? [Mark.X, x, o] : [Mark.O, o, x]; // If it's the current account's turn, then empty cells should show // the current player's mark on hover. Otherwise show nothing, and // disable interactivity. const player = whoseTurn({ curr, next, addr: account?.address }); const winner = whoWon({ curr, next, addr: account?.address, turn, trophy }); - const empty = Turn.Yours == player && trophy === Trophy.None ? mark : Mark._; + const empty = Turn.Yours === player && trophy === Trophy.None ? mark : Mark._; const onMove = (row: number, col: number) => { signAndExecute({ tx: tx.placeMark(game, row, col) }, () => { @@ -215,14 +215,14 @@ function OwnedGame({ } const { id, board, turn, x, o } = game; - const [mark, curr, next] = turn % 2 == 0 ? [Mark.X, x, o] : [Mark.O, o, x]; + const [mark, curr, next] = turn % 2 === 0 ? [Mark.X, x, o] : [Mark.O, o, x]; // If it's the current account's turn, then empty cells should show // the current player's mark on hover. Otherwise show nothing, and // disable interactivity. const player = whoseTurn({ curr, next, addr: account?.address }); const winner = whoWon({ curr, next, addr: account?.address, turn, trophy }); - const empty = Turn.Yours == player && trophy === Trophy.None ? mark : Mark._; + const empty = Turn.Yours === player && trophy === Trophy.None ? mark : Mark._; const onMove = (row: number, col: number) => { signAndExecute( @@ -313,7 +313,7 @@ function whoWon({ curr, next, addr, - turn: turn, + turn, trophy, }: { curr: string; @@ -336,7 +336,7 @@ function whoWon({ return Winner.You; } else if (addr === curr) { return Winner.Them; - } else if (turn % 2 == 0) { + } else if (turn % 2 === 0) { return Winner.O; } else { return Winner.X; diff --git a/examples/tic-tac-toe/ui/tsconfig.json b/examples/tic-tac-toe/ui/tsconfig.json index cd647dfa4c7cb..652022ce2abbf 100644 --- a/examples/tic-tac-toe/ui/tsconfig.json +++ b/examples/tic-tac-toe/ui/tsconfig.json @@ -1,26 +1,26 @@ { - "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, - /* Bundler mode */ - "baseUrl": "./src", - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", + /* Bundler mode */ + "baseUrl": "./src", + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/examples/tic-tac-toe/ui/tsconfig.node.json b/examples/tic-tac-toe/ui/tsconfig.node.json index 42872c59f5b01..eca66688d25a5 100644 --- a/examples/tic-tac-toe/ui/tsconfig.node.json +++ b/examples/tic-tac-toe/ui/tsconfig.node.json @@ -1,10 +1,10 @@ { - "compilerOptions": { - "composite": true, - "skipLibCheck": true, - "module": "ESNext", - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] } diff --git a/examples/tic-tac-toe/ui/vite.config.ts b/examples/tic-tac-toe/ui/vite.config.ts index 4e73d3252754d..14661da93c47f 100644 --- a/examples/tic-tac-toe/ui/vite.config.ts +++ b/examples/tic-tac-toe/ui/vite.config.ts @@ -1,11 +1,11 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { defineConfig } from "vite"; -import tsconfigPaths from "vite-tsconfig-paths"; -import react from "@vitejs/plugin-react-swc"; +import react from '@vitejs/plugin-react-swc'; +import { defineConfig } from 'vite'; +import tsconfigPaths from 'vite-tsconfig-paths'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react(), tsconfigPaths()], + plugins: [react(), tsconfigPaths()], }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f28f88a7021b8..82044fbddcdd9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -821,6 +821,76 @@ importers: specifier: ^5.5.3 version: 5.5.3 + examples/tic-tac-toe/ui: + dependencies: + '@mysten/dapp-kit': + specifier: workspace:* + version: link:../../../sdk/dapp-kit + '@mysten/sui': + specifier: workspace:* + version: link:../../../sdk/typescript + '@radix-ui/colors': + specifier: ^3.0.0 + version: 3.0.0 + '@radix-ui/react-icons': + specifier: ^1.3.0 + version: 1.3.0(react@18.3.1) + '@radix-ui/themes': + specifier: ^3.1.1 + version: 3.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@tanstack/react-query': + specifier: ^5.50.1 + version: 5.50.1(react@18.3.1) + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + react-hot-toast: + specifier: ^2.4.1 + version: 2.4.1(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + devDependencies: + '@tanstack/react-query-devtools': + specifier: ^5.0.0 + version: 5.51.1(@tanstack/react-query@5.50.1(react@18.3.1))(react@18.3.1) + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.0 + '@typescript-eslint/eslint-plugin': + specifier: ^6.1.0 + version: 6.1.0(@typescript-eslint/parser@6.1.0(eslint@8.45.0)(typescript@5.5.3))(eslint@8.45.0)(typescript@5.5.3) + '@typescript-eslint/parser': + specifier: ^6.1.0 + version: 6.1.0(eslint@8.45.0)(typescript@5.5.3) + '@vitejs/plugin-react-swc': + specifier: ^3.7.0 + version: 3.7.0(@swc/helpers@0.5.5)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1)) + eslint: + specifier: ^8.45.0 + version: 8.45.0 + eslint-plugin-react-hooks: + specifier: ^4.6.2 + version: 4.6.2(eslint@8.45.0) + eslint-plugin-react-refresh: + specifier: ^0.4.7 + version: 0.4.7(eslint@8.45.0) + prettier: + specifier: ^3.3.2 + version: 3.3.2 + typescript: + specifier: ^5.5.3 + version: 5.5.3 + vite: + specifier: ^5.3.3 + version: 5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) + vite-tsconfig-paths: + specifier: ^4.3.2 + version: 4.3.2(typescript@5.5.3)(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1)) + examples/trading/api: dependencies: '@mysten/sui': @@ -6114,9 +6184,18 @@ packages: '@tanstack/query-core@5.50.1': resolution: {integrity: sha512-lpfhKPrJlyV2DSVcQb/HuozH3Av3kws4ge22agx+lNGpFkS4vLZ7St0l3GLwlAD+bqB+qXGex3JdRKUNtMviEQ==} + '@tanstack/query-devtools@5.51.1': + resolution: {integrity: sha512-rehG0WmL3EXER6MAI2uHQia/n0b5c3ZROohpYm7u3G7yg4q+HsfQy6nuAo6uy40NzHUe3FmnfWCZQ0Vb/3lE6g==} + '@tanstack/query-persist-client-core@4.29.25': resolution: {integrity: sha512-jC1JlZxUaO4bJdeN0GcLwnNIbtsdzkL54hZP1rjTbp2tzfEHNQFkMjaIMZtnsxgdrU9LclXz8loOd1ufQ6C44w==} + '@tanstack/react-query-devtools@5.51.1': + resolution: {integrity: sha512-bRShIVKGpUOHpwziGKT8Aq1Ty0lIlGmNI7E0KbGYtmyOaImErpdElTdxfES1bRaI7i/j+mf2hLy+E6q7SrCwPg==} + peerDependencies: + '@tanstack/react-query': ^5.51.1 + react: ^18 || ^19 + '@tanstack/react-query-persist-client@4.29.25': resolution: {integrity: sha512-Vm4E+iPZ7rPGfN0jhsK35vZ5EUFvKyE3Kg0uthlqmqmy2rzm43f1EIFpA1++j0dWST/swIOj3pfiSBxJ/6s5zA==} peerDependencies: @@ -16847,7 +16926,7 @@ snapshots: '@graphql-tools/utils': 10.0.13(graphql@16.9.0) auto-bind: 4.0.0 graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 transitivePeerDependencies: - encoding - supports-color @@ -16938,7 +17017,7 @@ snapshots: graphql: 16.9.0 graphql-tag: 2.12.6(graphql@16.9.0) parse-filepath: 1.0.2 - tslib: 2.6.2 + tslib: 2.6.3 transitivePeerDependencies: - encoding - supports-color @@ -16975,7 +17054,7 @@ snapshots: '@graphql-tools/utils': 10.0.13(graphql@16.9.0) dataloader: 2.2.2 graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 value-or-promise: 1.0.12 '@graphql-tools/code-file-loader@8.1.0(graphql@16.9.0)': @@ -16997,13 +17076,13 @@ snapshots: '@graphql-tools/utils': 10.0.13(graphql@16.9.0) dataloader: 2.2.2 graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 '@graphql-tools/documents@1.0.0(graphql@16.9.0)': dependencies: graphql: 16.9.0 lodash.sortby: 4.7.0 - tslib: 2.6.2 + tslib: 2.6.3 '@graphql-tools/executor-graphql-ws@1.1.0(graphql@16.9.0)': dependencies: @@ -17012,7 +17091,7 @@ snapshots: graphql: 16.9.0 graphql-ws: 5.14.3(graphql@16.9.0) isomorphic-ws: 5.0.0(ws@8.18.0) - tslib: 2.6.2 + tslib: 2.6.3 ws: 8.18.0 transitivePeerDependencies: - bufferutil @@ -17026,7 +17105,7 @@ snapshots: extract-files: 11.0.0 graphql: 16.9.0 meros: 1.3.0(@types/node@20.14.10) - tslib: 2.6.2 + tslib: 2.6.3 value-or-promise: 1.0.12 transitivePeerDependencies: - '@types/node' @@ -17037,7 +17116,7 @@ snapshots: '@types/ws': 8.5.10 graphql: 16.9.0 isomorphic-ws: 5.0.0(ws@8.18.0) - tslib: 2.6.2 + tslib: 2.6.3 ws: 8.18.0 transitivePeerDependencies: - bufferutil @@ -17049,7 +17128,7 @@ snapshots: '@graphql-typed-document-node/core': 3.2.0(graphql@16.9.0) '@repeaterjs/repeater': 3.0.5 graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 value-or-promise: 1.0.12 '@graphql-tools/git-loader@8.0.4(graphql@16.9.0)': @@ -17097,7 +17176,7 @@ snapshots: '@babel/types': 7.23.9 '@graphql-tools/utils': 10.0.13(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 transitivePeerDependencies: - supports-color @@ -17106,7 +17185,7 @@ snapshots: '@graphql-tools/utils': 10.0.13(graphql@16.9.0) graphql: 16.9.0 resolve-from: 5.0.0 - tslib: 2.6.2 + tslib: 2.6.3 '@graphql-tools/json-file-loader@8.0.0(graphql@16.9.0)': dependencies: @@ -17133,7 +17212,7 @@ snapshots: '@graphql-tools/optimize@2.0.0(graphql@16.9.0)': dependencies: graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 '@graphql-tools/prisma-loader@8.0.2(@types/node@20.14.10)(graphql@16.9.0)': dependencies: @@ -17168,7 +17247,7 @@ snapshots: '@ardatan/relay-compiler': 12.0.0(graphql@16.9.0) '@graphql-tools/utils': 10.0.13(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 transitivePeerDependencies: - encoding - supports-color @@ -17188,7 +17267,7 @@ snapshots: '@graphql-tools/merge': 9.0.1(graphql@16.9.0) '@graphql-tools/utils': 10.0.13(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 value-or-promise: 1.0.12 '@graphql-tools/url-loader@8.0.1(@types/node@20.14.10)(graphql@16.9.0)': @@ -17235,7 +17314,7 @@ snapshots: '@graphql-tools/schema': 10.0.2(graphql@16.9.0) '@graphql-tools/utils': 10.0.13(graphql@16.9.0) graphql: 16.9.0 - tslib: 2.6.2 + tslib: 2.6.3 value-or-promise: 1.0.12 '@graphql-typed-document-node/core@3.2.0(graphql@16.9.0)': @@ -17908,18 +17987,18 @@ snapshots: dependencies: asn1js: 3.0.5 pvtsutils: 1.3.5 - tslib: 2.6.2 + tslib: 2.6.3 '@peculiar/json-schema@1.1.12': dependencies: - tslib: 2.6.2 + tslib: 2.6.3 '@peculiar/webcrypto@1.4.5': dependencies: '@peculiar/asn1-schema': 2.3.8 '@peculiar/json-schema': 1.1.12 pvtsutils: 1.3.5 - tslib: 2.6.2 + tslib: 2.6.3 webcrypto-core: 1.7.8 '@phenomnomnominal/tsquery@3.0.0(typescript@3.9.10)': @@ -20296,10 +20375,18 @@ snapshots: '@tanstack/query-core@5.50.1': {} + '@tanstack/query-devtools@5.51.1': {} + '@tanstack/query-persist-client-core@4.29.25': dependencies: '@tanstack/query-core': 4.29.25 + '@tanstack/react-query-devtools@5.51.1(@tanstack/react-query@5.50.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@tanstack/query-devtools': 5.51.1 + '@tanstack/react-query': 5.50.1(react@18.3.1) + react: 18.3.1 + '@tanstack/react-query-persist-client@4.29.25(@tanstack/react-query@5.50.1(react@18.3.1))': dependencies: '@tanstack/query-persist-client-core': 4.29.25 @@ -20849,7 +20936,7 @@ snapshots: '@typescript-eslint/utils': 6.1.0(eslint@8.45.0)(typescript@5.5.3) debug: 4.3.5(supports-color@8.1.1) eslint: 8.45.0 - ts-api-utils: 1.0.1(typescript@5.5.3) + ts-api-utils: 1.3.0(typescript@5.5.3) optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: @@ -20913,7 +21000,7 @@ snapshots: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 - ts-api-utils: 1.0.1(typescript@5.5.3) + ts-api-utils: 1.3.0(typescript@5.5.3) optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: @@ -20951,7 +21038,7 @@ snapshots: '@typescript-eslint/utils@5.33.1(eslint@8.45.0)(typescript@5.5.3)': dependencies: - '@types/json-schema': 7.0.14 + '@types/json-schema': 7.0.15 '@typescript-eslint/scope-manager': 5.33.1 '@typescript-eslint/types': 5.33.1 '@typescript-eslint/typescript-estree': 5.33.1(typescript@5.5.3) @@ -21343,7 +21430,7 @@ snapshots: busboy: 1.6.0 fast-querystring: 1.1.2 fast-url-parser: 1.1.3 - tslib: 2.6.2 + tslib: 2.6.3 '@whatwg-node/node-fetch@0.5.5': dependencies: @@ -21351,7 +21438,7 @@ snapshots: '@whatwg-node/events': 0.1.1 busboy: 1.6.0 fast-querystring: 1.1.2 - tslib: 2.6.2 + tslib: 2.6.3 '@xtuc/ieee754@1.2.0': {} @@ -21702,7 +21789,7 @@ snapshots: dependencies: pvtsutils: 1.3.5 pvutils: 1.1.3 - tslib: 2.6.2 + tslib: 2.6.3 assert-plus@1.0.0: {} @@ -22105,7 +22192,7 @@ snapshots: camel-case@4.1.2: dependencies: pascal-case: 3.1.2 - tslib: 2.6.2 + tslib: 2.6.3 camelcase-css@2.0.1: {} @@ -22120,7 +22207,7 @@ snapshots: capital-case@1.0.4: dependencies: no-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 upper-case-first: 2.0.2 cardinal@2.1.1: @@ -22192,7 +22279,7 @@ snapshots: path-case: 3.0.4 sentence-case: 3.0.4 snake-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 character-entities-html4@2.1.0: {} @@ -22519,7 +22606,7 @@ snapshots: constant-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 upper-case: 2.0.2 constants-browserify@1.0.0: {} @@ -22609,7 +22696,7 @@ snapshots: cross-inspect@1.0.0: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 cross-spawn@5.1.0: dependencies: @@ -23156,7 +23243,7 @@ snapshots: dot-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 dot-prop@5.3.0: dependencies: @@ -24973,7 +25060,7 @@ snapshots: header-case@2.0.4: dependencies: capital-case: 1.0.4 - tslib: 2.6.2 + tslib: 2.6.3 headers-polyfill@4.0.3: {} @@ -25343,7 +25430,7 @@ snapshots: is-lower-case@2.0.2: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 is-mergeable-object@1.1.1: {} @@ -25455,7 +25542,7 @@ snapshots: is-upper-case@2.0.2: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 is-utf8@0.2.1: {} @@ -25907,11 +25994,11 @@ snapshots: lower-case-first@2.0.2: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 lower-case@2.0.2: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 lowercase-keys@3.0.0: {} @@ -26808,7 +26895,7 @@ snapshots: no-case@3.0.4: dependencies: lower-case: 2.0.2 - tslib: 2.6.2 + tslib: 2.6.3 node-abort-controller@3.1.1: {} @@ -27133,7 +27220,7 @@ snapshots: param-case@3.0.4: dependencies: dot-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 parent-module@1.0.1: dependencies: @@ -27205,7 +27292,7 @@ snapshots: pascal-case@3.1.2: dependencies: no-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 password-prompt@1.1.3: dependencies: @@ -27217,7 +27304,7 @@ snapshots: path-case@3.0.4: dependencies: dot-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 path-equal@1.2.5: {} @@ -27817,7 +27904,7 @@ snapshots: pvtsutils@1.3.5: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 pvutils@1.1.3: {} @@ -27980,9 +28067,9 @@ snapshots: react-remove-scroll@2.5.5(@types/react@18.3.3)(react@18.3.1): dependencies: react: 18.3.1 - react-remove-scroll-bar: 2.3.4(@types/react@18.3.3)(react@18.3.1) + react-remove-scroll-bar: 2.3.6(@types/react@18.3.3)(react@18.3.1) react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) - tslib: 2.6.0 + tslib: 2.6.3 use-callback-ref: 1.3.0(@types/react@18.3.3)(react@18.3.1) use-sidecar: 1.1.2(@types/react@18.3.3)(react@18.3.1) optionalDependencies: @@ -28553,7 +28640,7 @@ snapshots: sentence-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.6.3 upper-case-first: 2.0.2 serialize-javascript@6.0.2: @@ -28789,7 +28876,7 @@ snapshots: sponge-case@1.0.1: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 sprintf-js@1.0.3: {} @@ -29050,7 +29137,7 @@ snapshots: swap-case@2.0.2: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 swc-loader@0.2.6(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack@5.92.1(@swc/core@1.6.13(@swc/helpers@0.5.5))(webpack-cli@5.1.4(webpack@5.92.1))): dependencies: @@ -29222,7 +29309,7 @@ snapshots: title-case@3.0.3: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 title@3.5.3: dependencies: @@ -29748,15 +29835,15 @@ snapshots: upper-case-first@2.0.2: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 upper-case@2.0.2: dependencies: - tslib: 2.6.2 + tslib: 2.6.3 uri-js@4.4.1: dependencies: - punycode: 2.3.0 + punycode: 2.3.1 url-parse@1.5.10: dependencies: @@ -29775,7 +29862,7 @@ snapshots: use-callback-ref@1.3.0(@types/react@18.3.3)(react@18.3.1): dependencies: react: 18.3.1 - tslib: 2.6.0 + tslib: 2.6.3 optionalDependencies: '@types/react': 18.3.3 @@ -29813,7 +29900,7 @@ snapshots: dependencies: detect-node-es: 1.1.0 react: 18.3.1 - tslib: 2.6.0 + tslib: 2.6.3 optionalDependencies: '@types/react': 18.3.3 @@ -30103,7 +30190,7 @@ snapshots: '@peculiar/json-schema': 1.1.12 asn1js: 3.0.5 pvtsutils: 1.3.5 - tslib: 2.6.2 + tslib: 2.6.3 webextension-polyfill@0.10.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 9bc321c5d61b2..908c7ee00ae94 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,7 +3,6 @@ packages: - 'apps/**' - 'dapps/**' - 'examples/**' - - '!examples/tic-tac-toe/**' - '!**/dist/**' - '!**/.next/**' - '!sdk/create-dapp/templates' diff --git a/sdk/typescript/test/e2e/object-vector.test.ts b/sdk/typescript/test/e2e/object-vector.test.ts index 09787ecae2e0f..1db20be6e9a2b 100644 --- a/sdk/typescript/test/e2e/object-vector.test.ts +++ b/sdk/typescript/test/e2e/object-vector.test.ts @@ -62,16 +62,9 @@ describe('Test Move call with a vector of objects as input', () => { await destroyObjects([(await mintObject(7))!, await mintObject(42)], /* withType */ false); }); - it( - 'Test object vector with type hint', - async () => { - await destroyObjects([await mintObject(7), await mintObject(42)], /* withType */ true); - }, - { - // TODO: This test is currently flaky, so adding a retry to unblock merging - retry: 10, - }, - ); + it('Test object vector with type hint', async () => { + await destroyObjects([await mintObject(7), await mintObject(42)], /* withType */ true); + }); it('Test regular arg mixed with object vector arg', async () => { const coins = await toolbox.getGasObjectsOwnedByAddress(); From afc4197ed0fbf3538345bf5a0183e3266205942c Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:08:17 -0700 Subject: [PATCH 058/163] [DB] disable write stalling and stopping due to pending compaction bytes for index (#18093) ## Description Index db cfs can become large and require compactions. Write throttling based on compaction bytes can happen after initial ingestion of data, and is hard to investigate. Disable write throttling for index cfs. ## Test plan Deploy to mainnet fullnode. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-storage/src/indexes.rs | 21 ++++++++++++--------- crates/typed-store/src/rocks/mod.rs | 10 ++++++---- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/crates/sui-storage/src/indexes.rs b/crates/sui-storage/src/indexes.rs index 4d0205f80cb73..a38eeded07958 100644 --- a/crates/sui-storage/src/indexes.rs +++ b/crates/sui-storage/src/indexes.rs @@ -237,31 +237,33 @@ pub struct IndexStore { // These functions are used to initialize the DB tables fn transactions_order_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn transactions_seq_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn transactions_from_addr_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn transactions_to_addr_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn transactions_by_move_function_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn timestamps_table_default_config() -> DBOptions { - default_db_options().optimize_for_point_lookup(64) + default_db_options() + .optimize_for_point_lookup(64) + .disable_write_throttling() } fn owner_index_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn dynamic_field_index_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn index_table_default_config() -> DBOptions { - default_db_options() + default_db_options().disable_write_throttling() } fn coin_index_table_default_config() -> DBOptions { default_db_options() @@ -269,6 +271,7 @@ fn coin_index_table_default_config() -> DBOptions { .optimize_for_read( read_size_from_env(ENV_VAR_COIN_INDEX_BLOCK_CACHE_SIZE_MB).unwrap_or(5 * 1024), ) + .disable_write_throttling() } impl IndexStore { diff --git a/crates/typed-store/src/rocks/mod.rs b/crates/typed-store/src/rocks/mod.rs index 30b797288a8f2..471b10ef0143b 100644 --- a/crates/typed-store/src/rocks/mod.rs +++ b/crates/typed-store/src/rocks/mod.rs @@ -2385,10 +2385,10 @@ impl DBOptions { self } - // Optimize tables receiving significant deletions. - // TODO: revisit when intra-epoch pruning is enabled. - pub fn optimize_for_pruning(mut self) -> DBOptions { - self.options.set_min_write_buffer_number_to_merge(2); + // Disables write stalling and stopping based on pending compaction bytes. + pub fn disable_write_throttling(mut self) -> DBOptions { + self.options.set_soft_pending_compaction_bytes_limit(0); + self.options.set_hard_pending_compaction_bytes_limit(0); self } } @@ -2439,7 +2439,9 @@ pub fn default_db_options() -> DBOptions { read_size_from_env(ENV_VAR_DB_WAL_SIZE).unwrap_or(DEFAULT_DB_WAL_SIZE) as u64 * 1024 * 1024, ); + // Num threads for compaction and flush. opt.increase_parallelism(4); + opt.set_enable_pipelined_write(true); opt.set_block_based_table_factory(&get_block_options(128)); From d019f53f01d9f7d04cae02bc8574ec12c2033d2c Mon Sep 17 00:00:00 2001 From: Patrick Kuo Date: Wed, 17 Jul 2024 16:20:04 +0100 Subject: [PATCH 059/163] [bridge indexer] - record bridge txn errors (#18510) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-bridge-indexer/src/eth_worker.rs | 6 +- crates/sui-bridge-indexer/src/lib.rs | 30 +++++++- .../down.sql | 1 + .../up.sql | 8 +++ crates/sui-bridge-indexer/src/models.rs | 14 +++- .../src/postgres_manager.rs | 32 ++++++--- crates/sui-bridge-indexer/src/schema.rs | 11 +++ .../src/sui_transaction_handler.rs | 34 ++++----- crates/sui-bridge-indexer/src/sui_worker.rs | 70 +++++++++++-------- crates/sui-bridge-indexer/src/types.rs | 1 + 10 files changed, 149 insertions(+), 58 deletions(-) create mode 100644 crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/down.sql create mode 100644 crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/up.sql diff --git a/crates/sui-bridge-indexer/src/eth_worker.rs b/crates/sui-bridge-indexer/src/eth_worker.rs index 470a5daf9c27a..d07327ff238da 100644 --- a/crates/sui-bridge-indexer/src/eth_worker.rs +++ b/crates/sui-bridge-indexer/src/eth_worker.rs @@ -6,7 +6,9 @@ use crate::latest_eth_syncer::LatestEthSyncer; use crate::metrics::BridgeIndexerMetrics; use crate::postgres_manager::get_latest_eth_token_transfer; use crate::postgres_manager::{write, PgPool}; -use crate::{BridgeDataSource, TokenTransfer, TokenTransferData, TokenTransferStatus}; +use crate::{ + BridgeDataSource, ProcessedTxnData, TokenTransfer, TokenTransferData, TokenTransferStatus, +}; use anyhow::{anyhow, Result}; use ethers::providers::Provider; use ethers::providers::{Http, Middleware}; @@ -248,7 +250,7 @@ async fn process_eth_events( }; // TODO: we either scream here or keep retrying this until we succeed - if let Err(e) = write(&pg_pool, vec![transfer]) { + if let Err(e) = write(&pg_pool, vec![ProcessedTxnData::TokenTransfer(transfer)]) { error!("Error writing token transfer to database: {:?}", e); } else { progress_gauge.set(block_number as i64); diff --git a/crates/sui-bridge-indexer/src/lib.rs b/crates/sui-bridge-indexer/src/lib.rs index df35bd621b5d5..2aed0d793e3c2 100644 --- a/crates/sui-bridge-indexer/src/lib.rs +++ b/crates/sui-bridge-indexer/src/lib.rs @@ -1,9 +1,10 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::models::TokenTransfer as DBTokenTransfer; use crate::models::TokenTransferData as DBTokenTransferData; +use crate::models::{SuiErrorTransactions, TokenTransfer as DBTokenTransfer}; use std::fmt::{Display, Formatter}; +use sui_types::base_types::{SuiAddress, TransactionDigest}; pub mod config; pub mod eth_worker; @@ -18,6 +19,21 @@ pub mod sui_transaction_queries; pub mod sui_worker; pub mod types; +#[derive(Clone)] +pub enum ProcessedTxnData { + TokenTransfer(TokenTransfer), + Error(SuiTxnError), +} + +#[derive(Clone)] +pub struct SuiTxnError { + tx_digest: TransactionDigest, + sender: SuiAddress, + timestamp_ms: u64, + failure_status: String, + cmd_idx: Option, +} + #[derive(Clone)] pub struct TokenTransfer { chain_id: u8, @@ -72,6 +88,18 @@ impl TokenTransfer { } } +impl SuiTxnError { + fn to_db(&self) -> SuiErrorTransactions { + SuiErrorTransactions { + txn_digest: self.tx_digest.inner().to_vec(), + sender_address: self.sender.to_vec(), + timestamp_ms: self.timestamp_ms as i64, + failure_status: self.failure_status.clone(), + cmd_idx: self.cmd_idx.map(|idx| idx as i64), + } + } +} + #[derive(Clone)] pub(crate) enum TokenTransferStatus { DepositedUnfinalized, diff --git a/crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/down.sql b/crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/down.sql new file mode 100644 index 0000000000000..031e40b9ddd26 --- /dev/null +++ b/crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS sui_error_transactions; diff --git a/crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/up.sql b/crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/up.sql new file mode 100644 index 0000000000000..96aea8f8f011b --- /dev/null +++ b/crates/sui-bridge-indexer/src/migrations/2024-07-02-101842_error_transaction/up.sql @@ -0,0 +1,8 @@ +CREATE TABLE sui_error_transactions +( + txn_digest bytea PRIMARY KEY, + sender_address bytea NOT NULL, + timestamp_ms BIGINT NOT NULL, + failure_status text NOT NULL, + cmd_idx BIGINT +); \ No newline at end of file diff --git a/crates/sui-bridge-indexer/src/models.rs b/crates/sui-bridge-indexer/src/models.rs index 4b2fd67a7c1e6..e005dca186d6f 100644 --- a/crates/sui-bridge-indexer/src/models.rs +++ b/crates/sui-bridge-indexer/src/models.rs @@ -1,7 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::schema::{progress_store, sui_progress_store, token_transfer, token_transfer_data}; +use crate::schema::{ + progress_store, sui_error_transactions, sui_progress_store, token_transfer, token_transfer_data, +}; use diesel::data_types::PgTimestamp; use diesel::{Identifiable, Insertable, Queryable, Selectable}; @@ -49,3 +51,13 @@ pub struct TokenTransferData { pub token_id: i32, pub amount: i64, } + +#[derive(Queryable, Selectable, Insertable, Identifiable, Debug)] +#[diesel(table_name = sui_error_transactions, primary_key(txn_digest))] +pub struct SuiErrorTransactions { + pub txn_digest: Vec, + pub sender_address: Vec, + pub timestamp_ms: i64, + pub failure_status: String, + pub cmd_idx: Option, +} diff --git a/crates/sui-bridge-indexer/src/postgres_manager.rs b/crates/sui-bridge-indexer/src/postgres_manager.rs index d869bd6ad6cb0..fc5feb2c72685 100644 --- a/crates/sui-bridge-indexer/src/postgres_manager.rs +++ b/crates/sui-bridge-indexer/src/postgres_manager.rs @@ -3,10 +3,9 @@ use crate::models::SuiProgressStore; use crate::models::TokenTransfer as DBTokenTransfer; -use crate::models::TokenTransferData as DBTokenTransferData; use crate::schema::sui_progress_store::txn_digest; -use crate::schema::token_transfer_data; -use crate::{schema, schema::token_transfer, TokenTransfer}; +use crate::schema::{sui_error_transactions, token_transfer_data}; +use crate::{schema, schema::token_transfer, ProcessedTxnData}; use diesel::result::Error; use diesel::BoolExpressionMethods; use diesel::{ @@ -29,16 +28,25 @@ pub fn get_connection_pool(database_url: String) -> PgPool { } // TODO: add retry logic -pub fn write(pool: &PgPool, token_txns: Vec) -> Result<(), anyhow::Error> { +pub fn write(pool: &PgPool, token_txns: Vec) -> Result<(), anyhow::Error> { if token_txns.is_empty() { return Ok(()); } - let (transfers, data): (Vec, Vec>) = token_txns - .iter() - .map(|t| (t.to_db(), t.to_data_maybe())) - .unzip(); - - let data = data.into_iter().flatten().collect::>(); + let (transfers, data, errors) = token_txns.iter().fold( + (vec![], vec![], vec![]), + |(mut transfers, mut data, mut errors), d| { + match d { + ProcessedTxnData::TokenTransfer(t) => { + transfers.push(t.to_db()); + if let Some(d) = t.to_data_maybe() { + data.push(d) + } + } + ProcessedTxnData::Error(e) => errors.push(e.to_db()), + } + (transfers, data, errors) + }, + ); let connection = &mut pool.get()?; connection.transaction(|conn| { @@ -49,6 +57,10 @@ pub fn write(pool: &PgPool, token_txns: Vec) -> Result<(), anyhow diesel::insert_into(token_transfer::table) .values(&transfers) .on_conflict_do_nothing() + .execute(conn)?; + diesel::insert_into(sui_error_transactions::table) + .values(&errors) + .on_conflict_do_nothing() .execute(conn) })?; Ok(()) diff --git a/crates/sui-bridge-indexer/src/schema.rs b/crates/sui-bridge-indexer/src/schema.rs index 5156e38a1d95c..8a9e7c02951e8 100644 --- a/crates/sui-bridge-indexer/src/schema.rs +++ b/crates/sui-bridge-indexer/src/schema.rs @@ -18,6 +18,16 @@ diesel::table! { } } +diesel::table! { + sui_error_transactions (txn_digest) { + txn_digest -> Bytea, + sender_address -> Bytea, + timestamp_ms -> Int8, + failure_status -> Text, + cmd_idx -> Nullable, + } +} + diesel::table! { token_transfer (chain_id, nonce, status) { chain_id -> Int4, @@ -49,6 +59,7 @@ diesel::table! { diesel::allow_tables_to_appear_in_same_query!( progress_store, + sui_error_transactions, sui_progress_store, token_transfer, token_transfer_data, diff --git a/crates/sui-bridge-indexer/src/sui_transaction_handler.rs b/crates/sui-bridge-indexer/src/sui_transaction_handler.rs index d49caceed95e4..e371231910fd8 100644 --- a/crates/sui-bridge-indexer/src/sui_transaction_handler.rs +++ b/crates/sui-bridge-indexer/src/sui_transaction_handler.rs @@ -4,7 +4,9 @@ use crate::metrics::BridgeIndexerMetrics; use crate::postgres_manager::{update_sui_progress_store, write, PgPool}; use crate::types::RetrievedTransaction; -use crate::{BridgeDataSource, TokenTransfer, TokenTransferData, TokenTransferStatus}; +use crate::{ + BridgeDataSource, ProcessedTxnData, TokenTransfer, TokenTransferData, TokenTransferStatus, +}; use anyhow::Result; use futures::StreamExt; use sui_types::digests::TransactionDigest; @@ -34,22 +36,22 @@ pub async fn handle_sui_transactions_loop( let mut stream = ReceiverStream::new(rx).ready_chunks(checkpoint_commit_batch_size); while let Some(batch) = stream.next().await { // unwrap: batch must not be empty - let cursor = batch.last().unwrap().1; - let token_transfers = batch + let (txns, cursor) = batch.last().cloned().unwrap(); + let data = batch .into_iter() // TODO: letting it panic so we can capture errors, but we should handle this more gracefully .flat_map(|(chunk, _)| process_transactions(chunk, &metrics).unwrap()) .collect::>(); - // write batched token transfers to DB - if !token_transfers.is_empty() { + // write batched transaction data to DB + if !data.is_empty() { // unwrap: token_transfers is not empty - let last_ckp = token_transfers.last().as_ref().unwrap().block_height; - while let Err(err) = write(&pg_pool, token_transfers.clone()) { + let last_ckp = txns.last().map(|tx| tx.checkpoint).unwrap_or_default(); + while let Err(err) = write(&pg_pool, data.clone()) { error!("Failed to write sui transactions to DB: {:?}", err); tokio::time::sleep(Duration::from_secs(5)).await; } - info!("Wrote {} token transfers to DB", token_transfers.len()); + info!("Wrote {} bridge transaction data to DB", data.len()); metrics.last_committed_sui_checkpoint.set(last_ckp as i64); } @@ -68,7 +70,7 @@ pub async fn handle_sui_transactions_loop( fn process_transactions( txns: Vec, metrics: &BridgeIndexerMetrics, -) -> Result> { +) -> Result> { txns.into_iter().try_fold(vec![], |mut result, tx| { result.append(&mut into_token_transfers(tx, metrics)?); Ok(result) @@ -78,7 +80,7 @@ fn process_transactions( pub fn into_token_transfers( tx: RetrievedTransaction, metrics: &BridgeIndexerMetrics, -) -> Result> { +) -> Result> { let mut transfers = Vec::new(); let tx_digest = tx.tx_digest; let timestamp_ms = tx.timestamp_ms; @@ -93,7 +95,7 @@ pub fn into_token_transfers( info!("Observed Sui Deposit {:?}", ev); metrics.total_sui_token_deposited.inc(); let move_event: MoveTokenDepositedEvent = bcs::from_bytes(&ev.bcs)?; - transfers.push(TokenTransfer { + transfers.push(ProcessedTxnData::TokenTransfer(TokenTransfer { chain_id: move_event.source_chain, nonce: move_event.seq_num, block_height: checkpoint_num, @@ -110,13 +112,13 @@ pub fn into_token_transfers( token_id: move_event.token_type, amount: move_event.amount_sui_adjusted, }), - }); + })); } "TokenTransferApproved" => { info!("Observed Sui Approval {:?}", ev); metrics.total_sui_token_transfer_approved.inc(); let event: MoveTokenTransferApproved = bcs::from_bytes(&ev.bcs)?; - transfers.push(TokenTransfer { + transfers.push(ProcessedTxnData::TokenTransfer(TokenTransfer { chain_id: event.message_key.source_chain, nonce: event.message_key.bridge_seq_num, block_height: checkpoint_num, @@ -127,13 +129,13 @@ pub fn into_token_transfers( gas_usage: effects.gas_cost_summary().net_gas_usage(), data_source: BridgeDataSource::Sui, data: None, - }); + })); } "TokenTransferClaimed" => { info!("Observed Sui Claim {:?}", ev); metrics.total_sui_token_transfer_claimed.inc(); let event: MoveTokenTransferClaimed = bcs::from_bytes(&ev.bcs)?; - transfers.push(TokenTransfer { + transfers.push(ProcessedTxnData::TokenTransfer(TokenTransfer { chain_id: event.message_key.source_chain, nonce: event.message_key.bridge_seq_num, block_height: checkpoint_num, @@ -144,7 +146,7 @@ pub fn into_token_transfers( gas_usage: effects.gas_cost_summary().net_gas_usage(), data_source: BridgeDataSource::Sui, data: None, - }); + })); } _ => { metrics.total_sui_bridge_txn_other.inc(); diff --git a/crates/sui-bridge-indexer/src/sui_worker.rs b/crates/sui-bridge-indexer/src/sui_worker.rs index 52c04090caf14..673140a4bc8fe 100644 --- a/crates/sui-bridge-indexer/src/sui_worker.rs +++ b/crates/sui-bridge-indexer/src/sui_worker.rs @@ -3,8 +3,8 @@ use crate::postgres_manager::{write, PgPool}; use crate::{ - metrics::BridgeIndexerMetrics, BridgeDataSource, TokenTransfer, TokenTransferData, - TokenTransferStatus, + metrics::BridgeIndexerMetrics, BridgeDataSource, ProcessedTxnData, SuiTxnError, TokenTransfer, + TokenTransferData, TokenTransferStatus, }; use anyhow::Result; use async_trait::async_trait; @@ -14,6 +14,7 @@ use sui_bridge::events::{ }; use sui_data_ingestion_core::Worker; use sui_types::event::Event; +use sui_types::execution_status::ExecutionStatus; use sui_types::{ base_types::ObjectID, effects::TransactionEffectsAPI, @@ -65,28 +66,41 @@ impl SuiBridgeWorker { tx: &CheckpointTransaction, checkpoint: u64, timestamp_ms: u64, - ) -> Result> { + ) -> Result> { self.metrics.total_sui_bridge_transactions.inc(); - if let Some(events) = &tx.events { - let token_transfers = events.data.iter().try_fold(vec![], |mut result, ev| { - if let Some(data) = - Self::process_sui_event(ev, tx, checkpoint, timestamp_ms, &self.metrics)? - { - result.push(data); - } - Ok::<_, anyhow::Error>(result) - })?; + match &tx.events { + Some(events) => { + let token_transfers = events.data.iter().try_fold(vec![], |mut result, ev| { + if let Some(data) = + Self::process_sui_event(ev, tx, checkpoint, timestamp_ms, &self.metrics)? + { + result.push(data); + } + Ok::<_, anyhow::Error>(result) + })?; - if !token_transfers.is_empty() { - info!( - "SUI: Extracted {} bridge token transfer data entries for tx {}.", - token_transfers.len(), - tx.transaction.digest() - ); + if !token_transfers.is_empty() { + info!( + "SUI: Extracted {} bridge token transfer data entries for tx {}.", + token_transfers.len(), + tx.transaction.digest() + ); + } + Ok(token_transfers) + } + None => { + if let ExecutionStatus::Failure { error, command } = tx.effects.status() { + Ok(vec![ProcessedTxnData::Error(SuiTxnError { + tx_digest: *tx.transaction.digest(), + sender: tx.transaction.sender_address(), + timestamp_ms, + failure_status: error.to_string(), + cmd_idx: command.map(|idx| idx as u64), + })]) + } else { + Ok(vec![]) + } } - Ok(token_transfers) - } else { - Ok(vec![]) } } @@ -96,14 +110,14 @@ impl SuiBridgeWorker { checkpoint: u64, timestamp_ms: u64, metrics: &BridgeIndexerMetrics, - ) -> Result> { + ) -> Result> { Ok(if ev.type_.address == BRIDGE_ADDRESS { match ev.type_.name.as_str() { "TokenDepositedEvent" => { info!("Observed Sui Deposit {:?}", ev); metrics.total_sui_token_deposited.inc(); let move_event: MoveTokenDepositedEvent = bcs::from_bytes(&ev.contents)?; - Some(TokenTransfer { + Some(ProcessedTxnData::TokenTransfer(TokenTransfer { chain_id: move_event.source_chain, nonce: move_event.seq_num, block_height: checkpoint, @@ -120,13 +134,13 @@ impl SuiBridgeWorker { token_id: move_event.token_type, amount: move_event.amount_sui_adjusted, }), - }) + })) } "TokenTransferApproved" => { info!("Observed Sui Approval {:?}", ev); metrics.total_sui_token_transfer_approved.inc(); let event: MoveTokenTransferApproved = bcs::from_bytes(&ev.contents)?; - Some(TokenTransfer { + Some(ProcessedTxnData::TokenTransfer(TokenTransfer { chain_id: event.message_key.source_chain, nonce: event.message_key.bridge_seq_num, block_height: checkpoint, @@ -137,13 +151,13 @@ impl SuiBridgeWorker { gas_usage: tx.effects.gas_cost_summary().net_gas_usage(), data_source: BridgeDataSource::Sui, data: None, - }) + })) } "TokenTransferClaimed" => { info!("Observed Sui Claim {:?}", ev); metrics.total_sui_token_transfer_claimed.inc(); let event: MoveTokenTransferClaimed = bcs::from_bytes(&ev.contents)?; - Some(TokenTransfer { + Some(ProcessedTxnData::TokenTransfer(TokenTransfer { chain_id: event.message_key.source_chain, nonce: event.message_key.bridge_seq_num, block_height: checkpoint, @@ -154,7 +168,7 @@ impl SuiBridgeWorker { gas_usage: tx.effects.gas_cost_summary().net_gas_usage(), data_source: BridgeDataSource::Sui, data: None, - }) + })) } _ => { metrics.total_sui_bridge_txn_other.inc(); diff --git a/crates/sui-bridge-indexer/src/types.rs b/crates/sui-bridge-indexer/src/types.rs index d6ea0331d1919..7b1d9dfb5506a 100644 --- a/crates/sui-bridge-indexer/src/types.rs +++ b/crates/sui-bridge-indexer/src/types.rs @@ -6,6 +6,7 @@ use sui_json_rpc_types::{ }; use sui_types::digests::TransactionDigest; +#[derive(Clone)] pub struct RetrievedTransaction { pub tx_digest: TransactionDigest, pub events: SuiTransactionBlockEvents, From c718a3687587b992642d9219d4b9f88cc276761f Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:44:21 -0700 Subject: [PATCH 060/163] remove sui-common which was accidentally added (#18686) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- Cargo.lock | 13 +- Cargo.toml | 2 - crates/sui-authority-aggregation/src/lib.rs | 6 +- crates/sui-bridge/Cargo.toml | 2 +- .../src/client/bridge_authority_aggregator.rs | 4 +- crates/sui-common/Cargo.toml | 14 -- .../sui-common/src/authority_aggregation.rs | 171 ------------------ crates/sui-common/src/lib.rs | 4 - 8 files changed, 7 insertions(+), 209 deletions(-) delete mode 100644 crates/sui-common/Cargo.toml delete mode 100644 crates/sui-common/src/authority_aggregation.rs delete mode 100644 crates/sui-common/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 651e0ee3e9ac6..916e3e9a85290 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12256,7 +12256,7 @@ dependencies = [ "serde_json", "serde_with 3.8.1", "shared-crypto", - "sui-common", + "sui-authority-aggregation", "sui-config", "sui-json-rpc-api", "sui-json-rpc-types", @@ -12372,17 +12372,6 @@ dependencies = [ "uuid 1.2.2", ] -[[package]] -name = "sui-common" -version = "0.1.0" -dependencies = [ - "futures", - "mysten-metrics", - "sui-types", - "tokio", - "tracing", -] - [[package]] name = "sui-config" version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml index 04d4ded8299ca..4648977bbef01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,6 @@ members = [ "crates/sui-bridge-cli", "crates/sui-bridge-indexer", "crates/sui-cluster-test", - "crates/sui-common", "crates/sui-config", "crates/sui-core", "crates/sui-cost", @@ -606,7 +605,6 @@ sui-authority-aggregation = { path = "crates/sui-authority-aggregation" } sui-benchmark = { path = "crates/sui-benchmark" } sui-bridge = { path = "crates/sui-bridge" } sui-cluster-test = { path = "crates/sui-cluster-test" } -sui-common = { path = "crates/sui-common" } sui-config = { path = "crates/sui-config" } sui-core = { path = "crates/sui-core" } sui-cost = { path = "crates/sui-cost" } diff --git a/crates/sui-authority-aggregation/src/lib.rs b/crates/sui-authority-aggregation/src/lib.rs index 880a4352b5bf5..a267c7cd7929a 100644 --- a/crates/sui-authority-aggregation/src/lib.rs +++ b/crates/sui-authority-aggregation/src/lib.rs @@ -50,7 +50,7 @@ pub async fn quorum_map_then_reduce_with_timeout_and_prefs< S, > where - K: Ord + ConciseableName<'a> + Copy + 'a, + K: Ord + ConciseableName<'a> + Clone + 'a, C: CommitteeTrait, FMap: FnOnce(K, Arc) -> AsyncResult<'a, V, E> + Clone + 'a, FReduce: Fn(S, K, StakeUnit, Result) -> BoxFuture<'a, ReduceOutput>, @@ -66,7 +66,7 @@ where let concise_name = name.concise_owned(); monitored_future!(async move { ( - name, + name.clone(), execute(name, client) .instrument( tracing::trace_span!("quorum_map_auth", authority =? concise_name), @@ -153,7 +153,7 @@ pub async fn quorum_map_then_reduce_with_timeout< S, > where - K: Ord + ConciseableName<'a> + Copy + 'a, + K: Ord + ConciseableName<'a> + Clone + 'a, C: CommitteeTrait, FMap: FnOnce(K, Arc) -> AsyncResult<'a, V, E> + Clone + 'a, FReduce: Fn(S, K, StakeUnit, Result) -> BoxFuture<'a, ReduceOutput> + 'a, diff --git a/crates/sui-bridge/Cargo.toml b/crates/sui-bridge/Cargo.toml index b158951ec711e..bab3b760dabb9 100644 --- a/crates/sui-bridge/Cargo.toml +++ b/crates/sui-bridge/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" ethers = "2.0" tokio = { workspace = true, features = ["full"] } sui-types.workspace = true -sui-common.workspace = true +sui-authority-aggregation.workspace = true arc-swap.workspace = true num_enum.workspace = true move-core-types.workspace = true diff --git a/crates/sui-bridge/src/client/bridge_authority_aggregator.rs b/crates/sui-bridge/src/client/bridge_authority_aggregator.rs index 493873b7e8af7..e4e7947622198 100644 --- a/crates/sui-bridge/src/client/bridge_authority_aggregator.rs +++ b/crates/sui-bridge/src/client/bridge_authority_aggregator.rs @@ -17,8 +17,8 @@ use std::collections::BTreeMap; use std::collections::BTreeSet; use std::sync::Arc; use std::time::Duration; -use sui_common::authority_aggregation::quorum_map_then_reduce_with_timeout_and_prefs; -use sui_common::authority_aggregation::ReduceOutput; +use sui_authority_aggregation::quorum_map_then_reduce_with_timeout_and_prefs; +use sui_authority_aggregation::ReduceOutput; use sui_types::base_types::ConciseableName; use sui_types::committee::StakeUnit; use sui_types::committee::TOTAL_VOTING_POWER; diff --git a/crates/sui-common/Cargo.toml b/crates/sui-common/Cargo.toml deleted file mode 100644 index 32d84e6f8bf26..0000000000000 --- a/crates/sui-common/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "sui-common" -authors = ["Mysten Labs "] -license = "Apache-2.0" -version = "0.1.0" -edition = "2021" -publish = false - -[dependencies] -sui-types.workspace = true -mysten-metrics.workspace = true -tokio.workspace = true -tracing.workspace = true -futures.workspace = true diff --git a/crates/sui-common/src/authority_aggregation.rs b/crates/sui-common/src/authority_aggregation.rs deleted file mode 100644 index a267c7cd7929a..0000000000000 --- a/crates/sui-common/src/authority_aggregation.rs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -use futures::Future; -use futures::{future::BoxFuture, stream::FuturesUnordered, StreamExt}; -use mysten_metrics::monitored_future; -use tracing::instrument::Instrument; - -use std::collections::{BTreeMap, BTreeSet}; -use std::sync::Arc; -use std::time::Duration; -use sui_types::base_types::ConciseableName; -use sui_types::committee::{CommitteeTrait, StakeUnit}; - -use tokio::time::timeout; - -pub type AsyncResult<'a, T, E> = BoxFuture<'a, Result>; - -pub enum ReduceOutput { - Continue(S), - ContinueWithTimeout(S, Duration), - Failed(S), - Success(R), -} - -pub async fn quorum_map_then_reduce_with_timeout_and_prefs< - 'a, - C, - K, - Client: 'a, - S, - V, - R, - E, - FMap, - FReduce, ->( - committee: Arc, - authority_clients: Arc>>, - authority_preferences: Option<&BTreeSet>, - initial_state: S, - map_each_authority: FMap, - reduce_result: FReduce, - initial_timeout: Duration, -) -> Result< - ( - R, - FuturesUnordered)> + 'a>, - ), - S, -> -where - K: Ord + ConciseableName<'a> + Clone + 'a, - C: CommitteeTrait, - FMap: FnOnce(K, Arc) -> AsyncResult<'a, V, E> + Clone + 'a, - FReduce: Fn(S, K, StakeUnit, Result) -> BoxFuture<'a, ReduceOutput>, -{ - let authorities_shuffled = committee.shuffle_by_stake(authority_preferences, None); - - // First, execute in parallel for each authority FMap. - let mut responses: futures::stream::FuturesUnordered<_> = authorities_shuffled - .into_iter() - .map(|name| { - let client = authority_clients[&name].clone(); - let execute = map_each_authority.clone(); - let concise_name = name.concise_owned(); - monitored_future!(async move { - ( - name.clone(), - execute(name, client) - .instrument( - tracing::trace_span!("quorum_map_auth", authority =? concise_name), - ) - .await, - ) - }) - }) - .collect(); - - let mut current_timeout = initial_timeout; - let mut accumulated_state = initial_state; - // Then, as results become available fold them into the state using FReduce. - while let Ok(Some((authority_name, result))) = timeout(current_timeout, responses.next()).await - { - let authority_weight = committee.weight(&authority_name); - accumulated_state = - match reduce_result(accumulated_state, authority_name, authority_weight, result).await { - // In the first two cases we are told to continue the iteration. - ReduceOutput::Continue(state) => state, - ReduceOutput::ContinueWithTimeout(state, duration) => { - // Adjust the waiting timeout. - current_timeout = duration; - state - } - ReduceOutput::Failed(state) => { - return Err(state); - } - ReduceOutput::Success(result) => { - // The reducer tells us that we have the result needed. Just return it. - return Ok((result, responses)); - } - } - } - // If we have exhausted all authorities and still have not returned a result, return - // error with the accumulated state. - Err(accumulated_state) -} - -/// This function takes an initial state, than executes an asynchronous function (FMap) for each -/// authority, and folds the results as they become available into the state using an async function (FReduce). -/// -/// FMap can do io, and returns a result V. An error there may not be fatal, and could be consumed by the -/// MReduce function to overall recover from it. This is necessary to ensure byzantine authorities cannot -/// interrupt the logic of this function. -/// -/// FReduce returns a result to a ReduceOutput. If the result is Err the function -/// shortcuts and the Err is returned. An Ok ReduceOutput result can be used to shortcut and return -/// the resulting state (ReduceOutput::End), continue the folding as new states arrive (ReduceOutput::Continue), -/// or continue with a timeout maximum waiting time (ReduceOutput::ContinueWithTimeout). -/// -/// This function provides a flexible way to communicate with a quorum of authorities, processing and -/// processing their results into a safe overall result, and also safely allowing operations to continue -/// past the quorum to ensure all authorities are up to date (up to a timeout). -pub async fn quorum_map_then_reduce_with_timeout< - 'a, - C, - K, - Client: 'a, - S: 'a, - V: 'a, - R: 'a, - E, - FMap, - FReduce, ->( - committee: Arc, - authority_clients: Arc>>, - // The initial state that will be used to fold in values from authorities. - initial_state: S, - // The async function used to apply to each authority. It takes an authority name, - // and authority client parameter and returns a Result. - map_each_authority: FMap, - // The async function that takes an accumulated state, and a new result for V from an - // authority and returns a result to a ReduceOutput state. - reduce_result: FReduce, - // The initial timeout applied to all - initial_timeout: Duration, -) -> Result< - ( - R, - FuturesUnordered)> + 'a>, - ), - S, -> -where - K: Ord + ConciseableName<'a> + Clone + 'a, - C: CommitteeTrait, - FMap: FnOnce(K, Arc) -> AsyncResult<'a, V, E> + Clone + 'a, - FReduce: Fn(S, K, StakeUnit, Result) -> BoxFuture<'a, ReduceOutput> + 'a, -{ - quorum_map_then_reduce_with_timeout_and_prefs( - committee, - authority_clients, - None, - initial_state, - map_each_authority, - reduce_result, - initial_timeout, - ) - .await -} diff --git a/crates/sui-common/src/lib.rs b/crates/sui-common/src/lib.rs deleted file mode 100644 index 284d4b9475280..0000000000000 --- a/crates/sui-common/src/lib.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -pub mod authority_aggregation; From ccbb3c2dc38aa8cfa59c3c63f8aa33e44418ef28 Mon Sep 17 00:00:00 2001 From: Zoe Braiterman Date: Wed, 17 Jul 2024 12:56:49 -0400 Subject: [PATCH 061/163] Grammar fix on the Wallet Standard page (#18703) ## Description Fix grammar on a doc page. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ * ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- docs/content/standards/wallet-standard.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/standards/wallet-standard.mdx b/docs/content/standards/wallet-standard.mdx index bccf1a5e4825a..0f2f6d2ab6565 100644 --- a/docs/content/standards/wallet-standard.mdx +++ b/docs/content/standards/wallet-standard.mdx @@ -209,6 +209,6 @@ to build Transaction using an object cache, and has a method to update it's inte effects of a transaction. Using the combination of `sui:signTransaction` and `sui:reportTransactionEffects` dApps can use -whichever API API they prefer to execute transactions, querying for whatever data the API exposes +whichever API they prefer to execute transactions, querying for whatever data the API exposes for use in the dapp, and by reporting the effects of the transaction to the wallet, the wallet should be able to execute transactions without running into issues caused by lagging indexer. From cdedf69b76d173c8534c575b89fabcabb279ec3f Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:03:00 -0700 Subject: [PATCH 062/163] =?UTF-8?q?[ts=20sdk]=20Add=20Arguments=20export?= =?UTF-8?q?=20for=20constructing=20Transaction=20arguments=20=E2=80=A6=20(?= =?UTF-8?q?#18540)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …without a Transaction instance ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .changeset/seven-turkeys-thank.md | 5 + sdk/typescript/src/transactions/Arguments.ts | 23 +++ .../src/transactions/Transaction.ts | 4 +- sdk/typescript/src/transactions/index.ts | 2 + sdk/typescript/src/transactions/pure.ts | 5 +- sdk/typescript/test/unit/arguments.test.ts | 137 ++++++++++++++++++ 6 files changed, 171 insertions(+), 5 deletions(-) create mode 100644 .changeset/seven-turkeys-thank.md create mode 100644 sdk/typescript/src/transactions/Arguments.ts create mode 100644 sdk/typescript/test/unit/arguments.test.ts diff --git a/.changeset/seven-turkeys-thank.md b/.changeset/seven-turkeys-thank.md new file mode 100644 index 0000000000000..b27e6e9127348 --- /dev/null +++ b/.changeset/seven-turkeys-thank.md @@ -0,0 +1,5 @@ +--- +'@mysten/sui': minor +--- + +Add Argument helpers for constructing transaction arguments without a Transaction instance diff --git a/sdk/typescript/src/transactions/Arguments.ts b/sdk/typescript/src/transactions/Arguments.ts new file mode 100644 index 0000000000000..920b3ff203423 --- /dev/null +++ b/sdk/typescript/src/transactions/Arguments.ts @@ -0,0 +1,23 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Inputs } from './Inputs.js'; +import { createPure } from './pure.js'; +import type { Transaction, TransactionObjectInput } from './Transaction.js'; + +export const Arguments = { + pure: createPure((value) => (tx: Transaction) => tx.pure(value)), + object: (value: TransactionObjectInput) => (tx: Transaction) => tx.object(value), + sharedObjectRef: + (...args: Parameters<(typeof Inputs)['SharedObjectRef']>) => + (tx: Transaction) => + tx.sharedObjectRef(...args), + objectRef: + (...args: Parameters<(typeof Inputs)['ObjectRef']>) => + (tx: Transaction) => + tx.objectRef(...args), + receivingRef: + (...args: Parameters<(typeof Inputs)['ReceivingRef']>) => + (tx: Transaction) => + tx.receivingRef(...args), +}; diff --git a/sdk/typescript/src/transactions/Transaction.ts b/sdk/typescript/src/transactions/Transaction.ts index ab3786e3e21ae..2dc90a4dd10a4 100644 --- a/sdk/typescript/src/transactions/Transaction.ts +++ b/sdk/typescript/src/transactions/Transaction.ts @@ -205,10 +205,10 @@ export class Transaction { } // Temporary workaround for the wallet interface accidentally serializing transactions via postMessage - get pure(): ReturnType { + get pure(): ReturnType> { Object.defineProperty(this, 'pure', { enumerable: false, - value: createPure((value): Argument => { + value: createPure((value): Argument => { if (isSerializedBcs(value)) { return this.#data.addInput('pure', { $kind: 'Pure', diff --git a/sdk/typescript/src/transactions/index.ts b/sdk/typescript/src/transactions/index.ts index cdbcf13631151..92dae65381206 100644 --- a/sdk/typescript/src/transactions/index.ts +++ b/sdk/typescript/src/transactions/index.ts @@ -45,3 +45,5 @@ export type { SerializeTransactionOptions, TransactionPlugin, } from './json-rpc-resolver.js'; + +export { Arguments } from './Arguments.js'; diff --git a/sdk/typescript/src/transactions/pure.ts b/sdk/typescript/src/transactions/pure.ts index 7e4519540e431..f4ea9828490f2 100644 --- a/sdk/typescript/src/transactions/pure.ts +++ b/sdk/typescript/src/transactions/pure.ts @@ -4,16 +4,15 @@ import type { SerializedBcs } from '@mysten/bcs'; import { bcs } from '../bcs/index.js'; -import type { Argument } from './data/internal.js'; -export function createPure(makePure: (value: SerializedBcs | Uint8Array) => Argument) { +export function createPure(makePure: (value: SerializedBcs | Uint8Array) => T) { function pure( /** * The pure value, serialized to BCS. If this is a Uint8Array, then the value * is assumed to be raw bytes, and will be used directly. */ value: SerializedBcs | Uint8Array, - ): Argument { + ): T { return makePure(value); } diff --git a/sdk/typescript/test/unit/arguments.test.ts b/sdk/typescript/test/unit/arguments.test.ts new file mode 100644 index 0000000000000..d737e5cc51e02 --- /dev/null +++ b/sdk/typescript/test/unit/arguments.test.ts @@ -0,0 +1,137 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { toB58 } from '@mysten/bcs'; +import { describe, expect, it } from 'vitest'; + +import { Arguments, Transaction } from '../../src/transactions'; + +describe('Arguments helpers', () => { + it('can use Arguments for building a transaction', async () => { + const args = [ + Arguments.object('0x123'), + Arguments.receivingRef({ + objectId: '1', + version: '123', + digest: toB58(new Uint8Array(32).fill(0x1)), + }), + Arguments.sharedObjectRef({ + objectId: '2', + mutable: true, + initialSharedVersion: '123', + }), + Arguments.objectRef({ + objectId: '3', + version: '123', + digest: toB58(new Uint8Array(32).fill(0x1)), + }), + Arguments.pure.address('0x2'), + ]; + + const tx = new Transaction(); + + tx.moveCall({ + target: '0x2::foo::bar', + arguments: args, + }); + + expect(tx.getData()).toMatchInlineSnapshot(` + { + "commands": [ + { + "$kind": "MoveCall", + "MoveCall": { + "arguments": [ + { + "$kind": "Input", + "Input": 0, + "type": "object", + }, + { + "$kind": "Input", + "Input": 1, + "type": "object", + }, + { + "$kind": "Input", + "Input": 2, + "type": "object", + }, + { + "$kind": "Input", + "Input": 3, + "type": "object", + }, + { + "$kind": "Input", + "Input": 4, + "type": "pure", + }, + ], + "function": "bar", + "module": "foo", + "package": "0x0000000000000000000000000000000000000000000000000000000000000002", + "typeArguments": [], + }, + }, + ], + "expiration": null, + "gasData": { + "budget": null, + "owner": null, + "payment": null, + "price": null, + }, + "inputs": [ + { + "$kind": "UnresolvedObject", + "UnresolvedObject": { + "objectId": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + }, + { + "$kind": "Object", + "Object": { + "$kind": "Receiving", + "Receiving": { + "digest": "4vJ9JU1bJJE96FWSJKvHsmmFADCg4gpZQff4P3bkLKi", + "objectId": "0x0000000000000000000000000000000000000000000000000000000000000001", + "version": "123", + }, + }, + }, + { + "$kind": "Object", + "Object": { + "$kind": "SharedObject", + "SharedObject": { + "initialSharedVersion": "123", + "mutable": true, + "objectId": "0x0000000000000000000000000000000000000000000000000000000000000002", + }, + }, + }, + { + "$kind": "Object", + "Object": { + "$kind": "ImmOrOwnedObject", + "ImmOrOwnedObject": { + "digest": "4vJ9JU1bJJE96FWSJKvHsmmFADCg4gpZQff4P3bkLKi", + "objectId": "0x0000000000000000000000000000000000000000000000000000000000000003", + "version": "123", + }, + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI=", + }, + }, + ], + "sender": null, + "version": 2, + } + `); + }); +}); From 086b2bc40bca2f59f3a09cd08654cd1693ba0910 Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:03:17 -0700 Subject: [PATCH 063/163] Add waitForLastTransaction to all executor classes (#18697) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .changeset/pink-wombats-appear.md | 5 +++++ .../src/transactions/executor/caching.ts | 16 ++++++++++++++-- .../src/transactions/executor/parallel.ts | 6 +++++- .../src/transactions/executor/serial.ts | 13 +++---------- sdk/typescript/test/e2e/object-cache.test.ts | 4 ++++ .../test/e2e/parallel-executor.test.ts | 5 +++++ sdk/typescript/test/e2e/serial-executor.test.ts | 6 +++++- 7 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 .changeset/pink-wombats-appear.md diff --git a/.changeset/pink-wombats-appear.md b/.changeset/pink-wombats-appear.md new file mode 100644 index 0000000000000..fefe0c2885f62 --- /dev/null +++ b/.changeset/pink-wombats-appear.md @@ -0,0 +1,5 @@ +--- +'@mysten/sui': minor +--- + +Add waitForLastTransaction methods to all executor classes diff --git a/sdk/typescript/src/transactions/executor/caching.ts b/sdk/typescript/src/transactions/executor/caching.ts index ecbd28b0eb9ea..e299b06d5577b 100644 --- a/sdk/typescript/src/transactions/executor/caching.ts +++ b/sdk/typescript/src/transactions/executor/caching.ts @@ -12,6 +12,7 @@ import { isTransaction } from '../Transaction.js'; export class CachingTransactionExecutor { #client: SuiClient; + #lastDigest: string | null = null; cache: ObjectCache; constructor({ @@ -29,8 +30,11 @@ export class CachingTransactionExecutor { * Immutable objects, Shared objects, and Move function definitions will be preserved */ async reset() { - await this.cache.clearOwnedObjects(); - await this.cache.clearCustom(); + await Promise.all([ + this.cache.clearOwnedObjects(), + this.cache.clearCustom(), + this.waitForLastTransaction(), + ]); } async buildTransaction({ @@ -94,6 +98,14 @@ export class CachingTransactionExecutor { } async applyEffects(effects: typeof bcs.TransactionEffects.$inferType) { + this.#lastDigest = effects.V2?.transactionDigest ?? null; await this.cache.applyEffects(effects); } + + async waitForLastTransaction() { + if (this.#lastDigest) { + await this.#client.waitForTransaction({ digest: this.#lastDigest }); + this.#lastDigest = null; + } + } } diff --git a/sdk/typescript/src/transactions/executor/parallel.ts b/sdk/typescript/src/transactions/executor/parallel.ts index d0fd55d86a303..a74eefc714920 100644 --- a/sdk/typescript/src/transactions/executor/parallel.ts +++ b/sdk/typescript/src/transactions/executor/parallel.ts @@ -100,6 +100,10 @@ export class ParallelTransactionExecutor { return this.#updateCache(() => this.#cache.reset()); } + async waitForLastTransaction() { + await this.#updateCache(() => this.#waitForLastDigest()); + } + async executeTransaction(transaction: Transaction) { const { promise, resolve, reject } = promiseWithResolvers<{ digest: string; @@ -404,7 +408,7 @@ export class ParallelTransactionExecutor { } txb.transferObjects(coinResults, address); - await this.#updateCache(() => this.#waitForLastDigest()); + await this.waitForLastTransaction(); const result = await this.#client.signAndExecuteTransaction({ transaction: txb, diff --git a/sdk/typescript/src/transactions/executor/serial.ts b/sdk/typescript/src/transactions/executor/serial.ts index c20d0e643380a..f301825ff887e 100644 --- a/sdk/typescript/src/transactions/executor/serial.ts +++ b/sdk/typescript/src/transactions/executor/serial.ts @@ -15,8 +15,6 @@ export class SerialTransactionExecutor { #queue = new SerialQueue(); #signer: Signer; #cache: CachingTransactionExecutor; - #client: SuiClient; - #lastDigest: string | null = null; constructor({ signer, @@ -26,7 +24,6 @@ export class SerialTransactionExecutor { signer: Signer; }) { this.#signer = signer; - this.#client = options.client; this.#cache = new CachingTransactionExecutor({ client: options.client, cache: options.cache, @@ -72,14 +69,11 @@ export class SerialTransactionExecutor { }; resetCache() { - return Promise.all([this.#cache.reset(), this.#waitForLastTransaction()]); + return this.#cache.reset(); } - async #waitForLastTransaction() { - if (this.#lastDigest) { - await this.#client.waitForTransaction({ digest: this.#lastDigest }); - this.#lastDigest = null; - } + waitForLastTransaction() { + return this.#cache.waitForLastTransaction(); } executeTransaction(transaction: Transaction | Uint8Array) { @@ -102,7 +96,6 @@ export class SerialTransactionExecutor { const effectsBytes = Uint8Array.from(results.rawEffects!); const effects = bcs.TransactionEffects.parse(effectsBytes); await this.applyEffects(effects); - this.#lastDigest = results.digest; return { digest: results.digest, diff --git a/sdk/typescript/test/e2e/object-cache.test.ts b/sdk/typescript/test/e2e/object-cache.test.ts index b9f181b5e06dc..ebce84241aa02 100644 --- a/sdk/typescript/test/e2e/object-cache.test.ts +++ b/sdk/typescript/test/e2e/object-cache.test.ts @@ -56,6 +56,10 @@ describe('CachingTransactionExecutor', async () => { )[0]!; }); + afterEach(async () => { + await executor.waitForLastTransaction(); + }); + afterEach(() => { vi.clearAllMocks(); }); diff --git a/sdk/typescript/test/e2e/parallel-executor.test.ts b/sdk/typescript/test/e2e/parallel-executor.test.ts index 850a27c699498..88d7c58b73ea9 100644 --- a/sdk/typescript/test/e2e/parallel-executor.test.ts +++ b/sdk/typescript/test/e2e/parallel-executor.test.ts @@ -1,6 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +import { afterEach } from 'node:test'; import { afterAll, beforeAll, beforeEach, describe, expect, it, Mock, vi } from 'vitest'; import { bcs } from '../../src/bcs'; @@ -30,6 +31,10 @@ beforeAll(async () => { vi.spyOn(toolbox.client, 'executeTransactionBlock'); }); +afterEach(async () => { + await executor.waitForLastTransaction(); +}); + afterAll(() => { vi.restoreAllMocks(); }); diff --git a/sdk/typescript/test/e2e/serial-executor.test.ts b/sdk/typescript/test/e2e/serial-executor.test.ts index d9f5872c515ef..830d32fa8bd5c 100644 --- a/sdk/typescript/test/e2e/serial-executor.test.ts +++ b/sdk/typescript/test/e2e/serial-executor.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { bcs } from '../../src/bcs'; import { Ed25519Keypair } from '../../src/keypairs/ed25519'; @@ -21,6 +21,10 @@ beforeAll(async () => { vi.spyOn(toolbox.client, 'getCoins'); }); +afterEach(async () => { + await executor.waitForLastTransaction(); +}); + afterAll(() => { vi.restoreAllMocks(); }); From 14ea5c4b6b5aec1955b4956b326ba5da177d3aa5 Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Wed, 17 Jul 2024 11:03:24 -0700 Subject: [PATCH 064/163] Enable consensus commit prologue V3 on mainnet (#18691) ## Description To be out in 1.30 ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-protocol-config/src/lib.rs | 7 +++++++ .../sui_protocol_config__test__Mainnet_version_53.snap | 2 ++ 2 files changed, 9 insertions(+) diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 824ea99ae9df8..9c6dfc646f89a 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -162,6 +162,7 @@ const MAX_PROTOCOL_VERSION: u64 = 53; // Add support for passkey in devnet. // Enable deny list v2 on testnet and mainnet. // Version 53: Add feature flag to decide whether to attempt to finalize bridge committee +// Enable consensus commit prologue V3 on testnet. #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -2493,6 +2494,12 @@ impl ProtocolConfig { 53 => { // Do not allow bridge committee to finalize on mainnet. cfg.bridge_should_try_to_finalize_committee = Some(chain != Chain::Mainnet); + + // Enable consensus commit prologue V3 on mainnet. + cfg.feature_flags + .record_consensus_determined_version_assignments_in_prologue = true; + cfg.feature_flags + .prepend_prologue_tx_in_consensus_commit_in_checkpoints = true; } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap index dae3269f827e8..d91e312f2ba54 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap @@ -50,7 +50,9 @@ feature_flags: 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 enable_coin_deny_list_v2: true max_tx_size_bytes: 131072 From beed646993dc128ab5eb45eba7b3ade08e323a5f Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:07:27 -0700 Subject: [PATCH 065/163] add tx.pure.vector and tx.pure.option (#18561) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .changeset/silver-tomatoes-refuse.md | 5 + .../transaction-building/basics.mdx | 30 ++++ sdk/typescript/src/transactions/pure.ts | 107 ++++++++++++- sdk/typescript/test/e2e/utils/setup.ts | 2 +- .../test/unit/pure-serialization.test.ts | 144 ++++++++++++++++++ 5 files changed, 285 insertions(+), 3 deletions(-) create mode 100644 .changeset/silver-tomatoes-refuse.md create mode 100644 sdk/typescript/test/unit/pure-serialization.test.ts diff --git a/.changeset/silver-tomatoes-refuse.md b/.changeset/silver-tomatoes-refuse.md new file mode 100644 index 0000000000000..57409dd9bd960 --- /dev/null +++ b/.changeset/silver-tomatoes-refuse.md @@ -0,0 +1,5 @@ +--- +'@mysten/sui': minor +--- + +Add tx.pure.vector and tx.pure.option methods diff --git a/sdk/docs/pages/typescript/transaction-building/basics.mdx b/sdk/docs/pages/typescript/transaction-building/basics.mdx index 07e92af1a3170..4c53a4a5ea2fd 100644 --- a/sdk/docs/pages/typescript/transaction-building/basics.mdx +++ b/sdk/docs/pages/typescript/transaction-building/basics.mdx @@ -113,6 +113,36 @@ tx.transferObjects([coin], tx.pure.address('0xSomeSuiAddress')); tx.transferObjects([coin], tx.pure(bcs.Address.serialize('0xSomeSuiAddress'))); ``` +To pass `vector` or `option` types, you you can pass use the corresponding methods on `tx.pure`, use +tx.pure as a function with a type argument, or serialize the value before passing it to tx.pure +using the bcs sdk: + +```ts +import { bcs } from '@mysten/sui/bcs'; + +tx.moveCall({ + target: '0x2::foo::bar', + arguments: [ + // using vector and option methods + tx.pure.vector('u8', [1, 2, 3]), + tx.pure.option('u8', 1), + tx.pure.option('u8', null), + + // Using pure with type arguments + tx.pure('vector', [1, 2, 3]), + tx.pure('option', 1), + tx.pure('option', null), + tx.pure('vector>', [1, null, 2]), + + // Using bcs.serialize + tx.pure(bcs.vector(bcs.U8).serialize([1, 2, 3])), + tx.pure(bcs.option(bcs.U8).serialize(1)), + tx.pure(bcs.option(bcs.U8).serialize(null)), + tx.pure(bcs.vector(bcs.option(bcs.U8)).serialize([1, null, 2])), + ], +}); +``` + #### Object references To use an on chain object as a transaction input, you must pass a reference to that object. This can diff --git a/sdk/typescript/src/transactions/pure.ts b/sdk/typescript/src/transactions/pure.ts index f4ea9828490f2..ea7332519c6e6 100644 --- a/sdk/typescript/src/transactions/pure.ts +++ b/sdk/typescript/src/transactions/pure.ts @@ -1,19 +1,39 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { SerializedBcs } from '@mysten/bcs'; +import { isSerializedBcs } from '@mysten/bcs'; +import type { BcsType, SerializedBcs } from '@mysten/bcs'; import { bcs } from '../bcs/index.js'; +import type { Argument } from './data/internal.js'; export function createPure(makePure: (value: SerializedBcs | Uint8Array) => T) { + function pure( + type: T extends PureTypeName ? ValidPureTypeName : T, + value: ShapeFromPureTypeName, + ): T; + function pure( /** * The pure value, serialized to BCS. If this is a Uint8Array, then the value * is assumed to be raw bytes, and will be used directly. */ value: SerializedBcs | Uint8Array, + ): T; + + function pure( + typeOrSerializedValue?: PureTypeName | SerializedBcs | Uint8Array, + value?: unknown, ): T { - return makePure(value); + if (typeof typeOrSerializedValue === 'string') { + return makePure(schemaFromName(typeOrSerializedValue).serialize(value as never)); + } + + if (typeOrSerializedValue instanceof Uint8Array || isSerializedBcs(typeOrSerializedValue)) { + return makePure(typeOrSerializedValue); + } + + throw new Error('tx.pure must be called either a bcs type name, or a serialized bcs value'); } pure.u8 = (value: number) => makePure(bcs.U8.serialize(value)); @@ -26,6 +46,89 @@ export function createPure(makePure: (value: SerializedBcs | Uint8A pure.string = (value: string) => makePure(bcs.String.serialize(value)); pure.address = (value: string) => makePure(bcs.Address.serialize(value)); pure.id = pure.address; + pure.vector = ( + type: T extends PureTypeName ? ValidPureTypeName : Type, + value: Iterable> & { length: number }, + ) => { + return makePure(bcs.vector(schemaFromName(type as BasePureType)).serialize(value as never)); + }; + pure.option = ( + type: T extends PureTypeName ? ValidPureTypeName : Type, + value: ShapeFromPureTypeName | null | undefined, + ) => { + return makePure(bcs.option(schemaFromName(type)).serialize(value as never)); + }; return pure; } + +export type BasePureType = + | 'u8' + | 'u16' + | 'u32' + | 'u64' + | 'u128' + | 'u256' + | 'bool' + | 'id' + | 'string' + | 'address'; + +export type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`; +export type ValidPureTypeName = T extends BasePureType + ? PureTypeName + : T extends `vector<${infer U}>` + ? ValidPureTypeName + : T extends `option<${infer U}>` + ? ValidPureTypeName + : PureTypeValidationError; + +type ShapeFromPureTypeName = T extends BasePureType + ? Parameters>[T]>[0] + : T extends `vector<${infer U extends PureTypeName}>` + ? ShapeFromPureTypeName[] + : T extends `option<${infer U extends PureTypeName}>` + ? ShapeFromPureTypeName | null + : never; + +type PureTypeValidationError = T & { + error: `Invalid Pure type name: ${T}`; +}; + +function schemaFromName( + name: T extends PureTypeName ? ValidPureTypeName : T, +): BcsType> { + switch (name) { + case 'u8': + return bcs.u8() as never; + case 'u16': + return bcs.u16() as never; + case 'u32': + return bcs.u32() as never; + case 'u64': + return bcs.u64() as never; + case 'u128': + return bcs.u128() as never; + case 'u256': + return bcs.u256() as never; + case 'bool': + return bcs.bool() as never; + case 'string': + return bcs.string() as never; + case 'id': + case 'address': + return bcs.Address as never; + } + + const generic = name.match(/^(vector|option)<(.+)>$/); + if (generic) { + const [kind, inner] = generic.slice(1); + if (kind === 'vector') { + return bcs.vector(schemaFromName(inner as PureTypeName)) as never; + } else { + return bcs.option(schemaFromName(inner as PureTypeName)) as never; + } + } + + throw new Error(`Invalid Pure type name: ${name}`); +} diff --git a/sdk/typescript/test/e2e/utils/setup.ts b/sdk/typescript/test/e2e/utils/setup.ts index c67bd64b2c83a..037e490f013d5 100644 --- a/sdk/typescript/test/e2e/utils/setup.ts +++ b/sdk/typescript/test/e2e/utils/setup.ts @@ -238,7 +238,7 @@ export async function upgradePackage( const cap = tx.object(capId); const ticket = tx.moveCall({ target: '0x2::package::authorize_upgrade', - arguments: [cap, tx.pure.u8(UpgradePolicy.COMPATIBLE), tx.pure(digest)], + arguments: [cap, tx.pure.u8(UpgradePolicy.COMPATIBLE), tx.pure.vector('u8', digest)], }); const receipt = tx.upgrade({ diff --git a/sdk/typescript/test/unit/pure-serialization.test.ts b/sdk/typescript/test/unit/pure-serialization.test.ts new file mode 100644 index 0000000000000..ab25810ceb6ae --- /dev/null +++ b/sdk/typescript/test/unit/pure-serialization.test.ts @@ -0,0 +1,144 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { bcs } from '@mysten/bcs'; +import { describe, expect, test } from 'vitest'; + +import { Transaction } from '../../src/transactions'; + +describe('tx.pure serialization', () => { + test('serialized pure values', () => { + const tx = new Transaction(); + + tx.pure.u8(1); + tx.pure.u16(1); + tx.pure.u32(1); + tx.pure.u64(1n); + tx.pure.u128(1n); + tx.pure.u256(1n); + tx.pure.bool(true); + tx.pure.string('foo'); + tx.pure.address('0x2'); + tx.pure.id('0x2'); + tx.pure(bcs.vector(bcs.u8()).serialize([1, 2, 3])); + tx.pure(bcs.option(bcs.u8()).serialize(1)); + tx.pure(bcs.option(bcs.u8()).serialize(null)); + tx.pure( + bcs.option(bcs.vector(bcs.vector(bcs.option(bcs.u8())))).serialize([ + [1, null, 3], + [4, null, 6], + ]), + ); + + const tx2 = new Transaction(); + + tx2.pure('u8', 1); + tx2.pure('u16', 1); + tx2.pure('u32', 1); + tx2.pure('u64', 1n); + tx2.pure('u128', 1n); + tx2.pure('u256', 1n); + tx2.pure('bool', true); + tx2.pure('string', 'foo'); + tx2.pure('address', '0x2'); + tx2.pure('id', '0x2'); + tx2.pure('vector', [1, 2, 3]); + tx2.pure('option', 1); + tx2.pure('option', null); + tx2.pure('option>>>', [ + [1, null, 3], + [4, null, 6], + ]); + + expect(tx.getData().inputs).toEqual(tx2.getData().inputs); + + expect(tx.getData().inputs).toMatchInlineSnapshot(` + [ + { + "$kind": "Pure", + "Pure": { + "bytes": "AQ==", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQA=", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQAAAA==", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQAAAAAAAAA=", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQAAAAAAAAAAAAAAAAAAAA==", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQ==", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "A2Zvbw==", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI=", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI=", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AwECAw==", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQE=", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AA==", + }, + }, + { + "$kind": "Pure", + "Pure": { + "bytes": "AQIDAQEAAQMDAQQAAQY=", + }, + }, + ] + `); + }); +}); From ddf42d3d61e3f5ef1dfcb1f6c4d13c8708c8eb23 Mon Sep 17 00:00:00 2001 From: "sui-merge-bot[bot]" <114704316+sui-merge-bot[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:23:08 +0000 Subject: [PATCH 066/163] Version Packages (#18555) This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @mysten/sui@1.3.0 ### Minor Changes - 086b2bc: Add waitForLastTransaction methods to all executor classes - cdedf69: Add Argument helpers for constructing transaction arguments without a Transaction instance - beed646: Add tx.pure.vector and tx.pure.option methods ### Patch Changes - 7fc464a: Remove unique symbols from types to improve compatability between version - 0fb0628: Mark subscription methods as deprecated. - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [0f27a97] - @mysten/bcs@1.0.3 ## @mysten/bcs@1.0.3 ### Patch Changes - 7fc464a: Remove unique symbols from types to improve compatability between version - 0f27a97: Update dependencies ## @mysten/create-dapp@0.3.12 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 - @mysten/dapp-kit@0.14.12 ## @mysten/dapp-kit@0.14.12 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 - @mysten/wallet-standard@0.12.12 - @mysten/zksend@0.10.1 ## @mysten/deepbook@0.8.11 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 ## @mysten/enoki@0.3.11 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 - @mysten/zklogin@0.7.11 ## @mysten/graphql-transport@0.2.11 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 - @mysten/bcs@1.0.3 ## @mysten/kiosk@0.9.11 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 ## @mysten/ledgerjs-hw-app-sui@0.4.1 ### Patch Changes - 0f27a97: Update dependencies ## @mysten/suins-toolkit@0.5.11 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 ## @mysten/wallet-standard@0.12.12 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 ## @mysten/zklogin@0.7.11 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 - @mysten/bcs@1.0.3 ## @mysten/zksend@0.10.1 ### Patch Changes - 0f27a97: Update dependencies - Updated dependencies [7fc464a] - Updated dependencies [086b2bc] - Updated dependencies [0fb0628] - Updated dependencies [cdedf69] - Updated dependencies [0f27a97] - Updated dependencies [beed646] - @mysten/sui@1.3.0 - @mysten/wallet-standard@0.12.12 Co-authored-by: github-actions[bot] --- .changeset/late-peas-greet.md | 6 - .changeset/pink-wombats-appear.md | 5 - .changeset/seven-chicken-occur.md | 5 - .changeset/seven-turkeys-thank.md | 5 - .changeset/shaggy-cows-decide.md | 17 -- .changeset/silver-tomatoes-refuse.md | 5 - sdk/bcs/CHANGELOG.md | 40 +++- sdk/bcs/package.json | 2 +- sdk/create-dapp/CHANGELOG.md | 20 +- sdk/create-dapp/package.json | 2 +- sdk/dapp-kit/CHANGELOG.md | 43 ++-- sdk/dapp-kit/package.json | 2 +- sdk/deepbook/CHANGELOG.md | 28 ++- sdk/deepbook/package.json | 2 +- sdk/enoki/CHANGELOG.md | 20 +- sdk/enoki/package.json | 2 +- sdk/graphql-transport/CHANGELOG.md | 20 +- sdk/graphql-transport/package.json | 2 +- sdk/kiosk/CHANGELOG.md | 47 ++++- sdk/kiosk/package.json | 2 +- sdk/ledgerjs-hw-app-sui/CHANGELOG.md | 20 +- sdk/ledgerjs-hw-app-sui/package.json | 2 +- sdk/suins-toolkit/CHANGELOG.md | 22 +- sdk/suins-toolkit/package.json | 2 +- sdk/typescript/CHANGELOG.md | 288 +++++++++++++++++++-------- sdk/typescript/package.json | 2 +- sdk/typescript/src/version.ts | 4 +- sdk/wallet-standard/CHANGELOG.md | 74 +++++-- sdk/wallet-standard/package.json | 2 +- sdk/zklogin/CHANGELOG.md | 23 ++- sdk/zklogin/package.json | 2 +- sdk/zksend/CHANGELOG.md | 32 ++- sdk/zksend/package.json | 2 +- 33 files changed, 528 insertions(+), 222 deletions(-) delete mode 100644 .changeset/late-peas-greet.md delete mode 100644 .changeset/pink-wombats-appear.md delete mode 100644 .changeset/seven-chicken-occur.md delete mode 100644 .changeset/seven-turkeys-thank.md delete mode 100644 .changeset/shaggy-cows-decide.md delete mode 100644 .changeset/silver-tomatoes-refuse.md diff --git a/.changeset/late-peas-greet.md b/.changeset/late-peas-greet.md deleted file mode 100644 index 8e823c61d80a6..0000000000000 --- a/.changeset/late-peas-greet.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@mysten/sui': patch -'@mysten/bcs': patch ---- - -Remove unique symbols from types to improve compatability between version diff --git a/.changeset/pink-wombats-appear.md b/.changeset/pink-wombats-appear.md deleted file mode 100644 index fefe0c2885f62..0000000000000 --- a/.changeset/pink-wombats-appear.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui': minor ---- - -Add waitForLastTransaction methods to all executor classes diff --git a/.changeset/seven-chicken-occur.md b/.changeset/seven-chicken-occur.md deleted file mode 100644 index fc618ebc9b4c8..0000000000000 --- a/.changeset/seven-chicken-occur.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui': patch ---- - -Mark subscription methods as deprecated. diff --git a/.changeset/seven-turkeys-thank.md b/.changeset/seven-turkeys-thank.md deleted file mode 100644 index b27e6e9127348..0000000000000 --- a/.changeset/seven-turkeys-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui': minor ---- - -Add Argument helpers for constructing transaction arguments without a Transaction instance diff --git a/.changeset/shaggy-cows-decide.md b/.changeset/shaggy-cows-decide.md deleted file mode 100644 index 17760047724e4..0000000000000 --- a/.changeset/shaggy-cows-decide.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@mysten/ledgerjs-hw-app-sui': patch -'@mysten/graphql-transport': patch -'@mysten/wallet-standard': patch -'@mysten/suins-toolkit': patch -'@mysten/create-dapp': patch -'@mysten/sui': patch -'@mysten/dapp-kit': patch -'@mysten/deepbook': patch -'@mysten/zklogin': patch -'@mysten/zksend': patch -'@mysten/enoki': patch -'@mysten/kiosk': patch -'@mysten/bcs': patch ---- - -Update dependencies diff --git a/.changeset/silver-tomatoes-refuse.md b/.changeset/silver-tomatoes-refuse.md deleted file mode 100644 index 57409dd9bd960..0000000000000 --- a/.changeset/silver-tomatoes-refuse.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui': minor ---- - -Add tx.pure.vector and tx.pure.option methods diff --git a/sdk/bcs/CHANGELOG.md b/sdk/bcs/CHANGELOG.md index 343554970bcd0..0bf7a819eed89 100644 --- a/sdk/bcs/CHANGELOG.md +++ b/sdk/bcs/CHANGELOG.md @@ -1,10 +1,18 @@ # Change Log +## 1.0.3 + +### Patch Changes + +- 7fc464a: Remove unique symbols from types to improve compatability between version +- 0f27a97: Update dependencies + ## 1.0.2 ### Patch Changes -- 369b924343: Improve error messages when attempting to serialze non-array values that should be arrays +- 369b924343: Improve error messages when attempting to serialze non-array values that should be + arrays ## 1.0.1 @@ -16,8 +24,10 @@ ### Major Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ## 0.11.1 @@ -53,7 +63,8 @@ ### Minor Changes -- fce0a08d0f: Deprecate the bcs.generic helper. This helper causes typescript performance issues, and the generated generics can't be exported +- fce0a08d0f: Deprecate the bcs.generic helper. This helper causes typescript performance issues, + and the generated generics can't be exported ## 0.8.1 @@ -65,7 +76,8 @@ ### Minor Changes -- 1bc430161: Add new type-safe schema builder. See https://sdk.mystenlabs.com/bcs for updated documentation +- 1bc430161: Add new type-safe schema builder. See https://sdk.mystenlabs.com/bcs for updated + documentation - e4484852b: Add isSerializedBcs helper ## 0.7.4 @@ -97,14 +109,17 @@ ### Minor Changes -- 19b567f21: Unified self- and delegated staking flows. Removed fields from `Validator` (`stake_amount`, `pending_stake`, and `pending_withdraw`) and renamed `delegation_staking_pool` to `staking_pool`. Additionally removed the `validator_stake` and `delegated_stake` fields in the `ValidatorSet` type and replaced them with a `total_stake` field. +- 19b567f21: Unified self- and delegated staking flows. Removed fields from `Validator` + (`stake_amount`, `pending_stake`, and `pending_withdraw`) and renamed `delegation_staking_pool` to + `staking_pool`. Additionally removed the `validator_stake` and `delegated_stake` fields in the + `ValidatorSet` type and replaced them with a `total_stake` field. - 5c3b00cde: Add object id to staking pool and pool id to staked sui. -- 3d9a04648: Adds `deactivation_epoch` to staking pool object, and adds `inactive_pools` to the validator set object. +- 3d9a04648: Adds `deactivation_epoch` to staking pool object, and adds `inactive_pools` to the + validator set object. - a8049d159: Fixes the issue with deep nested generics by introducing array type names - - all of the methods (except for aliasing) now allow passing in arrays instead - of strings to allow for easier composition of generics and avoid using template - strings + - all of the methods (except for aliasing) now allow passing in arrays instead of strings to allow + for easier composition of generics and avoid using template strings ```js // new syntax @@ -123,7 +138,10 @@ Similar approach applies to `bcs.ser()` and `bcs.de()` as well as to other register\* methods - a0955c479: Switch from 20 to 32-byte address. Match Secp256k1.deriveKeypair with Ed25519. -- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument names, RPC endpoints, Move functions, and object fields have been updated with this new naming convention. +- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various + capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument + names, RPC endpoints, Move functions, and object fields have been updated with this new naming + convention. - 77bdf907f: When parsing u64, u128, and u256 values with bcs, they are now string encoded. ## 0.6.1 diff --git a/sdk/bcs/package.json b/sdk/bcs/package.json index aa575ee491f10..8b33a50bf0b97 100644 --- a/sdk/bcs/package.json +++ b/sdk/bcs/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/bcs", - "version": "1.0.2", + "version": "1.0.3", "description": "BCS - Canonical Binary Serialization implementation for JavaScript", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/sdk/create-dapp/CHANGELOG.md b/sdk/create-dapp/CHANGELOG.md index fa29e9e6c8097..cb300f30d4b5d 100644 --- a/sdk/create-dapp/CHANGELOG.md +++ b/sdk/create-dapp/CHANGELOG.md @@ -1,5 +1,19 @@ # @mysten/create-dapp +## 0.3.12 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + - @mysten/dapp-kit@0.14.12 + ## 0.3.11 ### Patch Changes @@ -92,8 +106,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes diff --git a/sdk/create-dapp/package.json b/sdk/create-dapp/package.json index 45af91b5e5530..1416a064bb092 100644 --- a/sdk/create-dapp/package.json +++ b/sdk/create-dapp/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "A CLI for creating new Sui dApps", "homepage": "https://sdk.mystenlabs.com", - "version": "0.3.11", + "version": "0.3.12", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/sdk/dapp-kit/CHANGELOG.md b/sdk/dapp-kit/CHANGELOG.md index 637f9773e2ad2..36fef53cf62cc 100644 --- a/sdk/dapp-kit/CHANGELOG.md +++ b/sdk/dapp-kit/CHANGELOG.md @@ -1,5 +1,20 @@ # @mysten/dapp-kit +## 0.14.12 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + - @mysten/wallet-standard@0.12.12 + - @mysten/zksend@0.10.1 + ## 0.14.11 ### Patch Changes @@ -106,8 +121,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -122,7 +139,8 @@ ### Patch Changes -- 3f8b08dedc: Fix broken theme style tag in canary versions of React when the provider is placed outside of the body tag +- 3f8b08dedc: Fix broken theme style tag in canary versions of React when the provider is placed + outside of the body tag - Updated dependencies [eeb19db837] - @mysten/zksend@0.8.2 @@ -138,7 +156,8 @@ ### Minor Changes -- 807262f394: The `zksend` property on the `WalletProvider` has been replaced with a `stashedWallet` option. +- 807262f394: The `zksend` property on the `WalletProvider` has been replaced with a `stashedWallet` + option. ### Patch Changes @@ -431,14 +450,12 @@ ### Minor Changes - d4d9c9218: Upgrade dapp-kit and the scaffold applications to react-query v5 -- fb0ce3485: Add global connection status info and change the hook interface of `useCurrentWallet` to - return an object to encapsulate connection info together. To migrate: +- fb0ce3485: Add global connection status info and change the hook interface of `useCurrentWallet` + to return an object to encapsulate connection info together. To migrate: - Before: - const currentWallet = useCurrentWallet(); + Before: const currentWallet = useCurrentWallet(); - After: - const { currentWallet } = useCurrentWallet(); + After: const { currentWallet } = useCurrentWallet(); ### Patch Changes @@ -467,7 +484,8 @@ - 361818abc: execute transaction from dApp rather than wallet in useSignAndExecuteTransactionBlock - 2b532bc37: Fix issue where CSS was being overridden by application code - 0c5cdc049: Expose types related to theming -- c7e12c928: Infer the active chain when signing transactions and expose some more descriptive errors +- c7e12c928: Infer the active chain when signing transactions and expose some more descriptive + errors ### Patch Changes @@ -513,7 +531,8 @@ - b29f66f18: Add theme definitions for our UI components - 1227ee1ce: Theme UI components based on provided theme and add design polish -- 8e9590a8c: Exclude non-Sui accounts from the accounts state when someone connects a multi-chain wallet +- 8e9590a8c: Exclude non-Sui accounts from the accounts state when someone connects a multi-chain + wallet ## 0.1.0 diff --git a/sdk/dapp-kit/package.json b/sdk/dapp-kit/package.json index 0c1e2e9c6265e..595fc54315cca 100644 --- a/sdk/dapp-kit/package.json +++ b/sdk/dapp-kit/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "A collection of React hooks and components for interacting with the Sui blockchain and wallets.", "homepage": "https://sdk.mystenlabs.com/typescript", - "version": "0.14.11", + "version": "0.14.12", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/sdk/deepbook/CHANGELOG.md b/sdk/deepbook/CHANGELOG.md index 5c7361f6d5e91..5868cf6fddd58 100644 --- a/sdk/deepbook/CHANGELOG.md +++ b/sdk/deepbook/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/deepbook +## 0.8.11 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + ## 0.8.10 ### Patch Changes @@ -76,8 +89,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -147,7 +162,8 @@ ### Minor Changes -- b8fe02be26: GetLevel2BookStatus method of deepbook can retrieve both ask and bid side in a single call, if input argument is equal to 'both'. +- b8fe02be26: GetLevel2BookStatus method of deepbook can retrieve both ask and bid side in a single + call, if input argument is equal to 'both'. ### Patch Changes @@ -214,7 +230,8 @@ ### Patch Changes -- 43444c58f: Extend the `TransactionBlock#object()` API to accept the `TransactionResult` type as well, so that it can be used flexibly in SDKs. +- 43444c58f: Extend the `TransactionBlock#object()` API to accept the `TransactionResult` type as + well, so that it can be used flexibly in SDKs. - Updated dependencies [28c2c3330] - Updated dependencies [43444c58f] - Updated dependencies [8d1e74e52] @@ -336,7 +353,8 @@ - 6d41059c7: Update to use modular imports from @mysten/sui.js - Some methods now accept a `SuiClient` imported from `@mysten/sui.js/client` rather than a `JsonRpcProvider` + Some methods now accept a `SuiClient` imported from `@mysten/sui.js/client` rather than a + `JsonRpcProvider` ### Patch Changes diff --git a/sdk/deepbook/package.json b/sdk/deepbook/package.json index bfc96f65b298e..95e1079380dc0 100644 --- a/sdk/deepbook/package.json +++ b/sdk/deepbook/package.json @@ -2,7 +2,7 @@ "name": "@mysten/deepbook", "author": "Mysten Labs ", "description": "Sui Deepbook SDK", - "version": "0.8.10", + "version": "0.8.11", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/sdk/enoki/CHANGELOG.md b/sdk/enoki/CHANGELOG.md index 54b1bd307f39f..0b95b8580721e 100644 --- a/sdk/enoki/CHANGELOG.md +++ b/sdk/enoki/CHANGELOG.md @@ -1,5 +1,19 @@ # @mysten/enoki +## 0.3.11 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + - @mysten/zklogin@0.7.11 + ## 0.3.10 ### Patch Changes @@ -86,8 +100,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes diff --git a/sdk/enoki/package.json b/sdk/enoki/package.json index 11d5263e898c4..74e053d1c6ccc 100644 --- a/sdk/enoki/package.json +++ b/sdk/enoki/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/enoki", - "version": "0.3.10", + "version": "0.3.11", "description": "TODO: Description", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/sdk/graphql-transport/CHANGELOG.md b/sdk/graphql-transport/CHANGELOG.md index 572b5f7f8759e..020caa3d4755d 100644 --- a/sdk/graphql-transport/CHANGELOG.md +++ b/sdk/graphql-transport/CHANGELOG.md @@ -1,5 +1,19 @@ # @mysten/graphql-transport +## 0.2.11 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + - @mysten/bcs@1.0.3 + ## 0.2.10 ### Patch Changes @@ -80,8 +94,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes diff --git a/sdk/graphql-transport/package.json b/sdk/graphql-transport/package.json index a273520ae85f9..c22203491491f 100644 --- a/sdk/graphql-transport/package.json +++ b/sdk/graphql-transport/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/graphql-transport", - "version": "0.2.10", + "version": "0.2.11", "description": "A GraphQL transport to allow SuiClient to work with RPC 2.0", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/sdk/kiosk/CHANGELOG.md b/sdk/kiosk/CHANGELOG.md index c41b1dd5aa7b4..d21c10dc613d6 100644 --- a/sdk/kiosk/CHANGELOG.md +++ b/sdk/kiosk/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/kiosk +## 0.9.11 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + ## 0.9.10 ### Patch Changes @@ -76,8 +89,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -148,7 +163,9 @@ ### Patch Changes -- a3971c3524: Fixes `lock` function arguments. `itemId` is replaced by `item`, which accepts an ObjectArgument instead of a string. `itemId` is still supported but deprecated, and will be removed in future versions. +- a3971c3524: Fixes `lock` function arguments. `itemId` is replaced by `item`, which accepts an + ObjectArgument instead of a string. `itemId` is still supported but deprecated, and will be + removed in future versions. - Updated dependencies [a34f1cb67d] - Updated dependencies [c08e3569ef] - Updated dependencies [9a14e61db4] @@ -212,7 +229,8 @@ ### Patch Changes -- 43444c58f: Extend the `TransactionBlock#object()` API to accept the `TransactionResult` type as well, so that it can be used flexibly in SDKs. +- 43444c58f: Extend the `TransactionBlock#object()` API to accept the `TransactionResult` type as + well, so that it can be used flexibly in SDKs. - 3718a230b: Adds `txb.pure.id()` to pass ID pure values more intuitively - Updated dependencies [28c2c3330] - Updated dependencies [43444c58f] @@ -240,7 +258,8 @@ ### Patch Changes - b48289346: Mark packages as being side-effect free. -- 3699dd364: Adds support for extensions (on `getKiosk()`), and exports a `getKioskExtension()` function on kioskClient to get extension's content +- 3699dd364: Adds support for extensions (on `getKiosk()`), and exports a `getKioskExtension()` + function on kioskClient to get extension's content - Updated dependencies [b48289346] - Updated dependencies [11cf4e68b] - @mysten/sui.js@0.44.0 @@ -288,7 +307,8 @@ ### Minor Changes -- 5ee8c24f1: Introduces BREAKING CHANGES. Migration guide and explanation: https://sdk.mystenlabs.com/kiosk/from-v1 +- 5ee8c24f1: Introduces BREAKING CHANGES. Migration guide and explanation: + https://sdk.mystenlabs.com/kiosk/from-v1 ## 0.6.0 @@ -348,7 +368,8 @@ - cc6441f46: Updated types and imports to use new modular exports from the `@mysten/sui.js` refactor - 6d41059c7: Update to use modular imports from @mysten/sui.js - Some methods now accept a `SuiClient` imported from `@mysten/sui.js/client` rather than a `JsonRpcProvider` + Some methods now accept a `SuiClient` imported from `@mysten/sui.js/client` rather than a + `JsonRpcProvider` ### Patch Changes @@ -389,9 +410,12 @@ ### Patch Changes -- 6a2a42d779: Add `getOwnedKiosks` query to easily get owned kiosks and their ownerCaps for an address -- abf6ad381e: Refactor the fetchKiosk function to return all content instead of paginating, to prevent missing data -- d72fdb5a5c: Fix on createTransferPolicy method. Updated type arguments for public_share_object command. +- 6a2a42d779: Add `getOwnedKiosks` query to easily get owned kiosks and their ownerCaps for an + address +- abf6ad381e: Refactor the fetchKiosk function to return all content instead of paginating, to + prevent missing data +- d72fdb5a5c: Fix on createTransferPolicy method. Updated type arguments for public_share_object + command. - Updated dependencies [3ea9adb71a] - Updated dependencies [1cfb1c9da3] - Updated dependencies [1cfb1c9da3] @@ -402,7 +426,8 @@ ### Minor Changes -- 968304368d: Support kiosk_lock_rule and environment support for rules package. Breaks `purchaseAndResolvePolicies` as it changes signature and return format. +- 968304368d: Support kiosk_lock_rule and environment support for rules package. Breaks + `purchaseAndResolvePolicies` as it changes signature and return format. ### Patch Changes diff --git a/sdk/kiosk/package.json b/sdk/kiosk/package.json index 61b33955d130f..d11095d07d8b2 100644 --- a/sdk/kiosk/package.json +++ b/sdk/kiosk/package.json @@ -2,7 +2,7 @@ "name": "@mysten/kiosk", "author": "Mysten Labs ", "description": "Sui Kiosk library", - "version": "0.9.10", + "version": "0.9.11", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/sdk/ledgerjs-hw-app-sui/CHANGELOG.md b/sdk/ledgerjs-hw-app-sui/CHANGELOG.md index aea785d0e544b..456651eeb4fed 100644 --- a/sdk/ledgerjs-hw-app-sui/CHANGELOG.md +++ b/sdk/ledgerjs-hw-app-sui/CHANGELOG.md @@ -1,11 +1,19 @@ # @mysten/ledgerjs-hw-app-sui +## 0.4.1 + +### Patch Changes + +- 0f27a97: Update dependencies + ## 0.4.0 ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ## 0.3.1 @@ -29,6 +37,10 @@ ### Minor Changes -- a6690ac7d: Changed the default behavior of `publish` to publish an upgreadeable-by-sender package instead of immutable. -- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument names, RPC endpoints, Move functions, and object fields have been updated with this new naming convention. +- a6690ac7d: Changed the default behavior of `publish` to publish an upgreadeable-by-sender package + instead of immutable. +- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various + capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument + names, RPC endpoints, Move functions, and object fields have been updated with this new naming + convention. - 3709957cf: Published initial version of library diff --git a/sdk/ledgerjs-hw-app-sui/package.json b/sdk/ledgerjs-hw-app-sui/package.json index 49879215c498c..0ba5db34c3f3d 100644 --- a/sdk/ledgerjs-hw-app-sui/package.json +++ b/sdk/ledgerjs-hw-app-sui/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/ledgerjs-hw-app-sui", - "version": "0.4.0", + "version": "0.4.1", "description": "Ledger Hardware Wallet Sui Application API", "keywords": [ "Ledger", diff --git a/sdk/suins-toolkit/CHANGELOG.md b/sdk/suins-toolkit/CHANGELOG.md index 71c252f2a1c5a..807a6c1735e60 100644 --- a/sdk/suins-toolkit/CHANGELOG.md +++ b/sdk/suins-toolkit/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/suins-toolkit +## 0.5.11 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + ## 0.5.10 ### Patch Changes @@ -76,8 +89,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -321,7 +336,8 @@ - cc6441f46: Updated types and imports to use new modular exports from the `@mysten/sui.js` refactor - 6d41059c7: Update to use modular imports from @mysten/sui.js - Some methods now accept a `SuiClient` imported from `@mysten/sui.js/client` rather than a `JsonRpcProvider` + Some methods now accept a `SuiClient` imported from `@mysten/sui.js/client` rather than a + `JsonRpcProvider` ### Patch Changes diff --git a/sdk/suins-toolkit/package.json b/sdk/suins-toolkit/package.json index 311ab8ea8bcfb..f0b2527f0a660 100644 --- a/sdk/suins-toolkit/package.json +++ b/sdk/suins-toolkit/package.json @@ -2,7 +2,7 @@ "name": "@mysten/suins-toolkit", "author": "Mysten Labs ", "description": "SuiNS TypeScript SDK", - "version": "0.5.10", + "version": "0.5.11", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/sdk/typescript/CHANGELOG.md b/sdk/typescript/CHANGELOG.md index 22dd505e6c8dc..8185e0a3ba7e1 100644 --- a/sdk/typescript/CHANGELOG.md +++ b/sdk/typescript/CHANGELOG.md @@ -1,5 +1,23 @@ # @mysten/sui.js +## 1.3.0 + +### Minor Changes + +- 086b2bc: Add waitForLastTransaction methods to all executor classes +- cdedf69: Add Argument helpers for constructing transaction arguments without a Transaction + instance +- beed646: Add tx.pure.vector and tx.pure.option methods + +### Patch Changes + +- 7fc464a: Remove unique symbols from types to improve compatability between version +- 0fb0628: Mark subscription methods as deprecated. +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [0f27a97] + - @mysten/bcs@1.0.3 + ## 1.2.1 ### Patch Changes @@ -12,7 +30,8 @@ ### Minor Changes -- fef99d377f: Update parallel executor class to handle gasPrice and budgeting to remove extra rpc calls during execution" +- fef99d377f: Update parallel executor class to handle gasPrice and budgeting to remove extra rpc + calls during execution" ## 1.1.2 @@ -70,8 +89,10 @@ ### Major Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -105,7 +126,8 @@ ### Minor Changes -- 929db4976a: Add normalizeSuiNSName and isValidSuiNSName utils, and add a format option to SuiClient.resolveNameServiceNames +- 929db4976a: Add normalizeSuiNSName and isValidSuiNSName utils, and add a format option to + SuiClient.resolveNameServiceNames ## 0.51.2 @@ -137,7 +159,8 @@ ### Minor Changes -- a34f1cb67d: Use Bech32 instead of Hex for private key export, supports both Hex and Bech32 for importing +- a34f1cb67d: Use Bech32 instead of Hex for private key export, supports both Hex and Bech32 for + importing ### Patch Changes @@ -191,9 +214,14 @@ ### Minor Changes -- 0259aec82: Removed dependency on @open-rpc/client-js and replaced it with standard fetch and WebSocket based APIs +- 0259aec82: Removed dependency on @open-rpc/client-js and replaced it with standard fetch and + WebSocket based APIs - If you are using the `subscribeEvent` or `subscribeTransaction` in environments that do not support the `WebSocket` api natively (This will be true for most versions of Node.js) you will need to provide a WebSocket implementation when creating your SuiClient. You can either use a global polyfill for the WebSocket class, or pass a compatible WebSocket implementation into SuiHTTPTransport (eg, using the `ws` package) + If you are using the `subscribeEvent` or `subscribeTransaction` in environments that do not + support the `WebSocket` api natively (This will be true for most versions of Node.js) you will + need to provide a WebSocket implementation when creating your SuiClient. You can either use a + global polyfill for the WebSocket class, or pass a compatible WebSocket implementation into + SuiHTTPTransport (eg, using the `ws` package) ```typescript import { getFullnodeUrl, SuiClient, SuiHTTPTransport } from '@mysten/sui.js/client'; @@ -219,7 +247,8 @@ ### Patch Changes -- 652bcdd92: Remove some multisig methods that had previously been deprecated and are no longer exported +- 652bcdd92: Remove some multisig methods that had previously been deprecated and are no longer + exported ## 0.46.0 @@ -230,7 +259,8 @@ ### Patch Changes - 28c2c3330: Use the same issuer string in address derivation for the two google's iss values -- 43444c58f: Extend the `TransactionBlock#object()` API to accept the `TransactionResult` type as well, so that it can be used flexibly in SDKs. +- 43444c58f: Extend the `TransactionBlock#object()` API to accept the `TransactionResult` type as + well, so that it can be used flexibly in SDKs. - 8d1e74e52: Fix setting gasPrice for devInspectTransactionBlock - 3718a230b: Adds `txb.pure.id()` to pass ID pure values more intuitively @@ -274,7 +304,8 @@ ### Patch Changes -- faa13ded9: Ensure that TransactionBlocks can be copied via structuredClone to workaround bug in sui wallet +- faa13ded9: Ensure that TransactionBlocks can be copied via structuredClone to workaround bug in + sui wallet - c5684bb52: rename zk to zkLogin ## 0.43.0 @@ -288,7 +319,8 @@ - txb.transferObjects now accepts `address` as JavaScript string - All single objects, or lists of objects, now also accepts object IDs as JavaScript strings - txb.pure accepts `SerializedBcs` (eg `txb.pure(bcs.U64.serialize(123))`) - - Added pure helpers (`txb.pure.address()`, `txb.bool()`, and `txb.pure.u{8-256}()`) to simplify serialization of pure values + - Added pure helpers (`txb.pure.address()`, `txb.bool()`, and `txb.pure.u{8-256}()`) to simplify + serialization of pure values - Deprecated using `txb.pure` with raw JavaScript values, or an explicit type argument. - 1bc430161: Updated BCS defintions to use new BCS schema builder @@ -330,7 +362,8 @@ ### Minor Changes -- ba8e3b857: Rename TransactionBlock generated type in @mysten/sui.js/client to SuiTransactionBlock to avoid conflicting names in exports +- ba8e3b857: Rename TransactionBlock generated type in @mysten/sui.js/client to SuiTransactionBlock + to avoid conflicting names in exports ### Patch Changes @@ -344,13 +377,15 @@ ### Patch Changes -- 8281e3d25: Add new `sign` method to the TransactionBlock class, so that implementing transaction signing is easier. +- 8281e3d25: Add new `sign` method to the TransactionBlock class, so that implementing transaction + signing is easier. ## 0.39.0 ### Minor Changes -- 47ea5ec7c: Update keypair signature methods to return bytes as a base64 encoded string for better compatability +- 47ea5ec7c: Update keypair signature methods to return bytes as a base64 encoded string for better + compatability ## 0.38.0 @@ -361,8 +396,8 @@ - 0f06d593a: Added a MultiSigPublicKey class for verifying multisig signatures - 09f4ed3fc: update signMessage to correctly wrap PersonalMessages before signing - 6d41059c7: Deprecate imports from the root path which can be imported from a modular export -- cc6441f46: The Sui TS SDK has been broken up into a set of modular exports, and all exports from the root of - the package have been deprecated. The following export paths have been added: +- cc6441f46: The Sui TS SDK has been broken up into a set of modular exports, and all exports from + the root of the package have been deprecated. The following export paths have been added: - `@mysten/sui.js/client` - A client for interacting with Sui RPC nodes. - `@mysten/sui.js/bcs` - A BCS builder with pre-defined types for Sui. @@ -377,23 +412,23 @@ As part of this refactor we are deprecating a number of existing APIs: - `JsonRPCProvider` - This Provider pattern is being replaced by a new `SuiClient` - - `SignerWithProver` and `RawSigner` - The Concept of Signers is being removed from the SDK. Signing - in verifying has been moved to the KeyPair classes, and the `signAndExecuteTransactionBlock` - method has been moved to the new `SuiClient`. + - `SignerWithProver` and `RawSigner` - The Concept of Signers is being removed from the SDK. + Signing in verifying has been moved to the KeyPair classes, and the + `signAndExecuteTransactionBlock` method has been moved to the new `SuiClient`. - The `superstruct` type definitions for types used by JsonRPCProvider are being replaced with generated types exported from `@mysten/sui.js/client`. The new type definitions are pure typescript types and can't be used for runtime validation. By generating these as types, it will be easier to keep them in sync with the RPC definitions and avoid discrepancies between the type definitions in the SDK and the data returned by RPC methods. - A large number of "getters" are being deprecated. These getters were intended to reduce friction - caused by rapid iteration in the RPC layer leading up to the mainnet launch. Now that mainnet has - been launched the RPC API should be more stable, and many of these helpers can be replaced by - simply accessing the nested properties in the returned data directly. - - The current release should be mostly backwards compatible, and all existing exports will continue to - be available in this release (with deprecation warnings). With the large number of deprecations - there may be functionality that should be moved into the new modular version of the SDK. If you find - there are features that were deprecated without a suitable replacement, we have created a + caused by rapid iteration in the RPC layer leading up to the mainnet launch. Now that mainnet + has been launched the RPC API should be more stable, and many of these helpers can be replaced + by simply accessing the nested properties in the returned data directly. + + The current release should be mostly backwards compatible, and all existing exports will continue + to be available in this release (with deprecation warnings). With the large number of deprecations + there may be functionality that should be moved into the new modular version of the SDK. If you + find there are features that were deprecated without a suitable replacement, we have created a [Github Discussion thread](https://github.com/MystenLabs/sui/discussions/13150) to track those use-cases. @@ -450,8 +485,8 @@ #### Migrating faucet requests - The ability to request Sui from a faucet was not added to `SuiClient`, instead you will need to use - a method `@mysten/sui.js/faucet` to make these requests + The ability to request Sui from a faucet was not added to `SuiClient`, instead you will need to + use a method `@mysten/sui.js/faucet` to make these requests ```diff - import { JsonRpcProvider, devnetConnection } from '@mysten/sui.js'; @@ -467,12 +502,15 @@ +}); ``` -- 001148443: Introduce new `@mysten/sui.js/faucet` export, which should be used for all faucet interactions. This deprecates the previous `requestSuiFromFaucet` APIs that existed on the `JsonRpcProvider` and `Signer` classes. +- 001148443: Introduce new `@mysten/sui.js/faucet` export, which should be used for all faucet + interactions. This deprecates the previous `requestSuiFromFaucet` APIs that existed on the + `JsonRpcProvider` and `Signer` classes. ### Patch Changes - ad46f9f2f: add getAllEpochAddressMetrics method to rpc-provider -- 34242be56: Add new `isTransactionBlock` method, and deprecate the previous `TransactionBlock.is` method +- 34242be56: Add new `isTransactionBlock` method, and deprecate the previous `TransactionBlock.is` + method - 4e2a150a1: websocket client memory leak fix in reconnect logics - 83d0fb734: Deprecate type aliases for strings. @@ -504,8 +542,13 @@ ### Minor Changes - 3ea9adb71a: Add multisig support -- 1cfb1c9da3: The `TransactionBlock` builder now uses the protocol config from the chain when constructing and validating transactions, instead of using hard-coded limits. If you wish to perform signing offline (without a provider), you can either define a `protocolConfig` option when building a transaction, or explicitly set `limits`, which will be used instead of the protocol config. -- fb3bb9118a: Remove logging of RPCValidation errors when typescript types do not match RPC response types +- 1cfb1c9da3: The `TransactionBlock` builder now uses the protocol config from the chain when + constructing and validating transactions, instead of using hard-coded limits. If you wish to + perform signing offline (without a provider), you can either define a `protocolConfig` option when + building a transaction, or explicitly set `limits`, which will be used instead of the protocol + config. +- fb3bb9118a: Remove logging of RPCValidation errors when typescript types do not match RPC response + types ### Patch Changes @@ -526,13 +569,16 @@ - 470c27af50: Added network address metrics - 671faefe3c: Add `getChainIdentifier` method -- 9ce7e051b4: Update internal client to use `@open-rpc/client-js` instead of `jayson` and `rpc-websockets`. This results in a more consistent experience and better error messaging. +- 9ce7e051b4: Update internal client to use `@open-rpc/client-js` instead of `jayson` and + `rpc-websockets`. This results in a more consistent experience and better error messaging. ### Patch Changes - 4ea96d909a: the event BCS data is a base64 string - bcbb178c44: Fixes BCS definition so it matches the RPC one -- 03828224c9: Previously, effects had an unwrapped_then_deleted field on ts-sdk. This is an issue since jsonrpc returns the field as unwrappedThenDeleted. Update the transaction type definition to use camelcase. +- 03828224c9: Previously, effects had an unwrapped_then_deleted field on ts-sdk. This is an issue + since jsonrpc returns the field as unwrappedThenDeleted. Update the transaction type definition to + use camelcase. - 9ce7e051b4: Add `subscribeTransaction` method. - bb50698551: Fixes BCS type definition in the type layout @@ -573,13 +619,17 @@ ### Patch Changes -- 4ae3cbea3: Response for `getCoinMetadata` is now nullable, in the event that no metadata can be found. +- 4ae3cbea3: Response for `getCoinMetadata` is now nullable, in the event that no metadata can be + found. - d2755a496: Fix dependency on msw - f612dac98: Change the default gas budgeting to take storage rebates into account. - c219e7470: Changed the response type of `getRpcApiVersion` to string. -- 59ae0e7d6: Removed `skipDataValidation` option, this is now not configurable and is the default behavior. -- c219e7470: Fix type of `limit` on `getCheckpoints` and `getEpochs` API so that is correctly a number. -- 4e463c691: Add `waitForTransactionBlock` API to wait for a transaction to be available over the API. +- 59ae0e7d6: Removed `skipDataValidation` option, this is now not configurable and is the default + behavior. +- c219e7470: Fix type of `limit` on `getCheckpoints` and `getEpochs` API so that is correctly a + number. +- 4e463c691: Add `waitForTransactionBlock` API to wait for a transaction to be available over the + API. - b4f0bfc76: Fix type definitions for package exports. - Updated dependencies [b4f0bfc76] - @mysten/bcs@0.7.1 @@ -594,7 +644,9 @@ ### Minor Changes -- 9b42d0ada: This release replaces all uint64 and uint128 numbers with BigInt in all JSON RPC responses to preserve precision. This is a Major Breaking Change - you must update your TS-SDK to latest version +- 9b42d0ada: This release replaces all uint64 and uint128 numbers with BigInt in all JSON RPC + responses to preserve precision. This is a Major Breaking Change - you must update your TS-SDK to + latest version ## 0.31.0 @@ -613,59 +665,105 @@ ### Minor Changes -- 956ec28eb: Change `signMessage` to return message bytes. Add support for sui:signMessage in the wallet standard +- 956ec28eb: Change `signMessage` to return message bytes. Add support for sui:signMessage in the + wallet standard - 4adfbff73: Use Blake2b instead of sha3_256 for address generation -- 4c4573ebe: Removed DevInspectResultsType and now DevInspectResults has a property results of ExecutionResultType and a property error +- 4c4573ebe: Removed DevInspectResultsType and now DevInspectResults has a property results of + ExecutionResultType and a property error - acc2edb31: Update schema for `SuiSystemState` and `DelegatedStake` -- 941b03af1: Change functions in transactions.ts of ts-sdk such that: `getTotalGasUsed` and `getTotalGasUsedUpperBound` of ts-sdk return a `bigint`,fields of `gasCostSummary` are defined as `string`, `epochId` is defined as `string`. In `sui-json-rpc` the corresponding types are defined as `BigInt`. Introduce `SuiEpochId` type to `sui-json-rpc` types that is a `BigInt`. -- a6690ac7d: Changed the default behavior of `publish` to publish an upgreadeable-by-sender package instead of immutable. +- 941b03af1: Change functions in transactions.ts of ts-sdk such that: `getTotalGasUsed` and + `getTotalGasUsedUpperBound` of ts-sdk return a `bigint`,fields of `gasCostSummary` are defined as + `string`, `epochId` is defined as `string`. In `sui-json-rpc` the corresponding types are defined + as `BigInt`. Introduce `SuiEpochId` type to `sui-json-rpc` types that is a `BigInt`. +- a6690ac7d: Changed the default behavior of `publish` to publish an upgreadeable-by-sender package + instead of immutable. - a211dc03a: Change object digest from Base64 encoded to Base58 encoded for rpc version >= 0.28.0 -- 4c1e331b8: Gas budget is now optional, and will automatically be computed by executing a dry-run when not provided. -- 19b567f21: Unified self- and delegated staking flows. Removed fields from `Validator` (`stake_amount`, `pending_stake`, and `pending_withdraw`) and renamed `delegation_staking_pool` to `staking_pool`. Additionally removed the `validator_stake` and `delegated_stake` fields in the `ValidatorSet` type and replaced them with a `total_stake` field. -- 7659e2e91: Introduce new `Transaction` builder class, and deprecate all existing methods of sending transactions. The new builder class is designed to take full advantage of Programmable Transactions. Any transaction using the previous `SignableTransaction` interface will be converted to a `Transaction` class when possible, but this interface will be fully removed soon. +- 4c1e331b8: Gas budget is now optional, and will automatically be computed by executing a dry-run + when not provided. +- 19b567f21: Unified self- and delegated staking flows. Removed fields from `Validator` + (`stake_amount`, `pending_stake`, and `pending_withdraw`) and renamed `delegation_staking_pool` to + `staking_pool`. Additionally removed the `validator_stake` and `delegated_stake` fields in the + `ValidatorSet` type and replaced them with a `total_stake` field. +- 7659e2e91: Introduce new `Transaction` builder class, and deprecate all existing methods of + sending transactions. The new builder class is designed to take full advantage of Programmable + Transactions. Any transaction using the previous `SignableTransaction` interface will be converted + to a `Transaction` class when possible, but this interface will be fully removed soon. - 0d3cb44d9: Change all snake_case field in ts-sdk normalized.ts to camelCase. -- 36c264ebb: Remove `generateTransactionDigest`. Use one of the following instead: `signer.getTransactionDigest`, `Transaction.getDigest()` or `TransactionDataBuilder.getDigestFromBytes()` instead. -- 891abf5ed: Remove support for RPC Batch Request in favor of multiGetTransactions and multiGetObjects +- 36c264ebb: Remove `generateTransactionDigest`. Use one of the following instead: + `signer.getTransactionDigest`, `Transaction.getDigest()` or + `TransactionDataBuilder.getDigestFromBytes()` instead. +- 891abf5ed: Remove support for RPC Batch Request in favor of multiGetTransactions and + multiGetObjects - 2e0ef59fa: Added VALIDATORS_EVENTS_QUERY -- 33cb357e1: Change functions in json-rpc-provider.ts of ts-sdk such that: `getTotalTransactionBlocks`, `getReferenceGasPrice` return a `bigint`, `getLatestCheckpointSequenceNumber` returns a `string`, `gasPrice` of `devInspectTransactionBlock` is defined as a `string`, checkpoint sequence number of `getCheckpoint` is defined as a `string`, `cursor` of `getCheckpoints` is defined as a `string`. Introduce `SuiCheckpointSequenceNumber` type in sui-json-rpc-types that is a `BigInt` to use instead of `CheckpointSequenceNumber` of sui-types. +- 33cb357e1: Change functions in json-rpc-provider.ts of ts-sdk such that: + `getTotalTransactionBlocks`, `getReferenceGasPrice` return a `bigint`, + `getLatestCheckpointSequenceNumber` returns a `string`, `gasPrice` of `devInspectTransactionBlock` + is defined as a `string`, checkpoint sequence number of `getCheckpoint` is defined as a `string`, + `cursor` of `getCheckpoints` is defined as a `string`. Introduce `SuiCheckpointSequenceNumber` + type in sui-json-rpc-types that is a `BigInt` to use instead of `CheckpointSequenceNumber` of + sui-types. - 6bd88570c: Rework all coin APIs to take objects as arguments instead of positional arguments. -- f1e42f792: Consolidate get_object and get_raw_object into a single get_object endpoint which now takes an additional config parameter with type `SuiObjectDataOptions` and has a new return type `SuiObjectResponse`. By default, only object_id, version, and digest are fetched. +- f1e42f792: Consolidate get_object and get_raw_object into a single get_object endpoint which now + takes an additional config parameter with type `SuiObjectDataOptions` and has a new return type + `SuiObjectResponse`. By default, only object_id, version, and digest are fetched. - 272389c20: Support for new versioned TransactionData format - 3de8de361: Remove `getSuiSystemState` method. Use `getLatestSuiSystemState` method instead. -- be3c4f51e: Add `display` field in `SuiObjectResponse` for frontend rendering. See more details in https://forums.sui.io/t/nft-object-display-proposal/4872 -- dbe73d5a4: Update `executeTransaction` and `signAndExecuteTransaction` to take in an additional parameter `SuiTransactionBlockResponseOptions` which is used to specify which fields to include in `SuiTransactionBlockResponse` (e.g., transaction, effects, events, etc). By default, only the transaction digest will be included. -- c82e4b454: Introduce BigInt struct to sui-json-rpc-types to serialize and deserialize amounts to/from string. Change ts-sdk to serialize amounts of PaySui and Pay as string. -- 7a2eaf4a3: Changing the SuiObjectResponse struct to use data/error fields instead of details/status -- 2ef2bb59e: Deprecate getTransactionDigestsInRange. This method will be removed before April 2023, please use `getTransactions` instead +- be3c4f51e: Add `display` field in `SuiObjectResponse` for frontend rendering. See more details in + https://forums.sui.io/t/nft-object-display-proposal/4872 +- dbe73d5a4: Update `executeTransaction` and `signAndExecuteTransaction` to take in an additional + parameter `SuiTransactionBlockResponseOptions` which is used to specify which fields to include in + `SuiTransactionBlockResponse` (e.g., transaction, effects, events, etc). By default, only the + transaction digest will be included. +- c82e4b454: Introduce BigInt struct to sui-json-rpc-types to serialize and deserialize amounts + to/from string. Change ts-sdk to serialize amounts of PaySui and Pay as string. +- 7a2eaf4a3: Changing the SuiObjectResponse struct to use data/error fields instead of + details/status +- 2ef2bb59e: Deprecate getTransactionDigestsInRange. This method will be removed before April 2023, + please use `getTransactions` instead - 9b29bef37: Pass blake2b hash to signer API - 8700809b5: Add a new `getCheckpoints` endpoint that returns a paginated list of checkpoints. - 5c3b00cde: Add object id to staking pool and pool id to staked sui. -- 01272ab7d: Remove deprecated `getCheckpointContents`, `getCheckpointContentsByDigest`, `getCheckpointSummary` and `getCheckpointSummaryByDigest` methods. +- 01272ab7d: Remove deprecated `getCheckpointContents`, `getCheckpointContentsByDigest`, + `getCheckpointSummary` and `getCheckpointSummaryByDigest` methods. - 9822357d6: Add getStakesByIds to get DelegatedStake queried by id -- 3d9a04648: Adds `deactivation_epoch` to staking pool object, and adds `inactive_pools` to the validator set object. +- 3d9a04648: Adds `deactivation_epoch` to staking pool object, and adds `inactive_pools` to the + validator set object. - da72e73a9: Change the address of Move package for staking and validator related Move modules. - a0955c479: Switch from 20 to 32-byte address. Match Secp256k1.deriveKeypair with Ed25519. - 0c9047698: Remove all gas selection APIs from the json rpc provider. -- d5ef1b6e5: Added dependencies to publish command, dependencies now also returned from the sui move CLI with the `--dump-bytecode-as-base64` flag -- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument names, RPC endpoints, Move functions, and object fields have been updated with this new naming convention. +- d5ef1b6e5: Added dependencies to publish command, dependencies now also returned from the sui move + CLI with the `--dump-bytecode-as-base64` flag +- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various + capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument + names, RPC endpoints, Move functions, and object fields have been updated with this new naming + convention. - 3de8de361: Remove `getValidators` API. Use `getLatestSuiSystemState` instead. - dd348cf03: Refactor `getTransactions` to `queryTransactions` - 57c17e02a: Removed `JsonRpcProviderWithCache`, use `JsonRpcProvider` instead. -- 65f1372dd: Rename `provider.getTransactionWithEffects` to `provider.getTransaction`. The new method takes in an additional parameter `SuiTransactionBlockResponseOptions` to configure which fields to fetch(transaction, effects, events, etc). By default, only the transaction digest will be returned. +- 65f1372dd: Rename `provider.getTransactionWithEffects` to `provider.getTransaction`. The new + method takes in an additional parameter `SuiTransactionBlockResponseOptions` to configure which + fields to fetch(transaction, effects, events, etc). By default, only the transaction digest will + be returned. - a09239308: [testing only] an intent scope can be passed in to verifyMessage -- fe335e6ba: Removed usage of `cross-fetch` in the TypeScript SDK. If you are running in an environment that does not have `fetch` defined, you will need to polyfill it. +- fe335e6ba: Removed usage of `cross-fetch` in the TypeScript SDK. If you are running in an + environment that does not have `fetch` defined, you will need to polyfill it. - 5dc25faad: Remove getTransactionDigestsInRange from the SDK - 64234baaf: added combined `getCheckpoint` endpoint for retrieving information about a checkpoint - d3170ba41: All JSON-RPC APIs now accept objects instead of positional arugments. -- a6ffb8088: Removed events from transaction effects, TransactionEvents will now be provided in the TransactionResponse, along side TransactionEffects. -- 3304eb83b: Refactor Rust SuiTransactionBlockKind to be internally tagged for Json serialization with tag="type" and SuiEvent to be adjacently tagged with tag="type" and content="content" +- a6ffb8088: Removed events from transaction effects, TransactionEvents will now be provided in the + TransactionResponse, along side TransactionEffects. +- 3304eb83b: Refactor Rust SuiTransactionBlockKind to be internally tagged for Json serialization + with tag="type" and SuiEvent to be adjacently tagged with tag="type" and content="content" - 4189171ef: Adds support for validator candidate. - 77bdf907f: When parsing u64, u128, and u256 values with bcs, they are now string encoded. - a74df16ec: Minor change to the system transaction format -- 0f7aa6507: Switching the response type of the getOwnedObjects api to a paginatedObjects response, and also moving filtering to FN +- 0f7aa6507: Switching the response type of the getOwnedObjects api to a paginatedObjects response, + and also moving filtering to FN - 9b60bf700: Change all snake_case fields in checkpoint.ts and faucet.ts to camelCase -- 64fb649eb: Remove old `SuiExecuteTransactionResponse` interface, and `CertifiedTransaction` interface in favor of the new unified `SuiTransactionBlockResponse` interfaces. -- a6b0c4e5f: Changed the getOwnerObjectsForAddress api to getOwnedObjects, and added options/ pagination to the parameters +- 64fb649eb: Remove old `SuiExecuteTransactionResponse` interface, and `CertifiedTransaction` + interface in favor of the new unified `SuiTransactionBlockResponse` interfaces. +- a6b0c4e5f: Changed the getOwnerObjectsForAddress api to getOwnedObjects, and added options/ + pagination to the parameters ### Patch Changes @@ -688,7 +786,8 @@ ### Patch Changes -- 31bfcae6a: Make arguments field optional for MoveCall to match Rust definition. This fixes a bug where the Explorer page does not load for transactions with no argument. +- 31bfcae6a: Make arguments field optional for MoveCall to match Rust definition. This fixes a bug + where the Explorer page does not load for transactions with no argument. ## 0.29.0 @@ -696,7 +795,8 @@ - f2e713bd0: Add TransactionExpiration to TransactionData - 4baf554f1: Make fromSecretKey take the 32 bytes privkey -- aa650aa3b: Introduce new `Connection` class, which is used to define the endpoints that are used when interacting with the network. +- aa650aa3b: Introduce new `Connection` class, which is used to define the endpoints that are used + when interacting with the network. - 6ff0c785f: Use DynamicFieldName struct instead of string for dynamic field's name ### Patch Changes @@ -711,9 +811,15 @@ ### Minor Changes -- a67cc044b: Transaction signatures are now serialized into a single string, and all APIs that previously took the public key, signature, and scheme now just take the single serialized signature string. To help make parsing this easier, there are new `toSerializedSignature` and `toParsedSignaturePubkeyPair` methods exposed as well. -- a67cc044b: The RawSigner now provides a `signTransaction` function, which can be used to sign a transaction without submitting it to the network. -- a67cc044b: The RawSigner now provides a `signMessage` function that can be used to sign personal messages. The SDK also now exports a `verifyMessage` function that can be used to easily verify a message signed with `signMessage`. +- a67cc044b: Transaction signatures are now serialized into a single string, and all APIs that + previously took the public key, signature, and scheme now just take the single serialized + signature string. To help make parsing this easier, there are new `toSerializedSignature` and + `toParsedSignaturePubkeyPair` methods exposed as well. +- a67cc044b: The RawSigner now provides a `signTransaction` function, which can be used to sign a + transaction without submitting it to the network. +- a67cc044b: The RawSigner now provides a `signMessage` function that can be used to sign personal + messages. The SDK also now exports a `verifyMessage` function that can be used to easily verify a + message signed with `signMessage`. ### Patch Changes @@ -725,7 +831,8 @@ ### Minor Changes -- 473005d8f: Add protocol_version to CheckpointSummary and SuiSystemObject. Consolidate end-of-epoch information in CheckpointSummary. +- 473005d8f: Add protocol_version to CheckpointSummary and SuiSystemObject. Consolidate end-of-epoch + information in CheckpointSummary. - 59641dc29: Support for deserializing new ConsensusCommitPrologue system transaction - 629804d26: Remove usage of `Base64DataBuffer`, and use `Uint8Array` instead. - f51c85e85: remove get_objects_owned_by_object and replace it with get_dynamic_fields @@ -761,7 +868,8 @@ ### Minor Changes -- 7b4bf43bc: Support for interacting with Devnet v0.24+ where Move Calls refer to their packages by ObjectID only (not ObjectRef). +- 7b4bf43bc: Support for interacting with Devnet v0.24+ where Move Calls refer to their packages by + ObjectID only (not ObjectRef). ### Patch Changes @@ -778,7 +886,8 @@ ### Patch Changes - 01458ffd5: Fix websocket default port for DevNet -- a274ecfc7: Make previousTransaction optional for CoinStruct to support v0.22 network where it doesn't exist +- a274ecfc7: Make previousTransaction optional for CoinStruct to support v0.22 network where it + doesn't exist - 89091ddab: change estimator logic to use upper bound - 71bee7563: fix creating websocket url @@ -814,16 +923,22 @@ ### Minor Changes - 4fb12ac6d: - removes `transfer` function from framework Coin - - renames `newTransferTx` function from framework Coin to `newPayTransaction`. Also it's now a public method and without the need of signer so a dapp can use it + - renames `newTransferTx` function from framework Coin to `newPayTransaction`. Also it's now a + public method and without the need of signer so a dapp can use it - fixes edge cases with pay txs - bb14ffdc5: Remove ImmediateReturn and WaitForTxCert from ExecuteTransactionRequestType -- d2015f815: Rebuilt type-narrowing utilties (e.g. `isSuiObject`) on top of Superstruct, which should make them more reliable. - The type-narrowing functions are no longer exported, instead a Superstruct schema is exported, in addition to an `is` and `assert` function, both of which can be used to replace the previous narrowing functions. For example, `isSuiObject(data)` becomes `is(data, SuiObject)`. -- 7d0f25b61: Add devInspectTransaction, which is similar to dryRunTransaction, but lets you call any Move function(including non-entry function) with arbitrary values. +- d2015f815: Rebuilt type-narrowing utilties (e.g. `isSuiObject`) on top of Superstruct, which + should make them more reliable. The type-narrowing functions are no longer exported, instead a + Superstruct schema is exported, in addition to an `is` and `assert` function, both of which can be + used to replace the previous narrowing functions. For example, `isSuiObject(data)` becomes + `is(data, SuiObject)`. +- 7d0f25b61: Add devInspectTransaction, which is similar to dryRunTransaction, but lets you call any + Move function(including non-entry function) with arbitrary values. ### Patch Changes -- 9fbe2714b: Add devInspectMoveCall, which is similar to devInspectTransaction, but lets you call any Move function without a gas object and budget +- 9fbe2714b: Add devInspectMoveCall, which is similar to devInspectTransaction, but lets you call + any Move function without a gas object and budget ## 0.20.0 @@ -874,7 +989,8 @@ - a9602e533: Remove deprecated events API - db22728c1: \* adds dryRunTransaction support - - adds getGasCostEstimation to the signer-with-provider that estimates the gas cost for a transaction + - adds getGasCostEstimation to the signer-with-provider that estimates the gas cost for a + transaction - 3b510d0fc: adds coin transfer method to framework that uses pay and paySui ## 0.16.0 @@ -917,7 +1033,8 @@ - b4a8ee9bf: Support passing a vector of objects in LocalTxnBuilder - ef3571dc8: Fix gas selection bug for a vector of objects - cccfe9315: Add deserialization util method to LocalTxnDataSerializer -- 2dc594ef7: Introduce getCoinDenominationInfo, which returns denomination info of a coin, now only supporting SUI coin. +- 2dc594ef7: Introduce getCoinDenominationInfo, which returns denomination info of a coin, now only + supporting SUI coin. - 4f0c611ff: Protocol change to add 'initial shared version' to shared object references. ## 0.13.0 @@ -934,10 +1051,13 @@ ### Minor Changes - e0b173b9e: Standardize Ed25519KeyPair key derivation with SLIP10 -- 059ede517: Flip the default value of `skipDataValidation` to true in order to mitigate the impact of breaking changes on applications. When there's a mismatch between the TypeScript definitions and RPC response, the SDK now log a console warning instead of throwing an error. +- 059ede517: Flip the default value of `skipDataValidation` to true in order to mitigate the impact + of breaking changes on applications. When there's a mismatch between the TypeScript definitions + and RPC response, the SDK now log a console warning instead of throwing an error. - 03e6b552b: Add util function to get coin balances - 4575c0a02: Fix type definition of SuiMoveNormalizedType -- ccf7f148d: Added generic signAndExecuteTransaction method to the SDK, which can be used with any supported type of transaction. +- ccf7f148d: Added generic signAndExecuteTransaction method to the SDK, which can be used with any + supported type of transaction. ### Patch Changes diff --git a/sdk/typescript/package.json b/sdk/typescript/package.json index b1d0bd037a469..8720d52d8b12b 100644 --- a/sdk/typescript/package.json +++ b/sdk/typescript/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "Sui TypeScript API(Work in Progress)", "homepage": "https://sdk.mystenlabs.com", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "sideEffects": false, "files": [ diff --git a/sdk/typescript/src/version.ts b/sdk/typescript/src/version.ts index 5f80920639dc6..86359db32790b 100644 --- a/sdk/typescript/src/version.ts +++ b/sdk/typescript/src/version.ts @@ -3,5 +3,5 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '1.2.1'; -export const TARGETED_RPC_VERSION = '1.29.0'; +export const PACKAGE_VERSION = '1.3.0'; +export const TARGETED_RPC_VERSION = '1.30.0'; diff --git a/sdk/wallet-standard/CHANGELOG.md b/sdk/wallet-standard/CHANGELOG.md index 27ea708b9022a..c984dbf0f97d6 100644 --- a/sdk/wallet-standard/CHANGELOG.md +++ b/sdk/wallet-standard/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/wallet-standard +## 0.12.12 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + ## 0.12.11 ### Patch Changes @@ -20,7 +33,8 @@ ### Patch Changes -- 805ff4d4c2: Fix bug where transaction was passed as both transaction and transactionBlock to sui:signTransactionBlock +- 805ff4d4c2: Fix bug where transaction was passed as both transaction and transactionBlock to + sui:signTransactionBlock ## 0.12.8 @@ -82,8 +96,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -188,7 +204,8 @@ ### Minor Changes -- 165ad6b21d: Introduce new optional `id` property, which wallets can specify as a unique identifier, separate from the wallet name. +- 165ad6b21d: Introduce new optional `id` property, which wallets can specify as a unique + identifier, separate from the wallet name. ### Patch Changes @@ -487,24 +504,39 @@ ### Minor Changes -- 956ec28eb: Change `signMessage` to return message bytes. Add support for sui:signMessage in the wallet standard -- 19b567f21: Unified self- and delegated staking flows. Removed fields from `Validator` (`stake_amount`, `pending_stake`, and `pending_withdraw`) and renamed `delegation_staking_pool` to `staking_pool`. Additionally removed the `validator_stake` and `delegated_stake` fields in the `ValidatorSet` type and replaced them with a `total_stake` field. +- 956ec28eb: Change `signMessage` to return message bytes. Add support for sui:signMessage in the + wallet standard +- 19b567f21: Unified self- and delegated staking flows. Removed fields from `Validator` + (`stake_amount`, `pending_stake`, and `pending_withdraw`) and renamed `delegation_staking_pool` to + `staking_pool`. Additionally removed the `validator_stake` and `delegated_stake` fields in the + `ValidatorSet` type and replaced them with a `total_stake` field. - 5c3b00cde: Add object id to staking pool and pool id to staked sui. -- 3d9a04648: Adds `deactivation_epoch` to staking pool object, and adds `inactive_pools` to the validator set object. +- 3d9a04648: Adds `deactivation_epoch` to staking pool object, and adds `inactive_pools` to the + validator set object. - da72e73a9: Change the address of Move package for staking and validator related Move modules. -- 0672b5990: The Wallet Standard now only supports the `Transaction` type, instead of the previous `SignableTransaction` type. -- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument names, RPC endpoints, Move functions, and object fields have been updated with this new naming convention. -- c718deef4: wallet-standard: changes sui:signAndExecuteTransaction and sui:signTransaction features to support account and chain options - wallet-adapter-wallet-standard: change signAndExecuteTransaction and signTransaction signatures to support account and chain options - wallet-adapter-wallet-standard: ensure version compatibility for of the wallet signAndExecuteTransaction and signTransaction features before using them (same major version) +- 0672b5990: The Wallet Standard now only supports the `Transaction` type, instead of the previous + `SignableTransaction` type. +- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various + capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument + names, RPC endpoints, Move functions, and object fields have been updated with this new naming + convention. +- c718deef4: wallet-standard: changes sui:signAndExecuteTransaction and sui:signTransaction features + to support account and chain options wallet-adapter-wallet-standard: change + signAndExecuteTransaction and signTransaction signatures to support account and chain options + wallet-adapter-wallet-standard: ensure version compatibility for of the wallet + signAndExecuteTransaction and signTransaction features before using them (same major version) wallet-kit-core/wallet-kit: expose accounts as ReadonlyWalletAccount instead of only the address - wallet-kit-core: signTransaction and signAndExecuteTransaction methods mirror the ones in standard adapter + wallet-kit-core: signTransaction and signAndExecuteTransaction methods mirror the ones in standard + adapter - 68e60b02c: Changed where the options and requestType for signAndExecuteTransaction are. -- dbe73d5a4: Add an optional `contentOptions` field to `SuiSignAndExecuteTransactionOptions` to specify which fields to include in `SuiTransactionBlockResponse` (e.g., transaction, effects, events, etc). By default, only the transaction digest will be included. +- dbe73d5a4: Add an optional `contentOptions` field to `SuiSignAndExecuteTransactionOptions` to + specify which fields to include in `SuiTransactionBlockResponse` (e.g., transaction, effects, + events, etc). By default, only the transaction digest will be included. ### Patch Changes -- bf545c7d0: Add `features` prop to wallet kit that allows dapps to define which features they require to function properly. +- bf545c7d0: Add `features` prop to wallet kit that allows dapps to define which features they + require to function properly. - Updated dependencies [956ec28eb] - Updated dependencies [4adfbff73] - Updated dependencies [4c4573ebe] @@ -601,7 +633,8 @@ ### Minor Changes -- 473005d8f: Add protocol_version to CheckpointSummary and SuiSystemObject. Consolidate end-of-epoch information in CheckpointSummary. +- 473005d8f: Add protocol_version to CheckpointSummary and SuiSystemObject. Consolidate end-of-epoch + information in CheckpointSummary. ### Patch Changes @@ -625,7 +658,8 @@ ### Minor Changes -- 96e883fc1: Update wallet adapter and wallet standard to support passing through the desired request type. +- 96e883fc1: Update wallet adapter and wallet standard to support passing through the desired + request type. ### Patch Changes @@ -792,8 +826,10 @@ ### Minor Changes -- 5ac98bc9a: Introduce new wallet adapter based on the Wallet Standard. This wallet adapter automatically detects wallets that adhere to the standard interface. -- 5ac98bc9a: Introduce new "wallet-standard" package which can be used to build wallets that are compatible with the Wallet Standard. +- 5ac98bc9a: Introduce new wallet adapter based on the Wallet Standard. This wallet adapter + automatically detects wallets that adhere to the standard interface. +- 5ac98bc9a: Introduce new "wallet-standard" package which can be used to build wallets that are + compatible with the Wallet Standard. ### Patch Changes diff --git a/sdk/wallet-standard/package.json b/sdk/wallet-standard/package.json index 980129d26112c..fa19fdad28ca9 100644 --- a/sdk/wallet-standard/package.json +++ b/sdk/wallet-standard/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/wallet-standard", - "version": "0.12.11", + "version": "0.12.12", "description": "A suite of standard utilities for implementing wallets based on the Wallet Standard.", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/sdk/zklogin/CHANGELOG.md b/sdk/zklogin/CHANGELOG.md index d813e7fac67bf..378a140cbe213 100644 --- a/sdk/zklogin/CHANGELOG.md +++ b/sdk/zklogin/CHANGELOG.md @@ -1,5 +1,19 @@ # @mysten/zklogin +## 0.7.11 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + - @mysten/bcs@1.0.3 + ## 0.7.10 ### Patch Changes @@ -81,8 +95,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -289,7 +305,8 @@ ### Minor Changes -- d80a6ed62: Remove toBigIntBE, expose new `getExtendedEphemeralPublicKey` method. Methods now return base64-encoded strings instead of bigints. +- d80a6ed62: Remove toBigIntBE, expose new `getExtendedEphemeralPublicKey` method. Methods now + return base64-encoded strings instead of bigints. ### Patch Changes diff --git a/sdk/zklogin/package.json b/sdk/zklogin/package.json index 46cfde803f437..1f0ed57361b28 100644 --- a/sdk/zklogin/package.json +++ b/sdk/zklogin/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/zklogin", - "version": "0.7.10", + "version": "0.7.11", "description": "Utilities for interacting with zkLogin in Sui", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/sdk/zksend/CHANGELOG.md b/sdk/zksend/CHANGELOG.md index 04a45172e734b..dc8bfd9852092 100644 --- a/sdk/zksend/CHANGELOG.md +++ b/sdk/zksend/CHANGELOG.md @@ -1,5 +1,19 @@ # @mysten/zksend +## 0.10.1 + +### Patch Changes + +- 0f27a97: Update dependencies +- Updated dependencies [7fc464a] +- Updated dependencies [086b2bc] +- Updated dependencies [0fb0628] +- Updated dependencies [cdedf69] +- Updated dependencies [0f27a97] +- Updated dependencies [beed646] + - @mysten/sui@1.3.0 + - @mysten/wallet-standard@0.12.12 + ## 0.10.0 ### Minor Changes @@ -98,8 +112,10 @@ ### Minor Changes -- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features and breaking changes. - See the [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on how to upgrade. +- a92b03de42: The Typescript SDK has been renamed to `@mysten/sui` and includes many new features + and breaking changes. See the + [full migration guide](https://sdk.mystenlabs.com/typescript/migrations/sui-1.0) for details on + how to upgrade. ### Patch Changes @@ -166,7 +182,8 @@ ### Patch Changes -- 9a9ff3cde1: Fix assets extracted from transactionBlocks using type instead of objectType from object changes" +- 9a9ff3cde1: Fix assets extracted from transactionBlocks using type instead of objectType from + object changes" ## 0.5.0 @@ -209,7 +226,8 @@ ### Minor Changes -- c05a4e8cb7: removed listClaimableAssets, and added new assets and claimed properties to link instances +- c05a4e8cb7: removed listClaimableAssets, and added new assets and claimed properties to link + instances - c05a4e8cb7: Use contract by default for new links - c05a4e8cb7: Add helper for bulk link creation - c05a4e8cb7: Removed options for filtering claims @@ -241,7 +259,8 @@ ### Patch Changes - 4830361fa4: Updated typescript version -- 4fd676671b: Fix issue with overwriting balances when adding multiple balances for the same unnormalized coinType" +- 4fd676671b: Fix issue with overwriting balances when adding multiple balances for the same + unnormalized coinType" - Updated dependencies [4830361fa4] - @mysten/wallet-standard@0.10.3 - @mysten/sui.js@0.50.1 @@ -271,7 +290,8 @@ - 66fbbc7faa: Detect gasCoin when claiming - 7b8d044603: Detect wallet closing - c6b3066069: Improve zkSend error messages -- a2904e0075: Fix for claimable assets not accounting for cases where claimable balance comes from gas coin +- a2904e0075: Fix for claimable assets not accounting for cases where claimable balance comes from + gas coin - ea2744b0c3: Add redirect parameter and fix listing assets on links without Sui - 44a1f9ea0b: Tweak types of events sent over the bridge - 7cc09a7bb4: Handle cases where list of objects to transfer is empty diff --git a/sdk/zksend/package.json b/sdk/zksend/package.json index 40266fb26569d..8ab8fbae955c5 100644 --- a/sdk/zksend/package.json +++ b/sdk/zksend/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/zksend", - "version": "0.10.0", + "version": "0.10.1", "description": "TODO: Write Description", "license": "Apache-2.0", "author": "Mysten Labs ", From 6e79fda57ac18a4c42d4324afaf54d2e2842356b Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:29:41 -0700 Subject: [PATCH 067/163] Improve tracing for TransactionOrchestrator, QD, and AuthAgg (#18689) tracing for an execute transaction attempt now looks like: image --- crates/mysten-metrics/src/lib.rs | 66 ++++++++++++++++++- crates/sui-authority-aggregation/src/lib.rs | 13 +--- crates/sui-core/src/authority_aggregator.rs | 27 ++++---- crates/sui-core/src/quorum_driver/mod.rs | 26 ++++++-- crates/sui-core/src/safe_client.rs | 5 +- .../sui-core/src/transaction_orchestrator.rs | 18 +++-- 6 files changed, 117 insertions(+), 38 deletions(-) diff --git a/crates/mysten-metrics/src/lib.rs b/crates/mysten-metrics/src/lib.rs index a25cdcbb7218c..75c7fe2732151 100644 --- a/crates/mysten-metrics/src/lib.rs +++ b/crates/mysten-metrics/src/lib.rs @@ -13,7 +13,7 @@ use std::time::Instant; use once_cell::sync::OnceCell; use prometheus::{register_int_gauge_vec_with_registry, IntGaugeVec, Registry, TextEncoder}; use tap::TapFallible; -use tracing::warn; +use tracing::{warn, Span}; pub use scopeguard; use uuid::Uuid; @@ -271,6 +271,70 @@ impl Future for MonitoredScopeFuture { } } +pub struct CancelMonitor { + finished: bool, + inner: Pin>, +} + +impl CancelMonitor +where + F: Future, +{ + pub fn new(inner: F) -> Self { + Self { + finished: false, + inner: Box::pin(inner), + } + } + + pub fn is_finished(&self) -> bool { + self.finished + } +} + +impl Future for CancelMonitor +where + F: Future, +{ + type Output = F::Output; + + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + match self.inner.as_mut().poll(cx) { + Poll::Ready(output) => { + self.finished = true; + Poll::Ready(output) + } + Poll::Pending => Poll::Pending, + } + } +} + +impl Drop for CancelMonitor { + fn drop(&mut self) { + if !self.finished { + Span::current().record("cancelled", true); + } + } +} + +/// MonitorCancellation records a cancelled = true span attribute if the future it +/// is decorating is dropped before completion. The cancelled attribute must be added +/// at span creation, as you cannot add new attributes after the span is created. +pub trait MonitorCancellation { + fn monitor_cancellation(self) -> CancelMonitor + where + Self: Sized + Future; +} + +impl MonitorCancellation for T +where + T: Future, +{ + fn monitor_cancellation(self) -> CancelMonitor { + CancelMonitor::new(self) + } +} + pub type RegistryID = Uuid; /// A service to manage the prometheus registries. This service allow us to create diff --git a/crates/sui-authority-aggregation/src/lib.rs b/crates/sui-authority-aggregation/src/lib.rs index a267c7cd7929a..d1b05f5163e0a 100644 --- a/crates/sui-authority-aggregation/src/lib.rs +++ b/crates/sui-authority-aggregation/src/lib.rs @@ -4,7 +4,6 @@ use futures::Future; use futures::{future::BoxFuture, stream::FuturesUnordered, StreamExt}; use mysten_metrics::monitored_future; -use tracing::instrument::Instrument; use std::collections::{BTreeMap, BTreeSet}; use std::sync::Arc; @@ -63,17 +62,7 @@ where .map(|name| { let client = authority_clients[&name].clone(); let execute = map_each_authority.clone(); - let concise_name = name.concise_owned(); - monitored_future!(async move { - ( - name.clone(), - execute(name, client) - .instrument( - tracing::trace_span!("quorum_map_auth", authority =? concise_name), - ) - .await, - ) - }) + monitored_future!(async move { (name.clone(), execute(name, client).await,) }) }) .collect(); diff --git a/crates/sui-core/src/authority_aggregator.rs b/crates/sui-core/src/authority_aggregator.rs index c4f7da27474f9..6bc31210d6c51 100644 --- a/crates/sui-core/src/authority_aggregator.rs +++ b/crates/sui-core/src/authority_aggregator.rs @@ -9,7 +9,7 @@ use crate::authority_client::{ use crate::safe_client::{SafeClient, SafeClientMetrics, SafeClientMetricsBase}; use futures::{future::BoxFuture, stream::FuturesUnordered, StreamExt}; use mysten_metrics::histogram::Histogram; -use mysten_metrics::{monitored_future, spawn_monitored_task, GaugeGuard}; +use mysten_metrics::{monitored_future, spawn_monitored_task, GaugeGuard, MonitorCancellation}; use mysten_network::config::Config; use std::convert::AsRef; use std::net::SocketAddr; @@ -35,7 +35,7 @@ use sui_types::{ transaction::*, }; use thiserror::Error; -use tracing::{debug, error, info, trace, warn, Instrument}; +use tracing::{debug, error, info, instrument, trace, trace_span, warn, Instrument}; use crate::epoch::committee_store::CommitteeStore; use crate::stake_aggregator::{InsertResult, MultiStakeAggregator, StakeAggregator}; @@ -1012,6 +1012,7 @@ where } /// Submits the transaction to a quorum of validators to make a certificate. + #[instrument(level = "trace", skip_all)] pub async fn process_transaction( &self, transaction: Transaction, @@ -1051,11 +1052,15 @@ where committee.clone(), self.authority_clients.clone(), state, - |_name, client| { + |name, client| { Box::pin( async move { let _guard = GaugeGuard::acquire(&self.metrics.inflight_transaction_requests); - client.handle_transaction(transaction_ref.clone(), client_addr).await + let concise_name = name.concise_owned(); + client.handle_transaction(transaction_ref.clone(), client_addr) + .monitor_cancellation() + .instrument(trace_span!("handle_transaction", cancelled = false, authority =? concise_name)) + .await }, ) }, @@ -1475,6 +1480,7 @@ where - state.tx_signatures.total_votes() } + #[instrument(level = "trace", skip_all)] pub async fn process_certificate( &self, request: HandleCertificateRequestV3, @@ -1532,6 +1538,7 @@ where move |name, client| { Box::pin(async move { let _guard = GaugeGuard::acquire(&metrics_clone.inflight_certificate_requests); + let concise_name = name.concise_owned(); if request_ref.include_input_objects || request_ref.include_output_objects { // adjust the request to validators we aren't planning on sampling @@ -1549,16 +1556,12 @@ where client .handle_certificate_v3(req, client_addr) - .instrument( - tracing::trace_span!("handle_certificate", authority =? name.concise()), - ) + .instrument(trace_span!("handle_certificate_v3", authority =? concise_name)) .await } else { client .handle_certificate_v2(request_ref.certificate, client_addr) - .instrument( - tracing::trace_span!("handle_certificate", authority =? name.concise()), - ) + .instrument(trace_span!("handle_certificate_v2", authority =? concise_name)) .await .map(|response| HandleCertificateResponseV3 { effects: response.signed_effects, @@ -1771,6 +1774,7 @@ where } } + #[instrument(level = "trace", skip_all, fields(tx_digest = ?transaction.digest()))] pub async fn execute_transaction_block( &self, transaction: &Transaction, @@ -1779,7 +1783,6 @@ where let tx_guard = GaugeGuard::acquire(&self.metrics.inflight_transactions); let result = self .process_transaction(transaction.clone(), client_addr) - .instrument(tracing::debug_span!("process_tx")) .await?; let cert = match result { ProcessTransactionResult::Certified { certificate, .. } => certificate, @@ -1802,7 +1805,6 @@ where }, client_addr, ) - .instrument(tracing::debug_span!("process_cert")) .await?; Ok(response.effects_cert) @@ -1810,6 +1812,7 @@ where /// This function tries to get SignedTransaction OR CertifiedTransaction from /// an given list of validators who are supposed to know about it. + #[instrument(level = "trace", skip_all, fields(?tx_digest))] pub async fn handle_transaction_info_request_from_some_validators( &self, tx_digest: &TransactionDigest, diff --git a/crates/sui-core/src/quorum_driver/mod.rs b/crates/sui-core/src/quorum_driver/mod.rs index b10ac8762d781..a01afe41206b5 100644 --- a/crates/sui-core/src/quorum_driver/mod.rs +++ b/crates/sui-core/src/quorum_driver/mod.rs @@ -25,8 +25,7 @@ use tokio::time::{sleep_until, Instant}; use tokio::sync::mpsc::{self, Receiver, Sender}; use tokio::task::JoinHandle; -use tracing::Instrument; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info, instrument, trace_span, warn}; use crate::authority_aggregator::{ AggregatorProcessCertificateError, AggregatorProcessTransactionError, AuthorityAggregator, @@ -59,6 +58,7 @@ pub struct QuorumDriverTask { pub retry_times: u32, pub next_retry_after: Instant, pub client_addr: Option, + pub trace_span: Option, } impl Debug for QuorumDriverTask { @@ -193,6 +193,7 @@ impl QuorumDriver
{ retry_times: old_retry_times + 1, next_retry_after, client_addr, + trace_span: Some(tracing::Span::current()), }) .await } @@ -237,6 +238,7 @@ impl QuorumDriver where A: AuthorityAPI + Send + Sync + 'static + Clone, { + #[instrument(level = "trace", skip_all)] pub async fn submit_transaction( &self, request: ExecuteTransactionRequestV3, @@ -252,6 +254,7 @@ where retry_times: 0, next_retry_after: Instant::now(), client_addr: None, + trace_span: Some(tracing::Span::current()), }) .await?; Ok(ticket) @@ -259,6 +262,7 @@ where // Used when the it is called in a component holding the notifier, and a ticket is // already obtained prior to calling this function, for instance, TransactionOrchestrator + #[instrument(level = "trace", skip_all)] pub async fn submit_transaction_no_ticket( &self, request: ExecuteTransactionRequestV3, @@ -277,10 +281,12 @@ where retry_times: 0, next_retry_after: Instant::now(), client_addr, + trace_span: Some(tracing::Span::current()), }) .await } + #[instrument(level = "trace", skip_all)] pub(crate) async fn process_transaction( &self, transaction: Transaction, @@ -289,15 +295,13 @@ where let auth_agg = self.validators.load(); let _tx_guard = GaugeGuard::acquire(&auth_agg.metrics.inflight_transactions); let tx_digest = *transaction.digest(); - let result = auth_agg - .process_transaction(transaction, client_addr) - .instrument(tracing::debug_span!("aggregator_process_tx", ?tx_digest)) - .await; + let result = auth_agg.process_transaction(transaction, client_addr).await; self.process_transaction_result(result, tx_digest, client_addr) .await } + #[instrument(level = "trace", skip_all)] async fn process_transaction_result( &self, result: Result, @@ -410,6 +414,7 @@ where } } + #[instrument(level = "trace", skip_all)] async fn process_conflicting_tx( &self, tx_digest: TransactionDigest, @@ -470,6 +475,7 @@ where } } + #[instrument(level = "trace", skip_all, fields(tx_digest = ?request.certificate.digest()))] pub(crate) async fn process_certificate( &self, request: HandleCertificateRequestV3, @@ -480,7 +486,6 @@ where let tx_digest = *request.certificate.digest(); let response = auth_agg .process_certificate(request.clone(), client_addr) - .instrument(tracing::debug_span!("aggregator_process_cert", ?tx_digest)) .await .map_err(|agg_err| match agg_err { AggregatorProcessCertificateError::FatalExecuteCertificate { @@ -517,6 +522,7 @@ where /// Returns Some(true) if the conflicting transaction is executed successfully /// (or already executed), or Some(false) if it did not. + #[instrument(level = "trace", skip_all)] async fn attempt_conflicting_transaction( &self, tx_digest: &TransactionDigest, @@ -751,6 +757,7 @@ where /// Process a QuorumDriverTask. /// The function has no return value - the corresponding actions of task result /// are performed in this call. + #[instrument(level = "trace", parent = task.trace_span.as_ref().and_then(|s| s.id()), skip_all)] async fn process_task(quorum_driver: Arc>, task: QuorumDriverTask) { debug!(?task, "Quorum Driver processing task"); let QuorumDriverTask { @@ -917,6 +924,10 @@ where ) { let limit = Arc::new(Semaphore::new(TASK_QUEUE_SIZE)); while let Some(task) = task_receiver.recv().await { + let task_queue_span = + trace_span!(parent: task.trace_span.as_ref().and_then(|s| s.id()), "task_queue"); + let task_span_guard = task_queue_span.enter(); + // hold semaphore permit until task completes. unwrap ok because we never close // the semaphore in this context. let limit = limit.clone(); @@ -935,6 +946,7 @@ where } metrics.current_requests_in_flight.dec(); let qd = quorum_driver.clone(); + drop(task_span_guard); spawn_monitored_task!(async move { let _guard = permit; QuorumDriverHandler::process_task(qd, task).await diff --git a/crates/sui-core/src/safe_client.rs b/crates/sui-core/src/safe_client.rs index 0deae65548a69..74c80cd42afd4 100644 --- a/crates/sui-core/src/safe_client.rs +++ b/crates/sui-core/src/safe_client.rs @@ -28,7 +28,7 @@ use sui_types::{ transaction::*, }; use tap::TapFallible; -use tracing::{debug, error}; +use tracing::{debug, error, instrument}; macro_rules! check_error { ($address:expr, $cond:expr, $msg:expr) => { @@ -496,6 +496,7 @@ where } /// Handle Transaction information requests for a given digest. + #[instrument(level = "trace", skip_all, fields(authority = ?self.address.concise()))] pub async fn handle_transaction_info_request( &self, request: TransactionInfoRequest, @@ -582,6 +583,7 @@ where } } + #[instrument(level = "trace", skip_all, fields(authority = ?self.address.concise()))] pub async fn handle_checkpoint( &self, request: CheckpointRequest, @@ -597,6 +599,7 @@ where Ok(resp) } + #[instrument(level = "trace", skip_all, fields(authority = ?self.address.concise()))] pub async fn handle_system_state_object(&self) -> Result { self.authority_client .handle_system_state_object(SystemStateRequest { _unused: false }) diff --git a/crates/sui-core/src/transaction_orchestrator.rs b/crates/sui-core/src/transaction_orchestrator.rs index 1ef8bb7c86f8f..6b655d0358d56 100644 --- a/crates/sui-core/src/transaction_orchestrator.rs +++ b/crates/sui-core/src/transaction_orchestrator.rs @@ -228,6 +228,7 @@ where good_response_metrics.inc(); let QuorumDriverResponse { effects_cert, .. } = response; if !wait_for_local_execution { + debug!(?tx_digest, ?wait_for_local_execution, "success"); return Ok(ExecuteTransactionResponse::EffectsCert(Box::new(( FinalizedEffects::new_from_effects_cert(effects_cert.into()), response.events.unwrap_or_default(), @@ -249,11 +250,15 @@ where ) .await { - Ok(_) => Ok(ExecuteTransactionResponse::EffectsCert(Box::new(( - FinalizedEffects::new_from_effects_cert(effects_cert.into()), - response.events.unwrap_or_default(), - true, - )))), + Ok(_) => { + debug!(?tx_digest, ?wait_for_local_execution, "success"); + + Ok(ExecuteTransactionResponse::EffectsCert(Box::new(( + FinalizedEffects::new_from_effects_cert(effects_cert.into()), + response.events.unwrap_or_default(), + true, + )))) + } Err(_) => Ok(ExecuteTransactionResponse::EffectsCert(Box::new(( FinalizedEffects::new_from_effects_cert(effects_cert.into()), response.events.unwrap_or_default(), @@ -265,6 +270,8 @@ where } // Utilize the handle_certificate_v3 validator api to request input/output objects + #[instrument(name = "tx_orchestrator_execute_transaction_v3", level = "trace", skip_all, + fields(tx_digest = ?request.transaction.digest()))] pub async fn execute_transaction_v3( &self, request: ExecuteTransactionRequestV3, @@ -351,6 +358,7 @@ where /// Submits the transaction to Quorum Driver for execution. /// Returns an awaitable Future. + #[instrument(name = "tx_orchestrator_submit", level = "trace", skip_all)] async fn submit( &self, transaction: VerifiedTransaction, From 0ff46cd6fd532fa4e3383e09e52e654334f91166 Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:31:05 -0700 Subject: [PATCH 068/163] Record batch writes and inserts that are slower than 1s (#18698) We have seen situations where rocksdb throttling briefly causes all threads to block while attempting to write to a throttled table. However, it is not clear that very rare events such as these will show up in histograms. By tracking them in counters we can see definitively how often and when these events occur. --- crates/typed-store/src/metrics.rs | 32 +++++++++++++++++++++++++++ crates/typed-store/src/rocks/mod.rs | 34 +++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/crates/typed-store/src/metrics.rs b/crates/typed-store/src/metrics.rs index d8da9b44d7438..8b92fe983832c 100644 --- a/crates/typed-store/src/metrics.rs +++ b/crates/typed-store/src/metrics.rs @@ -255,6 +255,10 @@ pub struct OperationMetrics { pub rocksdb_batch_commit_latency_seconds: HistogramVec, pub rocksdb_batch_commit_bytes: HistogramVec, pub rocksdb_num_active_db_handles: IntGaugeVec, + pub rocksdb_very_slow_batch_writes_count: IntCounterVec, + pub rocksdb_very_slow_batch_writes_duration_ms: IntCounterVec, + pub rocksdb_very_slow_puts_count: IntCounterVec, + pub rocksdb_very_slow_puts_duration_ms: IntCounterVec, } impl OperationMetrics { @@ -379,6 +383,34 @@ impl OperationMetrics { registry, ) .unwrap(), + rocksdb_very_slow_batch_writes_count: register_int_counter_vec_with_registry!( + "rocksdb_num_very_slow_batch_writes", + "Number of batch writes that took more than 1 second", + &["db_name"], + registry, + ) + .unwrap(), + rocksdb_very_slow_batch_writes_duration_ms: register_int_counter_vec_with_registry!( + "rocksdb_very_slow_batch_writes_duration", + "Total duration of batch writes that took more than 1 second", + &["db_name"], + registry, + ) + .unwrap(), + rocksdb_very_slow_puts_count: register_int_counter_vec_with_registry!( + "rocksdb_num_very_slow_puts", + "Number of puts that took more than 1 second", + &["cf_name"], + registry, + ) + .unwrap(), + rocksdb_very_slow_puts_duration_ms: register_int_counter_vec_with_registry!( + "rocksdb_very_slow_puts_duration", + "Total duration of puts that took more than 1 second", + &["cf_name"], + registry, + ) + .unwrap(), } } } diff --git a/crates/typed-store/src/rocks/mod.rs b/crates/typed-store/src/rocks/mod.rs index 471b10ef0143b..3999add625e65 100644 --- a/crates/typed-store/src/rocks/mod.rs +++ b/crates/typed-store/src/rocks/mod.rs @@ -1347,7 +1347,7 @@ impl DBBatch { #[instrument(level = "trace", skip_all, err)] pub fn write(self) -> Result<(), TypedStoreError> { let db_name = self.rocksdb.db_name(); - let _timer = self + let timer = self .db_metrics .op_metrics .rocksdb_batch_commit_latency_seconds @@ -1372,6 +1372,20 @@ impl DBBatch { .write_perf_ctx_metrics .report_metrics(&db_name); } + let elapsed = timer.stop_and_record(); + if elapsed > 1.0 { + warn!(?elapsed, ?db_name, "very slow batch write"); + self.db_metrics + .op_metrics + .rocksdb_very_slow_batch_writes_count + .with_label_values(&[&db_name]) + .inc(); + self.db_metrics + .op_metrics + .rocksdb_very_slow_batch_writes_duration_ms + .with_label_values(&[&db_name]) + .inc_by((elapsed * 1000.0) as u64); + } Ok(()) } @@ -1863,7 +1877,7 @@ where #[instrument(level = "trace", skip_all, err)] fn insert(&self, key: &K, value: &V) -> Result<(), TypedStoreError> { - let _timer = self + let timer = self .db_metrics .op_metrics .rocksdb_put_latency_seconds @@ -1889,6 +1903,22 @@ where self.rocksdb .put_cf(&self.cf(), &key_buf, &value_buf, &self.opts.writeopts()) .map_err(typed_store_err_from_rocks_err)?; + + let elapsed = timer.stop_and_record(); + if elapsed > 1.0 { + warn!(?elapsed, cf = ?self.cf, "very slow insert"); + self.db_metrics + .op_metrics + .rocksdb_very_slow_puts_count + .with_label_values(&[&self.cf]) + .inc(); + self.db_metrics + .op_metrics + .rocksdb_very_slow_puts_duration_ms + .with_label_values(&[&self.cf]) + .inc_by((elapsed * 1000.0) as u64); + } + Ok(()) } From 77929e73c34d6256c3cd26b79f0afdd2eb92d857 Mon Sep 17 00:00:00 2001 From: Eugene Boguslavsky Date: Wed, 17 Jul 2024 13:38:15 -0700 Subject: [PATCH 069/163] Add REST API section to release notes (#18707) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Add REST API section to release notes ## Test plan 👀 --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- scripts/release_notes.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 55648d37c670c..d9188b7d2852b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -20,4 +20,5 @@ For each box you select, include information after the relevant heading that des - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: -- [ ] Rust SDK: +- [ ] Rust SDK: +- [ ] REST API: diff --git a/scripts/release_notes.py b/scripts/release_notes.py index 1a23da750624c..4629a304db631 100755 --- a/scripts/release_notes.py +++ b/scripts/release_notes.py @@ -59,6 +59,7 @@ "GraphQL", "CLI", "Rust SDK", + "REST API", ] From 6754bf86ee6b8a25dd4b3b08ac140f69fe95830a Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Wed, 17 Jul 2024 16:58:08 -0400 Subject: [PATCH 070/163] disable RSU timeout panic for non-debug builds (#18705) --- crates/sui-core/src/authority.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 53e86ebe831fe..3e123df8bc5b2 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -4911,17 +4911,30 @@ impl RandomnessRoundReceiver { // We set a very long timeout so that in case this gets stuck for some reason, the // validator will eventually crash rather than continuing in a zombie mode. const RANDOMNESS_STATE_UPDATE_EXECUTION_TIMEOUT: Duration = Duration::from_secs(300); - let Ok(mut effects) = tokio::time::timeout( + let result = tokio::time::timeout( RANDOMNESS_STATE_UPDATE_EXECUTION_TIMEOUT, authority_state .get_transaction_cache_reader() .notify_read_executed_effects(&[digest]), ) - .await - .unwrap_or_else(|_| panic!("randomness state update transaction execution timed out at epoch {epoch}, round {round}")) else { - panic!("failed to get effects for randomness state update transaction at epoch {epoch}, round {round}"); + .await; + let result = match result { + Ok(result) => result, + Err(_) => { + if cfg!(debug_assertions) { + // Crash on randomness update execution timeout in debug builds. + panic!("randomness state update transaction execution timed out at epoch {epoch}, round {round}"); + } + warn!("randomness state update transaction execution timed out at epoch {epoch}, round {round}"); + // Continue waiting as long as necessary in non-debug builds. + authority_state + .get_transaction_cache_reader() + .notify_read_executed_effects(&[digest]) + .await + } }; + let mut effects = result.unwrap_or_else(|_| panic!("failed to get effects for randomness state update transaction at epoch {epoch}, round {round}")); let effects = effects.pop().expect("should return effects"); if *effects.status() != ExecutionStatus::Success { panic!("failed to execute randomness state update transaction at epoch {epoch}, round {round}: {effects:?}"); From 3959d9af51172824b0e4f20802c71e416596c7df Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:59:36 -0700 Subject: [PATCH 071/163] Include digest of ProtocolConfig when voting for a version (#18675) Add AuthorityCapabilitiesV2, which includes the digest of the protocol config for each version. This makes it impossible for the committee to approve a protocol upgrade if (due to a release mistake) there is disagreement about what is in the config. --- crates/sui-core/src/authority.rs | 153 ++++++++++++++++-- .../authority/authority_per_epoch_store.rs | 86 +++++++++- crates/sui-core/src/consensus_adapter.rs | 1 + crates/sui-core/src/consensus_handler.rs | 1 + crates/sui-core/src/consensus_validator.rs | 5 +- crates/sui-core/src/mysticeti_adapter.rs | 1 + .../src/unit_tests/authority_tests.rs | 69 ++++++-- crates/sui-json-rpc-types/src/sui_protocol.rs | 1 - crates/sui-node/src/admin.rs | 8 +- crates/sui-node/src/lib.rs | 24 ++- crates/sui-open-rpc/spec/openrpc.json | 7 +- crates/sui-protocol-config/src/lib.rs | 29 +++- ...ocol_config__test__Mainnet_version_10.snap | 2 - ...ocol_config__test__Mainnet_version_11.snap | 2 - ...ocol_config__test__Mainnet_version_12.snap | 2 - ...ocol_config__test__Mainnet_version_13.snap | 2 - ...ocol_config__test__Mainnet_version_14.snap | 2 - ...ocol_config__test__Mainnet_version_15.snap | 2 - ...ocol_config__test__Mainnet_version_16.snap | 2 - ...ocol_config__test__Mainnet_version_17.snap | 2 - ...ocol_config__test__Mainnet_version_18.snap | 2 - ...ocol_config__test__Mainnet_version_19.snap | 2 - ...ocol_config__test__Mainnet_version_20.snap | 2 - ...ocol_config__test__Mainnet_version_21.snap | 3 - ...ocol_config__test__Mainnet_version_22.snap | 2 - ...ocol_config__test__Mainnet_version_23.snap | 2 - ...ocol_config__test__Mainnet_version_24.snap | 2 - ...ocol_config__test__Mainnet_version_25.snap | 2 - ...ocol_config__test__Mainnet_version_26.snap | 2 - ...ocol_config__test__Mainnet_version_27.snap | 2 - ...ocol_config__test__Mainnet_version_28.snap | 2 - ...ocol_config__test__Mainnet_version_29.snap | 2 - ...ocol_config__test__Mainnet_version_30.snap | 2 - ...ocol_config__test__Mainnet_version_31.snap | 2 - ...ocol_config__test__Mainnet_version_32.snap | 2 - ...ocol_config__test__Mainnet_version_33.snap | 2 - ...ocol_config__test__Mainnet_version_34.snap | 2 - ...ocol_config__test__Mainnet_version_35.snap | 2 - ...ocol_config__test__Mainnet_version_36.snap | 2 - ...ocol_config__test__Mainnet_version_37.snap | 2 - ...ocol_config__test__Mainnet_version_38.snap | 2 - ...ocol_config__test__Mainnet_version_39.snap | 2 - ...ocol_config__test__Mainnet_version_40.snap | 2 - ...ocol_config__test__Mainnet_version_41.snap | 2 - ...ocol_config__test__Mainnet_version_42.snap | 2 - ...ocol_config__test__Mainnet_version_43.snap | 2 - ...ocol_config__test__Mainnet_version_44.snap | 3 +- ...ocol_config__test__Mainnet_version_45.snap | 2 - ...ocol_config__test__Mainnet_version_46.snap | 2 - ...ocol_config__test__Mainnet_version_47.snap | 2 - ...ocol_config__test__Mainnet_version_48.snap | 2 - ...ocol_config__test__Mainnet_version_49.snap | 2 - ...tocol_config__test__Mainnet_version_5.snap | 2 - ...ocol_config__test__Mainnet_version_50.snap | 3 +- ...ocol_config__test__Mainnet_version_51.snap | 2 - ...ocol_config__test__Mainnet_version_52.snap | 2 - ...ocol_config__test__Mainnet_version_53.snap | 2 - ...tocol_config__test__Mainnet_version_6.snap | 2 - ...tocol_config__test__Mainnet_version_7.snap | 2 - ...tocol_config__test__Mainnet_version_8.snap | 2 - ...tocol_config__test__Mainnet_version_9.snap | 2 - ...ocol_config__test__Testnet_version_10.snap | 2 - ...ocol_config__test__Testnet_version_11.snap | 2 - ...ocol_config__test__Testnet_version_12.snap | 2 - ...ocol_config__test__Testnet_version_13.snap | 2 - ...ocol_config__test__Testnet_version_14.snap | 2 - ...ocol_config__test__Testnet_version_15.snap | 2 - ...ocol_config__test__Testnet_version_16.snap | 2 - ...ocol_config__test__Testnet_version_17.snap | 2 - ...ocol_config__test__Testnet_version_18.snap | 2 - ...ocol_config__test__Testnet_version_19.snap | 2 - ...ocol_config__test__Testnet_version_20.snap | 2 - ...ocol_config__test__Testnet_version_21.snap | 2 - ...ocol_config__test__Testnet_version_22.snap | 2 - ...ocol_config__test__Testnet_version_23.snap | 2 - ...ocol_config__test__Testnet_version_24.snap | 2 - ...ocol_config__test__Testnet_version_25.snap | 2 - ...ocol_config__test__Testnet_version_26.snap | 2 - ...ocol_config__test__Testnet_version_27.snap | 2 - ...ocol_config__test__Testnet_version_28.snap | 2 - ...ocol_config__test__Testnet_version_29.snap | 2 - ...ocol_config__test__Testnet_version_30.snap | 2 - ...ocol_config__test__Testnet_version_31.snap | 2 - ...ocol_config__test__Testnet_version_32.snap | 2 - ...ocol_config__test__Testnet_version_33.snap | 2 - ...ocol_config__test__Testnet_version_34.snap | 2 - ...ocol_config__test__Testnet_version_35.snap | 2 - ...ocol_config__test__Testnet_version_36.snap | 2 - ...ocol_config__test__Testnet_version_37.snap | 2 - ...ocol_config__test__Testnet_version_38.snap | 2 - ...ocol_config__test__Testnet_version_39.snap | 2 - ...ocol_config__test__Testnet_version_40.snap | 2 - ...ocol_config__test__Testnet_version_41.snap | 2 - ...ocol_config__test__Testnet_version_42.snap | 2 - ...ocol_config__test__Testnet_version_43.snap | 2 - ...ocol_config__test__Testnet_version_44.snap | 3 +- ...ocol_config__test__Testnet_version_45.snap | 2 - ...ocol_config__test__Testnet_version_46.snap | 2 - ...ocol_config__test__Testnet_version_47.snap | 2 - ...ocol_config__test__Testnet_version_48.snap | 2 - ...ocol_config__test__Testnet_version_49.snap | 2 - ...tocol_config__test__Testnet_version_5.snap | 2 - ...ocol_config__test__Testnet_version_50.snap | 3 +- ...ocol_config__test__Testnet_version_51.snap | 2 - ...ocol_config__test__Testnet_version_52.snap | 2 - ...ocol_config__test__Testnet_version_53.snap | 2 - ...tocol_config__test__Testnet_version_6.snap | 2 - ...tocol_config__test__Testnet_version_7.snap | 2 - ...tocol_config__test__Testnet_version_8.snap | 2 - ...tocol_config__test__Testnet_version_9.snap | 2 - ...sui_protocol_config__test__version_10.snap | 2 - ...sui_protocol_config__test__version_11.snap | 2 - ...sui_protocol_config__test__version_12.snap | 2 - ...sui_protocol_config__test__version_13.snap | 2 - ...sui_protocol_config__test__version_14.snap | 2 - ...sui_protocol_config__test__version_15.snap | 2 - ...sui_protocol_config__test__version_16.snap | 2 - ...sui_protocol_config__test__version_17.snap | 2 - ...sui_protocol_config__test__version_18.snap | 2 - ...sui_protocol_config__test__version_19.snap | 2 - ...sui_protocol_config__test__version_20.snap | 2 - ...sui_protocol_config__test__version_21.snap | 2 - ...sui_protocol_config__test__version_22.snap | 2 - ...sui_protocol_config__test__version_23.snap | 2 - ...sui_protocol_config__test__version_24.snap | 2 - ...sui_protocol_config__test__version_25.snap | 2 - ...sui_protocol_config__test__version_26.snap | 2 - ...sui_protocol_config__test__version_27.snap | 2 - ...sui_protocol_config__test__version_28.snap | 2 - ...sui_protocol_config__test__version_29.snap | 2 - ...sui_protocol_config__test__version_30.snap | 2 - ...sui_protocol_config__test__version_31.snap | 2 - ...sui_protocol_config__test__version_32.snap | 2 - ...sui_protocol_config__test__version_33.snap | 2 - ...sui_protocol_config__test__version_34.snap | 2 - ...sui_protocol_config__test__version_35.snap | 2 - ...sui_protocol_config__test__version_36.snap | 2 - ...sui_protocol_config__test__version_37.snap | 2 - ...sui_protocol_config__test__version_38.snap | 2 - ...sui_protocol_config__test__version_39.snap | 2 - ...sui_protocol_config__test__version_40.snap | 2 - ...sui_protocol_config__test__version_41.snap | 2 - ...sui_protocol_config__test__version_42.snap | 2 - ...sui_protocol_config__test__version_43.snap | 2 - ...sui_protocol_config__test__version_44.snap | 2 - ...sui_protocol_config__test__version_45.snap | 2 - ...sui_protocol_config__test__version_46.snap | 2 - ...sui_protocol_config__test__version_47.snap | 2 - ...sui_protocol_config__test__version_48.snap | 2 - ...sui_protocol_config__test__version_49.snap | 2 - .../sui_protocol_config__test__version_5.snap | 2 - ...sui_protocol_config__test__version_50.snap | 2 - ...sui_protocol_config__test__version_51.snap | 2 - ...sui_protocol_config__test__version_52.snap | 2 - ...sui_protocol_config__test__version_53.snap | 3 +- .../sui_protocol_config__test__version_6.snap | 2 - .../sui_protocol_config__test__version_7.snap | 2 - .../sui_protocol_config__test__version_8.snap | 2 - .../sui_protocol_config__test__version_9.snap | 2 - crates/sui-rest-api/src/system.rs | 1 - crates/sui-types/src/messages_consensus.rs | 82 +++++++++- .../src/supported_protocol_versions.rs | 55 +++++++ 162 files changed, 472 insertions(+), 351 deletions(-) diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 3e123df8bc5b2..dbf8210a4f936 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -47,6 +47,7 @@ use sui_config::NodeConfig; use sui_types::crypto::RandomnessRound; use sui_types::execution_status::ExecutionStatus; use sui_types::inner_temporary_store::PackageStoreWithFallback; +use sui_types::messages_consensus::{AuthorityCapabilitiesV1, AuthorityCapabilitiesV2}; use sui_types::type_resolver::into_struct_layout; use sui_types::type_resolver::LayoutResolver; use tap::{TapFallible, TapOptional}; @@ -101,7 +102,6 @@ use sui_types::messages_checkpoint::{ CheckpointResponseV2, CheckpointSequenceNumber, CheckpointSummary, CheckpointSummaryResponse, CheckpointTimestamp, ECMHLiveObjectSetDigest, VerifiedCheckpoint, }; -use sui_types::messages_consensus::AuthorityCapabilitiesV1; use sui_types::messages_grpc::{ HandleTransactionResponse, LayoutGenerationOption, ObjectInfoRequest, ObjectInfoRequestKind, ObjectInfoResponse, TransactionInfoRequest, TransactionInfoResponse, TransactionStatus, @@ -4316,7 +4316,8 @@ impl AuthorityState { Some(res) } - fn is_protocol_version_supported( + // TODO: delete once authority_capabilities_v2 is deployed everywhere + fn is_protocol_version_supported_v1( current_protocol_version: ProtocolVersion, proposed_protocol_version: ProtocolVersion, protocol_config: &ProtocolConfig, @@ -4403,7 +4404,96 @@ impl AuthorityState { }) } - fn choose_protocol_version_and_system_packages( + fn is_protocol_version_supported_v2( + current_protocol_version: ProtocolVersion, + proposed_protocol_version: ProtocolVersion, + protocol_config: &ProtocolConfig, + committee: &Committee, + capabilities: Vec, + mut buffer_stake_bps: u64, + ) -> Option<(ProtocolVersion, Vec)> { + if proposed_protocol_version > current_protocol_version + 1 + && !protocol_config.advance_to_highest_supported_protocol_version() + { + return None; + } + + if buffer_stake_bps > 10000 { + warn!("clamping buffer_stake_bps to 10000"); + buffer_stake_bps = 10000; + } + + // For each validator, gather the protocol version and system packages that it would like + // to upgrade to in the next epoch. + let mut desired_upgrades: Vec<_> = capabilities + .into_iter() + .filter_map(|mut cap| { + // A validator that lists no packages is voting against any change at all. + if cap.available_system_packages.is_empty() { + return None; + } + + cap.available_system_packages.sort(); + + info!( + "validator {:?} supports {:?} with system packages: {:?}", + cap.authority.concise(), + cap.supported_protocol_versions, + cap.available_system_packages, + ); + + // A validator that only supports the current protosl version is also voting + // against any change, because framework upgrades aways require a protocol version + // bump. + cap.supported_protocol_versions + .get_version_digest(proposed_protocol_version) + .map(|digest| (digest, cap.available_system_packages, cap.authority)) + }) + .collect(); + + // There can only be one set of votes that have a majority, find one if it exists. + desired_upgrades.sort(); + desired_upgrades + .into_iter() + .group_by(|(digest, packages, _authority)| (*digest, packages.clone())) + .into_iter() + .find_map(|((digest, packages), group)| { + // should have been filtered out earlier. + assert!(!packages.is_empty()); + + let mut stake_aggregator: StakeAggregator<(), true> = + StakeAggregator::new(Arc::new(committee.clone())); + + for (_, _, authority) in group { + stake_aggregator.insert_generic(authority, ()); + } + + let total_votes = stake_aggregator.total_votes(); + let quorum_threshold = committee.quorum_threshold(); + let f = committee.total_votes() - committee.quorum_threshold(); + + // multiple by buffer_stake_bps / 10000, rounded up. + let buffer_stake = (f * buffer_stake_bps + 9999) / 10000; + let effective_threshold = quorum_threshold + buffer_stake; + + info!( + protocol_config_digest = ?digest, + ?total_votes, + ?quorum_threshold, + ?buffer_stake_bps, + ?effective_threshold, + ?proposed_protocol_version, + ?packages, + "support for upgrade" + ); + + let has_support = total_votes >= effective_threshold; + has_support.then_some((proposed_protocol_version, packages)) + }) + } + + // TODO: delete once authority_capabilities_v2 is deployed everywhere + fn choose_protocol_version_and_system_packages_v1( current_protocol_version: ProtocolVersion, protocol_config: &ProtocolConfig, committee: &Committee, @@ -4413,7 +4503,32 @@ impl AuthorityState { let mut next_protocol_version = current_protocol_version; let mut system_packages = vec![]; - while let Some((version, packages)) = Self::is_protocol_version_supported( + while let Some((version, packages)) = Self::is_protocol_version_supported_v1( + current_protocol_version, + next_protocol_version + 1, + protocol_config, + committee, + capabilities.clone(), + buffer_stake_bps, + ) { + next_protocol_version = version; + system_packages = packages; + } + + (next_protocol_version, system_packages) + } + + fn choose_protocol_version_and_system_packages_v2( + current_protocol_version: ProtocolVersion, + protocol_config: &ProtocolConfig, + committee: &Committee, + capabilities: Vec, + buffer_stake_bps: u64, + ) -> (ProtocolVersion, Vec) { + let mut next_protocol_version = current_protocol_version; + let mut system_packages = vec![]; + + while let Some((version, packages)) = Self::is_protocol_version_supported_v2( current_protocol_version, next_protocol_version + 1, protocol_config, @@ -4593,15 +4708,27 @@ impl AuthorityState { let buffer_stake_bps = epoch_store.get_effective_buffer_stake_bps(); let (next_epoch_protocol_version, next_epoch_system_packages) = - Self::choose_protocol_version_and_system_packages( - epoch_store.protocol_version(), - epoch_store.protocol_config(), - epoch_store.committee(), - epoch_store - .get_capabilities() - .expect("read capabilities from db cannot fail"), - buffer_stake_bps, - ); + if epoch_store.protocol_config().authority_capabilities_v2() { + Self::choose_protocol_version_and_system_packages_v2( + epoch_store.protocol_version(), + epoch_store.protocol_config(), + epoch_store.committee(), + epoch_store + .get_capabilities_v2() + .expect("read capabilities from db cannot fail"), + buffer_stake_bps, + ) + } else { + Self::choose_protocol_version_and_system_packages_v1( + epoch_store.protocol_version(), + epoch_store.protocol_config(), + epoch_store.committee(), + epoch_store + .get_capabilities_v1() + .expect("read capabilities from db cannot fail"), + buffer_stake_bps, + ) + }; // since system packages are created during the current epoch, they should abide by the // rules of the current epoch, including the current epoch's max Move binary format version 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 8d2ce96aae175..e9e10e17555fd 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -97,8 +97,8 @@ use sui_types::messages_checkpoint::{ CheckpointContents, CheckpointSequenceNumber, CheckpointSignatureMessage, CheckpointSummary, }; use sui_types::messages_consensus::{ - check_total_jwk_size, AuthorityCapabilitiesV1, ConsensusTransaction, ConsensusTransactionKey, - ConsensusTransactionKind, + check_total_jwk_size, AuthorityCapabilitiesV1, AuthorityCapabilitiesV2, ConsensusTransaction, + ConsensusTransactionKey, ConsensusTransactionKind, }; use sui_types::messages_consensus::{VersionedDkgConfimation, VersionedDkgMessage}; use sui_types::storage::GetSharedLocks; @@ -488,6 +488,7 @@ pub struct AuthorityEpochTables { /// Record of the capabilities advertised by each authority. authority_capabilities: DBMap, + authority_capabilities_v2: DBMap, /// Contains a single key, which overrides the value of /// ProtocolConfig::buffer_stake_for_protocol_upgrade_bps @@ -2127,9 +2128,10 @@ impl AuthorityPerEpochStore { pub fn record_capabilities(&self, capabilities: &AuthorityCapabilitiesV1) -> SuiResult { info!("received capabilities {:?}", capabilities); let authority = &capabilities.authority; + let tables = self.tables()?; // Read-compare-write pattern assumes we are only called from the consensus handler task. - if let Some(cap) = self.tables()?.authority_capabilities.get(authority)? { + if let Some(cap) = tables.authority_capabilities.get(authority)? { if cap.generation >= capabilities.generation { debug!( "ignoring new capabilities {:?} in favor of previous capabilities {:?}", @@ -2138,13 +2140,36 @@ impl AuthorityPerEpochStore { return Ok(()); } } - self.tables()? + tables .authority_capabilities .insert(authority, capabilities)?; Ok(()) } - pub fn get_capabilities(&self) -> SuiResult> { + /// Record most recently advertised capabilities of all authorities + pub fn record_capabilities_v2(&self, capabilities: &AuthorityCapabilitiesV2) -> SuiResult { + info!("received capabilities v2 {:?}", capabilities); + let authority = &capabilities.authority; + let tables = self.tables()?; + + // Read-compare-write pattern assumes we are only called from the consensus handler task. + if let Some(cap) = tables.authority_capabilities_v2.get(authority)? { + if cap.generation >= capabilities.generation { + debug!( + "ignoring new capabilities {:?} in favor of previous capabilities {:?}", + capabilities, cap + ); + return Ok(()); + } + } + tables + .authority_capabilities_v2 + .insert(authority, capabilities)?; + Ok(()) + } + + pub fn get_capabilities_v1(&self) -> SuiResult> { + assert!(!self.protocol_config.authority_capabilities_v2()); let result: Result, TypedStoreError> = self .tables()? .authority_capabilities @@ -2154,6 +2179,17 @@ impl AuthorityPerEpochStore { Ok(result?) } + pub fn get_capabilities_v2(&self) -> SuiResult> { + assert!(self.protocol_config.authority_capabilities_v2()); + let result: Result, TypedStoreError> = self + .tables()? + .authority_capabilities_v2 + .values() + .map_into() + .collect(); + Ok(result?) + } + pub fn record_jwk_vote( &self, batch: &mut DBBatch, @@ -2451,13 +2487,25 @@ impl AuthorityPerEpochStore { } } SequencedConsensusTransactionKind::External(ConsensusTransaction { - kind: ConsensusTransactionKind::CapabilityNotification(capabilities), + kind: + ConsensusTransactionKind::CapabilityNotification(AuthorityCapabilitiesV1 { + authority, + .. + }), + .. + }) + | SequencedConsensusTransactionKind::External(ConsensusTransaction { + kind: + ConsensusTransactionKind::CapabilityNotificationV2(AuthorityCapabilitiesV2 { + authority, + .. + }), .. }) => { - if transaction.sender_authority() != capabilities.authority { + if transaction.sender_authority() != *authority { warn!( "CapabilityNotification authority {} does not match its author from consensus {}", - capabilities.authority, transaction.certificate_author_index + authority, transaction.certificate_author_index ); return None; } @@ -3514,6 +3562,28 @@ impl AuthorityPerEpochStore { } Ok(ConsensusCertificateResult::ConsensusMessage) } + SequencedConsensusTransactionKind::External(ConsensusTransaction { + kind: ConsensusTransactionKind::CapabilityNotificationV2(capabilities), + .. + }) => { + let authority = capabilities.authority; + if self + .get_reconfig_state_read_lock_guard() + .should_accept_consensus_certs() + { + debug!( + "Received CapabilityNotificationV2 from {:?}", + authority.concise() + ); + self.record_capabilities_v2(capabilities)?; + } else { + debug!( + "Ignoring CapabilityNotificationV2 from {:?} because of end of epoch", + authority.concise() + ); + } + Ok(ConsensusCertificateResult::ConsensusMessage) + } SequencedConsensusTransactionKind::External(ConsensusTransaction { kind: ConsensusTransactionKind::NewJWKFetched(authority, jwk_id, jwk), .. diff --git a/crates/sui-core/src/consensus_adapter.rs b/crates/sui-core/src/consensus_adapter.rs index 70a2cd4e38375..068b73b4e7558 100644 --- a/crates/sui-core/src/consensus_adapter.rs +++ b/crates/sui-core/src/consensus_adapter.rs @@ -750,6 +750,7 @@ impl ConsensusAdapter { transactions[0].kind, ConsensusTransactionKind::EndOfPublish(_) | ConsensusTransactionKind::CapabilityNotification(_) + | ConsensusTransactionKind::CapabilityNotificationV2(_) | ConsensusTransactionKind::RandomnessDkgMessage(_, _) | ConsensusTransactionKind::RandomnessDkgConfirmation(_, _) ) { diff --git a/crates/sui-core/src/consensus_handler.rs b/crates/sui-core/src/consensus_handler.rs index d3c839f7a4e79..26bab2d6fa9fd 100644 --- a/crates/sui-core/src/consensus_handler.rs +++ b/crates/sui-core/src/consensus_handler.rs @@ -572,6 +572,7 @@ pub(crate) fn classify(transaction: &ConsensusTransaction) -> &'static str { ConsensusTransactionKind::CheckpointSignature(_) => "checkpoint_signature", ConsensusTransactionKind::EndOfPublish(_) => "end_of_publish", ConsensusTransactionKind::CapabilityNotification(_) => "capability_notification", + ConsensusTransactionKind::CapabilityNotificationV2(_) => "capability_notification_v2", ConsensusTransactionKind::NewJWKFetched(_, _, _) => "new_jwk_fetched", ConsensusTransactionKind::RandomnessStateUpdate(_, _) => "randomness_state_update", ConsensusTransactionKind::RandomnessDkgMessage(_, _) => "randomness_dkg_message", diff --git a/crates/sui-core/src/consensus_validator.rs b/crates/sui-core/src/consensus_validator.rs index 6651241cd6a06..b56236ed7e3f9 100644 --- a/crates/sui-core/src/consensus_validator.rs +++ b/crates/sui-core/src/consensus_validator.rs @@ -85,9 +85,12 @@ impl SuiTxValidator { return Err(SuiError::InvalidDkgMessageSize.into()); } } + + ConsensusTransactionKind::CapabilityNotification(_) => {} + ConsensusTransactionKind::EndOfPublish(_) - | ConsensusTransactionKind::CapabilityNotification(_) | ConsensusTransactionKind::NewJWKFetched(_, _, _) + | ConsensusTransactionKind::CapabilityNotificationV2(_) | ConsensusTransactionKind::RandomnessStateUpdate(_, _) => {} } } diff --git a/crates/sui-core/src/mysticeti_adapter.rs b/crates/sui-core/src/mysticeti_adapter.rs index eda10df0e6b3e..a913ce74ada41 100644 --- a/crates/sui-core/src/mysticeti_adapter.rs +++ b/crates/sui-core/src/mysticeti_adapter.rs @@ -103,6 +103,7 @@ impl SubmitToConsensus for LazyMysticetiClient { transactions[0].kind, ConsensusTransactionKind::EndOfPublish(_) | ConsensusTransactionKind::CapabilityNotification(_) + | ConsensusTransactionKind::CapabilityNotificationV2(_) | ConsensusTransactionKind::RandomnessDkgMessage(_, _) | ConsensusTransactionKind::RandomnessDkgConfirmation(_, _) ) diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index 9d438715574a4..266defdd6b4ff 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -31,6 +31,7 @@ use sui_json_rpc_types::{ }; use sui_macros::sim_test; use sui_protocol_config::{Chain, PerObjectCongestionControlMode, ProtocolConfig, ProtocolVersion}; +use sui_types::digests::Digest; use sui_types::dynamic_field::DynamicFieldType; use sui_types::effects::TransactionEffects; use sui_types::epoch_data::EpochData; @@ -38,7 +39,9 @@ use sui_types::error::UserInputError; use sui_types::execution::SharedInput; use sui_types::execution_status::{ExecutionFailureStatus, ExecutionStatus}; use sui_types::gas_coin::GasCoin; -use sui_types::messages_consensus::ConsensusDeterminedVersionAssignments; +use sui_types::messages_consensus::{ + AuthorityCapabilitiesV2, ConsensusDeterminedVersionAssignments, +}; use sui_types::object::Data; use sui_types::programmable_transaction_builder::ProgrammableTransactionBuilder; use sui_types::randomness_state::get_randomness_state_obj_initial_shared_version; @@ -4957,12 +4960,30 @@ fn test_choose_next_system_packages() { macro_rules! make_capabilities { ($v: expr, $name: expr, $packages: expr) => { - AuthorityCapabilitiesV1::new( + AuthorityCapabilitiesV2::new( $name, + Chain::Unknown, SupportedProtocolVersions::new_for_testing(1, $v), $packages, ) }; + + ($v: expr, $name: expr, $packages: expr, $digest: expr) => {{ + let mut cap = AuthorityCapabilitiesV2::new( + $name, + Chain::Unknown, + SupportedProtocolVersions::new_for_testing(1, $v), + $packages, + ); + + for (version, digest) in cap.supported_protocol_versions.versions.iter_mut() { + if version.as_u64() == $v { + *digest = $digest; + } + } + + cap + }}; } let committee = Committee::new_simple_test_committee().0; @@ -4982,7 +5003,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(1), vec![]), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5001,7 +5022,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(1), vec![]), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5015,7 +5036,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(2), sort(vec![o1, o2])), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5034,7 +5055,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(1), vec![]), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5053,7 +5074,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(2), sort(vec![o1, o2])), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5072,7 +5093,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(1), vec![]), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5092,7 +5113,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(2), sort(vec![o1, o2])), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5111,7 +5132,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(1), vec![]), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5132,7 +5153,7 @@ fn test_choose_next_system_packages() { assert_eq!( (ver(3), sort(vec![o1, o2])), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5152,7 +5173,7 @@ fn test_choose_next_system_packages() { // 3 which is the highest supported version assert_eq!( (ver(3), sort(vec![o1, o2])), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, @@ -5173,7 +5194,29 @@ fn test_choose_next_system_packages() { // a way to detect that. The upgrade simply won't happen until everyone moves to 3. assert_eq!( (ver(1), sort(vec![])), - AuthorityState::choose_protocol_version_and_system_packages( + AuthorityState::choose_protocol_version_and_system_packages_v2( + ProtocolVersion::MIN, + &protocol_config, + &committee, + capabilities, + protocol_config.buffer_stake_for_protocol_upgrade_bps(), + ) + ); + + // all validators support 2, but they disagree on the digest of the protocol config for 2, so + // no upgrade happens. + let digest_a = Digest::random(); + let digest_b = Digest::random(); + let capabilities = vec![ + make_capabilities!(2, v[0].0, vec![o1, o2], digest_a), + make_capabilities!(2, v[1].0, vec![o1, o2], digest_a), + make_capabilities!(2, v[2].0, vec![o1, o2], digest_b), + make_capabilities!(2, v[3].0, vec![o1, o2], digest_b), + ]; + + assert_eq!( + (ver(1), sort(vec![])), + AuthorityState::choose_protocol_version_and_system_packages_v2( ProtocolVersion::MIN, &protocol_config, &committee, diff --git a/crates/sui-json-rpc-types/src/sui_protocol.rs b/crates/sui-json-rpc-types/src/sui_protocol.rs index 4439ad4ddf13d..045bb9722b770 100644 --- a/crates/sui-json-rpc-types/src/sui_protocol.rs +++ b/crates/sui-json-rpc-types/src/sui_protocol.rs @@ -48,7 +48,6 @@ impl From for SuiProtocolConfigValue { ProtocolConfigValue::u16(y) => SuiProtocolConfigValue::U16(y), ProtocolConfigValue::u32(y) => SuiProtocolConfigValue::U32(y), ProtocolConfigValue::u64(x) => SuiProtocolConfigValue::U64(x), - ProtocolConfigValue::f64(z) => SuiProtocolConfigValue::F64(z), ProtocolConfigValue::bool(z) => SuiProtocolConfigValue::Bool(z), } } diff --git a/crates/sui-node/src/admin.rs b/crates/sui-node/src/admin.rs index 50afbe772e3d0..af0d710e229b4 100644 --- a/crates/sui-node/src/admin.rs +++ b/crates/sui-node/src/admin.rs @@ -232,13 +232,19 @@ async fn set_filter( async fn capabilities(State(state): State>) -> (StatusCode, String) { let epoch_store = state.node.state().load_epoch_store_one_call_per_task(); - let capabilities = epoch_store.get_capabilities(); + // Only one of v1 or v2 will be populated at a time + let capabilities = epoch_store.get_capabilities_v1(); let mut output = String::new(); for capability in &capabilities { output.push_str(&format!("{:?}\n", capability)); } + let capabilities = epoch_store.get_capabilities_v2(); + for capability in &capabilities { + output.push_str(&format!("{:?}\n", capability)); + } + (StatusCode::OK, output) } diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index 59aff2583d501..b438215453195 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -39,6 +39,7 @@ use sui_rest_api::RestMetrics; use sui_types::base_types::ConciseableName; use sui_types::crypto::RandomnessRound; use sui_types::digests::ChainIdentifier; +use sui_types::messages_consensus::AuthorityCapabilitiesV2; use sui_types::sui_system_state::SuiSystemState; use tap::tap::TapFallible; use tokio::runtime::Handle; @@ -1509,8 +1510,23 @@ impl SuiNode { let config = cur_epoch_store.protocol_config(); let binary_config = to_binary_config(config); - let transaction = ConsensusTransaction::new_capability_notification( - AuthorityCapabilitiesV1::new( + let transaction = if config.authority_capabilities_v2() { + ConsensusTransaction::new_capability_notification_v2( + AuthorityCapabilitiesV2::new( + self.state.name, + cur_epoch_store.get_chain_identifier().chain(), + self.config + .supported_protocol_versions + .expect("Supported versions should be populated") + // no need to send digests of versions less than the current version + .truncate_below(config.version), + self.state + .get_available_system_packages(&binary_config) + .await, + ), + ) + } else { + ConsensusTransaction::new_capability_notification(AuthorityCapabilitiesV1::new( self.state.name, self.config .supported_protocol_versions @@ -1518,8 +1534,8 @@ impl SuiNode { self.state .get_available_system_packages(&binary_config) .await, - ), - ); + )) + }; info!(?transaction, "submitting capabilities to consensus"); components .consensus_adapter diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index b3be07a01d874..3cf11e10d5275 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -1300,6 +1300,7 @@ "advance_epoch_start_time_in_safe_mode": true, "advance_to_highest_supported_protocol_version": false, "allow_receiving_object_id": false, + "authority_capabilities_v2": false, "ban_entry_init": false, "bridge": false, "commit_root_state_digest": false, @@ -1864,12 +1865,6 @@ "reward_slashing_rate": { "u64": "10000" }, - "scoring_decision_cutoff_value": { - "f64": "2.5" - }, - "scoring_decision_mad_divisor": { - "f64": "2.3" - }, "storage_fund_reinvest_rate": { "u64": "500" }, diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 9c6dfc646f89a..74cd992249209 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -497,6 +497,10 @@ struct FeatureFlags { // Enable passkey auth (SIP-9) #[serde(skip_serializing_if = "is_false")] passkey_auth: bool, + + // Use AuthorityCapabilitiesV2 + #[serde(skip_serializing_if = "is_false")] + authority_capabilities_v2: bool, } fn is_false(b: &bool) -> bool { @@ -1096,12 +1100,13 @@ pub struct ProtocolConfig { vdf_verify_vdf_cost: Option, vdf_hash_to_input_cost: Option, + // ==== Ephemeral (consensus only) params deleted ==== + // // Const params for consensus scoring decision // The scaling factor property for the MED outlier detection - scoring_decision_mad_divisor: Option, + // scoring_decision_mad_divisor: Option, // The cutoff value for the MED outlier detection - scoring_decision_cutoff_value: Option, - + // scoring_decision_cutoff_value: Option, /// === Execution Version === execution_version: Option, @@ -1471,6 +1476,10 @@ impl ProtocolConfig { pub fn passkey_auth(&self) -> bool { self.feature_flags.passkey_auth } + + pub fn authority_capabilities_v2(&self) -> bool { + self.feature_flags.authority_capabilities_v2 + } } #[cfg(not(msim))] @@ -1892,9 +1901,10 @@ impl ProtocolConfig { max_size_written_objects: None, max_size_written_objects_system_tx: None, + // ==== Ephemeral (consensus only) params deleted ==== // Const params for consensus scoring decision - scoring_decision_mad_divisor: None, - scoring_decision_cutoff_value: None, + // scoring_decision_mad_divisor: None, + // scoring_decision_cutoff_value: None, // Limits the length of a Move identifier max_move_identifier_len: None, @@ -1979,8 +1989,9 @@ impl ProtocolConfig { cfg.feature_flags.missing_type_is_compatibility_error = true; cfg.gas_model_version = Some(4); cfg.feature_flags.scoring_decision_with_validity_cutoff = true; - cfg.scoring_decision_mad_divisor = Some(2.3); - cfg.scoring_decision_cutoff_value = Some(2.5); + // ==== Ephemeral (consensus only) params deleted ==== + // cfg.scoring_decision_mad_divisor = Some(2.3); + // cfg.scoring_decision_cutoff_value = Some(2.5); } 6 => { cfg.gas_model_version = Some(5); @@ -2500,6 +2511,10 @@ impl ProtocolConfig { .record_consensus_determined_version_assignments_in_prologue = true; cfg.feature_flags .prepend_prologue_tx_in_consensus_commit_in_checkpoints = true; + + if chain == Chain::Unknown { + cfg.feature_flags.authority_capabilities_v2 = true; + } } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_10.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_10.snap index ca0e669641dc1..a134148bb74c3 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_10.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_10.snap @@ -174,6 +174,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_11.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_11.snap index b5a47c349db78..8a19929af88ba 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_11.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_11.snap @@ -175,6 +175,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_12.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_12.snap index 78f62ac078443..6a176e61b8c3d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_12.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_12.snap @@ -176,6 +176,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_13.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_13.snap index e05985d41094f..6354027e0cafe 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_13.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_13.snap @@ -176,6 +176,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_14.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_14.snap index 7dc7acfe8468d..88e75fe7481ac 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_14.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_14.snap @@ -177,6 +177,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_15.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_15.snap index 64838bafff014..2c472366d5c08 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_15.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_15.snap @@ -178,6 +178,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_16.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_16.snap index 7f0c0b680b301..1cbda5cf53342 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_16.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_16.snap @@ -179,6 +179,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_17.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_17.snap index 67e764471fecd..5a20392c51628 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_17.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_17.snap @@ -180,6 +180,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_18.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_18.snap index a0ef828c1dce8..a0a612164c657 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_18.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_18.snap @@ -181,7 +181,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_19.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_19.snap index 74a03e8f3bdd4..8b7ab0887e791 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_19.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_19.snap @@ -182,7 +182,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_20.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_20.snap index 66637ea7497b3..baf0d9b0363c0 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_20.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_20.snap @@ -183,7 +183,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap index 2d1bc3b767990..7ca0100335ed9 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap @@ -1,6 +1,5 @@ --- source: crates/sui-protocol-config/src/lib.rs -assertion_line: 1578 expression: "ProtocolConfig::get_for_version(cur, *chain_id)" --- version: 21 @@ -184,7 +183,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_22.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_22.snap index c567c81097c45..1a9e33cba5009 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_22.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_22.snap @@ -184,7 +184,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_23.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_23.snap index 9d597266e3419..16002e872bfa8 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_23.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_23.snap @@ -186,8 +186,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_24.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_24.snap index 8f979463c7a3e..6470b160d0ba0 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_24.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_24.snap @@ -189,8 +189,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_25.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_25.snap index 090964857ec12..2788bc5ba8d75 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_25.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_25.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_26.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_26.snap index 6e417c4df1be8..11fcaeb6246a6 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_26.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_26.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_27.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_27.snap index 79802ad5c4215..da13a945e827b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_27.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_27.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_28.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_28.snap index 9e88e835c719e..e0549e99cdc97 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_28.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_28.snap @@ -197,8 +197,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_29.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_29.snap index ec44a3a9129a4..34b4a336c8de7 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_29.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_29.snap @@ -198,8 +198,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_30.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_30.snap index 50c7e3e9ee04a..04d935c5cd4da 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_30.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_30.snap @@ -195,8 +195,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_31.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_31.snap index 051abce77eaf4..155e0a8d1c0be 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_31.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_31.snap @@ -195,8 +195,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_32.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_32.snap index aeb65b3b69397..0fbad6d400de9 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_32.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_32.snap @@ -196,8 +196,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_33.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_33.snap index 4b72129f811f6..bc733d2e925c0 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_33.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_33.snap @@ -201,8 +201,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_34.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_34.snap index 59a294fd2a2c6..b42439b1a9ea5 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_34.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_34.snap @@ -201,8 +201,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_35.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_35.snap index 771a370b88c17..091a393d64b32 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_35.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_35.snap @@ -202,8 +202,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_36.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_36.snap index 2cf05242b9dd1..f6345c9b2d335 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_36.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_36.snap @@ -203,8 +203,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_37.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_37.snap index 9967595041cf7..02ba119597eaf 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_37.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_37.snap @@ -204,8 +204,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_38.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_38.snap index 2e9cfea0cae79..e080488d5c782 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_38.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_38.snap @@ -219,8 +219,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_39.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_39.snap index 81ae35c97107d..189e8a748017c 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_39.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_39.snap @@ -219,8 +219,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_40.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_40.snap index 2ae7a736586cd..4a3e4e02a2d96 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_40.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_40.snap @@ -219,8 +219,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_41.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_41.snap index 81dc925f58f24..8fe4086856d2e 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_41.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_41.snap @@ -250,8 +250,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_42.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_42.snap index d6b4f8d67502c..181f87fa2ec97 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_42.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_42.snap @@ -250,8 +250,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_43.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_43.snap index 5490e5d361d30..38778893c7b72 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_43.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_43.snap @@ -252,8 +252,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap index c50fb2cd497d3..b1c1dcf2bad16 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap @@ -253,8 +253,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 @@ -262,3 +260,4 @@ max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_45.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_45.snap index b82dd571a4c35..acce876de1506 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_45.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_45.snap @@ -255,8 +255,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_46.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_46.snap index 8cf9534214937..c910986f58f6b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_46.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_46.snap @@ -256,8 +256,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_47.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_47.snap index b1b44bf0da3dd..ca7b8e436ef51 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_47.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_47.snap @@ -256,8 +256,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_48.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_48.snap index a7f669ee83483..bbf3d0478498f 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_48.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_48.snap @@ -259,8 +259,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_49.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_49.snap index 704b1273a1a8b..5e87a7882189e 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_49.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_49.snap @@ -260,8 +260,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_5.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_5.snap index c7ec728a6e9b8..9d92d6f1c060f 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_5.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_5.snap @@ -165,6 +165,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap index a4c45c21b6388..5941b1fcedc16 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap @@ -261,8 +261,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 @@ -271,3 +269,4 @@ random_beacon_reduction_allowed_delta: 800 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 max_deferral_rounds_for_congestion_control: 10 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_51.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_51.snap index 69c3a057c43b7..43fe0f648934e 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_51.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_51.snap @@ -261,8 +261,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_52.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_52.snap index a6a9a452ca387..853aff9841ad0 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_52.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_52.snap @@ -266,8 +266,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap index d91e312f2ba54..2761b97f0f926 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap @@ -268,8 +268,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_6.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_6.snap index 2f5e9b84e183e..0ad8557dcc7c5 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_6.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_6.snap @@ -166,6 +166,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_7.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_7.snap index f259aef8f8e13..2089e2f9b132c 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_7.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_7.snap @@ -170,6 +170,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_8.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_8.snap index 30e47cddfcd6f..77ab698312187 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_8.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_8.snap @@ -171,6 +171,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_9.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_9.snap index ea60c2e222709..ba7c1301f69da 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_9.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_9.snap @@ -174,6 +174,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_10.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_10.snap index ca0e669641dc1..a134148bb74c3 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_10.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_10.snap @@ -174,6 +174,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_11.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_11.snap index b5a47c349db78..8a19929af88ba 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_11.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_11.snap @@ -175,6 +175,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_12.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_12.snap index 654806391d98a..dffa9aed47db4 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_12.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_12.snap @@ -177,6 +177,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_13.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_13.snap index c7b71cd885994..1e4939373f246 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_13.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_13.snap @@ -177,6 +177,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_14.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_14.snap index 37d4f2e2f5ecd..1abcf3a46f65d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_14.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_14.snap @@ -178,6 +178,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_15.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_15.snap index 63e7a656cc17c..ac1bff014c312 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_15.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_15.snap @@ -179,6 +179,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_16.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_16.snap index 4cd96200670d8..d8f805f09cfc7 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_16.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_16.snap @@ -180,6 +180,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_17.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_17.snap index 8d8ea894d75af..36611ce0c852a 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_17.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_17.snap @@ -181,6 +181,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_18.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_18.snap index 0ca6c89d356d2..240a45aa1211e 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_18.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_18.snap @@ -182,7 +182,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_19.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_19.snap index 4d7e3b6aa105c..b391a0eda3850 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_19.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_19.snap @@ -183,7 +183,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_20.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_20.snap index 303dcb8d3475c..40efb4666f02d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_20.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_20.snap @@ -184,8 +184,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_21.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_21.snap index 19901cd46d813..864c36d243854 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_21.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_21.snap @@ -188,8 +188,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_22.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_22.snap index c0829a989bd89..eaf0a4a556616 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_22.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_22.snap @@ -189,8 +189,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_23.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_23.snap index 8032ebea8e0f7..10c2537b9dd04 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_23.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_23.snap @@ -190,8 +190,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_24.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_24.snap index 49f07d77bb88d..906d917bfa408 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_24.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_24.snap @@ -194,8 +194,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_25.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_25.snap index 090964857ec12..2788bc5ba8d75 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_25.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_25.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_26.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_26.snap index 6e417c4df1be8..11fcaeb6246a6 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_26.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_26.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_27.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_27.snap index 79802ad5c4215..da13a945e827b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_27.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_27.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_28.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_28.snap index 9e88e835c719e..e0549e99cdc97 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_28.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_28.snap @@ -197,8 +197,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_29.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_29.snap index ec44a3a9129a4..34b4a336c8de7 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_29.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_29.snap @@ -198,8 +198,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_30.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_30.snap index f253b3568abad..8afd58d54a920 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_30.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_30.snap @@ -197,8 +197,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_31.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_31.snap index 9dc8fded14844..36898107b2a29 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_31.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_31.snap @@ -197,8 +197,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_32.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_32.snap index 31cfe89f6078d..56a0317ca57a0 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_32.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_32.snap @@ -200,8 +200,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_33.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_33.snap index f6e6eacadb5a6..af783fd33efb8 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_33.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_33.snap @@ -203,8 +203,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_34.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_34.snap index 07a8a685d3490..1ddb44e9cb87d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_34.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_34.snap @@ -203,8 +203,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_35.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_35.snap index a19a7264dc6f2..1a09afeb69fd6 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_35.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_35.snap @@ -204,8 +204,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_36.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_36.snap index 9a7597b38dc99..182ea97d354d3 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_36.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_36.snap @@ -204,8 +204,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_37.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_37.snap index 1f9f81396b907..9f02b716623a2 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_37.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_37.snap @@ -206,8 +206,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_38.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_38.snap index 7ea12e6d491b6..448b1ccb3eb0b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_38.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_38.snap @@ -221,8 +221,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_39.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_39.snap index 1f97738ecd154..b4146d886b8ee 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_39.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_39.snap @@ -221,8 +221,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_40.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_40.snap index 545c4fc98c387..694bbefeac57f 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_40.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_40.snap @@ -221,8 +221,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_41.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_41.snap index d599dcc4740b5..3444614cca722 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_41.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_41.snap @@ -252,8 +252,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_42.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_42.snap index 003146a845d6a..6d436d922e70b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_42.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_42.snap @@ -252,8 +252,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_43.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_43.snap index daee7175154b4..0c5378bed713d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_43.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_43.snap @@ -254,8 +254,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap index db3c0e12927fc..87d3f97634bc9 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap @@ -255,8 +255,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 @@ -264,3 +262,4 @@ max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_45.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_45.snap index 24d731cc136f3..1b3975f28df03 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_45.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_45.snap @@ -257,8 +257,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_46.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_46.snap index c643e94279f78..5283ed3be8f23 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_46.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_46.snap @@ -259,8 +259,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_47.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_47.snap index 58ab6f88d4a36..e59140bb0530d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_47.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_47.snap @@ -259,8 +259,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_48.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_48.snap index e53c608077eaa..b5d4d47f412c8 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_48.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_48.snap @@ -263,8 +263,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_49.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_49.snap index 00a3c55b4a908..5ba76646749c0 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_49.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_49.snap @@ -264,8 +264,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_5.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_5.snap index c7ec728a6e9b8..9d92d6f1c060f 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_5.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_5.snap @@ -165,6 +165,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap index e3e86f7630440..e6c194f4402a4 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap @@ -265,8 +265,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 @@ -280,3 +278,4 @@ consensus_max_transactions_in_block_bytes: 6291456 max_deferral_rounds_for_congestion_control: 10 min_checkpoint_interval_ms: 200 checkpoint_summary_version_specific_data: 1 + diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_51.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_51.snap index 19c4defdc7383..4375c0232a1ac 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_51.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_51.snap @@ -265,8 +265,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_52.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_52.snap index da555c77cda9c..060c6455f6de0 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_52.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_52.snap @@ -271,8 +271,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap index 12aebd0da3f6d..48ae83e570f8e 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap @@ -271,8 +271,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_6.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_6.snap index 2f5e9b84e183e..0ad8557dcc7c5 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_6.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_6.snap @@ -166,6 +166,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_7.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_7.snap index f259aef8f8e13..2089e2f9b132c 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_7.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_7.snap @@ -170,6 +170,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_8.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_8.snap index 30e47cddfcd6f..77ab698312187 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_8.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_8.snap @@ -171,6 +171,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_9.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_9.snap index ea60c2e222709..ba7c1301f69da 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_9.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_9.snap @@ -174,6 +174,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_10.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_10.snap index ca0e669641dc1..a134148bb74c3 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_10.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_10.snap @@ -174,6 +174,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_11.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_11.snap index b5a47c349db78..8a19929af88ba 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_11.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_11.snap @@ -175,6 +175,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_12.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_12.snap index 0193270fabf43..712b481b67c0e 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_12.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_12.snap @@ -178,6 +178,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_13.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_13.snap index a6a74337ac5a4..daf8c5927ac2b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_13.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_13.snap @@ -178,6 +178,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_14.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_14.snap index 106ca5bc89b31..f281eae5c74f5 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_14.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_14.snap @@ -179,6 +179,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_15.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_15.snap index 47e3c1f8b7e9f..fd34acc5b26fa 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_15.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_15.snap @@ -180,6 +180,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_16.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_16.snap index fe40b84319aa5..c7421f8e69034 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_16.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_16.snap @@ -181,6 +181,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_17.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_17.snap index e9ebf0ec1d4c5..a759c17b7efc6 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_17.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_17.snap @@ -182,6 +182,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_18.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_18.snap index 947b490e10bd6..8066c7d55d489 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_18.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_18.snap @@ -183,7 +183,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_19.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_19.snap index a49d81383fa55..3cfd615e36afd 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_19.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_19.snap @@ -184,7 +184,5 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_20.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_20.snap index 1fc627076059e..61bda5f1fa1fc 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_20.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_20.snap @@ -185,8 +185,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_21.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_21.snap index 2253b7dfd0807..953a089a2d832 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_21.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_21.snap @@ -189,8 +189,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_22.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_22.snap index 0ce8b51b1652a..68c62adc48e45 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_22.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_22.snap @@ -190,8 +190,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_23.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_23.snap index 0035c33c9bd13..70ad2ead28a14 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_23.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_23.snap @@ -191,8 +191,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_24.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_24.snap index d1689a889d2a9..a3d5eaa9b8207 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_24.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_24.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_25.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_25.snap index 090964857ec12..2788bc5ba8d75 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_25.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_25.snap @@ -195,8 +195,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_26.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_26.snap index 0f2f5f7c74867..b419d81af7d1a 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_26.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_26.snap @@ -197,8 +197,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_27.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_27.snap index ad0dd73de2c66..48a92ab290c10 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_27.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_27.snap @@ -197,8 +197,6 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_28.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_28.snap index 361d906b89f10..7bc6a1cddf6ab 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_28.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_28.snap @@ -200,8 +200,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_29.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_29.snap index 32cd1e3bf4be1..c2bd6af017102 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_29.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_29.snap @@ -201,8 +201,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_30.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_30.snap index 8f8427682bace..bc6717cb9285b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_30.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_30.snap @@ -199,8 +199,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 1 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_31.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_31.snap index a866bb9aac4c2..c28d1f071f9b8 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_31.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_31.snap @@ -200,8 +200,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_32.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_32.snap index 729a23666a58e..5b553269db29f 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_32.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_32.snap @@ -203,8 +203,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_33.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_33.snap index 0b7f805740ede..9f6d2ee2faa76 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_33.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_33.snap @@ -205,8 +205,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_34.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_34.snap index a2854c18971e8..6f9c72cfd8c02 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_34.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_34.snap @@ -205,8 +205,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_35.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_35.snap index d84028d320640..6a5cd2c45013c 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_35.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_35.snap @@ -209,8 +209,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_36.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_36.snap index 6c23c8b3a68c0..b99a27e713c96 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_36.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_36.snap @@ -241,8 +241,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_37.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_37.snap index ebd79741ea6ec..3f5dcd22b5f54 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_37.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_37.snap @@ -242,8 +242,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 2 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_38.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_38.snap index 0ad71d2eef1ec..de003518ee22c 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_38.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_38.snap @@ -257,8 +257,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_39.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_39.snap index ba92803885668..47afea3fb8d93 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_39.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_39.snap @@ -257,8 +257,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_40.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_40.snap index 0fff609e4e734..c020047ef6e83 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_40.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_40.snap @@ -257,8 +257,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_41.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_41.snap index d8a0346784b92..ccee392fc8eed 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_41.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_41.snap @@ -257,8 +257,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_42.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_42.snap index 776eb4c04d20d..a4b6aed5bc7a9 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_42.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_42.snap @@ -257,8 +257,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_43.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_43.snap index d008bd2ad997d..560455b99e91b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_43.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_43.snap @@ -259,8 +259,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_44.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_44.snap index 5b870c3e950a1..d586e88c2c35d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_44.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_44.snap @@ -260,8 +260,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_45.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_45.snap index ec70bdb6e811a..bfbf23544ba4b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_45.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_45.snap @@ -264,8 +264,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_46.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_46.snap index a50219ee6d0d5..30e2c028e1e31 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_46.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_46.snap @@ -265,8 +265,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_47.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_47.snap index 162557285df9a..47daa86e253a6 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_47.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_47.snap @@ -265,8 +265,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_48.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_48.snap index 8be5aa235b8f4..26f807390468b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_48.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_48.snap @@ -267,8 +267,6 @@ 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_49.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_49.snap index cdddb0b634fd2..af916ff1f3811 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_49.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_49.snap @@ -272,8 +272,6 @@ check_zklogin_id_cost_base: 200 check_zklogin_issuer_cost_base: 200 vdf_verify_vdf_cost: 1500 vdf_hash_to_input_cost: 100 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_5.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_5.snap index c7ec728a6e9b8..9d92d6f1c060f 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_5.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_5.snap @@ -165,6 +165,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_50.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_50.snap index 8dc464079b3ed..2e5e6ee356928 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_50.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_50.snap @@ -274,8 +274,6 @@ check_zklogin_id_cost_base: 200 check_zklogin_issuer_cost_base: 200 vdf_verify_vdf_cost: 1500 vdf_hash_to_input_cost: 100 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_51.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_51.snap index 00355fa9bf444..033ebba8caf9a 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_51.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_51.snap @@ -275,8 +275,6 @@ check_zklogin_id_cost_base: 200 check_zklogin_issuer_cost_base: 200 vdf_verify_vdf_cost: 1500 vdf_hash_to_input_cost: 100 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap index de778e4142afc..4bdaa579cb0f5 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap @@ -280,8 +280,6 @@ check_zklogin_id_cost_base: 200 check_zklogin_issuer_cost_base: 200 vdf_verify_vdf_cost: 1500 vdf_hash_to_input_cost: 100 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap index 07d831bf9ee1d..24bcdbf70c03b 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap @@ -63,6 +63,7 @@ feature_flags: soft_bundle: true enable_coin_deny_list_v2: true passkey_auth: true + authority_capabilities_v2: true max_tx_size_bytes: 131072 max_input_objects: 2048 max_size_written_objects: 5000000 @@ -280,8 +281,6 @@ check_zklogin_id_cost_base: 200 check_zklogin_issuer_cost_base: 200 vdf_verify_vdf_cost: 1500 vdf_hash_to_input_cost: 100 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 execution_version: 3 consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_6.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_6.snap index 2f5e9b84e183e..0ad8557dcc7c5 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_6.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_6.snap @@ -166,6 +166,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_7.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_7.snap index f259aef8f8e13..2089e2f9b132c 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_7.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_7.snap @@ -170,6 +170,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_8.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_8.snap index 30e47cddfcd6f..77ab698312187 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_8.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_8.snap @@ -171,6 +171,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_9.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_9.snap index ea60c2e222709..ba7c1301f69da 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_9.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_9.snap @@ -174,6 +174,4 @@ hash_keccak256_data_cost_per_block: 2 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 -scoring_decision_mad_divisor: 2.3 -scoring_decision_cutoff_value: 2.5 diff --git a/crates/sui-rest-api/src/system.rs b/crates/sui-rest-api/src/system.rs index 2f783ed2e35ff..f20121ff1ea5d 100644 --- a/crates/sui-rest-api/src/system.rs +++ b/crates/sui-rest-api/src/system.rs @@ -626,7 +626,6 @@ impl From for ProtocolConfigResponse { ProtocolConfigValue::u16(x) => x.to_string(), ProtocolConfigValue::u32(y) => y.to_string(), ProtocolConfigValue::u64(z) => z.to_string(), - ProtocolConfigValue::f64(f) => f.to_string(), ProtocolConfigValue::bool(b) => b.to_string(), }; (k, v) diff --git a/crates/sui-types/src/messages_consensus.rs b/crates/sui-types/src/messages_consensus.rs index 2f251723fd112..79f3ededc305d 100644 --- a/crates/sui-types/src/messages_consensus.rs +++ b/crates/sui-types/src/messages_consensus.rs @@ -7,7 +7,9 @@ use crate::digests::ConsensusCommitDigest; use crate::messages_checkpoint::{ CheckpointSequenceNumber, CheckpointSignatureMessage, CheckpointTimestamp, }; -use crate::supported_protocol_versions::SupportedProtocolVersions; +use crate::supported_protocol_versions::{ + Chain, SupportedProtocolVersions, SupportedProtocolVersionsWithHashes, +}; use crate::transaction::CertifiedTransaction; use byteorder::{BigEndian, ReadBytesExt}; use fastcrypto::error::FastCryptoResult; @@ -190,12 +192,75 @@ impl AuthorityCapabilitiesV1 { } } +/// Used to advertise capabilities of each authority via narwhal. This allows validators to +/// negotiate the creation of the ChangeEpoch transaction. +#[derive(Serialize, Deserialize, Clone, Hash)] +pub struct AuthorityCapabilitiesV2 { + /// Originating authority - must match narwhal transaction source. + pub authority: AuthorityName, + /// Generation number set by sending authority. Used to determine which of multiple + /// AuthorityCapabilities messages from the same authority is the most recent. + /// + /// (Currently, we just set this to the current time in milliseconds since the epoch, but this + /// should not be interpreted as a timestamp.) + pub generation: u64, + + /// ProtocolVersions that the authority supports. + pub supported_protocol_versions: SupportedProtocolVersionsWithHashes, + + /// The ObjectRefs of all versions of system packages that the validator possesses. + /// Used to determine whether to do a framework/movestdlib upgrade. + pub available_system_packages: Vec, +} + +impl Debug for AuthorityCapabilitiesV2 { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("AuthorityCapabilities") + .field("authority", &self.authority.concise()) + .field("generation", &self.generation) + .field( + "supported_protocol_versions", + &self.supported_protocol_versions, + ) + .field("available_system_packages", &self.available_system_packages) + .finish() + } +} + +impl AuthorityCapabilitiesV2 { + pub fn new( + authority: AuthorityName, + chain: Chain, + supported_protocol_versions: SupportedProtocolVersions, + available_system_packages: Vec, + ) -> Self { + let generation = SystemTime::now() + .duration_since(UNIX_EPOCH) + .expect("Sui did not exist prior to 1970") + .as_millis() + .try_into() + .expect("This build of sui is not supported in the year 500,000,000"); + Self { + authority, + generation, + supported_protocol_versions: + SupportedProtocolVersionsWithHashes::from_supported_versions( + supported_protocol_versions, + chain, + ), + available_system_packages, + } + } +} + #[derive(Serialize, Deserialize, Clone, Debug)] pub enum ConsensusTransactionKind { UserTransaction(Box), CheckpointSignature(Box), EndOfPublish(AuthorityName), + CapabilityNotification(AuthorityCapabilitiesV1), + NewJWKFetched(AuthorityName, JwkId, JWK), RandomnessStateUpdate(u64, Vec), // deprecated // DKG is used to generate keys for use in the random beacon protocol. @@ -206,6 +271,8 @@ pub enum ConsensusTransactionKind { // `RandomnessDkgMessages` have been received locally, to complete the key generation process. // Contents are a serialized `fastcrypto_tbls::dkg::Confirmation`. RandomnessDkgConfirmation(AuthorityName, Vec), + + CapabilityNotificationV2(AuthorityCapabilitiesV2), } impl ConsensusTransactionKind { @@ -375,6 +442,16 @@ impl ConsensusTransaction { } } + pub fn new_capability_notification_v2(capabilities: AuthorityCapabilitiesV2) -> Self { + let mut hasher = DefaultHasher::new(); + capabilities.hash(&mut hasher); + let tracking_id = hasher.finish().to_le_bytes(); + Self { + tracking_id, + kind: ConsensusTransactionKind::CapabilityNotificationV2(capabilities), + } + } + pub fn new_mysticeti_certificate( round: u64, offset: u64, @@ -466,6 +543,9 @@ impl ConsensusTransaction { ConsensusTransactionKind::CapabilityNotification(cap) => { ConsensusTransactionKey::CapabilityNotification(cap.authority, cap.generation) } + ConsensusTransactionKind::CapabilityNotificationV2(cap) => { + ConsensusTransactionKey::CapabilityNotification(cap.authority, cap.generation) + } ConsensusTransactionKind::NewJWKFetched(authority, id, key) => { ConsensusTransactionKey::NewJWKFetched(Box::new(( *authority, diff --git a/crates/sui-types/src/supported_protocol_versions.rs b/crates/sui-types/src/supported_protocol_versions.rs index 57d18040fad39..fb7013ee88791 100644 --- a/crates/sui-types/src/supported_protocol_versions.rs +++ b/crates/sui-types/src/supported_protocol_versions.rs @@ -1,6 +1,10 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +use std::ops::RangeInclusive; + +use crate::{crypto::DefaultHash, digests::Digest}; +use fastcrypto::hash::HashFunction; use serde::{Deserialize, Serialize}; pub use sui_protocol_config::{Chain, ProtocolConfig, ProtocolVersion}; @@ -36,4 +40,55 @@ impl SupportedProtocolVersions { pub fn is_version_supported(&self, v: ProtocolVersion) -> bool { v.as_u64() >= self.min.as_u64() && v.as_u64() <= self.max.as_u64() } + + pub fn as_range(&self) -> RangeInclusive { + self.min.as_u64()..=self.max.as_u64() + } + + pub fn truncate_below(self, v: ProtocolVersion) -> Self { + let min = std::cmp::max(self.min, v); + Self { min, max: self.max } + } +} + +/// Models the set of protocol versions supported by a validator. +/// The `sui-node` binary will always use the SYSTEM_DEFAULT constant, but for testing we need +/// to be able to inject arbitrary versions into SuiNode. +#[derive(Serialize, Deserialize, Debug, Clone, Hash, PartialEq, Eq)] +pub struct SupportedProtocolVersionsWithHashes { + pub versions: Vec<(ProtocolVersion, Digest)>, +} + +impl SupportedProtocolVersionsWithHashes { + pub fn get_version_digest(&self, v: ProtocolVersion) -> Option { + self.versions + .iter() + .find(|(version, _)| *version == v) + .map(|(_, digest)| *digest) + } + + // Ideally this would be in sui-protocol-config, but sui-types depends on sui-protocol-config, + // so it would introduce a circular dependency. + fn protocol_config_digest(config: &ProtocolConfig) -> Digest { + let mut digest = DefaultHash::default(); + bcs::serialize_into(&mut digest, &config).expect("serialization cannot fail"); + Digest::new(digest.finalize().into()) + } + + pub fn from_supported_versions(supported: SupportedProtocolVersions, chain: Chain) -> Self { + Self { + versions: supported + .as_range() + .map(|v| { + ( + v.into(), + Self::protocol_config_digest(&ProtocolConfig::get_for_version( + v.into(), + chain, + )), + ) + }) + .collect(), + } + } } From 30e3c5fba13f9c0e238ab58acb2ad704dc3665db Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Wed, 17 Jul 2024 23:41:55 +0100 Subject: [PATCH 072/163] [Disassembler] Fix string contraction logic ## Description Always pick whole UTF8 characters. ## Test plan Tested against a package containing a UTF8 constant. --- .../move/crates/move-disassembler/src/disassembler.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/external-crates/move/crates/move-disassembler/src/disassembler.rs b/external-crates/move/crates/move-disassembler/src/disassembler.rs index e03a684a579f5..92687e05ea840 100644 --- a/external-crates/move/crates/move-disassembler/src/disassembler.rs +++ b/external-crates/move/crates/move-disassembler/src/disassembler.rs @@ -452,7 +452,9 @@ impl<'a> Disassembler<'a> { if s.len() <= PREVIEW_LEN + 2 { s.to_string() } else { - format!("{}..", &s[..PREVIEW_LEN]) + let mut preview: String = s.chars().take(PREVIEW_LEN).collect(); + preview.push_str(".."); + preview } } From 9417279fa92a43435b4de1e60974c1e1ab388b33 Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:01:00 -0700 Subject: [PATCH 073/163] Compute median instead of average for range queries in metrics checker (#18708) ## Description This should tolerate temporary spikes better. If we want to check to ensure there is no spikes, we can create a new query type in future. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-metric-checker/src/lib.rs | 2 ++ crates/sui-metric-checker/src/query.rs | 28 +++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/crates/sui-metric-checker/src/lib.rs b/crates/sui-metric-checker/src/lib.rs index 93b4054c7dd6e..4d6035cc3e145 100644 --- a/crates/sui-metric-checker/src/lib.rs +++ b/crates/sui-metric-checker/src/lib.rs @@ -10,7 +10,9 @@ pub mod query; #[derive(Debug, Display, Deserialize, PartialEq)] pub enum QueryType { + // Checks the last instant value of the query. Instant, + // Checks the median value of the query over time. Range { // Both start & end accepts specific time formats // - "%Y-%m-%d %H:%M:%S" (UTC) diff --git a/crates/sui-metric-checker/src/query.rs b/crates/sui-metric-checker/src/query.rs index f5baeeccc0954..3761c9b60a816 100644 --- a/crates/sui-metric-checker/src/query.rs +++ b/crates/sui-metric-checker/src/query.rs @@ -41,7 +41,7 @@ pub async fn instant_query( } } -// This will return the average value of the queried metric over the given time range. +// This will return the median value of the queried metric over the given time range. pub async fn range_query( auth_header: &str, client: Client, @@ -69,17 +69,31 @@ pub async fn range_query( .unwrap_or_else(|| panic!("Expected result of type matrix for {query}")); if !result.is_empty() { - let samples = result.first().unwrap().samples(); - let sum: f64 = samples.iter().map(|sample| sample.value()).sum(); - let count = samples.len(); + let mut samples: Vec = result + .first() + .unwrap() + .samples() + .iter() + .filter_map(|sample| { + let v = sample.value(); + if v.is_nan() { + None + } else { + Some(v) + } + }) + .collect(); + assert!(!samples.is_empty(), "No valid samples found for {query}"); - let avg = if count > 0 { sum / count as f64 } else { 0.0 }; + samples.sort_by(|a, b| a.partial_cmp(b).unwrap()); + + let median = (samples[(samples.len() - 1) / 2] + samples[samples.len() / 2]) / 2.; debug!( - "Got average value {avg} over time range {} - {}", + "Got median value {median} over time range {} - {}", unix_seconds_to_timestamp_string(start), unix_seconds_to_timestamp_string(end) ); - Ok(avg) + Ok(median) } else { Err(anyhow!( "Did not get expected response from server for {query}" From 66b19f7d84794010b673ea662a2ac43cdf7d1e0e Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Wed, 17 Jul 2024 21:27:30 -0700 Subject: [PATCH 074/163] Remove deleted protocol fields from older snapshots to avoid spurious failures (#18715) - Remove bad changes from cargo insta - Remove deleted protocol fields from older snapshots to avoid spurious failures --- ...i_protocol_config__test__Mainnet_version_21.snap | 1 + ...i_protocol_config__test__Mainnet_version_44.snap | 1 - ...i_protocol_config__test__Mainnet_version_50.snap | 1 - ...i_protocol_config__test__Testnet_version_44.snap | 1 - ...i_protocol_config__test__Testnet_version_50.snap | 1 - .../compatibility/check-protocol-compatibility.sh | 13 +++++++++++++ 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap index 7ca0100335ed9..9355bae0dbd8e 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_21.snap @@ -1,5 +1,6 @@ --- source: crates/sui-protocol-config/src/lib.rs +assertion_line: 1578 expression: "ProtocolConfig::get_for_version(cur, *chain_id)" --- version: 21 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap index b1c1dcf2bad16..d4e7aa90b2f10 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_44.snap @@ -260,4 +260,3 @@ max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 - diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap index 5941b1fcedc16..9d142ad4f11c7 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_50.snap @@ -269,4 +269,3 @@ random_beacon_reduction_allowed_delta: 800 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 max_deferral_rounds_for_congestion_control: 10 - diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap index 87d3f97634bc9..e2f643d2e776d 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_44.snap @@ -262,4 +262,3 @@ max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 - diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap index e6c194f4402a4..894bc84497f49 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_50.snap @@ -278,4 +278,3 @@ consensus_max_transactions_in_block_bytes: 6291456 max_deferral_rounds_for_congestion_control: 10 min_checkpoint_interval_ms: 200 checkpoint_summary_version_specific_data: 1 - diff --git a/scripts/compatibility/check-protocol-compatibility.sh b/scripts/compatibility/check-protocol-compatibility.sh index bff2f9a71a677..2fd661e81cd98 100755 --- a/scripts/compatibility/check-protocol-compatibility.sh +++ b/scripts/compatibility/check-protocol-compatibility.sh @@ -75,6 +75,19 @@ else fi echo "Checking for changes to snapshot files matching $NETWORK_PATTERN" + +# The fields `scoring_decision_mad_divisor`, `scoring_decision_cutoff_value` were removed from the protocol config, +# but they are still present in older snapshot files. We need to delete them from the snapshot files before +# checking if the git repo is clean. +# TODO: Remove this workaround once commit 3959d9af51172824b0e4f20802c71e416596c7df has been release to all networks. +SED=$(which gsed) +if [ -z "$SED" ]; then + SED=$(which sed) +fi + +grep -lE 'scoring_decision_mad_divisor|scoring_decision_cutoff_value' crates/sui-protocol-config/src/snapshots/$NETWORK_PATTERN | xargs $SED -Ei '/(scoring_decision_mad_divisor|scoring_decision_cutoff_value)/d' +git add . + check_git_clean "Detected changes to snapshot files since $ORIGIN_COMMIT - not safe to release" "$NETWORK_PATTERN" # remove any snapshot file changes that were ignored From 9cdfc6d64af5a6788f51abd994848a0a41af1bef Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Thu, 18 Jul 2024 17:17:02 +0100 Subject: [PATCH 075/163] [Resolver/Inputs] Support layout inference for overlapping inputs (#18720) ## Description From the perspective of input layout calculation, it's fine for a pure input to be referred to multiple times in a PTB, as long as those usages are consistent (all refer to those pure bytes as being the same type). ## Test plan New unit test: ``` sui-package-resolver$ cargo nextest run ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [x] JSON-RPC: Bugfix for displaying PTBs where a pure input has been used multiple times. - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-package-resolver/src/lib.rs | 73 +++++++++++++++++-- ...tests__pure_input_layouts_overlapping.snap | 20 +++++ 2 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 crates/sui-package-resolver/src/snapshots/sui_package_resolver__tests__pure_input_layouts_overlapping.snap diff --git a/crates/sui-package-resolver/src/lib.rs b/crates/sui-package-resolver/src/lib.rs index c2cb4017d6dc3..e23916ec8ffd4 100644 --- a/crates/sui-package-resolver/src/lib.rs +++ b/crates/sui-package-resolver/src/lib.rs @@ -464,11 +464,14 @@ impl Resolver { return Ok(()); }; - if let Some(prev) = type_.replace(tag.clone()) { - // SAFETY: We just inserted `tag` in here. - let curr = type_.take().unwrap(); - return Err(Error::InputTypeConflict(ix, prev, curr)); - }; + match type_ { + None => *type_ = Some(tag.clone()), + Some(prev) => { + if prev != tag { + return Err(Error::InputTypeConflict(ix, prev.clone(), tag.clone())); + } + } + } Ok(()) }; @@ -2619,6 +2622,66 @@ mod tests { insta::assert_snapshot!(output); } + /// Like the test above, but the inputs are re-used, which we want to detect (but is fine + /// because they are assigned the same type at each usage). + #[tokio::test] + async fn test_pure_input_layouts_overlapping() { + use CallArg as I; + use ObjectArg::ImmOrOwnedObject as O; + use TypeTag as T; + + let (_, cache) = package_cache([ + (1, build_package("std"), std_types()), + (1, build_package("sui"), sui_types()), + (1, build_package("e0"), e0_types()), + ]); + + let resolver = Resolver::new(cache); + + // Helper function to generate a PTB calling 0xe0::m::foo. + let ptb = ProgrammableTransaction { + inputs: vec![ + I::Object(O(random_object_ref())), + I::Pure(bcs::to_bytes(&42u64).unwrap()), + I::Object(O(random_object_ref())), + I::Pure(bcs::to_bytes(&43u64).unwrap()), + I::Object(O(random_object_ref())), + I::Pure(bcs::to_bytes("hello").unwrap()), + I::Pure(bcs::to_bytes("world").unwrap()), + ], + commands: vec![ + Command::MoveCall(Box::new(ProgrammableMoveCall { + package: addr("0xe0").into(), + module: ident_str!("m").to_owned(), + function: ident_str!("foo").to_owned(), + type_arguments: vec![T::U64], + arguments: (0..=6).map(Argument::Input).collect(), + })), + Command::MoveCall(Box::new(ProgrammableMoveCall { + package: addr("0xe0").into(), + module: ident_str!("m").to_owned(), + function: ident_str!("foo").to_owned(), + type_arguments: vec![T::U64], + arguments: (0..=6).map(Argument::Input).collect(), + })), + ], + }; + + let inputs = resolver.pure_input_layouts(&ptb).await.unwrap(); + + // Make the output format a little nicer for the snapshot + let mut output = String::new(); + for input in inputs { + if let Some(layout) = input { + output += &format!("{layout:#}\n"); + } else { + output += "???\n"; + } + } + + insta::assert_snapshot!(output); + } + #[tokio::test] async fn test_pure_input_layouts_conflicting() { use CallArg as I; diff --git a/crates/sui-package-resolver/src/snapshots/sui_package_resolver__tests__pure_input_layouts_overlapping.snap b/crates/sui-package-resolver/src/snapshots/sui_package_resolver__tests__pure_input_layouts_overlapping.snap new file mode 100644 index 0000000000000..50e048cf80875 --- /dev/null +++ b/crates/sui-package-resolver/src/snapshots/sui_package_resolver__tests__pure_input_layouts_overlapping.snap @@ -0,0 +1,20 @@ +--- +source: crates/sui-package-resolver/src/lib.rs +expression: output +--- +??? +u64 +??? +u64 +??? +struct 0x1::option::Option<0x1::string::String> { + vec: vector, + }>, +} +vector { + vec: vector, + }>, +}> + From 6a5e72e60cc33954010f7f402ddc35c129e1546a Mon Sep 17 00:00:00 2001 From: benr-ml <112846738+benr-ml@users.noreply.github.com> Date: Thu, 18 Jul 2024 19:59:55 +0300 Subject: [PATCH 076/163] Update fastcrypto (#18722) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- Cargo.lock | 11 ++++++----- Cargo.toml | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 916e3e9a85290..1eae6e43e74d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4382,7 +4382,7 @@ dependencies = [ [[package]] name = "fastcrypto" version = "0.1.8" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" dependencies = [ "aes", "aes-gcm", @@ -4436,7 +4436,7 @@ dependencies = [ [[package]] name = "fastcrypto-derive" version = "0.1.3" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" dependencies = [ "quote 1.0.35", "syn 1.0.107", @@ -4445,7 +4445,7 @@ dependencies = [ [[package]] name = "fastcrypto-tbls" version = "0.1.0" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" dependencies = [ "bcs", "digest 0.10.7", @@ -4458,12 +4458,13 @@ dependencies = [ "tap", "tracing", "typenum", + "zeroize", ] [[package]] name = "fastcrypto-vdf" version = "0.1.0" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" dependencies = [ "bcs", "fastcrypto", @@ -4480,7 +4481,7 @@ dependencies = [ [[package]] name = "fastcrypto-zkp" version = "0.1.3" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=729145c130be00908d40804bb0eececa46e84340#729145c130be00908d40804bb0eececa46e84340" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" dependencies = [ "ark-bls12-381", "ark-bn254", diff --git a/Cargo.toml b/Cargo.toml index 4648977bbef01..6f5b1b61eaadb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -565,10 +565,10 @@ move-abstract-interpreter = { path = "external-crates/move/crates/move-abstract- move-abstract-stack = { path = "external-crates/move/crates/move-abstract-stack" } move-analyzer = { path = "external-crates/move/crates/move-analyzer" } -fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340" } -fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340" } -fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340", package = "fastcrypto-zkp" } -fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "729145c130be00908d40804bb0eececa46e84340", features = ["experimental"] } +fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608" } +fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608" } +fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608", package = "fastcrypto-zkp" } +fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608", features = ["experimental"] } passkey-types = { version = "0.2.0" } passkey-client = { version = "0.2.0" } passkey-authenticator = { version = "0.2.0" } From 10beaec2e58d8071e623f694b9dbf46e0a0bcf2b Mon Sep 17 00:00:00 2001 From: Calvin Li Date: Fri, 19 Jul 2024 01:16:31 +0800 Subject: [PATCH 077/163] Update sui-bridging.mdx for the correct anchor link (#17633) ## Description In line 7: Sui supports bridging through .... and [Wormhole Portal Bridge](#wormhole-portal-bridge). Updating line 27 to make the anchor link match with line 7, or else the section jump from lin 7 would fail. ## Test plan N/A --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> --- docs/content/concepts/tokenomics/sui-bridging.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/concepts/tokenomics/sui-bridging.mdx b/docs/content/concepts/tokenomics/sui-bridging.mdx index 284bda996faa7..d859d00279eaf 100644 --- a/docs/content/concepts/tokenomics/sui-bridging.mdx +++ b/docs/content/concepts/tokenomics/sui-bridging.mdx @@ -24,7 +24,7 @@ The gas drop-off feature enables users to pay an additional fee on the source ch To learn more about Wormhole Connect, see their [FAQ](https://docs.wormhole.com/wormhole/faqs) page. -## Wormhole Portal Bridge {#bridge} +## Wormhole Portal Bridge The Wormhole powered [Portal Bridge](https://www.portalbridge.com/sui) supports bridging any asset from any of the [22 supported Wormhole chains](https://www.wormhole.com/network). From cc64c377a6653287dbf9d20bca253d13bae3f65d Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 18 Jul 2024 11:13:24 -0700 Subject: [PATCH 078/163] Integrate validator tx finalizer (#18681) ## Description This PR integrates the validator tx finalizer with the validator service, which is then invoked after handling a transaction. A node config is used to control whether an instance of the service is created when the service starts. It is enabled on devnet and testnet. We will enable for mainnet later when we feel confident. ## Test plan Added e2e simtests. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-config/src/node.rs | 3 + crates/sui-core/src/authority_server.rs | 54 ++++++++++++--- .../src/unit_tests/execution_driver_tests.rs | 14 +--- crates/sui-core/src/validator_tx_finalizer.rs | 54 ++++++++++++--- .../tests/validator_tx_finalizer_e2e_tests.rs | 69 +++++++++++++++++++ crates/sui-node/src/lib.rs | 34 ++++++--- .../src/single_node.rs | 12 ++-- .../src/node_config_builder.rs | 3 + ...ests__network_config_snapshot_matches.snap | 7 ++ .../simtest_sui_system_state_inner.rs | 3 +- 10 files changed, 204 insertions(+), 49 deletions(-) create mode 100644 crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index b21481c2f7913..5a97e42dd0b7c 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -190,6 +190,9 @@ pub struct NodeConfig { #[serde(default = "bool_true")] pub enable_soft_bundle: bool, + + #[serde(default = "bool_true")] + pub enable_validator_tx_finalizer: bool, } #[derive(Clone, Debug, Deserialize, Serialize, Default)] diff --git a/crates/sui-core/src/authority_server.rs b/crates/sui-core/src/authority_server.rs index eee0663e8c79f..6e8bdb88f1163 100644 --- a/crates/sui-core/src/authority_server.rs +++ b/crates/sui-core/src/authority_server.rs @@ -23,7 +23,9 @@ use sui_network::{ }; use sui_types::effects::TransactionEffectsAPI; use sui_types::messages_consensus::ConsensusTransaction; -use sui_types::messages_grpc::{HandleCertificateRequestV3, HandleCertificateResponseV3}; +use sui_types::messages_grpc::{ + HandleCertificateRequestV3, HandleCertificateResponseV3, TransactionStatus, +}; use sui_types::messages_grpc::{ HandleCertificateResponseV2, HandleTransactionResponse, ObjectInfoRequest, ObjectInfoResponse, SubmitCertificateResponse, SystemStateRequest, TransactionInfoRequest, TransactionInfoResponse, @@ -47,6 +49,8 @@ use tonic::metadata::{Ascii, MetadataValue}; use tracing::{error, error_span, info, Instrument}; use crate::authority::authority_per_epoch_store::AuthorityPerEpochStore; +use crate::authority_client::NetworkAuthorityClient; +use crate::validator_tx_finalizer::ValidatorTxFinalizer; use crate::{ authority::AuthorityState, consensus_adapter::{ConsensusAdapter, ConsensusAdapterMetrics}, @@ -145,13 +149,11 @@ impl AuthorityServer { ) -> Result { let mut server = mysten_network::config::Config::new() .server_builder() - .add_service(ValidatorServer::new(ValidatorService { - state: self.state, - consensus_adapter: self.consensus_adapter, - metrics: self.metrics.clone(), - traffic_controller: None, - client_id_source: None, - })) + .add_service(ValidatorServer::new(ValidatorService::new_for_tests( + self.state, + self.consensus_adapter, + self.metrics, + ))) .bind(&address) .await .unwrap(); @@ -296,6 +298,7 @@ pub struct ValidatorService { metrics: Arc, traffic_controller: Option>, client_id_source: Option, + validator_tx_finalizer: Option>>, } impl ValidatorService { @@ -306,6 +309,7 @@ impl ValidatorService { traffic_controller_metrics: TrafficControllerMetrics, policy_config: Option, firewall_config: Option, + validator_tx_finalizer: Option>>, ) -> Self { Self { state, @@ -319,6 +323,22 @@ impl ValidatorService { )) }), client_id_source: policy_config.map(|policy| policy.client_id_source), + validator_tx_finalizer, + } + } + + pub fn new_for_tests( + state: Arc, + consensus_adapter: Arc, + metrics: Arc, + ) -> Self { + Self { + state, + consensus_adapter, + metrics, + traffic_controller: None, + client_id_source: None, + validator_tx_finalizer: None, } } @@ -352,6 +372,7 @@ impl ValidatorService { metrics, traffic_controller: _, client_id_source: _, + validator_tx_finalizer, } = self.clone(); let transaction = request.into_inner(); let epoch_store = state.load_epoch_store_one_call_per_task(); @@ -399,7 +420,7 @@ impl ValidatorService { let span = error_span!("validator_state_process_tx", ?tx_digest); let info = state - .handle_transaction(&epoch_store, transaction) + .handle_transaction(&epoch_store, transaction.clone()) .instrument(span) .await .tap_err(|e| { @@ -413,6 +434,21 @@ impl ValidatorService { // to save more CPU. return Err(error.into()); } + + if let Some(validator_tx_finalizer) = validator_tx_finalizer { + if let TransactionStatus::Signed(sig) = &info.status { + let signed_tx = VerifiedSignedTransaction::new_unchecked( + SignedTransaction::new_from_data_and_sig( + transaction.into_inner().into_data(), + sig.clone(), + ), + ); + spawn_monitored_task!(epoch_store.within_alive_epoch( + validator_tx_finalizer + .track_signed_tx(state.get_transaction_cache_reader().clone(), signed_tx,) + )); + } + } Ok((tonic::Response::new(info), Weight::zero())) } diff --git a/crates/sui-core/src/unit_tests/execution_driver_tests.rs b/crates/sui-core/src/unit_tests/execution_driver_tests.rs index 9009645df2916..e9a5f381dceeb 100644 --- a/crates/sui-core/src/unit_tests/execution_driver_tests.rs +++ b/crates/sui-core/src/unit_tests/execution_driver_tests.rs @@ -7,8 +7,7 @@ use crate::authority::AuthorityState; use crate::authority_aggregator::authority_aggregator_tests::{ create_object_move_transaction, do_cert, do_transaction, extract_cert, get_latest_ref, }; -use crate::authority_server::ValidatorService; -use crate::authority_server::ValidatorServiceMetrics; +use crate::authority_server::{ValidatorService, ValidatorServiceMetrics}; use crate::consensus_adapter::ConnectionMonitorStatusForTests; use crate::consensus_adapter::ConsensusAdapter; use crate::consensus_adapter::ConsensusAdapterMetrics; @@ -28,7 +27,6 @@ use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::Arc; use std::time::Duration; -use crate::traffic_controller::metrics::TrafficControllerMetrics; use itertools::Itertools; use sui_config::node::AuthorityOverloadConfig; use sui_test_transaction_builder::TestTransactionBuilder; @@ -776,13 +774,10 @@ async fn test_authority_txn_signing_pushback() { ConsensusAdapterMetrics::new_test(), epoch_store.protocol_config().clone(), )); - let validator_service = Arc::new(ValidatorService::new( + let validator_service = Arc::new(ValidatorService::new_for_tests( authority_state.clone(), consensus_adapter, Arc::new(ValidatorServiceMetrics::new_for_tests()), - TrafficControllerMetrics::new_for_tests(), - None, - None, )); // Manually make the authority into overload state and reject 100% of traffic. @@ -908,13 +903,10 @@ async fn test_authority_txn_execution_pushback() { ConsensusAdapterMetrics::new_test(), epoch_store.protocol_config().clone(), )); - let validator_service = Arc::new(ValidatorService::new( + let validator_service = Arc::new(ValidatorService::new_for_tests( authority_state.clone(), consensus_adapter, Arc::new(ValidatorServiceMetrics::new_for_tests()), - TrafficControllerMetrics::new_for_tests(), - None, - None, )); // Manually make the authority into overload state and reject 100% of traffic. diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index 6e1438290859d..415ff2204f87b 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -4,6 +4,7 @@ use crate::authority_aggregator::AuthorityAggregator; use crate::authority_client::AuthorityAPI; use crate::execution_cache::TransactionCacheRead; +use arc_swap::ArcSwap; use mysten_metrics::TX_LATENCY_SEC_BUCKETS; use prometheus::{ register_histogram_with_registry, register_int_counter_with_registry, Histogram, IntCounter, @@ -87,15 +88,14 @@ impl ValidatorTxFinalizerMetrics { /// after the transaction has been signed, and then attempting to finalize /// the transaction if it has not yet been done by a fullnode. pub struct ValidatorTxFinalizer { - agg: Arc>, + agg: Arc>>, tx_finalization_delay: Duration, finalization_timeout: Duration, metrics: Arc, } impl ValidatorTxFinalizer { - #[allow(dead_code)] - pub(crate) fn new(agg: Arc>, registry: &Registry) -> Self { + pub fn new(agg: Arc>>, registry: &Registry) -> Self { Self { agg, tx_finalization_delay: TX_FINALIZATION_DELAY, @@ -106,7 +106,7 @@ impl ValidatorTxFinalizer { #[cfg(test)] pub(crate) fn new_for_testing( - agg: Arc>, + agg: Arc>>, tx_finalization_delay: Duration, finalization_timeout: Duration, ) -> Self { @@ -117,6 +117,11 @@ impl ValidatorTxFinalizer { metrics: Arc::new(ValidatorTxFinalizerMetrics::new(&Registry::new())), } } + + #[cfg(test)] + pub(crate) fn auth_agg(&self) -> &Arc>> { + &self.agg + } } impl ValidatorTxFinalizer @@ -162,6 +167,7 @@ where tokio::time::timeout( self.finalization_timeout, self.agg + .load() .execute_transaction_block(tx.into_unsigned().inner(), None), ) .await??; @@ -177,6 +183,7 @@ mod tests { use crate::authority_aggregator::{AuthorityAggregator, AuthorityAggregatorBuilder}; use crate::authority_client::AuthorityAPI; use crate::validator_tx_finalizer::ValidatorTxFinalizer; + use arc_swap::ArcSwap; use async_trait::async_trait; use std::collections::BTreeMap; use std::iter; @@ -339,7 +346,7 @@ mod tests { finalizer1.track_signed_tx(cache_read, signed_tx).await; }); handle.await.unwrap(); - check_quorum_execution(&auth_agg, &clients, &tx_digest, true); + check_quorum_execution(&auth_agg.load(), &clients, &tx_digest, true); assert_eq!( metrics.num_finalization_attempts_for_testing.load(Relaxed), 1 @@ -376,7 +383,7 @@ mod tests { }); states[0].reconfigure_for_testing().await; handle.await.unwrap(); - check_quorum_execution(&auth_agg, &clients, &tx_digest, false); + check_quorum_execution(&auth_agg.load(), &clients, &tx_digest, false); assert_eq!( metrics.num_finalization_attempts_for_testing.load(Relaxed), 0 @@ -389,6 +396,28 @@ mod tests { ); } + #[tokio::test] + async fn test_validator_tx_finalizer_auth_agg_reconfig() { + let (sender, _) = get_account_key_pair(); + let gas_object = Object::with_owner_for_testing(sender); + let (_states, auth_agg, _clients) = create_validators(gas_object).await; + let finalizer1 = ValidatorTxFinalizer::new_for_testing( + auth_agg.clone(), + std::time::Duration::from_secs(10), + std::time::Duration::from_secs(60), + ); + let mut new_auth_agg = (**auth_agg.load()).clone(); + let mut new_committee = (*new_auth_agg.committee).clone(); + new_committee.epoch = 100; + new_auth_agg.committee = Arc::new(new_committee); + auth_agg.store(Arc::new(new_auth_agg)); + assert_eq!( + finalizer1.auth_agg().load().committee.epoch, + 100, + "AuthorityAggregator not updated" + ); + } + #[tokio::test] async fn test_validator_tx_finalizer_already_executed() { telemetry_subscribers::init_for_testing(); @@ -413,11 +442,12 @@ mod tests { .await; }); auth_agg + .load() .execute_transaction_block(&signed_tx.into_inner().into_unsigned(), None) .await .unwrap(); handle.await.unwrap(); - check_quorum_execution(&auth_agg, &clients, &tx_digest, true); + check_quorum_execution(&auth_agg.load(), &clients, &tx_digest, true); assert_eq!( metrics.num_finalization_attempts_for_testing.load(Relaxed), 0 @@ -457,7 +487,7 @@ mod tests { .await; }); handle.await.unwrap(); - check_quorum_execution(&auth_agg, &clients, &tx_digest, false); + check_quorum_execution(&auth_agg.load(), &clients, &tx_digest, false); assert_eq!( metrics.num_finalization_attempts_for_testing.load(Relaxed), 1 @@ -474,7 +504,7 @@ mod tests { gas_object: Object, ) -> ( Vec>, - Arc>, + Arc>>, BTreeMap, ) { let network_config = ConfigBuilder::new_with_temp_dir() @@ -503,7 +533,11 @@ mod tests { .collect(); let auth_agg = AuthorityAggregatorBuilder::from_network_config(&network_config) .build_custom_clients(clients.clone()); - (authority_states, Arc::new(auth_agg), clients) + ( + authority_states, + Arc::new(ArcSwap::new(Arc::new(auth_agg))), + clients, + ) } async fn create_tx( diff --git a/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs b/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs new file mode 100644 index 0000000000000..127c17402ec1f --- /dev/null +++ b/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs @@ -0,0 +1,69 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use std::time::Duration; +use sui_macros::sim_test; +use sui_test_transaction_builder::publish_basics_package_and_make_counter; +use sui_types::base_types::dbg_addr; +use test_cluster::TestClusterBuilder; + +#[sim_test] +async fn test_validator_tx_finalizer_fastpath_tx() { + let cluster = TestClusterBuilder::new() + .with_num_validators(7) + // Make epoch duration large enough so that reconfig is never triggered. + .with_epoch_duration_ms(1000 * 1000) + .build() + .await; + let tx_data = cluster + .test_transaction_builder() + .await + .transfer_sui(None, dbg_addr(1)) + .build(); + let tx = cluster.sign_transaction(&tx_data); + let tx_digest = *tx.digest(); + cluster + .authority_aggregator() + .authority_clients + .values() + .next() + .unwrap() + .handle_transaction(tx, None) + .await + .unwrap(); + tokio::time::sleep(Duration::from_secs(120)).await; + for node in cluster.all_node_handles() { + node.with(|n| assert!(n.state().is_tx_already_executed(&tx_digest).unwrap())); + } +} + +#[sim_test] +async fn test_validator_tx_finalizer_consensus_tx() { + let cluster = TestClusterBuilder::new() + .with_num_validators(7) + // Make epoch duration large enough so that reconfig is never triggered. + .with_epoch_duration_ms(1000 * 1000) + .build() + .await; + let (package, counter) = publish_basics_package_and_make_counter(&cluster.wallet).await; + let tx_data = cluster + .test_transaction_builder() + .await + .call_counter_increment(package.0, counter.0, counter.1) + .build(); + let tx = cluster.sign_transaction(&tx_data); + let tx_digest = *tx.digest(); + cluster + .authority_aggregator() + .authority_clients + .values() + .next() + .unwrap() + .handle_transaction(tx, None) + .await + .unwrap(); + tokio::time::sleep(Duration::from_secs(120)).await; + for node in cluster.all_node_handles() { + node.with(|n| assert!(n.state().is_tx_already_executed(&tx_digest).unwrap())); + } +} diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index b438215453195..5c530a2fc963a 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -214,6 +214,7 @@ use simulator::*; pub use simulator::set_jwk_injector; use sui_core::consensus_handler::ConsensusHandlerInitializer; use sui_core::safe_client::SafeClientMetricsBase; +use sui_core::validator_tx_finalizer::ValidatorTxFinalizer; use sui_types::execution_config_utils::to_binary_config; pub struct SuiNode { @@ -254,7 +255,7 @@ pub struct SuiNode { /// Use ArcSwap so that we could mutate it without taking mut reference. // TODO: Eventually we can make this auth aggregator a shared reference so that this // update will automatically propagate to other uses. - auth_agg: ArcSwap>, + auth_agg: Arc>>, } impl fmt::Debug for SuiNode { @@ -478,12 +479,14 @@ impl SuiNode { let auth_agg = { let safe_client_metrics_base = SafeClientMetricsBase::new(&prometheus_registry); let auth_agg_metrics = Arc::new(AuthAggMetrics::new(&prometheus_registry)); - Arc::new(AuthorityAggregator::new_from_epoch_start_state( - epoch_start_configuration.epoch_start_state(), - &committee_store, - safe_client_metrics_base, - auth_agg_metrics, - )) + Arc::new(ArcSwap::new(Arc::new( + AuthorityAggregator::new_from_epoch_start_state( + epoch_start_configuration.epoch_start_state(), + &committee_store, + safe_client_metrics_base, + auth_agg_metrics, + ), + ))) }; let epoch_options = default_db_options().optimize_db_for_write_throughput(4); @@ -712,7 +715,7 @@ impl SuiNode { let transaction_orchestrator = if is_full_node && run_with_range.is_none() { Some(Arc::new( TransactiondOrchestrator::new_with_auth_aggregator( - auth_agg.clone(), + auth_agg.load_full(), state.clone(), end_of_epoch_receiver, &config.db_path(), @@ -778,6 +781,7 @@ impl SuiNode { connection_monitor_status.clone(), ®istry_service, sui_node_metrics.clone(), + auth_agg.clone(), ) .await?; // This is only needed during cold start. @@ -818,7 +822,7 @@ impl SuiNode { _state_snapshot_uploader_handle: state_snapshot_handle, shutdown_channel_tx: shutdown_channel, - auth_agg: ArcSwap::new(auth_agg), + auth_agg, }; info!("SuiNode started!"); @@ -1142,6 +1146,7 @@ impl SuiNode { connection_monitor_status: Arc, registry_service: &RegistryService, sui_node_metrics: Arc, + auth_agg: Arc>>, ) -> Result { let mut config_clone = config.clone(); let consensus_config = config_clone @@ -1176,6 +1181,8 @@ impl SuiNode { &config, state.clone(), consensus_adapter.clone(), + auth_agg, + epoch_store.get_chain_identifier().chain(), ®istry_service.default_registry(), ) .await?; @@ -1404,8 +1411,15 @@ impl SuiNode { config: &NodeConfig, state: Arc, consensus_adapter: Arc, + auth_agg: Arc>>, + chain: Chain, prometheus_registry: &Registry, ) -> Result>> { + let enable_validator_tx_finalizer = + config.enable_validator_tx_finalizer && chain != Chain::Mainnet; + let validator_tx_finalizer = enable_validator_tx_finalizer.then_some(Arc::new( + ValidatorTxFinalizer::new(auth_agg, prometheus_registry), + )); let validator_service = ValidatorService::new( state.clone(), consensus_adapter, @@ -1413,6 +1427,7 @@ impl SuiNode { TrafficControllerMetrics::new(prometheus_registry), config.policy_config.clone(), config.firewall_config.clone(), + validator_tx_finalizer, ); let mut server_conf = mysten_network::config::Config::new(); @@ -1734,6 +1749,7 @@ impl SuiNode { self.connection_monitor_status.clone(), &self.registry_service, self.metrics.clone(), + self.auth_agg.clone(), ) .await?, ) diff --git a/crates/sui-single-node-benchmark/src/single_node.rs b/crates/sui-single-node-benchmark/src/single_node.rs index 3df2ddb62bbd0..5bea4521f65bc 100644 --- a/crates/sui-single-node-benchmark/src/single_node.rs +++ b/crates/sui-single-node-benchmark/src/single_node.rs @@ -16,7 +16,6 @@ use sui_core::consensus_adapter::{ }; use sui_core::mock_consensus::{ConsensusMode, MockConsensusClient}; use sui_core::state_accumulator::StateAccumulator; -use sui_core::traffic_controller::metrics::TrafficControllerMetrics; use sui_test_transaction_builder::{PublishData, TestTransactionBuilder}; use sui_types::base_types::{AuthorityName, ObjectRef, SuiAddress, TransactionDigest}; use sui_types::committee::Committee; @@ -67,16 +66,13 @@ impl SingleValidator { ConsensusAdapterMetrics::new_test(), epoch_store.protocol_config().clone(), )); - let validator_service = Arc::new(ValidatorService::new( + // TODO: for validator benchmarking purposes, we should allow for traffic control + // to be configurable and introduce traffic control benchmarks to test + // against different policies + let validator_service = Arc::new(ValidatorService::new_for_tests( validator, consensus_adapter, Arc::new(ValidatorServiceMetrics::new_for_tests()), - TrafficControllerMetrics::new_for_tests(), - // TODO: for validator benchmarking purposes, we should allow for this - // to be configurable and introduce traffic control benchmarks to test - // against different policies - None, /* PolicyConfig */ - None, /* RemoteFirewallConfig */ )); Self { validator_service, diff --git a/crates/sui-swarm-config/src/node_config_builder.rs b/crates/sui-swarm-config/src/node_config_builder.rs index ee5d34926a8a3..59293909d7217 100644 --- a/crates/sui-swarm-config/src/node_config_builder.rs +++ b/crates/sui-swarm-config/src/node_config_builder.rs @@ -238,6 +238,7 @@ impl ValidatorConfigBuilder { execution_cache: ExecutionCacheConfig::default(), state_accumulator_v2: self.state_accumulator_v2, enable_soft_bundle: true, + enable_validator_tx_finalizer: true, } } @@ -519,6 +520,8 @@ impl FullnodeConfigBuilder { execution_cache: ExecutionCacheConfig::default(), state_accumulator_v2: true, enable_soft_bundle: true, + // This is a validator specific feature. + enable_validator_tx_finalizer: false, } } } 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 972df1a52de4e..9614b93cb74b0 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 @@ -140,6 +140,7 @@ validator_configs: execution-cache: passthrough-cache state-accumulator-v2: true enable-soft-bundle: true + enable-validator-tx-finalizer: true - protocol-key-pair: value: avYcyVgYMXTyaUYh9IRwLK0gSzl7YF6ZQDAbrS1Bhvo= worker-key-pair: @@ -277,6 +278,7 @@ validator_configs: execution-cache: passthrough-cache state-accumulator-v2: true enable-soft-bundle: true + enable-validator-tx-finalizer: true - protocol-key-pair: value: OXnx3yM1C/ppgnDMx/o1d49fJs7E05kq11mXNae/O+I= worker-key-pair: @@ -414,6 +416,7 @@ validator_configs: execution-cache: passthrough-cache state-accumulator-v2: true enable-soft-bundle: true + enable-validator-tx-finalizer: true - protocol-key-pair: value: CyNkjqNVr3HrHTH7f/NLs7u5lUHJzuPAw0PqMTD2y2s= worker-key-pair: @@ -551,6 +554,7 @@ validator_configs: execution-cache: passthrough-cache state-accumulator-v2: true enable-soft-bundle: true + enable-validator-tx-finalizer: true - protocol-key-pair: value: X/I/kM+KvHcxAKEf2UU6Sr7SpN3bhiE9nP5CuM/iIY0= worker-key-pair: @@ -688,6 +692,7 @@ validator_configs: execution-cache: passthrough-cache state-accumulator-v2: true enable-soft-bundle: true + enable-validator-tx-finalizer: true - protocol-key-pair: value: N272EiFDyKtxRbDKbyN6ujenJ+skPcRoc/XolpOLGnU= worker-key-pair: @@ -825,6 +830,7 @@ validator_configs: execution-cache: passthrough-cache state-accumulator-v2: true enable-soft-bundle: true + enable-validator-tx-finalizer: true - protocol-key-pair: value: a74f03IOjL8ZFSWFChFVEi+wiMwHNwNCPDGIYkGfgjs= worker-key-pair: @@ -962,6 +968,7 @@ validator_configs: execution-cache: passthrough-cache state-accumulator-v2: true enable-soft-bundle: true + enable-validator-tx-finalizer: true account_keys: - Hloy4pnf8pWEHGP+4OFsXz56bLdIJhkD2O+OdKMqCA4= - pvMScjoMR/DaN0M5IOxS2VpGC59N6kv6gDm63ufLQ5w= diff --git a/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs b/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs index 3ee52ac91ce2f..fc743a426b649 100644 --- a/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs +++ b/crates/sui-types/src/sui_system_state/simtest_sui_system_state_inner.rs @@ -4,7 +4,7 @@ use crate::balance::Balance; use crate::base_types::SuiAddress; use crate::collection_types::{Bag, Table}; -use crate::committee::{Committee, CommitteeWithNetworkMetadata, NetworkMetadata}; +use crate::committee::{CommitteeWithNetworkMetadata, NetworkMetadata}; use crate::crypto::AuthorityPublicKeyBytes; use crate::error::SuiError; use crate::storage::ObjectStore; @@ -19,7 +19,6 @@ use fastcrypto::traits::ToFromBytes; use mysten_network::Multiaddr; use once_cell::sync::OnceCell; use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] pub struct SimTestSuiSystemStateInnerV1 { From 61b00f5bac218d4ffb6c618b0371b3028a2d0106 Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:47:24 -0700 Subject: [PATCH 079/163] [bridge] add metrics for SignerWithCache (#18685) ## Description as title. `SignerWithCache` today already guarantees single processing of one request (if they are received in a short period of time and not evicted in cache). In this PR we add hit and miss metrics for us to understand how well it works. https://github.com/MystenLabs/sui/blob/main/crates/sui-bridge/src/server/handler.rs#L152 ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-bridge/src/metrics.rs | 17 +++++++ crates/sui-bridge/src/node.rs | 1 + .../src/server/governance_verifier.rs | 4 ++ crates/sui-bridge/src/server/handler.rs | 49 +++++++++++++++++-- 4 files changed, 66 insertions(+), 5 deletions(-) diff --git a/crates/sui-bridge/src/metrics.rs b/crates/sui-bridge/src/metrics.rs index 9f4a6d103d0cc..556eb47e20278 100644 --- a/crates/sui-bridge/src/metrics.rs +++ b/crates/sui-bridge/src/metrics.rs @@ -34,6 +34,9 @@ pub struct BridgeMetrics { pub(crate) action_executor_signing_queue_skipped_actions: IntCounter, pub(crate) action_executor_execution_queue_received_actions: IntCounter, + pub(crate) signer_with_cache_hit: IntCounterVec, + pub(crate) signer_with_cache_miss: IntCounterVec, + pub(crate) eth_provider_queries: IntCounter, pub(crate) gas_coin_balance: IntGauge, } @@ -189,6 +192,20 @@ impl BridgeMetrics { registry, ) .unwrap(), + signer_with_cache_hit: register_int_counter_vec_with_registry!( + "bridge_signer_with_cache_hit", + "Total number of hit in signer's cache, by verifier type", + &["type"], + registry, + ) + .unwrap(), + signer_with_cache_miss: register_int_counter_vec_with_registry!( + "bridge_signer_with_cache_miss", + "Total number of miss in signer's cache, by verifier type", + &["type"], + registry, + ) + .unwrap(), } } diff --git a/crates/sui-bridge/src/node.rs b/crates/sui-bridge/src/node.rs index fded514880d77..0fffe9291235c 100644 --- a/crates/sui-bridge/src/node.rs +++ b/crates/sui-bridge/src/node.rs @@ -56,6 +56,7 @@ pub async fn run_bridge_node( server_config.sui_client, server_config.eth_client, server_config.approved_governance_actions, + metrics.clone(), ), metrics, Arc::new(metadata), diff --git a/crates/sui-bridge/src/server/governance_verifier.rs b/crates/sui-bridge/src/server/governance_verifier.rs index ecfc8bfc832a5..eb9a004c3ca33 100644 --- a/crates/sui-bridge/src/server/governance_verifier.rs +++ b/crates/sui-bridge/src/server/governance_verifier.rs @@ -30,6 +30,10 @@ impl GovernanceVerifier { #[async_trait::async_trait] impl ActionVerifier for GovernanceVerifier { + fn name(&self) -> &'static str { + "GovernanceVerifier" + } + async fn verify(&self, key: BridgeAction) -> BridgeResult { // TODO: an optimization would be to check the current nonce on chain and err for older ones if !key.is_governace_action() { diff --git a/crates/sui-bridge/src/server/handler.rs b/crates/sui-bridge/src/server/handler.rs index 7b9d70f26c871..d82beb3896041 100644 --- a/crates/sui-bridge/src/server/handler.rs +++ b/crates/sui-bridge/src/server/handler.rs @@ -6,6 +6,7 @@ use crate::crypto::{BridgeAuthorityKeyPair, BridgeAuthoritySignInfo}; use crate::error::{BridgeError, BridgeResult}; use crate::eth_client::EthClient; +use crate::metrics::BridgeMetrics; use crate::sui_client::{SuiClient, SuiClientInner}; use crate::types::{BridgeAction, SignedBridgeAction}; use async_trait::async_trait; @@ -51,6 +52,8 @@ pub trait BridgeRequestHandlerTrait { #[async_trait::async_trait] pub trait ActionVerifier: Send + Sync { + // Name of the verifier, used for metrics + fn name(&self) -> &'static str; async fn verify(&self, key: K) -> BridgeResult; } @@ -67,6 +70,10 @@ impl ActionVerifier<(TransactionDigest, u16)> for SuiActionVerifier where C: SuiClientInner + Send + Sync + 'static, { + fn name(&self) -> &'static str { + "SuiActionVerifier" + } + async fn verify(&self, key: (TransactionDigest, u16)) -> BridgeResult { let (tx_digest, event_idx) = key; self.sui_client @@ -81,6 +88,10 @@ impl ActionVerifier<(TxHash, u16)> for EthActionVerifier where C: JsonRpcClient + Send + Sync + 'static, { + fn name(&self) -> &'static str { + "EthActionVerifier" + } + async fn verify(&self, key: (TxHash, u16)) -> BridgeResult { let (tx_hash, event_idx) = key; self.eth_client @@ -95,6 +106,7 @@ struct SignerWithCache { verifier: Arc>, mutex: Arc>, cache: LruCache>>>>, + metrics: Arc, } impl SignerWithCache @@ -104,12 +116,14 @@ where fn new( signer: Arc, verifier: impl ActionVerifier + 'static, + metrics: Arc, ) -> Self { Self { signer, verifier: Arc::new(verifier), mutex: Arc::new(Mutex::new(())), cache: LruCache::new(NonZeroUsize::new(1000).unwrap()), + metrics, } } @@ -148,11 +162,20 @@ where async fn sign(&mut self, key: K) -> BridgeResult { let signer = self.signer.clone(); let verifier = self.verifier.clone(); + let verifier_name = verifier.name(); let entry = self.get_cache_entry(key.clone()).await; let mut guard = entry.lock().await; if let Some(result) = &*guard { + self.metrics + .signer_with_cache_hit + .with_label_values(&[verifier_name]) + .inc(); return result.clone(); } + self.metrics + .signer_with_cache_miss + .with_label_values(&[verifier_name]) + .inc(); match verifier.verify(key.clone()).await { Ok(bridge_action) => { let sig = BridgeAuthoritySignInfo::new(&bridge_action, &signer); @@ -213,6 +236,7 @@ impl BridgeRequestHandler { sui_client: Arc>, eth_client: Arc>, approved_governance_actions: Vec, + metrics: Arc, ) -> Self { let (sui_signer_tx, sui_rx) = mysten_metrics::metered_channel::channel( 1000, @@ -237,11 +261,22 @@ impl BridgeRequestHandler { ); let signer = Arc::new(signer); - SignerWithCache::new(signer.clone(), SuiActionVerifier { sui_client }).spawn(sui_rx); - SignerWithCache::new(signer.clone(), EthActionVerifier { eth_client }).spawn(eth_rx); + SignerWithCache::new( + signer.clone(), + SuiActionVerifier { sui_client }, + metrics.clone(), + ) + .spawn(sui_rx); + SignerWithCache::new( + signer.clone(), + EthActionVerifier { eth_client }, + metrics.clone(), + ) + .spawn(eth_rx); SignerWithCache::new( signer.clone(), GovernanceVerifier::new(approved_governance_actions).unwrap(), + metrics.clone(), ) .spawn(governance_rx); @@ -337,7 +372,8 @@ mod tests { let sui_verifier = SuiActionVerifier { sui_client: Arc::new(SuiClient::new_for_testing(sui_client_mock.clone())), }; - let mut sui_signer_with_cache = SignerWithCache::new(signer.clone(), sui_verifier); + let metrics = Arc::new(BridgeMetrics::new_for_testing()); + let mut sui_signer_with_cache = SignerWithCache::new(signer.clone(), sui_verifier, metrics); // Test `get_cache_entry` creates a new entry if not exist let sui_tx_digest = TransactionDigest::random(); @@ -474,7 +510,9 @@ mod tests { let eth_verifier = EthActionVerifier { eth_client: Arc::new(eth_client), }; - let mut eth_signer_with_cache = SignerWithCache::new(signer.clone(), eth_verifier); + let metrics = Arc::new(BridgeMetrics::new_for_testing()); + let mut eth_signer_with_cache = + SignerWithCache::new(signer.clone(), eth_verifier, metrics.clone()); // Test `get_cache_entry` creates a new entry if not exist let eth_tx_hash = TxHash::random(); @@ -557,7 +595,8 @@ mod tests { let (_, kp): (_, BridgeAuthorityKeyPair) = get_key_pair(); let signer = Arc::new(kp); - let mut signer_with_cache = SignerWithCache::new(signer.clone(), verifier); + let metrics = Arc::new(BridgeMetrics::new_for_testing()); + let mut signer_with_cache = SignerWithCache::new(signer.clone(), verifier, metrics.clone()); // action_1 is signable signer_with_cache.sign(action_1.clone()).await.unwrap(); From 5e3f38cfce10138ff3d1e3c72d392890b5bbda2d Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 18 Jul 2024 11:55:05 -0700 Subject: [PATCH 080/163] [tx-finalizer] Add validator leader delay (#18672) ## Description Add incremental delays for validators so that they wake up at different times for efficiency. ## Test plan Added a test --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-core/src/consensus_adapter.rs | 20 +-- crates/sui-core/src/validator_tx_finalizer.rs | 149 ++++++++++++++++-- crates/sui-node/src/lib.rs | 2 +- crates/sui-types/src/committee.rs | 17 +- 4 files changed, 151 insertions(+), 37 deletions(-) diff --git a/crates/sui-core/src/consensus_adapter.rs b/crates/sui-core/src/consensus_adapter.rs index 068b73b4e7558..8b33d8031fac7 100644 --- a/crates/sui-core/src/consensus_adapter.rs +++ b/crates/sui-core/src/consensus_adapter.rs @@ -23,8 +23,6 @@ use prometheus::{ register_int_counter_vec_with_registry, register_int_gauge_vec_with_registry, register_int_gauge_with_registry, }; -use rand::rngs::StdRng; -use rand::SeedableRng; use std::collections::HashMap; use std::future::Future; use std::ops::Deref; @@ -33,7 +31,7 @@ use std::sync::atomic::Ordering; use std::sync::Arc; use std::time::Instant; use sui_types::base_types::TransactionDigest; -use sui_types::committee::{Committee, CommitteeTrait}; +use sui_types::committee::Committee; use sui_types::error::{SuiError, SuiResult}; use tap::prelude::*; @@ -515,7 +513,7 @@ impl ConsensusAdapter { committee: &Committee, tx_digest: &TransactionDigest, ) -> (usize, usize, usize) { - let positions = order_validators_for_submission(committee, tx_digest); + let positions = committee.shuffle_by_stake_from_tx_digest(tx_digest); self.check_submission_wrt_connectivity_and_scores(positions) } @@ -966,18 +964,6 @@ pub fn get_position_in_list( .0 } -pub fn order_validators_for_submission( - committee: &Committee, - tx_digest: &TransactionDigest, -) -> Vec { - // the 32 is as requirement of the default StdRng::from_seed choice - let digest_bytes = tx_digest.into_inner(); - - // permute the validators deterministically, based on the digest - let mut rng = StdRng::from_seed(digest_bytes); - committee.shuffle_by_stake_with_rng(None, None, &mut rng) -} - impl ReconfigurationInitiator for Arc { /// This method is called externally to begin reconfiguration /// It transition reconfig state to reject new certificates from user @@ -1138,7 +1124,7 @@ pub fn position_submit_certificate( ourselves: &AuthorityName, tx_digest: &TransactionDigest, ) -> usize { - let validators = order_validators_for_submission(committee, tx_digest); + let validators = committee.shuffle_by_stake_from_tx_digest(tx_digest); get_position_in_list(*ourselves, validators) } diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index 415ff2204f87b..2aefc8e16ba3b 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -10,11 +10,14 @@ use prometheus::{ register_histogram_with_registry, register_int_counter_with_registry, Histogram, IntCounter, Registry, }; +use std::ops::Add; #[cfg(test)] use std::sync::atomic::{AtomicU64, Ordering::Relaxed}; use std::sync::Arc; use std::time::Duration; +use sui_types::base_types::{AuthorityName, TransactionDigest}; use sui_types::transaction::VerifiedSignedTransaction; +use tokio::select; use tokio::time::Instant; use tracing::{debug, error, trace}; @@ -26,10 +29,14 @@ const TX_FINALIZATION_DELAY: Duration = Duration::from_secs(60); /// If a transaction can not be finalized within 1 min of being woken up, give up. const FINALIZATION_TIMEOUT: Duration = Duration::from_secs(60); +/// Incremental delay for validators to wake up to finalize a transaction. +const VALIDATOR_DELAY_INCREMENTS_SEC: u64 = 10; + struct ValidatorTxFinalizerMetrics { num_finalization_attempts: IntCounter, num_successful_finalizations: IntCounter, finalization_latency: Histogram, + validator_tx_finalizer_attempt_position: Histogram, #[cfg(test)] num_finalization_attempts_for_testing: AtomicU64, #[cfg(test)] @@ -58,6 +65,13 @@ impl ValidatorTxFinalizerMetrics { registry, ) .unwrap(), + validator_tx_finalizer_attempt_position: register_histogram_with_registry!( + "validator_tx_finalizer_attempt_position", + "Position of the validator in the committee that attempted to finalize the transaction after waking up", + vec![0.0, 1.0, 2.0, 3.0, 4.0, 5.0], + registry, + ) + .unwrap(), #[cfg(test)] num_finalization_attempts_for_testing: AtomicU64::new(0), #[cfg(test)] @@ -89,15 +103,21 @@ impl ValidatorTxFinalizerMetrics { /// the transaction if it has not yet been done by a fullnode. pub struct ValidatorTxFinalizer { agg: Arc>>, + name: AuthorityName, tx_finalization_delay: Duration, finalization_timeout: Duration, metrics: Arc, } impl ValidatorTxFinalizer { - pub fn new(agg: Arc>>, registry: &Registry) -> Self { + pub fn new( + agg: Arc>>, + name: AuthorityName, + registry: &Registry, + ) -> Self { Self { agg, + name, tx_finalization_delay: TX_FINALIZATION_DELAY, finalization_timeout: FINALIZATION_TIMEOUT, metrics: Arc::new(ValidatorTxFinalizerMetrics::new(registry)), @@ -107,11 +127,13 @@ impl ValidatorTxFinalizer { #[cfg(test)] pub(crate) fn new_for_testing( agg: Arc>>, + name: AuthorityName, tx_finalization_delay: Duration, finalization_timeout: Duration, ) -> Self { Self { agg, + name, tx_finalization_delay, finalization_timeout, metrics: Arc::new(ValidatorTxFinalizerMetrics::new(&Registry::new())), @@ -152,13 +174,21 @@ where cache_read: Arc, tx: VerifiedSignedTransaction, ) -> anyhow::Result { - tokio::time::sleep(self.tx_finalization_delay).await; let tx_digest = *tx.digest(); - trace!(?tx_digest, "Waking up to finalize transaction"); - if cache_read.is_tx_already_executed(&tx_digest)? { - trace!(?tx_digest, "Transaction already finalized"); - return Ok(false); + let (position, tx_finalization_delay) = self.determine_finalization_delay(&tx_digest)?; + let digests = [tx_digest]; + select! { + _ = tokio::time::sleep(tx_finalization_delay) => { + trace!(?tx_digest, "Waking up to finalize transaction"); + } + _ = cache_read.notify_read_executed_effects_digests(&digests) => { + trace!(?tx_digest, "Transaction already finalized"); + return Ok(false); + } } + self.metrics + .validator_tx_finalizer_attempt_position + .observe(position as f64); let start_time = self.metrics.start_finalization(); debug!( ?tx_digest, @@ -174,6 +204,37 @@ where self.metrics.finalization_succeeded(start_time); Ok(true) } + + // We want to avoid all validators waking up at the same time to finalize the same transaction. + // That can lead to a waste of resource and flood the network unnecessarily. + // Here we use the transaction digest to determine an order of all validators. + // Validators will wake up one by one with incremental delays to finalize the transaction. + // The hope is that the first few should be able to finalize the transaction, + // and the rest will see it already executed and do not need to do anything. + fn determine_finalization_delay( + &self, + tx_digest: &TransactionDigest, + ) -> anyhow::Result<(usize, Duration)> { + let order = self + .agg + .load() + .committee + .shuffle_by_stake_from_tx_digest(tx_digest); + let position = order + .iter() + .position(|&name| name == self.name) + .ok_or_else(|| { + // Somehow the validator is not found in the committee. This should never happen. + // TODO: This is where we should report system invariant violation. + anyhow::anyhow!("Validator {} not found in the committee", self.name) + })?; + + let extra_delay = position as u64 * VALIDATOR_DELAY_INCREMENTS_SEC; + let delay = self + .tx_finalization_delay + .add(Duration::from_secs(extra_delay)); + Ok((position, delay)) + } } #[cfg(test)] @@ -185,6 +246,7 @@ mod tests { use crate::validator_tx_finalizer::ValidatorTxFinalizer; use arc_swap::ArcSwap; use async_trait::async_trait; + use prometheus::Registry; use std::collections::BTreeMap; use std::iter; use std::net::SocketAddr; @@ -192,6 +254,7 @@ mod tests { use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering::Relaxed; use std::sync::Arc; + use std::time::Duration; use sui_macros::sim_test; use sui_swarm_config::network_config_builder::ConfigBuilder; use sui_test_transaction_builder::TestTransactionBuilder; @@ -335,8 +398,9 @@ mod tests { let (states, auth_agg, clients) = create_validators(gas_object).await; let finalizer1 = ValidatorTxFinalizer::new_for_testing( auth_agg.clone(), - std::time::Duration::from_secs(1), - std::time::Duration::from_secs(60), + states[0].name, + Duration::from_secs(1), + Duration::from_secs(60), ); let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; let tx_digest = *signed_tx.digest(); @@ -367,8 +431,9 @@ mod tests { let (states, auth_agg, clients) = create_validators(gas_object).await; let finalizer1 = ValidatorTxFinalizer::new_for_testing( auth_agg.clone(), - std::time::Duration::from_secs(10), - std::time::Duration::from_secs(60), + states[0].name, + Duration::from_secs(10), + Duration::from_secs(60), ); let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; let tx_digest = *signed_tx.digest(); @@ -400,11 +465,12 @@ mod tests { async fn test_validator_tx_finalizer_auth_agg_reconfig() { let (sender, _) = get_account_key_pair(); let gas_object = Object::with_owner_for_testing(sender); - let (_states, auth_agg, _clients) = create_validators(gas_object).await; + let (states, auth_agg, _clients) = create_validators(gas_object).await; let finalizer1 = ValidatorTxFinalizer::new_for_testing( auth_agg.clone(), - std::time::Duration::from_secs(10), - std::time::Duration::from_secs(60), + states[0].name, + Duration::from_secs(10), + Duration::from_secs(60), ); let mut new_auth_agg = (**auth_agg.load()).clone(); let mut new_committee = (*new_auth_agg.committee).clone(); @@ -427,8 +493,9 @@ mod tests { let (states, auth_agg, clients) = create_validators(gas_object).await; let finalizer1 = ValidatorTxFinalizer::new_for_testing( auth_agg.clone(), - std::time::Duration::from_secs(20), - std::time::Duration::from_secs(60), + states[0].name, + Duration::from_secs(20), + Duration::from_secs(60), ); let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; let tx_digest = *signed_tx.digest(); @@ -469,8 +536,9 @@ mod tests { let (states, auth_agg, clients) = create_validators(gas_object).await; let finalizer1 = ValidatorTxFinalizer::new_for_testing( auth_agg.clone(), - std::time::Duration::from_secs(10), - std::time::Duration::from_secs(30), + states[0].name, + Duration::from_secs(10), + Duration::from_secs(30), ); let signed_tx = create_tx(&clients, &states[0], sender, &keypair, gas_object_id).await; let tx_digest = *signed_tx.digest(); @@ -500,6 +568,53 @@ mod tests { ); } + #[tokio::test] + async fn test_validator_tx_finalizer_determine_finalization_delay() { + let network_config = ConfigBuilder::new_with_temp_dir() + .committee_size(NonZeroUsize::new(10).unwrap()) + .build(); + let (auth_agg, _) = AuthorityAggregatorBuilder::from_network_config(&network_config) + .build_network_clients(); + let auth_agg = Arc::new(auth_agg); + let finalizers = (0..10) + .map(|idx| { + ValidatorTxFinalizer::new( + Arc::new(ArcSwap::new(auth_agg.clone())), + auth_agg.committee.voting_rights[idx].0, + &Registry::new(), + ) + }) + .collect::>(); + for _ in 0..100 { + let tx_digest = TransactionDigest::random(); + let mut delays: Vec<_> = finalizers + .iter() + .map(|finalizer| { + finalizer + .determine_finalization_delay(&tx_digest) + .map(|(pos, delay)| (pos, delay.as_secs())) + .unwrap() + }) + .collect(); + delays.sort(); + assert_eq!( + delays, + vec![ + (0, 60), + (1, 70), + (2, 80), + (3, 90), + (4, 100), + (5, 110), + (6, 120), + (7, 130), + (8, 140), + (9, 150) + ] + ) + } + } + async fn create_validators( gas_object: Object, ) -> ( diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index 5c530a2fc963a..e42d0eb6e9035 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -1418,7 +1418,7 @@ impl SuiNode { let enable_validator_tx_finalizer = config.enable_validator_tx_finalizer && chain != Chain::Mainnet; let validator_tx_finalizer = enable_validator_tx_finalizer.then_some(Arc::new( - ValidatorTxFinalizer::new(auth_agg, prometheus_registry), + ValidatorTxFinalizer::new(auth_agg, state.name, prometheus_registry), )); let validator_service = ValidatorService::new( state.clone(), diff --git a/crates/sui-types/src/committee.rs b/crates/sui-types/src/committee.rs index 05e4e99b5f395..906fd6ba1c94c 100644 --- a/crates/sui-types/src/committee.rs +++ b/crates/sui-types/src/committee.rs @@ -8,9 +8,9 @@ use crate::error::{SuiError, SuiResult}; use crate::multiaddr::Multiaddr; use fastcrypto::traits::KeyPair; use once_cell::sync::OnceCell; -use rand::rngs::ThreadRng; +use rand::rngs::{StdRng, ThreadRng}; use rand::seq::SliceRandom; -use rand::Rng; +use rand::{Rng, SeedableRng}; use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::fmt::Write; @@ -225,6 +225,19 @@ impl Committee { .is_ok() } + /// Derive a seed deterministically from the transaction digest and shuffle the validators. + pub fn shuffle_by_stake_from_tx_digest( + &self, + tx_digest: &TransactionDigest, + ) -> Vec { + // the 32 is as requirement of the default StdRng::from_seed choice + let digest_bytes = tx_digest.into_inner(); + + // permute the validators deterministically, based on the digest + let mut rng = StdRng::from_seed(digest_bytes); + self.shuffle_by_stake_with_rng(None, None, &mut rng) + } + // ===== Testing-only methods ===== // pub fn new_simple_test_committee_of_size(size: usize) -> (Self, Vec) { From 72bc96f5265288a3b4a7ae5425b260ab5041bcbb Mon Sep 17 00:00:00 2001 From: Zihe Huang Date: Thu, 18 Jul 2024 15:22:32 -0700 Subject: [PATCH 081/163] [docs] update sui move cli options (#18724) ## Description Update the Sui Move CLI docs to have the latest CLI options ## Test plan manual --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> --- docs/content/references/cli/move.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/content/references/cli/move.mdx b/docs/content/references/cli/move.mdx index f3c943df91f6e..956e232e7fdf0 100644 --- a/docs/content/references/cli/move.mdx +++ b/docs/content/references/cli/move.mdx @@ -16,13 +16,13 @@ Usage: sui move [OPTIONS] Commands: build - coverage Inspect test coverage for this package. A previous test run with the `--coverage` flag must have previously been run + coverage Inspect test coverage for this package. A previous test run with the `--coverage` flag must have previously been run disassemble - new Create a new Move package with name `name` at `path`. If `path` is not provided the package will be created in the directory `name` - prove Run the Move Prover on the package at `path`. If no path is provided defaults to current directory. Use `.. prove .. -- ` to pass on options to the - prover - test Run Move unit tests in this package - help Print this message or the help of the given subcommand(s) + manage-package Record addresses (Object IDs) for where this package is published on chain (this command sets variables in Move.lock) + migrate Migrate to Move 2024 for the package at `path`. If no path is provided defaults to current directory + new Create a new Move package with name `name` at `path`. If `path` is not provided the package will be created in the directory `name` + test Run Move unit tests in this package + help Print this message or the help of the given subcommand(s) Options: -p, --path Path to a package which the command should be run with respect to From b6775051d8bd8218a60ba74ce533350703e203c1 Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:49:11 -0700 Subject: [PATCH 082/163] Tweak antithesis configs (#18725) ## Description - Reduce # of commands in each batch payment txn and its TPS to 1. - Reduce TPS of shared and owned obj txns to 1 as well, since sui surfer is already running. - Update logging config for consensus. ## Test plan https://github.com/MystenLabs/sui-operations/actions/runs/9997864674 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- docker/sui-network/docker-compose-antithesis.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/sui-network/docker-compose-antithesis.yaml b/docker/sui-network/docker-compose-antithesis.yaml index 533409e8a780d..0ee506b8a14b5 100644 --- a/docker/sui-network/docker-compose-antithesis.yaml +++ b/docker/sui-network/docker-compose-antithesis.yaml @@ -10,7 +10,7 @@ services: hostname: validator1 environment: - RUST_BACKTRACE=1 - - RUST_LOG=info,sui_core=debug,narwhal=debug,narwhal-primary::helper=info,jsonrpsee=error + - RUST_LOG=info,sui_core=debug,consensus=debug,jsonrpsee=error - RPC_WORKER_THREAD=12 - NEW_CHECKPOINT_WARNING_TIMEOUT_MS=30000 - NEW_CHECKPOINT_PANIC_TIMEOUT_MS=60000 @@ -37,7 +37,7 @@ services: hostname: validator2 environment: - RUST_BACKTRACE=1 - - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,narwhal=debug,narwhal-primary::helper=info,jsonrpsee=error + - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,consensus=debug,jsonrpsee=error - RPC_WORKER_THREAD=12 - NEW_CHECKPOINT_WARNING_TIMEOUT_MS=30000 - NEW_CHECKPOINT_PANIC_TIMEOUT_MS=60000 @@ -64,7 +64,7 @@ services: hostname: validator3 environment: - RUST_BACKTRACE=1 - - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,narwhal=debug,narwhal-primary::helper=info,jsonrpsee=error + - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,consensus=debug,jsonrpsee=error - RPC_WORKER_THREAD=12 - NEW_CHECKPOINT_WARNING_TIMEOUT_MS=30000 - NEW_CHECKPOINT_PANIC_TIMEOUT_MS=60000 @@ -91,7 +91,7 @@ services: hostname: validator4 environment: - RUST_BACKTRACE=1 - - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,narwhal=debug,narwhal-primary::helper=info,jsonrpsee=error + - RUST_LOG=info,sui_core=debug,sui_network=debug,sui_node=debug,consensus=debug,jsonrpsee=error - RPC_WORKER_THREAD=12 - NEW_CHECKPOINT_WARNING_TIMEOUT_MS=30000 - NEW_CHECKPOINT_PANIC_TIMEOUT_MS=60000 @@ -118,7 +118,7 @@ services: container_name: fullnode1 environment: - RUST_BACKTRACE=1 - - RUST_LOG=info,sui_core=info,narwhal=info,narwhal-primary::helper=info,jsonrpsee=error + - RUST_LOG=info,jsonrpsee=error - RPC_WORKER_THREAD=12 - NEW_CHECKPOINT_WARNING_TIMEOUT_MS=30000 - NEW_CHECKPOINT_PANIC_TIMEOUT_MS=60000 @@ -156,12 +156,12 @@ services: - PRIMARY_GAS_OWNER=0xd59d79516a4ed5b6825e80826c075a12bdd2759aaeb901df2f427f5f880c8f60 - GENESIS_BLOB_PATH=/opt/sui/config/genesis.blob - KEYSTORE_PATH=/opt/sui/config/sui.keystore - - STRESS_TARGET_QPS=10 + - STRESS_TARGET_QPS=3 - STRESS_SHARED_COUNTER=1 - STRESS_TRANSFER_OBJECT=1 - STRESS_DELEGATION=0 - BATCH_PAYMENT=1 - - BATCH_PAYMENT_SIZE=100 + - BATCH_PAYMENT_SIZE=15 - STRESS_ADVERSARIAL=0 volumes: - ./genesis/files/genesis.blob:/opt/sui/config/genesis.blob:ro From 4dffddbfb51b0aaa70dd35d06fdaec6e38557b29 Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Thu, 18 Jul 2024 18:02:40 -0700 Subject: [PATCH 083/163] Create a separate congestion control consensus commit limit for Mysticeti (#18648) ## Description Since mysticeti has different commit rate than Narwhal, we want to use different transaction count limit for shared object congestion control in consensus commit. Therefore, I created a different config for mysticeti, and the consensus handler will choose to use different limit based on the current consensus algorithm. We also turn on shared object congestion control on testnet. ## Test plan simtest updated cluster testing --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --------- Co-authored-by: Eugene Boguslavsky --- crates/sui-benchmark/tests/simtest.rs | 22 +++++++++------ .../authority/authority_per_epoch_store.rs | 21 +++++++++++---- .../shared_object_congestion_tracker.rs | 22 +++++++-------- crates/sui-core/src/consensus_manager/mod.rs | 6 +++-- .../src/unit_tests/authority_tests.rs | 16 ++++++++--- .../unit_tests/congestion_control_tests.rs | 9 ++++--- crates/sui-open-rpc/spec/openrpc.json | 3 ++- crates/sui-protocol-config/src/lib.rs | 27 ++++++++++++++++--- ...ocol_config__test__Testnet_version_53.snap | 3 +++ ...sui_protocol_config__test__version_52.snap | 2 +- ...sui_protocol_config__test__version_53.snap | 4 +-- sdk/graphql-transport/src/methods.ts | 2 +- 12 files changed, 96 insertions(+), 41 deletions(-) diff --git a/crates/sui-benchmark/tests/simtest.rs b/crates/sui-benchmark/tests/simtest.rs index f0d1dfa5cbe88..270a2fd6af878 100644 --- a/crates/sui-benchmark/tests/simtest.rs +++ b/crates/sui-benchmark/tests/simtest.rs @@ -466,15 +466,21 @@ mod test { config.set_per_object_congestion_control_mode_for_testing(mode); match mode { PerObjectCongestionControlMode::None => panic!("Congestion control mode cannot be None in test_simulated_load_shared_object_congestion_control"), - PerObjectCongestionControlMode::TotalGasBudget => - config.set_max_accumulated_txn_cost_per_object_in_checkpoint_for_testing( - checkpoint_budget_factor + PerObjectCongestionControlMode::TotalGasBudget => { + let total_gas_limit = checkpoint_budget_factor * DEFAULT_VALIDATOR_GAS_PRICE - * TEST_ONLY_GAS_UNIT_FOR_HEAVY_COMPUTATION_STORAGE, - ), - PerObjectCongestionControlMode::TotalTxCount => config.set_max_accumulated_txn_cost_per_object_in_checkpoint_for_testing( - txn_count_limit - ), + * TEST_ONLY_GAS_UNIT_FOR_HEAVY_COMPUTATION_STORAGE; + config.set_max_accumulated_txn_cost_per_object_in_narwhal_commit_for_testing(total_gas_limit); + config.set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing(total_gas_limit); + }, + PerObjectCongestionControlMode::TotalTxCount => { + config.set_max_accumulated_txn_cost_per_object_in_narwhal_commit_for_testing( + txn_count_limit + ); + config.set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing( + txn_count_limit + ); + }, } config.set_max_deferral_rounds_for_congestion_control_for_testing(max_deferral_rounds); config 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 e9e10e17555fd..74dabea0ce9c4 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -20,7 +20,7 @@ use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque}; use std::future::Future; use std::path::{Path, PathBuf}; use std::sync::Arc; -use sui_config::node::ExpensiveSafetyCheckConfig; +use sui_config::node::{ConsensusProtocol, ExpensiveSafetyCheckConfig}; use sui_macros::fail_point_arg; use sui_types::accumulator::Accumulator; use sui_types::authenticator_state::{get_authenticator_state, ActiveJwk}; @@ -66,6 +66,7 @@ use crate::consensus_handler::{ ConsensusCommitInfo, SequencedConsensusTransaction, SequencedConsensusTransactionKey, SequencedConsensusTransactionKind, VerifiedSequencedConsensusTransaction, }; +use crate::consensus_manager::ConsensusManager; use crate::epoch::epoch_metrics::EpochMetrics; use crate::epoch::randomness::{ DkgStatus, RandomnessManager, RandomnessReporter, VersionedProcessedMessage, @@ -1748,6 +1749,17 @@ impl AuthorityPerEpochStore { .collect::, _>>()?) } + fn get_max_accumulated_txn_cost_per_object_in_commit(&self) -> Option { + match ConsensusManager::get_consensus_protocol_in_epoch(self) { + ConsensusProtocol::Narwhal => self + .protocol_config() + .max_accumulated_txn_cost_per_object_in_narwhal_commit_as_option(), + ConsensusProtocol::Mysticeti => self + .protocol_config() + .max_accumulated_txn_cost_per_object_in_mysticeti_commit_as_option(), + } + } + fn should_defer( &self, cert: &VerifiedExecutableTransaction, @@ -1774,15 +1786,14 @@ impl AuthorityPerEpochStore { )); } - if let Some(max_accumulated_txn_cost_per_object_in_checkpoint) = self - .protocol_config() - .max_accumulated_txn_cost_per_object_in_checkpoint_as_option() + if let Some(max_accumulated_txn_cost_per_object_in_commit) = + self.get_max_accumulated_txn_cost_per_object_in_commit() { // Defer transaction if it uses shared objects that are congested. if let Some((deferral_key, congested_objects)) = shared_object_congestion_tracker .should_defer_due_to_object_congestion( cert, - max_accumulated_txn_cost_per_object_in_checkpoint, + max_accumulated_txn_cost_per_object_in_commit, previously_deferred_tx_digests, commit_round, ) diff --git a/crates/sui-core/src/authority/shared_object_congestion_tracker.rs b/crates/sui-core/src/authority/shared_object_congestion_tracker.rs index 68f95e21fec4b..4732afe4b7399 100644 --- a/crates/sui-core/src/authority/shared_object_congestion_tracker.rs +++ b/crates/sui-core/src/authority/shared_object_congestion_tracker.rs @@ -74,7 +74,7 @@ impl SharedObjectCongestionTracker { pub fn should_defer_due_to_object_congestion( &self, cert: &VerifiedExecutableTransaction, - max_accumulated_txn_cost_per_object_in_checkpoint: u64, + max_accumulated_txn_cost_per_object_in_commit: u64, previously_deferred_tx_digests: &HashMap, commit_round: Round, ) -> Option<(DeferralKey, Vec)> { @@ -89,7 +89,7 @@ impl SharedObjectCongestionTracker { } let start_cost = self.compute_tx_start_at_cost(&shared_input_objects); - if start_cost + tx_cost <= max_accumulated_txn_cost_per_object_in_checkpoint { + if start_cost + tx_cost <= max_accumulated_txn_cost_per_object_in_commit { return None; } @@ -273,8 +273,8 @@ mod object_cost_tests { let tx_gas_budget = 100; - // Set max_accumulated_txn_cost_per_object_in_checkpoint to only allow 1 transaction to go through. - let max_accumulated_txn_cost_per_object_in_checkpoint = match mode { + // Set max_accumulated_txn_cost_per_object_in_commit to only allow 1 transaction to go through. + let max_accumulated_txn_cost_per_object_in_commit = match mode { PerObjectCongestionControlMode::None => unreachable!(), PerObjectCongestionControlMode::TotalGasBudget => tx_gas_budget + 1, PerObjectCongestionControlMode::TotalTxCount => 2, @@ -310,7 +310,7 @@ mod object_cost_tests { if let Some((_, congested_objects)) = shared_object_congestion_tracker .should_defer_due_to_object_congestion( &tx, - max_accumulated_txn_cost_per_object_in_checkpoint, + max_accumulated_txn_cost_per_object_in_commit, &HashMap::new(), 0, ) @@ -328,7 +328,7 @@ mod object_cost_tests { assert!(shared_object_congestion_tracker .should_defer_due_to_object_congestion( &tx, - max_accumulated_txn_cost_per_object_in_checkpoint, + max_accumulated_txn_cost_per_object_in_commit, &HashMap::new(), 0, ) @@ -345,7 +345,7 @@ mod object_cost_tests { if let Some((_, congested_objects)) = shared_object_congestion_tracker .should_defer_due_to_object_congestion( &tx, - max_accumulated_txn_cost_per_object_in_checkpoint, + max_accumulated_txn_cost_per_object_in_commit, &HashMap::new(), 0, ) @@ -370,7 +370,7 @@ mod object_cost_tests { let shared_obj_0 = ObjectID::random(); let tx = build_transaction(&[(shared_obj_0, true)], 100); // Make should_defer_due_to_object_congestion always defer transactions. - let max_accumulated_txn_cost_per_object_in_checkpoint = 0; + let max_accumulated_txn_cost_per_object_in_commit = 0; let shared_object_congestion_tracker = SharedObjectCongestionTracker::new(mode); // Insert a random pre-existing transaction. @@ -392,7 +392,7 @@ mod object_cost_tests { _, )) = shared_object_congestion_tracker.should_defer_due_to_object_congestion( &tx, - max_accumulated_txn_cost_per_object_in_checkpoint, + max_accumulated_txn_cost_per_object_in_commit, &previously_deferred_tx_digests, 10, ) { @@ -419,7 +419,7 @@ mod object_cost_tests { _, )) = shared_object_congestion_tracker.should_defer_due_to_object_congestion( &tx, - max_accumulated_txn_cost_per_object_in_checkpoint, + max_accumulated_txn_cost_per_object_in_commit, &previously_deferred_tx_digests, 10, ) { @@ -447,7 +447,7 @@ mod object_cost_tests { _, )) = shared_object_congestion_tracker.should_defer_due_to_object_congestion( &tx, - max_accumulated_txn_cost_per_object_in_checkpoint, + max_accumulated_txn_cost_per_object_in_commit, &previously_deferred_tx_digests, 10, ) { diff --git a/crates/sui-core/src/consensus_manager/mod.rs b/crates/sui-core/src/consensus_manager/mod.rs index 26503aec169f1..1ce7606caba84 100644 --- a/crates/sui-core/src/consensus_manager/mod.rs +++ b/crates/sui-core/src/consensus_manager/mod.rs @@ -152,7 +152,9 @@ impl ConsensusManager { } // Picks the consensus protocol based on the protocol config and the epoch. - fn pick_protocol(&self, epoch_store: &AuthorityPerEpochStore) -> ConsensusProtocol { + pub fn get_consensus_protocol_in_epoch( + epoch_store: &AuthorityPerEpochStore, + ) -> ConsensusProtocol { let protocol_config = epoch_store.protocol_config(); if protocol_config.version >= ProtocolVersion::new(36) { if let Ok(consensus_choice) = std::env::var("CONSENSUS") { @@ -205,7 +207,7 @@ impl ConsensusManagerTrait for ConsensusManager { "Cannot start consensus. ConsensusManager protocol {index} is already running" ); }); - let protocol = self.pick_protocol(&epoch_store); + let protocol = Self::get_consensus_protocol_in_epoch(&epoch_store); info!("Starting consensus protocol {protocol:?} ..."); match protocol { ConsensusProtocol::Narwhal => { diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index 266defdd6b4ff..b0b48a4dfedb6 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -5812,10 +5812,17 @@ async fn test_consensus_handler_per_object_congestion_control( PerObjectCongestionControlMode::None => unreachable!(), PerObjectCongestionControlMode::TotalGasBudget => { protocol_config - .set_max_accumulated_txn_cost_per_object_in_checkpoint_for_testing(200_000_000); + .set_max_accumulated_txn_cost_per_object_in_narwhal_commit_for_testing(200_000_000); + protocol_config + .set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing( + 200_000_000, + ); } PerObjectCongestionControlMode::TotalTxCount => { - protocol_config.set_max_accumulated_txn_cost_per_object_in_checkpoint_for_testing(2); + protocol_config + .set_max_accumulated_txn_cost_per_object_in_narwhal_commit_for_testing(2); + protocol_config + .set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing(2); } } protocol_config.set_max_deferral_rounds_for_congestion_control_for_testing(1000); // Set to a large number so that we don't hit this limit. @@ -6034,7 +6041,10 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() { protocol_config.set_per_object_congestion_control_mode_for_testing( PerObjectCongestionControlMode::TotalGasBudget, ); - protocol_config.set_max_accumulated_txn_cost_per_object_in_checkpoint_for_testing(100_000_000); + protocol_config + .set_max_accumulated_txn_cost_per_object_in_narwhal_commit_for_testing(100_000_000); + protocol_config + .set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing(100_000_000); protocol_config.set_max_deferral_rounds_for_congestion_control_for_testing(2); let authority = TestAuthorityBuilder::new() .with_reference_gas_price(1000) diff --git a/crates/sui-core/src/unit_tests/congestion_control_tests.rs b/crates/sui-core/src/unit_tests/congestion_control_tests.rs index 75bf76d603a6a..4890b2006644b 100644 --- a/crates/sui-core/src/unit_tests/congestion_control_tests.rs +++ b/crates/sui-core/src/unit_tests/congestion_control_tests.rs @@ -56,10 +56,13 @@ impl TestSetup { ); // Set shared object congestion control such that it only allows 1 transaction to go through. - let max_accumulated_txn_cost_per_object_in_checkpoint = + let max_accumulated_txn_cost_per_object_in_commit = TEST_ONLY_GAS_PRICE * TEST_ONLY_GAS_UNIT; - protocol_config.set_max_accumulated_txn_cost_per_object_in_checkpoint_for_testing( - max_accumulated_txn_cost_per_object_in_checkpoint, + protocol_config.set_max_accumulated_txn_cost_per_object_in_narwhal_commit_for_testing( + max_accumulated_txn_cost_per_object_in_commit, + ); + protocol_config.set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing( + max_accumulated_txn_cost_per_object_in_commit, ); // Set max deferral rounds to 0 to testr cancellation. All deferred transactions will be cancelled. diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 3cf11e10d5275..244d7016f3af5 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -1661,7 +1661,8 @@ "hmac_hmac_sha3_256_input_cost_per_byte": { "u64": "2" }, - "max_accumulated_txn_cost_per_object_in_checkpoint": null, + "max_accumulated_txn_cost_per_object_in_mysticeti_commit": null, + "max_accumulated_txn_cost_per_object_in_narwhal_commit": null, "max_age_of_jwk_in_epochs": null, "max_arguments": { "u32": "512" diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 74cd992249209..aed1c00a616e1 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -163,6 +163,7 @@ const MAX_PROTOCOL_VERSION: u64 = 53; // Enable deny list v2 on testnet and mainnet. // Version 53: Add feature flag to decide whether to attempt to finalize bridge committee // Enable consensus commit prologue V3 on testnet. +// Turn on shared object congestion control in testnet. #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -1147,9 +1148,11 @@ pub struct ProtocolConfig { /// The maximum size of transactions included in a consensus proposed block consensus_max_transactions_in_block_bytes: Option, - /// The max accumulated txn execution cost per object in a checkpoint. Transactions + /// The max accumulated txn execution cost per object in a Narwhal commit. Transactions /// in a checkpoint will be deferred once their touch shared objects hit this limit. - max_accumulated_txn_cost_per_object_in_checkpoint: Option, + /// This config is meant to be used when consensus protocol is Narwhal, where each + /// consensus commit corresponding to 1 checkpoint (or 2 if randomness is enabled) + max_accumulated_txn_cost_per_object_in_narwhal_commit: Option, /// The max number of consensus rounds a transaction can be deferred due to shared object congestion. /// Transactions will be cancelled after this many rounds. @@ -1168,6 +1171,12 @@ pub struct ProtocolConfig { // Note: this is not a feature flag because we want to distinguish between // `None` and `Some(false)`, as committee was already finalized on Testnet. bridge_should_try_to_finalize_committee: Option, + + /// The max accumulated txn execution cost per object in a mysticeti. Transactions + /// in a commit will be deferred once their touch shared objects hit this limit. + /// This config plays the same role as `max_accumulated_txn_cost_per_object_in_narwhal_commit` + /// but for mysticeti commits due to that mysticeti has higher commit rate. + max_accumulated_txn_cost_per_object_in_mysticeti_commit: Option, } // feature flags @@ -1937,7 +1946,7 @@ impl ProtocolConfig { consensus_max_transactions_in_block_bytes: None, - max_accumulated_txn_cost_per_object_in_checkpoint: None, + max_accumulated_txn_cost_per_object_in_narwhal_commit: None, max_deferral_rounds_for_congestion_control: None, @@ -1948,6 +1957,8 @@ impl ProtocolConfig { max_soft_bundle_size: None, bridge_should_try_to_finalize_committee: None, + + max_accumulated_txn_cost_per_object_in_mysticeti_commit: None, // When adding a new constant, set it to None in the earliest version, like this: // new_constant: None, }; @@ -2470,7 +2481,7 @@ impl ProtocolConfig { // Turn on shared object congestion control in devnet. if chain != Chain::Testnet && chain != Chain::Mainnet { - cfg.max_accumulated_txn_cost_per_object_in_checkpoint = Some(100); + cfg.max_accumulated_txn_cost_per_object_in_narwhal_commit = Some(100); cfg.feature_flags.per_object_congestion_control_mode = PerObjectCongestionControlMode::TotalTxCount; } @@ -2515,6 +2526,14 @@ impl ProtocolConfig { if chain == Chain::Unknown { cfg.feature_flags.authority_capabilities_v2 = true; } + + // Turns on shared object congestion control on testnet. + if chain != Chain::Mainnet { + cfg.max_accumulated_txn_cost_per_object_in_narwhal_commit = Some(100); + cfg.max_accumulated_txn_cost_per_object_in_mysticeti_commit = Some(10); + cfg.feature_flags.per_object_congestion_control_mode = + PerObjectCongestionControlMode::TotalTxCount; + } } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap index 48ae83e570f8e..0419b3548b467 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap @@ -45,6 +45,7 @@ feature_flags: 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 @@ -282,9 +283,11 @@ random_beacon_min_round_interval_ms: 200 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 +max_accumulated_txn_cost_per_object_in_narwhal_commit: 100 max_deferral_rounds_for_congestion_control: 10 min_checkpoint_interval_ms: 200 checkpoint_summary_version_specific_data: 1 max_soft_bundle_size: 5 bridge_should_try_to_finalize_committee: true +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 10 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap index 4bdaa579cb0f5..f3621117fcd26 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_52.snap @@ -291,7 +291,7 @@ random_beacon_min_round_interval_ms: 200 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 -max_accumulated_txn_cost_per_object_in_checkpoint: 100 +max_accumulated_txn_cost_per_object_in_narwhal_commit: 100 max_deferral_rounds_for_congestion_control: 10 min_checkpoint_interval_ms: 200 checkpoint_summary_version_specific_data: 1 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap index 24bcdbf70c03b..095c918715c91 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap @@ -292,10 +292,10 @@ random_beacon_min_round_interval_ms: 200 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 -max_accumulated_txn_cost_per_object_in_checkpoint: 100 +max_accumulated_txn_cost_per_object_in_narwhal_commit: 100 max_deferral_rounds_for_congestion_control: 10 min_checkpoint_interval_ms: 200 checkpoint_summary_version_specific_data: 1 max_soft_bundle_size: 5 bridge_should_try_to_finalize_committee: true - +max_accumulated_txn_cost_per_object_in_mysticeti_commit: 10 diff --git a/sdk/graphql-transport/src/methods.ts b/sdk/graphql-transport/src/methods.ts index 8957d70289e53..4525d68762217 100644 --- a/sdk/graphql-transport/src/methods.ts +++ b/sdk/graphql-transport/src/methods.ts @@ -1330,7 +1330,7 @@ export const RPC_METHODS: { const attributes: Record = {}; const configTypeMap: Record = { - max_accumulated_txn_cost_per_object_in_checkpoint: 'u64', + max_accumulated_txn_cost_per_object_in_narwhal_commit: 'u64', max_arguments: 'u32', max_gas_payment_objects: 'u32', max_modules_in_publish: 'u32', From 1e65d62f745102f353c22183efe8ecceb8c62efd Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Thu, 18 Jul 2024 19:36:03 -0700 Subject: [PATCH 084/163] Monitor thread stalls in sui node (#18700) ## Description Assuming when tokio scheduling stalls temporarily, tasks are not woken up after sleeps. A dedicated task can be used to monitor this issue. This mechanism will stop reporting when the system is completely frozen, which has been observed once before. This issue will require a separate std::thread to monitor, which can be added if needed in future. ## Test plan TODO --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/mysten-metrics/Cargo.toml | 1 - crates/mysten-metrics/src/lib.rs | 40 +++++++------ .../src/thread_stall_monitor.rs | 56 +++++++++++++++++++ crates/sui-core/src/validator_tx_finalizer.rs | 4 +- crates/sui-node/src/lib.rs | 5 ++ 5 files changed, 86 insertions(+), 20 deletions(-) create mode 100644 crates/mysten-metrics/src/thread_stall_monitor.rs diff --git a/crates/mysten-metrics/Cargo.toml b/crates/mysten-metrics/Cargo.toml index a5516cda25f93..2a26c989a9451 100644 --- a/crates/mysten-metrics/Cargo.toml +++ b/crates/mysten-metrics/Cargo.toml @@ -19,5 +19,4 @@ uuid.workspace = true parking_lot.workspace = true futures.workspace = true async-trait.workspace = true - prometheus-closure-metric.workspace = true diff --git a/crates/mysten-metrics/src/lib.rs b/crates/mysten-metrics/src/lib.rs index 75c7fe2732151..4a2c01c97f01a 100644 --- a/crates/mysten-metrics/src/lib.rs +++ b/crates/mysten-metrics/src/lib.rs @@ -11,7 +11,10 @@ use std::task::{Context, Poll}; use std::time::Instant; use once_cell::sync::OnceCell; -use prometheus::{register_int_gauge_vec_with_registry, IntGaugeVec, Registry, TextEncoder}; +use prometheus::{ + register_histogram_with_registry, register_int_gauge_vec_with_registry, Histogram, IntGaugeVec, + Registry, TextEncoder, +}; use tap::TapFallible; use tracing::{warn, Span}; @@ -22,14 +25,16 @@ mod guards; pub mod histogram; pub mod metered_channel; pub mod monitored_mpsc; +pub mod thread_stall_monitor; pub use guards::*; pub const TX_TYPE_SINGLE_WRITER_TX: &str = "single_writer"; pub const TX_TYPE_SHARED_OBJ_TX: &str = "shared_object"; -pub const TX_LATENCY_SEC_BUCKETS: &[f64] = &[ - 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.5, 2., 2.5, - 3., 3.5, 4., 4.5, 5., 6., 7., 8., 9., 10., 20., 30., 60., 90., +pub const LATENCY_SEC_BUCKETS: &[f64] = &[ + 0.001, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, + 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2., 2.5, 3., 3.5, 4., 4.5, 5., + 6., 7., 8., 9., 10., 15., 20., 25., 30., 60., 90., ]; #[derive(Debug)] @@ -42,6 +47,7 @@ pub struct Metrics { pub scope_iterations: IntGaugeVec, pub scope_duration_ns: IntGaugeVec, pub scope_entrance: IntGaugeVec, + pub thread_stall_duration_sec: Histogram, } impl Metrics { @@ -103,6 +109,12 @@ impl Metrics { registry, ) .unwrap(), + thread_stall_duration_sec: register_histogram_with_registry!( + "thread_stall_duration_sec", + "Duration of thread stalls in seconds.", + registry, + ) + .unwrap(), } } } @@ -134,18 +146,18 @@ macro_rules! monitored_future { }; async move { - let metrics = mysten_metrics::get_metrics(); + let metrics = $crate::get_metrics(); let _metrics_guard = if let Some(m) = metrics { m.$metric.with_label_values(&[location]).inc(); - Some(mysten_metrics::scopeguard::guard(m, |metrics| { + Some($crate::scopeguard::guard(m, |_| { m.$metric.with_label_values(&[location]).dec(); })) } else { None }; let _logging_guard = if $logging_enabled { - Some(mysten_metrics::scopeguard::guard((), |_| { + Some($crate::scopeguard::guard((), |_| { tracing::event!( tracing::Level::$logging_level, "Future {} completed", @@ -172,28 +184,22 @@ macro_rules! monitored_future { #[macro_export] macro_rules! spawn_monitored_task { ($fut: expr) => { - tokio::task::spawn(mysten_metrics::monitored_future!( - tasks, $fut, "", INFO, false - )) + tokio::task::spawn($crate::monitored_future!(tasks, $fut, "", INFO, false)) }; } #[macro_export] macro_rules! spawn_logged_monitored_task { ($fut: expr) => { - tokio::task::spawn(mysten_metrics::monitored_future!( - tasks, $fut, "", INFO, true - )) + tokio::task::spawn($crate::monitored_future!(tasks, $fut, "", INFO, true)) }; ($fut: expr, $name: expr) => { - tokio::task::spawn(mysten_metrics::monitored_future!( - tasks, $fut, $name, INFO, true - )) + tokio::task::spawn($crate::monitored_future!(tasks, $fut, $name, INFO, true)) }; ($fut: expr, $name: expr, $logging_level: ident) => { - tokio::task::spawn(mysten_metrics::monitored_future!( + tokio::task::spawn($crate::monitored_future!( tasks, $fut, $name, diff --git a/crates/mysten-metrics/src/thread_stall_monitor.rs b/crates/mysten-metrics/src/thread_stall_monitor.rs new file mode 100644 index 0000000000000..a23c0d2783465 --- /dev/null +++ b/crates/mysten-metrics/src/thread_stall_monitor.rs @@ -0,0 +1,56 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use std::sync::Once; + +use tracing::{error, info}; + +use crate::{get_metrics, spawn_logged_monitored_task}; + +static THREAD_STALL_MONITOR: Once = Once::new(); + +const MONITOR_INTERVAL: std::time::Duration = std::time::Duration::from_millis(500); + +/// Monitors temporary stalls in tokio scheduling every MONITOR_INTERVAL. +/// Logs an error and increments a metric if more than 2 * MONITOR_INTERVAL has elapsed, +/// which means the stall lasted longer than MONITOR_INTERVAL. +pub fn start_thread_stall_monitor() { + let mut called = true; + THREAD_STALL_MONITOR.call_once(|| { + called = false; + }); + if called { + return; + } + if tokio::runtime::Handle::try_current().is_err() { + info!("Not running in a tokio runtime, not starting thread stall monitor."); + return; + } + + spawn_logged_monitored_task!( + async move { + let Some(metrics) = get_metrics() else { + info!("Metrics uninitialized, not starting thread stall monitor."); + return; + }; + let mut last_sleep_time = tokio::time::Instant::now(); + loop { + tokio::time::sleep(MONITOR_INTERVAL).await; + let current_time = tokio::time::Instant::now(); + let stalled_duration = current_time - last_sleep_time - MONITOR_INTERVAL; + last_sleep_time = current_time; + if stalled_duration > MONITOR_INTERVAL { + metrics + .thread_stall_duration_sec + .observe(stalled_duration.as_secs_f64()); + // TODO: disable this in simulation tests with artificial thread stalls? + error!( + "Thread stalled for {}s. Possible causes include CPU overload or too much blocking calls.", + stalled_duration.as_secs_f64() + ); + } + } + }, + "ThreadStallMonitor" + ); +} diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index 2aefc8e16ba3b..2d97a14255590 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -5,7 +5,7 @@ use crate::authority_aggregator::AuthorityAggregator; use crate::authority_client::AuthorityAPI; use crate::execution_cache::TransactionCacheRead; use arc_swap::ArcSwap; -use mysten_metrics::TX_LATENCY_SEC_BUCKETS; +use mysten_metrics::LATENCY_SEC_BUCKETS; use prometheus::{ register_histogram_with_registry, register_int_counter_with_registry, Histogram, IntCounter, Registry, @@ -61,7 +61,7 @@ impl ValidatorTxFinalizerMetrics { finalization_latency: register_histogram_with_registry!( "validator_tx_finalizer_finalization_latency", "Latency of transaction finalization", - TX_LATENCY_SEC_BUCKETS.to_vec(), + LATENCY_SEC_BUCKETS.to_vec(), registry, ) .unwrap(), diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index e42d0eb6e9035..cdbe544e907d0 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -439,7 +439,12 @@ impl SuiNode { // Initialize metrics to track db usage before creating any stores DBMetrics::init(&prometheus_registry); + + // Initialize Mysten metrics. mysten_metrics::init_metrics(&prometheus_registry); + // Unsupported (because of the use of static variable) and unnecessary in simtests. + #[cfg(not(msim))] + mysten_metrics::thread_stall_monitor::start_thread_stall_monitor(); let genesis = config.genesis()?.clone(); From 2c1733108b5f5e9ffd85769ed39d3571ea324b38 Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Thu, 18 Jul 2024 19:39:26 -0700 Subject: [PATCH 085/163] [move][move-2024] Revised index syntax typing to avoid crash (#18696) ## Description This fixes an issue reported around crashing when there are errors in index calls that then chain to method calls. ## Test plan Repros added to the compiler suite --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../move-compiler/src/typing/translate.rs | 40 +++-- .../typing/index_call_invalid_args.exp | 2 +- .../move_2024/typing/index_invalid_crash.exp | 11 ++ .../move_2024/typing/index_invalid_crash.move | 15 ++ .../typing/index_syntax_methods_miscalled.exp | 146 ++++++++---------- .../move_2024/typing/index_underspecified.exp | 11 ++ .../typing/index_underspecified.move | 14 ++ 7 files changed, 147 insertions(+), 92 deletions(-) create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.move create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.move diff --git a/external-crates/move/crates/move-compiler/src/typing/translate.rs b/external-crates/move/crates/move-compiler/src/typing/translate.rs index e144b900f99e6..aaa88ce26e161 100644 --- a/external-crates/move/crates/move-compiler/src/typing/translate.rs +++ b/external-crates/move/crates/move-compiler/src/typing/translate.rs @@ -3532,6 +3532,11 @@ fn borrow_exp_dotted( exp = make_error_exp(context, loc); break; }; + if matches!(index_base_type.value, Type_::UnresolvedError) { + assert!(context.env.has_errors()); + exp = make_error_exp(context, loc); + break; + } let (m, f) = if mut_ { if let Some(index_mut) = index_methods.index_mut { index_mut.target_function @@ -3556,6 +3561,8 @@ fn borrow_exp_dotted( let sp!(argloc, mut args_) = args; args_.insert(0, *exp); let mut_type = sp(index_loc, Type_::Ref(mut_, Box::new(index_base_type))); + // Note that `module_call` here never raise parameter subtyping errors, since we + // already checked them when processing the index functions. let (ret_ty, e_) = module_call(context, error_loc, m, f, None, argloc, args_); if invariant_no_report(context, mut_type.clone(), ret_ty.clone()).is_err() { let msg = format!( @@ -4099,17 +4106,32 @@ fn syntax_call_return_ty( // the type in the case of a polymorphic return type, e.g., // fun index(&mut S, x: &T): &T { ... } // We don't know what the base type is until we have T in our hand and do this. The subtyping - // takes care of this for us. If it fails, however, we're in error mode (explained below). - for (arg_ty, (_, param_ty)) in arg_tys.into_iter().zip(parameters.clone()) { - if let Err(_failure) = subtype_no_report(context, arg_ty, param_ty) { - valid = false; - } + // takes care of this for us. + + // For the first argument, since it may be incorrectly mut/imm, we don't report an error. + let mut args_params = arg_tys.into_iter().zip(parameters.clone()); + if let Some((arg_ty, (_, param_ty))) = args_params.next() { + let _ = subtype_no_report(context, arg_ty, param_ty); } + + // For the other arguments, failure should be reported. If it is, we also mark the call as + // invalid, indicating a return type error. + for (arg_ty, (param, param_ty)) in args_params { + let msg = || { + format!( + "Invalid call of '{}::{}'. Invalid argument for parameter '{}'", + &m, &f, ¶m.value.name + ) + }; + valid &= subtype_opt(context, loc, msg, arg_ty, param_ty).is_some(); + } + // The failure case for dotted expressions hands an error expression up the chain: if a field - // or syntax index function fails to resolve, we hand up an error and propagate it, instead of - // re-attempting to handle it at each step in the accessors (which would cause the user to get - // a new error for each part of the access path). Similarly, if our call arguments are wrong, - // the path is already bad so we're done trying to resolve it and drop into this error case. + // or syntax index function is invalid or failed to resolve, we hand up an error and propagate + // it, instead of re-attempting to handle it at each step in the accessors (which would cause + // the user to get a new error for each part of the access path). Similarly, if our call + // arguments are wrong, the path is already bad so we're done trying to resolve it and drop + // into this error case. if !valid { context.error_type(return_.loc) } else { diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.exp index 1f6d063871a3a..b8ec6c01489ee 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.exp @@ -7,5 +7,5 @@ error[E04007]: incompatible types 12 │ public fun foo (y: Y, i: &u64) { │ --- Given: 'u64' 13 │ y.x[i].i; - │ ^^^^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter 'z' + │ ^^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter 'z' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.exp new file mode 100644 index 0000000000000..94adf5f742b71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.exp @@ -0,0 +1,11 @@ +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_invalid_crash.move:13:5 + │ +12 │ public fun index_by_reference(table: &mut Table>) { + │ --- Expected: 'u64' +13 │ table[&1].push_back(3); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of 'a::m::borrow'. Invalid argument for parameter '_k' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.move new file mode 100644 index 0000000000000..6d0f270fcee09 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.move @@ -0,0 +1,15 @@ +module a::m; + +public struct Table has drop { + size: u64, +} + +#[syntax(index)] +public fun borrow(_table: &mut Table, _k: K): &mut V { + abort 0 +} + +public fun index_by_reference(table: &mut Table>) { + table[&1].push_back(3); +} + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.exp index 867208346abb3..6b6390727e395 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.exp @@ -1,5 +1,5 @@ error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:30:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:30:10 │ 8 │ native public fun borrow(v: &vector, i: u64): ∈ │ --- Expected: 'u64' @@ -7,21 +7,21 @@ error[E04007]: incompatible types 29 │ public fun miscall0(s: &S, i: u32): &u64 { │ --- Given: 'u32' 30 │ &s.t[i] - │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:34:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:34:14 │ -12 │ native public fun borrow_mut(v: &mut vector, i: u64): &mut Element; - │ --- Expected: 'u64' + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' · 33 │ public fun miscall1(s: &mut S, i: u32): &mut u64 { │ --- Given: 'u32' 34 │ &mut s.t[i] - │ ^^^^^^^^^^^ Invalid call of 'std::vector::borrow_mut'. Invalid argument for parameter 'i' + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:38:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:38:10 │ 8 │ native public fun borrow(v: &vector, i: u64): ∈ │ --- Expected: 'u64' @@ -29,21 +29,21 @@ error[E04007]: incompatible types 37 │ public fun miscall2(s: &S, i: T): &u64 { │ - Given: 'T' 38 │ &s.t[i] - │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:43:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:43:14 │ -12 │ native public fun borrow_mut(v: &mut vector, i: u64): &mut Element; - │ --- Expected: 'u64' + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' · 42 │ public fun miscall3(s: &mut S, i: T): &mut u64 { │ - Given: 'T' 43 │ &mut s.t[i] - │ ^^^^^^^^^^^ Invalid call of 'std::vector::borrow_mut'. Invalid argument for parameter 'i' + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:52:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:52:10 │ 20 │ public fun borrow_s(s: &S, i: u64): &u64 { │ --- Expected: 'u64' @@ -51,21 +51,21 @@ error[E04007]: incompatible types 51 │ fun miscall0(s: &s::S, i: u32): &u64 { │ --- Given: 'u32' 52 │ &s[i] - │ ^^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:56:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:56:14 │ -25 │ public fun borrow_s_mut(s: &mut S, i: u64): &mut u64 { - │ --- Expected: 'u64' +20 │ public fun borrow_s(s: &S, i: u64): &u64 { + │ --- Expected: 'u64' · 55 │ fun miscall1(s: &mut s::S, i: u32): &mut u64 { │ --- Given: 'u32' 56 │ &mut s[i] - │ ^^^^^^^^^ Invalid call of 'a::s::borrow_s_mut'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:60:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:60:10 │ 20 │ public fun borrow_s(s: &S, i: u64): &u64 { │ --- Expected: 'u64' @@ -73,21 +73,21 @@ error[E04007]: incompatible types 59 │ fun miscall2(s: &s::S, i: T): &u64 { │ - Given: 'T' 60 │ &s[i] - │ ^^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:64:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:64:14 │ -25 │ public fun borrow_s_mut(s: &mut S, i: u64): &mut u64 { - │ --- Expected: 'u64' +20 │ public fun borrow_s(s: &S, i: u64): &u64 { + │ --- Expected: 'u64' · 63 │ fun miscall3(s: &mut s::S, i: T): &mut u64 { │ - Given: 'T' 64 │ &mut s[i] - │ ^^^^^^^^^ Invalid call of 'a::s::borrow_s_mut'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:80:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:80:10 │ 77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } │ -------- Expected: '&mut u64' @@ -95,21 +95,21 @@ error[E04007]: incompatible types 79 │ fun miscall0(q: &Q, i: u32): &u64 { │ --- Given: 'u32' 80 │ &q[i] - │ ^^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:84:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:84:14 │ -74 │ public fun borrow_mirror_mut(_q: &mut Q, i: &mut u64): &mut u64 { i } - │ -------- Expected: '&mut u64' +77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } + │ -------- Expected: '&mut u64' · 83 │ fun miscall1(q: &mut Q, i: u32): &mut u64 { │ --- Given: 'u32' 84 │ &mut q[i] - │ ^^^^^^^^^ Invalid call of 'a::mirror::borrow_mirror_mut'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:88:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:88:10 │ 77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } │ -------- Expected: '&mut u64' @@ -117,21 +117,21 @@ error[E04007]: incompatible types 87 │ fun miscall2(q: &Q, i: T): &u64 { │ - Given: 'T' 88 │ &q[i] - │ ^^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:92:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:92:14 │ -74 │ public fun borrow_mirror_mut(_q: &mut Q, i: &mut u64): &mut u64 { i } - │ -------- Expected: '&mut u64' +77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } + │ -------- Expected: '&mut u64' · 91 │ fun miscall3(q: &mut Q, i: T): &mut u64 { │ - Given: 'T' 92 │ &mut q[i] - │ ^^^^^^^^^ Invalid call of 'a::mirror::borrow_mirror_mut'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:100:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:100:10 │ 8 │ native public fun borrow(v: &vector, i: u64): ∈ │ --- Expected: 'u64' @@ -139,21 +139,21 @@ error[E04007]: incompatible types 99 │ public fun miscall1(v: &vector, i: u32): &T { │ --- Given: 'u32' 100 │ &v[i] - │ ^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:104:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:104:14 │ - 12 │ native public fun borrow_mut(v: &mut vector, i: u64): &mut Element; - │ --- Expected: 'u64' + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' · 103 │ public fun miscall2(v: &mut vector, i: u32): &mut T { │ --- Given: 'u32' 104 │ &mut v[i] - │ ^^^^^^^^^ Invalid call of 'std::vector::borrow_mut'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:108:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:108:10 │ 8 │ native public fun borrow(v: &vector, i: u64): ∈ │ --- Expected: 'u64' @@ -161,18 +161,18 @@ error[E04007]: incompatible types 107 │ public fun miscall3(v: &vector, i: U): &T { │ - Given: 'U' 108 │ &v[i] - │ ^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:112:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:112:14 │ - 12 │ native public fun borrow_mut(v: &mut vector, i: u64): &mut Element; - │ --- Expected: 'u64' + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' · 111 │ public fun miscall4(v: &mut vector, i: U): &mut T { │ - Given: 'U' 112 │ &mut v[i] - │ ^^^^^^^^^ Invalid call of 'std::vector::borrow_mut'. Invalid argument for parameter 'i' + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04017]: too many arguments ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:120:9 @@ -211,16 +211,16 @@ error[E04017]: too many arguments │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:10 │ 128 │ &v[i, j] - │ ^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + │ ^^^^^^^ + │ ││ + │ │Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:10 │ 8 │ native public fun borrow(v: &vector, i: u64): ∈ │ --- Expected: 'u64' @@ -228,16 +228,7 @@ error[E04007]: incompatible types 127 │ public fun miscall3(v: &vector, i: U, j: V): &T { │ - Given: 'U' 128 │ &v[i, j] - │ ^^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:10 - │ -128 │ &v[i, j] - │ ^^^^^^^ - │ ││ - │ │Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E03004]: unbound type ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:131:59 @@ -246,33 +237,24 @@ error[E03004]: unbound type │ ^ Unbound type 'V' in current scope error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:14 │ 132 │ &mut v[i, j] - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow_mut'. The call expected 2 argument(s) but got 3 + │ ^^^^^^^ + │ ││ + │ │Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:9 + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:14 │ - 12 │ native public fun borrow_mut(v: &mut vector, i: u64): &mut Element; - │ --- Expected: 'u64' + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' · 131 │ public fun miscall4(v: &mut vector, i: U, j : V): &mut T { │ - Given: 'U' 132 │ &mut v[i, j] - │ ^^^^^^^^^^^^ Invalid call of 'std::vector::borrow_mut'. Invalid argument for parameter 'i' - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:14 - │ -132 │ &mut v[i, j] - │ ^^^^^^^ - │ ││ - │ │Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' error[E04016]: too few arguments ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:152:9 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.exp new file mode 100644 index 0000000000000..1720d3066b96f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.exp @@ -0,0 +1,11 @@ +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_underspecified.move:13:5 + │ +12 │ public fun index_by_reference(table: &mut Table) { + │ --- Expected: 'u64' +13 │ table[&1].push_back(3); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of 'a::m::borrow'. Invalid argument for parameter '_k' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.move new file mode 100644 index 0000000000000..3e72f4e897e34 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.move @@ -0,0 +1,14 @@ +module a::m; + +public struct Table has drop { + size: u64, +} + +#[syntax(index)] +public fun borrow(_table: &mut Table, _k: K): &mut V { + abort 0 +} + +public fun index_by_reference(table: &mut Table) { + table[&1].push_back(3); +} From 92d112757e99088135fa87851785214273431bfb Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Thu, 18 Jul 2024 20:17:16 -0700 Subject: [PATCH 086/163] [Metric Checker] Take specific percentiles for range queries (#18728) ## Description This allows the following: 1. Check p95 or even p99 in the time range for p50 latency and TPS. 2. Check p50 in the time range for p95 latency. Config will be modified separately. ## Test plan Nightly run --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-metric-checker/src/lib.rs | 5 ++ crates/sui-metric-checker/src/main.rs | 8 ++- crates/sui-metric-checker/src/query.rs | 68 ++++++++++++++------------ 3 files changed, 50 insertions(+), 31 deletions(-) diff --git a/crates/sui-metric-checker/src/lib.rs b/crates/sui-metric-checker/src/lib.rs index 4d6035cc3e145..d397870662085 100644 --- a/crates/sui-metric-checker/src/lib.rs +++ b/crates/sui-metric-checker/src/lib.rs @@ -24,6 +24,9 @@ pub enum QueryType { end: String, // Query resolution step width as float number of seconds step: f64, + // The result of the query is the percentile of the data points. + // Valid values are [1, 100]. + percentile: u8, }, } @@ -186,6 +189,7 @@ mod tests { start: "now-1h" end: "now" step: 60.0 + percentile: 50 validate_result: threshold: 3.0 failure_condition: Greater @@ -199,6 +203,7 @@ mod tests { start: "now-1h".to_string(), end: "now".to_string(), step: 60.0, + percentile: 50, }, validate_result: Some(QueryResultValidation { threshold: 3.0, diff --git a/crates/sui-metric-checker/src/main.rs b/crates/sui-metric-checker/src/main.rs index 9cbe870df77a0..88d92d2c10c75 100644 --- a/crates/sui-metric-checker/src/main.rs +++ b/crates/sui-metric-checker/src/main.rs @@ -78,7 +78,12 @@ async fn main() -> Result<(), anyhow::Error> { }) .await } - QueryType::Range { start, end, step } => { + QueryType::Range { + start, + end, + step, + percentile, + } => { retry(backoff.clone(), || async { range_query( &auth_header, @@ -87,6 +92,7 @@ async fn main() -> Result<(), anyhow::Error> { timestamp_string_to_unix_seconds::(&start)?, timestamp_string_to_unix_seconds::(&end)?, step, + percentile, ) .await .map_err(backoff::Error::transient) diff --git a/crates/sui-metric-checker/src/query.rs b/crates/sui-metric-checker/src/query.rs index 3761c9b60a816..f07972002ce69 100644 --- a/crates/sui-metric-checker/src/query.rs +++ b/crates/sui-metric-checker/src/query.rs @@ -5,7 +5,7 @@ use anyhow::anyhow; use base64::{engine::general_purpose, Engine}; use prometheus_http_query::Client; use reqwest::header::{HeaderValue, AUTHORIZATION}; -use tracing::debug; +use tracing::{debug, info}; pub async fn instant_query( auth_header: &str, @@ -49,6 +49,7 @@ pub async fn range_query( start: i64, end: i64, step: f64, + percentile: u8, ) -> Result { debug!("Executing {query}"); let response = client @@ -68,35 +69,42 @@ pub async fn range_query( .as_matrix() .unwrap_or_else(|| panic!("Expected result of type matrix for {query}")); - if !result.is_empty() { - let mut samples: Vec = result - .first() - .unwrap() - .samples() - .iter() - .filter_map(|sample| { - let v = sample.value(); - if v.is_nan() { - None - } else { - Some(v) - } - }) - .collect(); - assert!(!samples.is_empty(), "No valid samples found for {query}"); - - samples.sort_by(|a, b| a.partial_cmp(b).unwrap()); - - let median = (samples[(samples.len() - 1) / 2] + samples[samples.len() / 2]) / 2.; - debug!( - "Got median value {median} over time range {} - {}", - unix_seconds_to_timestamp_string(start), - unix_seconds_to_timestamp_string(end) - ); - Ok(median) - } else { - Err(anyhow!( + if result.is_empty() { + return Err(anyhow!( "Did not get expected response from server for {query}" - )) + )); + } + + let mut samples: Vec = result + .first() + .unwrap() + .samples() + .iter() + .filter_map(|sample| { + let v = sample.value(); + if v.is_nan() { + None + } else { + Some(v) + } + }) + .collect(); + if samples.is_empty() { + return Err(anyhow!("Query returned zero data point! {query}")); } + samples.sort_by(|a, b| a.partial_cmp(b).unwrap()); + + assert!( + (1..=100).contains(&percentile), + "Invalid percentile {percentile}" + ); + let index = samples.len() * percentile as usize / 100; + let result = samples[index]; + info!( + "{query}: got p{percentile} value {result}, over {} data points in time range {} - {}", + samples.len(), + unix_seconds_to_timestamp_string(start), + unix_seconds_to_timestamp_string(end) + ); + Ok(result) } From 7187fc18171ed0f22848f36b9ae6d0f290cf2250 Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Thu, 18 Jul 2024 22:48:56 -0700 Subject: [PATCH 087/163] [move][ide] Revise IDE path information to always include all possible names. (#18733) ## Description This revises IDE path information to include _all_ available information, not just information based on the position of the name. ## Test plan A new test, plus updated other tests. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../move-compiler/src/expansion/aliases.rs | 42 ++----- .../src/expansion/path_expander.rs | 107 ++++++------------ .../crates/move-compiler/src/shared/ide.rs | 74 ++++++------ .../move-compiler/src/shared/string_utils.rs | 22 ++-- .../ide_mode/index_autocomplete.ide.exp | 35 +++++- .../ide_mode/type_param_autocomplete.ide.exp | 35 +++++- .../type_param_no_autocomplete.ide.exp | 35 +++++- .../named_struct_autocomplete.ide.exp | 35 +++++- 8 files changed, 216 insertions(+), 169 deletions(-) diff --git a/external-crates/move/crates/move-compiler/src/expansion/aliases.rs b/external-crates/move/crates/move-compiler/src/expansion/aliases.rs index f94dd7e478fcf..b86514ba3b614 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/aliases.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/aliases.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 use move_ir_types::location::Loc; -use move_symbol_pool::Symbol; use crate::{ diagnostics::Diagnostic, @@ -31,8 +30,7 @@ pub struct AliasMap { // macro lambdas, but those have to have a leading `$` and cannot conflict with module members module_members: UniqueMap, // These are for caching resolution for IDE information. - all_leading_names: Option>, - all_module_members: Option>, + ide_alias_info: Option, previous: Option>, } @@ -109,8 +107,7 @@ impl AliasMap { unused: BTreeSet::new(), leading_access: UniqueMap::new(), module_members: UniqueMap::new(), - all_leading_names: None, - all_module_members: None, + ide_alias_info: None, previous: None, } } @@ -212,8 +209,7 @@ impl AliasMap { unused, leading_access, module_members, - all_leading_names: None, - all_module_members: None, + ide_alias_info: None, previous: None, }; @@ -262,38 +258,25 @@ impl AliasMap { result } - /// Gets a map of all in-scope leading names, subject to shadowing, either from a cached value - /// or generated fresh. - pub fn get_all_leading_names(&mut self) -> &BTreeMap { - if self.all_leading_names.is_none() { + /// Gets a map of all in-scope names for IDE information, subject to shadowing, either from a + /// cached value or generated fresh. + pub fn get_ide_alias_information(&mut self) -> ide::AliasAutocompleteInfo { + if self.ide_alias_info.is_none() { let mut cur: Option<&Self> = Some(self); let mut leading_names = BTreeMap::new(); + let mut member_names = BTreeMap::new(); while let Some(map) = cur { for (name, entry) in map.leading_access.key_cloned_iter() { leading_names.entry(name.value).or_insert(*entry); } - cur = map.previous.as_deref(); - } - self.all_leading_names = Some(leading_names); - } - self.all_leading_names.as_ref().unwrap() - } - - /// Gets a map of all in-scope member names, subject to shadowing, either from a cached value - /// or generated fresh. - pub fn get_all_member_names(&mut self) -> &BTreeMap { - if self.all_module_members.is_none() { - let mut cur: Option<&Self> = Some(self); - let mut members = BTreeMap::new(); - while let Some(map) = cur { for (name, entry) in map.module_members.key_cloned_iter() { - members.entry(name.value).or_insert(*entry); + member_names.entry(name.value).or_insert(*entry); } cur = map.previous.as_deref(); } - self.all_module_members = Some(members); + self.ide_alias_info = Some((leading_names, member_names).into()) } - self.all_module_members.as_ref().unwrap() + self.ide_alias_info.clone().unwrap() } } @@ -307,8 +290,7 @@ impl fmt::Debug for AliasMap { unused, leading_access, module_members, - all_leading_names: _, - all_module_members: _, + ide_alias_info: _, previous, } = self; writeln!(f, "AliasMap(\n unused: [")?; diff --git a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs index cff37e83d4049..b5cf39b0d17c7 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs @@ -86,6 +86,8 @@ pub trait PathExpander { context: &mut DefnContext, name_chain: P::NameAccessChain, ) -> Option; + + fn ide_autocomplete_suggestion(&mut self, context: &mut DefnContext, loc: Loc); } pub fn make_access_result( @@ -216,7 +218,7 @@ impl Move2024PathExpander { ) -> AccessChainNameResult { use AccessChainFailure as NF; use AccessChainNameResult as NR; - self.ide_autocomplete_suggestion(context, &namespace, name.loc); + self.ide_autocomplete_suggestion(context, name.loc); match self.aliases.resolve(namespace, &name) { Some(AliasEntry::Member(_, mident, sp!(_, mem))) => { // We are preserving the name's original location, rather than referring to where @@ -477,22 +479,6 @@ impl Move2024PathExpander { } } } - - fn ide_autocomplete_suggestion( - &mut self, - context: &mut DefnContext, - namespace: &NameSpace, - loc: Loc, - ) { - if context.env.ide_mode() { - let info: AliasAutocompleteInfo = match namespace { - NameSpace::LeadingAccess => self.aliases.get_all_leading_names().into(), - NameSpace::ModuleMembers => self.aliases.get_all_member_names().into(), - }; - let annotation = IDEAnnotation::PathAutocompleteInfo(Box::new(info)); - context.env.add_ide_annotation(loc, annotation) - } - } } impl PathExpander for Move2024PathExpander { @@ -751,6 +737,15 @@ impl PathExpander for Move2024PathExpander { } } } + + fn ide_autocomplete_suggestion(&mut self, context: &mut DefnContext, loc: Loc) { + if context.env.ide_mode() { + let info = self.aliases.get_ide_alias_information(); + context + .env + .add_ide_annotation(loc, IDEAnnotation::PathAutocompleteInfo(Box::new(info))); + } + } } impl AccessChainNameResult { @@ -848,12 +843,6 @@ pub struct LegacyPathExpander { old_alias_maps: Vec, } -enum LegacyPositionKind { - Address, - Module, - Member, -} - impl LegacyPathExpander { pub fn new() -> LegacyPathExpander { LegacyPathExpander { @@ -861,37 +850,6 @@ impl LegacyPathExpander { old_alias_maps: vec![], } } - - fn ide_autocomplete_suggestion( - &mut self, - context: &mut DefnContext, - position_kind: LegacyPositionKind, - loc: Loc, - ) { - if context.env.ide_mode() && context.is_source_definition { - let mut info = AliasAutocompleteInfo::new(); - - match position_kind { - LegacyPositionKind::Address => { - for (name, addr) in context.named_address_mapping.unwrap().iter() { - info.addresses.insert((*name, *addr)); - } - } - LegacyPositionKind::Module => { - for (_, name, (_, mident)) in self.aliases.modules.iter() { - info.modules.insert((*name, *mident)); - } - } - LegacyPositionKind::Member => { - for (_, name, (_, (mident, member))) in self.aliases.members.iter() { - info.members.insert((*name, *mident, *member)); - } - } - } - let annotation = IDEAnnotation::PathAutocompleteInfo(Box::new(info)); - context.env.add_ide_annotation(loc, annotation) - } - } } impl PathExpander for LegacyPathExpander { @@ -936,7 +894,7 @@ impl PathExpander for LegacyPathExpander { PV::ModuleAccess(sp!(ident_loc, single_entry!(name, tyargs, is_macro))) if self.aliases.module_alias_get(&name).is_some() => { - self.ide_autocomplete_suggestion(context, LegacyPositionKind::Module, loc); + self.ide_autocomplete_suggestion(context, loc); ice_assert!(context.env, tyargs.is_none(), loc, "Found tyargs"); ice_assert!(context.env, is_macro.is_none(), loc, "Found macro"); let sp!(_, mident_) = self.aliases.module_alias_get(&name).unwrap(); @@ -1028,7 +986,7 @@ impl PathExpander for LegacyPathExpander { if access == Access::Type { ice_assert!(context.env, is_macro.is_none(), loc, "Found macro"); } - self.ide_autocomplete_suggestion(context, LegacyPositionKind::Member, loc); + self.ide_autocomplete_suggestion(context, loc); let access = match self.aliases.member_alias_get(&name) { Some((mident, mem)) => EN::ModuleAccess(mident, mem), None => EN::Name(name), @@ -1038,7 +996,7 @@ impl PathExpander for LegacyPathExpander { (Access::Term, single_entry!(name, tyargs, is_macro)) if is_valid_datatype_or_constant_name(name.value.as_str()) => { - self.ide_autocomplete_suggestion(context, LegacyPositionKind::Member, loc); + self.ide_autocomplete_suggestion(context, loc); let access = match self.aliases.member_alias_get(&name) { Some((mident, mem)) => EN::ModuleAccess(mident, mem), None => EN::Name(name), @@ -1081,11 +1039,7 @@ impl PathExpander for LegacyPathExpander { } // Others (sp!(_, LN::Name(n1)), [n2]) => { - self.ide_autocomplete_suggestion( - context, - LegacyPositionKind::Module, - n1.loc, - ); + self.ide_autocomplete_suggestion(context, n1.loc); if let Some(mident) = self.aliases.module_alias_get(n1) { let n2_name = n2.name; let (tyargs, is_macro) = if !(path.has_tyargs_last()) { @@ -1115,11 +1069,7 @@ impl PathExpander for LegacyPathExpander { } } (ln, [n2, n3]) => { - self.ide_autocomplete_suggestion( - context, - LegacyPositionKind::Address, - ln.loc, - ); + self.ide_autocomplete_suggestion(context, ln.loc); let ident_loc = make_loc( ln.loc.file_hash(), ln.loc.start() as usize, @@ -1148,11 +1098,7 @@ impl PathExpander for LegacyPathExpander { return None; } (ln, [_n1, _n2, ..]) => { - self.ide_autocomplete_suggestion( - context, - LegacyPositionKind::Address, - ln.loc, - ); + self.ide_autocomplete_suggestion(context, ln.loc); let mut diag = diag!(Syntax::InvalidName, (loc, "Too many name segments")); diag.add_note("Names may only have 0, 1, or 2 segments separated by '::'"); context.env.add_diag(diag); @@ -1232,6 +1178,23 @@ impl PathExpander for LegacyPathExpander { } } } + + fn ide_autocomplete_suggestion(&mut self, context: &mut DefnContext, loc: Loc) { + if context.env.ide_mode() && context.is_source_definition { + let mut info = AliasAutocompleteInfo::new(); + for (name, addr) in context.named_address_mapping.unwrap().iter() { + info.addresses.insert((*name, *addr)); + } + for (_, name, (_, mident)) in self.aliases.modules.iter() { + info.modules.insert((*name, *mident)); + } + for (_, name, (_, (mident, member))) in self.aliases.members.iter() { + info.members.insert((*name, *mident, *member)); + } + let annotation = IDEAnnotation::PathAutocompleteInfo(Box::new(info)); + context.env.add_ide_annotation(loc, annotation) + } + } } fn unexpected_address_module_error(loc: Loc, nloc: Loc, access: Access) -> Diagnostic { diff --git a/external-crates/move/crates/move-compiler/src/shared/ide.rs b/external-crates/move/crates/move-compiler/src/shared/ide.rs index 829cdf8b1cac2..51f9738aacc6d 100644 --- a/external-crates/move/crates/move-compiler/src/shared/ide.rs +++ b/external-crates/move/crates/move-compiler/src/shared/ide.rs @@ -201,14 +201,24 @@ impl AliasAutocompleteInfo { } } -impl From<&BTreeMap> for AliasAutocompleteInfo { - fn from(names: &BTreeMap) -> Self { +impl + From<( + BTreeMap, + BTreeMap, + )> for AliasAutocompleteInfo +{ + fn from( + (leading_names, member_names): ( + BTreeMap, + BTreeMap, + ), + ) -> Self { let mut addresses: BTreeSet<(Symbol, NumericalAddress)> = BTreeSet::new(); let mut modules: BTreeSet<(Symbol, E::ModuleIdent)> = BTreeSet::new(); let mut members: BTreeSet<(Symbol, E::ModuleIdent, Name)> = BTreeSet::new(); let mut type_params: BTreeSet = BTreeSet::new(); - for (symbol, entry) in names + for (symbol, entry) in leading_names .iter() .filter(|(symbol, _)| symbol.to_string() != UNIT_TEST_POISON_FUN_NAME.to_string()) { @@ -228,23 +238,8 @@ impl From<&BTreeMap> for AliasAutocompleteInfo { } } - AliasAutocompleteInfo { - members, - modules, - addresses, - type_params, - } - } -} - -impl From<&BTreeMap> for AliasAutocompleteInfo { - fn from(names: &BTreeMap) -> Self { - let addresses: BTreeSet<(Symbol, NumericalAddress)> = BTreeSet::new(); - let modules: BTreeSet<(Symbol, E::ModuleIdent)> = BTreeSet::new(); - let mut members: BTreeSet<(Symbol, E::ModuleIdent, Name)> = BTreeSet::new(); - let mut type_params: BTreeSet = BTreeSet::new(); - - for (symbol, entry) in names + // The member names shadow, though this should be no issue as they should be identical. + for (symbol, entry) in member_names .iter() .filter(|(symbol, _)| symbol.to_string() != UNIT_TEST_POISON_FUN_NAME.to_string()) { @@ -303,26 +298,27 @@ impl From<(Loc, IDEAnnotation)> for Diagnostic { addresses, type_params, } = *info; - let names = members + + let members = members .into_iter() - .map(|(name, m, f)| format!("{name} -> {m}::{f}")) - .chain( - modules - .into_iter() - .map(|(name, m)| format!("{name} -> {m}")), - ) - .chain( - addresses - .into_iter() - .map(|(name, a)| format!("{name} -> {a}")), - ) - .chain(type_params.into_iter().map(|p| format!("{p}"))) - .collect::>(); - let msg = format!( - "Possible in-scope names: {}", - format_oxford_list!("or", "'{}'", names) - ); - diag!(IDE::PathAutocomplete, (loc, msg)) + .map(|(name, m, f)| format!("{name} -> {m}::{f}")); + let member_names = format_oxford_list!(ITER, "or", "'{}'", members); + let modules = modules + .into_iter() + .map(|(name, m)| format!("{name} -> {m}")); + let module_names = format_oxford_list!(ITER, "or", "'{}'", modules); + let addrs = addresses + .into_iter() + .map(|(name, a)| format!("{name} -> {a}")); + let address_names = format_oxford_list!(ITER, "or", "'{}'", addrs); + let type_params = type_params.into_iter().map(|p| format!("{p}")); + let type_param_names = format_oxford_list!(ITER, "or", "'{}'", type_params); + let mut diag = diag!(IDE::PathAutocomplete, (loc, "Possible in-scope names")); + diag.add_note(format!("members: {member_names}")); + diag.add_note(format!("modules: {module_names}")); + diag.add_note(format!("addresses: {address_names}")); + diag.add_note(format!("type params: {type_param_names}")); + diag } IDEAnnotation::DotAutocompleteInfo(info) => { let DotAutocompleteInfo { methods, fields } = *info; diff --git a/external-crates/move/crates/move-compiler/src/shared/string_utils.rs b/external-crates/move/crates/move-compiler/src/shared/string_utils.rs index f0933ca7484a9..b1baa80ea22dc 100644 --- a/external-crates/move/crates/move-compiler/src/shared/string_utils.rs +++ b/external-crates/move/crates/move-compiler/src/shared/string_utils.rs @@ -32,26 +32,32 @@ pub fn make_ascii_titlecase(in_s: &str) -> String { } /// Formats a string into an oxford list as: `format_oxford_list("or", "{}", vs);`. Calls `iter()` -/// and `len()` on `vs`. +/// and `len()` on `vs`. If you already have an iter, you can pass `ITER` as a first parameter. /// /// This will use `or` as the separator for the last two elements, interspersing commas as /// appropriate: +/// /// ```text -/// format_oxford_list("or", "{}", [1]); +/// format_oxford_list!("or", "{}", [1]); /// ==> "1" /// -/// format_oxford_list("or", "{}", [1, 2]); +/// format_oxford_list!("or", "{}", [1, 2]); /// ==> "1 or 2" /// -/// format_oxford_list("or", "{}", [1, 2, 3]); +/// format_oxford_list!("or", "{}", [1, 2, 3]); /// ==> "1, 2, or 3" -///``` /// +/// format_oxford_list!(ITER, "or", "{}", [1, 2, 3].iter()); +/// ==> "1, 2, or 3" +///``` macro_rules! format_oxford_list { ($sep:expr, $format_str:expr, $e:expr) => {{ - let in_entries = $e; - let e_len = in_entries.len(); - let mut entries = in_entries.iter(); + let entries = $e; + format_oxford_list!(ITER, $sep, $format_str, entries.iter()) + }}; + (ITER, $sep:expr, $format_str:expr, $e:expr) => {{ + let mut entries = $e; + let e_len = entries.len(); match e_len { 0 => String::new(), 1 => format!($format_str, entries.next().unwrap()), diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp index af370e963d960..ebfb867f8fcce 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp @@ -7,31 +7,56 @@ note[I15006]: IDE path autocomplete 5 │ │ #[syntax(index)] 6 │ │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; 7 │ │ } - │ ╰─^ Possible in-scope names: 'Option -> std::option::Option', 'Self -> std::vector', 'option -> std::option', 'vector -> std::vector', 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:51 │ 4 │ native public fun vborrow(v: &vector, i: u64): ∈ - │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:71 │ 4 │ native public fun vborrow(v: &vector, i: u64): ∈ - │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:59 │ 6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; - │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:83 │ 6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; - │ ^^^^^^^ Possible in-scope names: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', 'vborrow_mut -> std::vector::vborrow_mut', or 'Element' + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' warning[W09009]: unused struct field ┌─ tests/move_2024/ide_mode/index_autocomplete.move:14:23 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp index c2d26e9d021f5..9a5538addcde0 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp @@ -8,31 +8,56 @@ note[I15006]: IDE path autocomplete 5 │ │ public fun make_action_ref(action: &mut Action): &mut T { 6 │ │ &mut action.inner.bar 7 │ │ } - │ ╰─^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'Self -> 0x42::m', 'option -> std::option', 'vector -> std::vector', 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + │ ╰─^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:3:34 │ 3 │ public struct Action { inner: T } - │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:44 │ 5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^^^^^^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^^^^^^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:51 │ 5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:61 │ 5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' error[E04009]: expected specific type ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:10 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp index 1a86fceabb78d..a5cf88c2641c4 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp @@ -8,31 +8,56 @@ note[I15006]: IDE path autocomplete 5 │ │ public fun make_action_ref(action: &mut Action): &mut T { 6 │ │ &mut action.inner 7 │ │ } - │ ╰─^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'Self -> 0x42::m', 'option -> std::option', 'vector -> std::vector', 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + │ ╰─^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:3:34 │ 3 │ public struct Action { inner: T } - │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:44 │ 5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^^^^^^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^^^^^^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:51 │ 5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' note[I15006]: IDE path autocomplete ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:61 │ 5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', 'make_action_ref -> 0x42::m::make_action_ref', or 'T' + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' note[I15001]: IDE dot autocomplete ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:17 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp index ae348b9e60474..a100d250d665a 100644 --- a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp +++ b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp @@ -8,31 +8,56 @@ note[I15006]: IDE path autocomplete · │ 15 │ │ } 16 │ │ } - │ ╰─^ Possible in-scope names: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15006]: IDE path autocomplete ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:4:12 │ 4 │ x: u64 - │ ^^^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + │ ^^^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15006]: IDE path autocomplete ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:8:12 │ 8 │ a: A - │ ^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15006]: IDE path autocomplete ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:18 │ 12 │ let _s = B { a: A { x: 0 } }; - │ ^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15006]: IDE path autocomplete ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:25 │ 12 │ let _s = B { a: A { x: 0 } }; - │ ^ Possible in-scope names: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: note[I15001]: IDE dot autocomplete ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:23 From 3e0a4ec98cf04239c10fdb91991f958e1412c8a4 Mon Sep 17 00:00:00 2001 From: benr-ml <112846738+benr-ml@users.noreply.github.com> Date: Fri, 19 Jul 2024 20:13:26 +0300 Subject: [PATCH 088/163] [beacon] Remove dkg v0 (#18560) ## Description Remove the support of dkg v0 which is no longer used in any network ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../authority/authority_per_epoch_store.rs | 34 +- crates/sui-core/src/epoch/randomness.rs | 350 ++++++------------ crates/sui-protocol-config/src/lib.rs | 6 +- crates/sui-types/src/messages_consensus.rs | 95 ++--- 4 files changed, 152 insertions(+), 333 deletions(-) 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 74dabea0ce9c4..dfa5dc5c1eae5 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -4,8 +4,8 @@ use arc_swap::ArcSwapOption; use enum_dispatch::enum_dispatch; use fastcrypto::groups::bls12381; +use fastcrypto_tbls::dkg; use fastcrypto_tbls::nodes::PartyId; -use fastcrypto_tbls::{dkg, dkg_v0}; use fastcrypto_zkp::bn254::zk_login::{JwkId, OIDCProvider, JWK}; use fastcrypto_zkp::bn254::zk_login_api::ZkLoginEnv; use futures::future::{join_all, select, Either}; @@ -97,11 +97,11 @@ use sui_types::message_envelope::TrustedEnvelope; use sui_types::messages_checkpoint::{ CheckpointContents, CheckpointSequenceNumber, CheckpointSignatureMessage, CheckpointSummary, }; +use sui_types::messages_consensus::VersionedDkgConfirmation; use sui_types::messages_consensus::{ check_total_jwk_size, AuthorityCapabilitiesV1, AuthorityCapabilitiesV2, ConsensusTransaction, ConsensusTransactionKey, ConsensusTransactionKind, }; -use sui_types::messages_consensus::{VersionedDkgConfimation, VersionedDkgMessage}; use sui_types::storage::GetSharedLocks; use sui_types::sui_system_state::epoch_start_sui_system_state::{ EpochStartSystemState, EpochStartSystemStateTrait, @@ -524,20 +524,26 @@ pub struct AuthorityEpochTables { /// Records messages processed from other nodes. Updated when receiving a new dkg::Message /// via consensus. pub(crate) dkg_processed_messages_v2: DBMap, + /// This table is no longer used (can be removed when DBMap supports removing tables) + #[allow(dead_code)] #[deprecated] - pub(crate) dkg_processed_messages: DBMap>, + pub(crate) dkg_processed_messages: DBMap>, /// Records messages used to generate a DKG confirmation. Updated when enough DKG /// messages are received to progress to the next phase. pub(crate) dkg_used_messages_v2: DBMap, + /// This table is no longer used (can be removed when DBMap supports removing tables) + #[allow(dead_code)] #[deprecated] - pub(crate) dkg_used_messages: DBMap>, + pub(crate) dkg_used_messages: DBMap>, /// Records confirmations received from other nodes. Updated when receiving a new /// dkg::Confirmation via consensus. - pub(crate) dkg_confirmations_v2: DBMap, + pub(crate) dkg_confirmations_v2: DBMap, + /// This table is no longer used (can be removed when DBMap supports removing tables) + #[allow(dead_code)] #[deprecated] - pub(crate) dkg_confirmations: DBMap>, + pub(crate) dkg_confirmations: DBMap>, /// Records the final output of DKG after completion, including the public VSS key and /// any local private shares. pub(crate) dkg_output: DBMap>, @@ -3635,12 +3641,7 @@ impl AuthorityPerEpochStore { "Received RandomnessDkgMessage from {:?}", authority.concise() ); - let versioned_dkg_message = match self.protocol_config.dkg_version() { - // old message was not an enum - 0 => bcs::from_bytes(bytes).map(VersionedDkgMessage::V0), - _ => bcs::from_bytes(bytes), - }; - match versioned_dkg_message { + match bcs::from_bytes(bytes) { Ok(message) => randomness_manager.add_message(authority, message)?, Err(e) => { warn!( @@ -3673,14 +3674,7 @@ impl AuthorityPerEpochStore { "Received RandomnessDkgConfirmation from {:?}", authority.concise() ); - - let versioned_dkg_confirmation = match self.protocol_config.dkg_version() { - // old message was not an enum - 0 => bcs::from_bytes(bytes).map(VersionedDkgConfimation::V0), - _ => bcs::from_bytes(bytes), - }; - - match versioned_dkg_confirmation { + match bcs::from_bytes(bytes) { Ok(message) => { randomness_manager.add_confirmation(batch, authority, message)? } diff --git a/crates/sui-core/src/epoch/randomness.rs b/crates/sui-core/src/epoch/randomness.rs index 55fd9e985dce9..6699459e1e844 100644 --- a/crates/sui-core/src/epoch/randomness.rs +++ b/crates/sui-core/src/epoch/randomness.rs @@ -7,7 +7,7 @@ use fastcrypto::error::{FastCryptoError, FastCryptoResult}; use fastcrypto::groups::bls12381; use fastcrypto::serde_helpers::ToFromByteArray; use fastcrypto::traits::{KeyPair, ToFromBytes}; -use fastcrypto_tbls::{dkg, dkg::Output, dkg_v0, dkg_v1, nodes, nodes::PartyId}; +use fastcrypto_tbls::{dkg, dkg::Output, dkg_v1, nodes, nodes::PartyId}; use futures::stream::FuturesUnordered; use futures::StreamExt; use narwhal_types::{Round, TimestampMs}; @@ -25,7 +25,7 @@ use sui_types::committee::{Committee, EpochId, StakeUnit}; use sui_types::crypto::{AuthorityKeyPair, RandomnessRound}; use sui_types::error::{SuiError, SuiResult}; use sui_types::messages_consensus::VersionedDkgMessage; -use sui_types::messages_consensus::{ConsensusTransaction, VersionedDkgConfimation}; +use sui_types::messages_consensus::{ConsensusTransaction, VersionedDkgConfirmation}; use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemStateTrait; use tokio::sync::OnceCell; use tokio::task::JoinHandle; @@ -47,26 +47,20 @@ pub const SINGLETON_KEY: u64 = 0; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[allow(clippy::large_enum_variant)] pub enum VersionedProcessedMessage { - V0(dkg_v0::ProcessedMessage), + V0(), // deprecated V1(dkg_v1::ProcessedMessage), } impl VersionedProcessedMessage { pub fn sender(&self) -> PartyId { match self { - VersionedProcessedMessage::V0(msg) => msg.message.sender, + VersionedProcessedMessage::V0() => { + panic!("BUG: invalid VersionedProcessedMessage version V0") + } VersionedProcessedMessage::V1(msg) => msg.message.sender, } } - fn unwrap_v0(self) -> dkg_v0::ProcessedMessage { - if let VersionedProcessedMessage::V0(msg) = self { - msg - } else { - panic!("BUG: expected message version is 0") - } - } - fn unwrap_v1(self) -> dkg_v1::ProcessedMessage { if let VersionedProcessedMessage::V1(msg) = self { msg @@ -75,116 +69,58 @@ impl VersionedProcessedMessage { } } - fn expect_v1(self) -> Self { - if let VersionedProcessedMessage::V1(_) = self { - self - } else { - panic!("BUG: expected message version is 1") - } - } - pub fn process( - dkg_version: u64, party: Arc>, message: VersionedDkgMessage, ) -> FastCryptoResult { - match dkg_version { - 0 => { - let processed = - party.process_message(message.unwrap_v0(), &mut rand::thread_rng())?; - Ok(VersionedProcessedMessage::V0(processed)) - } - 1 => { - let processed = - party.process_message_v1(message.unwrap_v1(), &mut rand::thread_rng())?; - Ok(VersionedProcessedMessage::V1(processed)) - } - _ => panic!("BUG: invalid DKG version {dkg_version}"), - } + // All inputs are verified in add_message, so we can assume they are of the correct version. + let processed = party.process_message_v1(message.unwrap_v1(), &mut rand::thread_rng())?; + Ok(VersionedProcessedMessage::V1(processed)) } pub fn merge( - dkg_version: u64, party: Arc>, messages: Vec, - ) -> FastCryptoResult<(VersionedDkgConfimation, VersionedUsedProcessedMessages)> { - match dkg_version { - 0 => { - let (conf, msgs) = party.merge( - &messages - .into_iter() - .map(|vm| vm.unwrap_v0()) - .collect::>(), - )?; - Ok(( - VersionedDkgConfimation::V0(conf), - VersionedUsedProcessedMessages::V0(msgs), - )) - } - 1 => { - let (conf, msgs) = party.merge_v1( - &messages - .into_iter() - .map(|vm| vm.unwrap_v1()) - .collect::>(), - )?; - Ok(( - VersionedDkgConfimation::V1(conf), - VersionedUsedProcessedMessages::V1(msgs), - )) - } - _ => panic!("BUG: invalid DKG version {dkg_version}"), - } + ) -> FastCryptoResult<(VersionedDkgConfirmation, VersionedUsedProcessedMessages)> { + // All inputs were created by this validator, so we can assume they are of the correct version. + let (conf, msgs) = party.merge_v1( + &messages + .into_iter() + .map(|vm| vm.unwrap_v1()) + .collect::>(), + )?; + Ok(( + VersionedDkgConfirmation::V1(conf), + VersionedUsedProcessedMessages::V1(msgs), + )) } } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum VersionedUsedProcessedMessages { - V0(dkg_v0::UsedProcessedMessages), + V0(), // deprecated V1(dkg_v1::UsedProcessedMessages), } impl VersionedUsedProcessedMessages { - fn complete_dkg<'a, Iter: Iterator>( + fn complete_dkg<'a, Iter: Iterator>( &self, party: Arc>, confirmations: Iter, ) -> FastCryptoResult> { + // All inputs are verified in add_confirmation, so we can assume they are of the correct version. let rng = &mut StdRng::from_rng(OsRng).expect("RNG construction should not fail"); - match self { - VersionedUsedProcessedMessages::V0(msg) => party.complete( - msg, - &confirmations - .map(|vm| vm.unwrap_v0()) - .cloned() - .collect::>(), - rng, - ), - VersionedUsedProcessedMessages::V1(msg) => party.complete_v1( - msg, - &confirmations - .map(|vm| vm.unwrap_v1()) - .cloned() - .collect::>(), - rng, - ), - } - } - - fn unwrap_v0(self) -> dkg_v0::UsedProcessedMessages { - if let VersionedUsedProcessedMessages::V0(msg) = self { - msg - } else { - panic!("BUG: expected message version is 0") - } - } - - fn expect_v1(self) -> Self { - if let VersionedUsedProcessedMessages::V1(_) = self { - self - } else { - panic!("BUG: expected message version is 1") - } + let VersionedUsedProcessedMessages::V1(msg) = self else { + panic!("BUG: invalid VersionedUsedProcessedMessages version") + }; + party.complete_v1( + msg, + &confirmations + .map(|vm| vm.unwrap_v1()) + .cloned() + .collect::>(), + rng, + ) } } @@ -220,7 +156,7 @@ pub struct RandomnessManager { enqueued_messages: BTreeMap>>, processed_messages: BTreeMap, used_messages: OnceCell, - confirmations: BTreeMap, + confirmations: BTreeMap, dkg_output: OnceCell>>, // State for randomness generation. @@ -389,57 +325,31 @@ impl RandomnessManager { ); // Load intermediate data. - match epoch_store.protocol_config().dkg_version() { - #[allow(deprecated)] - 0 => { - rm.processed_messages - .extend(tables.dkg_processed_messages.safe_iter().map(|result| { - let (pid, msg) = result.expect("typed_store should not fail"); - (pid, VersionedProcessedMessage::V0(msg)) - })); - if let Some(used_messages) = tables - .dkg_used_messages - .get(&SINGLETON_KEY) - .expect("typed_store should not fail") - { - rm.used_messages - .set(VersionedUsedProcessedMessages::V0(used_messages.clone())) - .expect("setting new OnceCell should succeed"); - } - rm.confirmations - .extend(tables.dkg_confirmations.safe_iter().map(|result| { - let (pid, msg) = result.expect("typed_store should not fail"); - (pid, VersionedDkgConfimation::V0(msg)) - })); - } - 1 => { - rm.processed_messages.extend( - tables - .dkg_processed_messages_v2 - .safe_iter() - .map(|result| result.expect("typed_store should not fail")), - ); - if let Some(used_messages) = tables - .dkg_used_messages_v2 - .get(&SINGLETON_KEY) - .expect("typed_store should not fail") - { - rm.used_messages - .set(used_messages.clone()) - .expect("setting new OnceCell should succeed"); - } - rm.confirmations.extend( - tables - .dkg_confirmations_v2 - .safe_iter() - .map(|result| result.expect("typed_store should not fail")), - ); - } - _ => panic!( - "BUG: invalid DKG version {}", - epoch_store.protocol_config().dkg_version() - ), + assert!( + epoch_store.protocol_config().dkg_version() > 0, + "BUG: DKG version 0 is deprecated" + ); + rm.processed_messages.extend( + tables + .dkg_processed_messages_v2 + .safe_iter() + .map(|result| result.expect("typed_store should not fail")), + ); + if let Some(used_messages) = tables + .dkg_used_messages_v2 + .get(&SINGLETON_KEY) + .expect("typed_store should not fail") + { + rm.used_messages + .set(used_messages.clone()) + .expect("setting new OnceCell should succeed"); } + rm.confirmations.extend( + tables + .dkg_confirmations_v2 + .safe_iter() + .map(|result| result.expect("typed_store should not fail")), + ); } // Resume randomness generation from where we left off. @@ -532,7 +442,6 @@ impl RandomnessManager { /// sending out a dkg::Confirmation and generating final output. pub async fn advance_dkg(&mut self, batch: &mut DBBatch, round: Round) -> SuiResult { let epoch_store = self.epoch_store()?; - let dkg_version = epoch_store.protocol_config().dkg_version(); // Once we have enough Messages, send a Confirmation. if !self.dkg_output.initialized() && !self.used_messages.initialized() { @@ -544,28 +453,15 @@ impl RandomnessManager { if let Ok(Some(processed)) = res { self.processed_messages .insert(processed.sender(), processed.clone()); - match dkg_version { - 0 => { - #[allow(deprecated)] - batch.insert_batch( - &epoch_store.tables()?.dkg_processed_messages, - std::iter::once((processed.sender(), processed.unwrap_v0())), - )?; - } - 1 => { - batch.insert_batch( - &epoch_store.tables()?.dkg_processed_messages_v2, - std::iter::once((processed.sender(), processed.expect_v1())), - )?; - } - _ => panic!("BUG: invalid DKG version {dkg_version}"), - } + batch.insert_batch( + &epoch_store.tables()?.dkg_processed_messages_v2, + std::iter::once((processed.sender(), processed)), + )?; } } // Attempt to generate the Confirmation. match VersionedProcessedMessage::merge( - self.epoch_store()?.protocol_config().dkg_version(), self.party.clone(), self.processed_messages .values() @@ -580,22 +476,10 @@ impl RandomnessManager { if self.used_messages.set(used_msgs.clone()).is_err() { error!("BUG: used_messages should only ever be set once"); } - match dkg_version { - 0 => { - #[allow(deprecated)] - batch.insert_batch( - &epoch_store.tables()?.dkg_used_messages, - std::iter::once((SINGLETON_KEY, used_msgs.unwrap_v0())), - )?; - } - 1 => { - batch.insert_batch( - &epoch_store.tables()?.dkg_used_messages_v2, - std::iter::once((SINGLETON_KEY, used_msgs.expect_v1())), - )?; - } - _ => panic!("BUG: invalid DKG version {dkg_version}"), - }; + batch.insert_batch( + &epoch_store.tables()?.dkg_used_messages_v2, + std::iter::once((SINGLETON_KEY, used_msgs)), + )?; let transaction = ConsensusTransaction::new_randomness_dkg_confirmation( epoch_store.name, @@ -622,7 +506,7 @@ impl RandomnessManager { .set(elapsed as i64); } } - Err(fastcrypto::error::FastCryptoError::NotEnoughInputs) => (), // wait for more input + Err(FastCryptoError::NotEnoughInputs) => (), // wait for more input Err(e) => debug!("random beacon: error while merging DKG Messages: {e:?}"), } } @@ -670,7 +554,7 @@ impl RandomnessManager { std::iter::once((SINGLETON_KEY, output)), )?; } - Err(fastcrypto::error::FastCryptoError::NotEnoughInputs) => (), // wait for more input + Err(FastCryptoError::NotEnoughInputs) => (), // wait for more input Err(e) => error!("random beacon: error while processing DKG Confirmations: {e:?}"), } } @@ -693,12 +577,20 @@ impl RandomnessManager { Ok(()) } - /// Adds a received dkg::Message to the randomness DKG state machine. + /// Adds a received VersionedDkgMessage to the randomness DKG state machine. pub fn add_message( &mut self, authority: &AuthorityName, msg: VersionedDkgMessage, ) -> SuiResult { + // message was received from other validators, so we need to ensure it uses a supported + // version before we call other functions that assume the version is correct + let dkg_version = self.epoch_store()?.protocol_config().dkg_version(); + if !msg.is_valid_version(dkg_version) { + warn!("ignoring DKG Message from authority {authority:?} with unsupported version"); + return Ok(()); + } + if self.used_messages.initialized() || self.dkg_output.initialized() { // We've already sent a `Confirmation`, so we can't add any more messages. return Ok(()); @@ -719,12 +611,11 @@ impl RandomnessManager { } let party = self.party.clone(); - let dkg_version = self.epoch_store()?.protocol_config().dkg_version(); // TODO: Could save some CPU by not processing messages if we already have enough to merge. self.enqueued_messages.insert( msg.sender(), tokio::task::spawn_blocking(move || { - match VersionedProcessedMessage::process(dkg_version, party, msg) { + match VersionedProcessedMessage::process(party, msg) { Ok(processed) => Some(processed), Err(err) => { debug!("random beacon: error while processing DKG Message: {err:?}"); @@ -741,8 +632,18 @@ impl RandomnessManager { &mut self, batch: &mut DBBatch, authority: &AuthorityName, - conf: VersionedDkgConfimation, + conf: VersionedDkgConfirmation, ) -> SuiResult { + // confirmation was received from other validators, so we need to ensure it uses a supported + // version before we call other functions that assume the version is correct + let dkg_version = self.epoch_store()?.protocol_config().dkg_version(); + if !conf.is_valid_version(dkg_version) { + warn!( + "ignoring DKG Confirmation from authority {authority:?} with unsupported version" + ); + return Ok(()); + } + if self.dkg_output.initialized() { // Once we have completed DKG, no more `Confirmation`s are needed. return Ok(()); @@ -758,23 +659,10 @@ impl RandomnessManager { return Ok(()); } self.confirmations.insert(conf.sender(), conf.clone()); - let dkg_version = self.epoch_store()?.protocol_config().dkg_version(); - match dkg_version { - 0 => { - #[allow(deprecated)] - batch.insert_batch( - &self.tables()?.dkg_confirmations, - std::iter::once((conf.sender(), conf.unwrap_v0())), - )?; - } - 1 => { - batch.insert_batch( - &self.tables()?.dkg_confirmations_v2, - std::iter::once((conf.sender(), conf.expect_v1())), - )?; - } - _ => panic!("BUG: invalid DKG version {dkg_version}"), - } + batch.insert_batch( + &self.tables()?.dkg_confirmations_v2, + std::iter::once((conf.sender(), conf)), + )?; Ok(()) } @@ -947,11 +835,6 @@ mod tests { use sui_types::messages_consensus::ConsensusTransactionKind; use tokio::sync::mpsc; - #[tokio::test] - async fn test_dkg_v0() { - test_dkg(0).await; - } - #[tokio::test] async fn test_dkg_v1() { test_dkg(1).await; @@ -1025,16 +908,9 @@ mod tests { assert!(dkg_message.len() == 1); match dkg_message.remove(0).kind { ConsensusTransactionKind::RandomnessDkgMessage(_, bytes) => { - if version == 0 { - let msg: fastcrypto_tbls::dkg_v0::Message = - bcs::from_bytes(&bytes) - .expect("DKG message deserialization should not fail"); - dkg_messages.push(VersionedDkgMessage::V0(msg)); - } else { - let msg: VersionedDkgMessage = bcs::from_bytes(&bytes) - .expect("DKG message deserialization should not fail"); - dkg_messages.push(msg); - } + let msg: VersionedDkgMessage = bcs::from_bytes(&bytes) + .expect("DKG message deserialization should not fail"); + dkg_messages.push(msg); } _ => panic!("wrong type of message sent"), } @@ -1060,15 +936,9 @@ mod tests { assert!(dkg_confirmation.len() == 1); match dkg_confirmation.remove(0).kind { ConsensusTransactionKind::RandomnessDkgConfirmation(_, bytes) => { - if version == 0 { - let msg: fastcrypto_tbls::dkg::Confirmation = bcs::from_bytes(&bytes) - .expect("DKG confirmation deserialization should not fail"); - dkg_confirmations.push(VersionedDkgConfimation::V0(msg)); - } else { - let msg: VersionedDkgConfimation = bcs::from_bytes(&bytes) - .expect("DKG message deserialization should not fail"); - dkg_confirmations.push(msg); - } + let msg: VersionedDkgConfirmation = bcs::from_bytes(&bytes) + .expect("DKG message deserialization should not fail"); + dkg_confirmations.push(msg); } _ => panic!("wrong type of message sent"), } @@ -1093,11 +963,6 @@ mod tests { } } - #[tokio::test] - async fn test_dkg_expiration_v0() { - test_dkg_expiration(0).await; - } - #[tokio::test] async fn test_dkg_expiration_v1() { test_dkg_expiration(1).await; @@ -1171,16 +1036,9 @@ mod tests { assert!(dkg_message.len() == 1); match dkg_message.remove(0).kind { ConsensusTransactionKind::RandomnessDkgMessage(_, bytes) => { - if version == 0 { - let msg: fastcrypto_tbls::dkg_v0::Message = - bcs::from_bytes(&bytes) - .expect("DKG message deserialization should not fail"); - dkg_messages.push(VersionedDkgMessage::V0(msg)); - } else { - let msg: VersionedDkgMessage = bcs::from_bytes(&bytes) - .expect("DKG message deserialization should not fail"); - dkg_messages.push(msg); - } + let msg: VersionedDkgMessage = bcs::from_bytes(&bytes) + .expect("DKG message deserialization should not fail"); + dkg_messages.push(msg); } _ => panic!("wrong type of message sent"), } diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index aed1c00a616e1..0a630e7a87b44 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -1139,7 +1139,8 @@ pub struct ProtocolConfig { /// Minimum interval between consecutive rounds of generated randomness. random_beacon_min_round_interval_ms: Option, - /// Version of the random beacon DKG protocol, 0 when not set. + /// Version of the random beacon DKG protocol. + /// 0 was deprecated (and currently not supported), 1 is the default version. random_beacon_dkg_version: Option, /// The maximum serialised transaction size (in bytes) accepted by consensus. That should be bigger than the @@ -1352,7 +1353,8 @@ impl ProtocolConfig { } pub fn dkg_version(&self) -> u64 { - self.random_beacon_dkg_version.unwrap_or(0) + // Version 0 was deprecated and removed, the default is 1 if not set. + self.random_beacon_dkg_version.unwrap_or(1) } pub fn enable_bridge(&self) -> bool { diff --git a/crates/sui-types/src/messages_consensus.rs b/crates/sui-types/src/messages_consensus.rs index 79f3ededc305d..169b64f8ccdc2 100644 --- a/crates/sui-types/src/messages_consensus.rs +++ b/crates/sui-types/src/messages_consensus.rs @@ -14,7 +14,7 @@ use crate::transaction::CertifiedTransaction; use byteorder::{BigEndian, ReadBytesExt}; use fastcrypto::error::FastCryptoResult; use fastcrypto::groups::bls12381; -use fastcrypto_tbls::{dkg, dkg_v0, dkg_v1}; +use fastcrypto_tbls::{dkg, dkg_v1}; use fastcrypto_zkp::bn254::zk_login::{JwkId, JWK}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -288,26 +288,20 @@ impl ConsensusTransactionKind { #[derive(Clone, PartialEq, Eq, Serialize, Deserialize)] #[allow(clippy::large_enum_variant)] pub enum VersionedDkgMessage { - V0(dkg_v0::Message), + V0(), // deprecated V1(dkg_v1::Message), } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub enum VersionedDkgConfimation { - V0(dkg::Confirmation), +pub enum VersionedDkgConfirmation { + V0(), // deprecated V1(dkg::Confirmation), } impl Debug for VersionedDkgMessage { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { - VersionedDkgMessage::V0(msg) => write!( - f, - "DKG V0 Message with sender={}, vss_pk.degree={}, encrypted_shares.len()={}", - msg.sender, - msg.vss_pk.degree(), - msg.encrypted_shares.len(), - ), + VersionedDkgMessage::V0() => panic!("BUG: invalid VersionedDkgMessage version"), VersionedDkgMessage::V1(msg) => write!( f, "DKG V1 Message with sender={}, vss_pk.degree={}, encrypted_shares.len()={}", @@ -322,7 +316,7 @@ impl Debug for VersionedDkgMessage { impl VersionedDkgMessage { pub fn sender(&self) -> u16 { match self { - VersionedDkgMessage::V0(msg) => msg.sender, + VersionedDkgMessage::V0() => panic!("BUG: invalid VersionedDkgMessage version"), VersionedDkgMessage::V1(msg) => msg.sender, } } @@ -331,24 +325,9 @@ impl VersionedDkgMessage { dkg_version: u64, party: Arc>, ) -> FastCryptoResult { - match dkg_version { - 0 => { - let msg = party.create_message(&mut rand::thread_rng())?; - Ok(VersionedDkgMessage::V0(msg)) - } - 1 => { - let msg = party.create_message_v1(&mut rand::thread_rng())?; - Ok(VersionedDkgMessage::V1(msg)) - } - _ => panic!("BUG: invalid DKG version"), - } - } - - pub fn unwrap_v0(self) -> dkg_v0::Message { - match self { - VersionedDkgMessage::V0(msg) => msg, - _ => panic!("BUG: expected V0 message"), - } + assert_eq!(dkg_version, 1, "BUG: invalid DKG version"); + let msg = party.create_message_v1(&mut rand::thread_rng())?; + Ok(VersionedDkgMessage::V1(msg)) } pub fn unwrap_v1(self) -> dkg_v1::Message { @@ -357,42 +336,40 @@ impl VersionedDkgMessage { _ => panic!("BUG: expected V1 message"), } } + + pub fn is_valid_version(&self, dkg_version: u64) -> bool { + matches!((self, dkg_version), (VersionedDkgMessage::V1(_), 1)) + } } -impl VersionedDkgConfimation { +impl VersionedDkgConfirmation { pub fn sender(&self) -> u16 { match self { - VersionedDkgConfimation::V0(msg) => msg.sender, - VersionedDkgConfimation::V1(msg) => msg.sender, + VersionedDkgConfirmation::V0() => { + panic!("BUG: invalid VersionedDkgConfimation version") + } + VersionedDkgConfirmation::V1(msg) => msg.sender, } } pub fn num_of_complaints(&self) -> usize { match self { - VersionedDkgConfimation::V0(msg) => msg.complaints.len(), - VersionedDkgConfimation::V1(msg) => msg.complaints.len(), - } - } - - pub fn unwrap_v0(&self) -> &dkg::Confirmation { - match self { - VersionedDkgConfimation::V0(msg) => msg, - _ => panic!("BUG: expected V0 confirmation"), + VersionedDkgConfirmation::V0() => { + panic!("BUG: invalid VersionedDkgConfimation version") + } + VersionedDkgConfirmation::V1(msg) => msg.complaints.len(), } } pub fn unwrap_v1(&self) -> &dkg::Confirmation { match self { - VersionedDkgConfimation::V1(msg) => msg, + VersionedDkgConfirmation::V1(msg) => msg, _ => panic!("BUG: expected V1 confirmation"), } } - pub fn expect_v1(self) -> Self { - match self { - VersionedDkgConfimation::V1(_) => self, - _ => panic!("BUG: expected V1 confirmation"), - } + pub fn is_valid_version(&self, dkg_version: u64) -> bool { + matches!((self, dkg_version), (VersionedDkgConfirmation::V1(_), 1)) } } @@ -483,13 +460,8 @@ impl ConsensusTransaction { authority: AuthorityName, versioned_message: &VersionedDkgMessage, ) -> Self { - let message = match versioned_message { - VersionedDkgMessage::V0(msg) => { - // Old version does not use the enum, so we need to serialize it separately. - bcs::to_bytes(msg).expect("message serialization should not fail") - } - _ => bcs::to_bytes(versioned_message).expect("message serialization should not fail"), - }; + let message = + bcs::to_bytes(versioned_message).expect("message serialization should not fail"); let mut hasher = DefaultHasher::new(); message.hash(&mut hasher); let tracking_id = hasher.finish().to_le_bytes(); @@ -500,17 +472,10 @@ impl ConsensusTransaction { } pub fn new_randomness_dkg_confirmation( authority: AuthorityName, - versioned_confirmation: &VersionedDkgConfimation, + versioned_confirmation: &VersionedDkgConfirmation, ) -> Self { - let confirmation = match versioned_confirmation { - VersionedDkgConfimation::V0(msg) => { - // Old version does not use the enum, so we need to serialize it separately. - bcs::to_bytes(msg).expect("message serialization should not fail") - } - _ => bcs::to_bytes(versioned_confirmation) - .expect("message serialization should not fail"), - }; - + let confirmation = + bcs::to_bytes(versioned_confirmation).expect("message serialization should not fail"); let mut hasher = DefaultHasher::new(); confirmation.hash(&mut hasher); let tracking_id = hasher.finish().to_le_bytes(); From 031f6b8a02bd776b0f9f414a4f5526ee71190fe0 Mon Sep 17 00:00:00 2001 From: Eugene Boguslavsky Date: Fri, 19 Jul 2024 11:00:08 -0700 Subject: [PATCH 089/163] Update suiop-cli-binaries workflow (#18732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Update dispatch event-type to be more specific. See https://github.com/MystenLabs/sui-operations/pull/3967 ## Test plan 👀 --- .github/workflows/build-suiop-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-suiop-cli.yml b/.github/workflows/build-suiop-cli.yml index 06fb1b36b1915..2a4c2bceadf9d 100644 --- a/.github/workflows/build-suiop-cli.yml +++ b/.github/workflows/build-suiop-cli.yml @@ -24,5 +24,5 @@ jobs: # we could generate a different secret for this # for separation of concerns: token: ${{ secrets.CHANGESETS_DEPLOY_DISPATCH }} - event-type: build-binaries + event-type: build-suiop-cli-binaries client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From cd69f3cd643530d065a521d6dd9de5c7ffd4d4f6 Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Fri, 19 Jul 2024 11:06:11 -0700 Subject: [PATCH 090/163] [move][move-2024] Revise some visibility errors, add macro information (#18735) ## Description This adds information about macro expansion to visibility errors, when appropriate. It also slightly reforms how visibility errors for data structures are reported to unify reporting them and function visibility errors. ## Test plan Updated tests, plus some new ones. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../crates/move-compiler/src/typing/core.rs | 64 +++++++++++++++-- .../move-compiler/src/typing/translate.rs | 68 +++++++++---------- .../move_2024/matching/enum_visibility.exp | 6 +- .../move_2024/parser/invalid_macro_locs.exp | 45 ++++++++++-- .../macro_visibility_higher_order_error.exp | 30 ++++++++ .../macro_visibility_higher_order_error.move | 24 +++++++ .../macros_visibility_not_checked_called.exp | 62 +++++++++++++++-- .../typing/native_structs_pack_unpack.exp | 12 ++-- .../typing/pack_private_with_field.exp | 6 +- .../move_check/typing/pack_unpack_private.exp | 12 ++-- .../tests/sui_mode/id_leak/private_pack.exp | 6 +- 11 files changed, 266 insertions(+), 69 deletions(-) create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.move diff --git a/external-crates/move/crates/move-compiler/src/typing/core.rs b/external-crates/move/crates/move-compiler/src/typing/core.rs index 9ee7186f40f1d..bb08249b9bd1e 100644 --- a/external-crates/move/crates/move-compiler/src/typing/core.rs +++ b/external-crates/move/crates/move-compiler/src/typing/core.rs @@ -24,7 +24,7 @@ use crate::{ known_attributes::TestingAttribute, matching::{new_match_var_name, MatchContext}, program_info::*, - string_utils::debug_print, + string_utils::{debug_print, format_oxford_list}, unique_map::UniqueMap, *, }, @@ -477,6 +477,19 @@ impl<'env> Context<'env> { } } + pub fn expanding_macros_names(&self) -> Option { + if self.macro_expansion.is_empty() { + return None; + } + let names = self + .macro_expansion + .iter() + .filter_map(|exp| exp.maybe_name()) + .map(|(m, f)| format!("{m}::{f}")) + .collect::>(); + Some(format_oxford_list!("and", "'{}'", names)) + } + pub fn current_call_color(&self) -> Color { self.use_funs.last().unwrap().color.unwrap() } @@ -865,6 +878,15 @@ impl MatchContext for Context<'_> { } } +impl MacroExpansion { + fn maybe_name(&self) -> Option<(ModuleIdent, FunctionName)> { + match self { + MacroExpansion::Call(call) => Some((call.module, call.function)), + MacroExpansion::Argument { .. } => None, + } + } +} + //************************************************************************************************** // Subst //************************************************************************************************** @@ -1576,7 +1598,7 @@ fn check_function_visibility( Visibility::PUBLIC, friend_or_package, ); - report_visibility_error( + report_visibility_error_( context, public_for_testing, ( @@ -1618,7 +1640,7 @@ fn check_function_visibility( .map(|pkg_name| format!("{}", pkg_name)) .unwrap_or("".to_string()) ); - report_visibility_error( + report_visibility_error_( context, public_for_testing, (usage_loc, msg), @@ -1633,7 +1655,7 @@ fn check_function_visibility( ); let internal_msg = format!("This function can only be called from a 'friend' of module '{m}'",); - report_visibility_error( + report_visibility_error_( context, public_for_testing, (usage_loc, msg), @@ -1670,7 +1692,15 @@ pub fn public_testing_visibility( callee_entry.map(PublicForTesting::Entry) } -fn report_visibility_error( +pub fn report_visibility_error( + context: &mut Context, + call_msg: (Loc, impl ToString), + defn_msg: (Loc, impl ToString), +) { + report_visibility_error_(context, None, call_msg, defn_msg) +} + +fn report_visibility_error_( context: &mut Context, public_for_testing: Option, (call_loc, call_msg): (Loc, impl ToString), @@ -1698,6 +1728,30 @@ fn report_visibility_error( diag.add_secondary_label((test_loc, test_msg)) } } + if let Some(names) = context.expanding_macros_names() { + let macro_s = if context.macro_expansion.len() > 1 { + "macros" + } else { + "macro" + }; + match context.macro_expansion.first() { + Some(MacroExpansion::Call(call)) => { + diag.add_secondary_label((call.invocation, "While expanding this macro")); + } + _ => { + context.env.add_diag(ice!(( + call_loc, + "Error when dealing with macro visibilities" + ))); + } + }; + diag.add_note(format!( + "This visibility error occurs in a macro body while expanding the {macro_s} {names}" + )); + diag.add_note( + "Visibility inside of expanded macros is resolved in the scope of the caller.", + ); + } context.env.add_diag(diag); } diff --git a/external-crates/move/crates/move-compiler/src/typing/translate.rs b/external-crates/move/crates/move-compiler/src/typing/translate.rs index aaa88ce26e161..80b303e3a5c06 100644 --- a/external-crates/move/crates/move-compiler/src/typing/translate.rs +++ b/external-crates/move/crates/move-compiler/src/typing/translate.rs @@ -32,7 +32,8 @@ use crate::{ typing::{ ast::{self as T}, core::{ - self, public_testing_visibility, Context, PublicForTesting, ResolvedFunctionType, Subst, + self, public_testing_visibility, report_visibility_error, Context, PublicForTesting, + ResolvedFunctionType, Subst, }, dependency_ordering, expand, infinite_instantiations, macro_expand, match_analysis, recursive_datatypes, @@ -1798,21 +1799,21 @@ fn exp(context: &mut Context, ne: Box) -> Box { subtype( context, arg.exp.loc, - || format!("Invalid argument for field '{}' for '{}::{}'", f, &m, &n), + || format!("Invalid argument for field '{f}' for '{m}::{n}'"), arg.ty.clone(), fty.clone(), ); (idx, (fty, *arg)) }); if !context.is_current_module(&m) { - let msg = format!( - "Invalid instantiation of '{}::{}'.\nAll structs can only be constructed in \ - the module in which they are declared", - &m, &n, + report_visibility_error( + context, + (eloc, format!("Struct '{m}::{n}' can only be instantiated within its defining module '{m}'")), + ( + context.struct_declared_loc(&m, &n), + format!("Struct defined in module '{m}'") + ) ); - context - .env - .add_diag(diag!(TypeSafety::Visibility, (eloc, msg))); } (bt, TE::Pack(m, n, targs, tfields)) } @@ -1835,26 +1836,21 @@ fn exp(context: &mut Context, ne: Box) -> Box { subtype( context, arg.exp.loc, - || { - format!( - "Invalid argument for field '{}' for '{}::{}::{}'", - f, &m, &e, &v - ) - }, + || format!("Invalid argument for field '{f}' for '{m}::{e}::{v}'"), arg.ty.clone(), fty.clone(), ); (idx, (fty, *arg)) }); if !context.is_current_module(&m) { - let msg = format!( - "Invalid instantiation of '{}::{}::{}'.\nAll enum variants can only be \ - constructed in the module in which they are declared", - &m, &e, &v + report_visibility_error( + context, + (eloc, format!("Enum variant '{m}::{e}::{v}' can only be instantiated within its defining module '{m}'")), + ( + context.enum_declared_loc(&m, &e), + format!("Enum defined in module '{m}'") + ) ); - context - .env - .add_diag(diag!(TypeSafety::Visibility, (eloc, msg))); } (bt, TE::PackVariant(m, e, v, targs, tfields)) } @@ -2262,14 +2258,14 @@ fn match_pattern_( (idx, (fty, tpat)) }); if !context.is_current_module(&m) { - let msg = format!( - "Invalid pattern for '{}::{}::{}'.\n All enums can only be \ - matched in the module in which they are declared", - &m, &enum_, &variant + report_visibility_error( + context, + (loc, format!("Enum variant '{m}::{enum_}::{variant}' can only be matched within its defining module '{m}'")), + ( + context.enum_declared_loc(&m, &enum_), + format!("Enum defined in module '{m}'") + ) ); - context - .env - .add_diag(diag!(TypeSafety::Visibility, (loc, msg))); } let bt = rtype!(bt); let pat_ = if field_error { @@ -2739,14 +2735,14 @@ fn lvalue( (idx, (fty, tl)) }); if !context.is_current_module(&m) { - let msg = format!( - "Invalid deconstruction {} of '{}::{}'.\n All structs can only be \ - deconstructed in the module in which they are declared", - verb, &m, &n, + report_visibility_error( + context, + (loc, format!("Struct '{m}::{n}' can only be used in deconstruction {verb} within its defining module '{m}'")), + ( + context.struct_declared_loc(&m, &n), + format!("Struct defined in module '{m}'") + ), ); - context - .env - .add_diag(diag!(TypeSafety::Visibility, (loc, msg))); } match ref_mut { None => TL::Unpack(m, n, targs, tfields), diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.exp index a26279eebf48b..59775a9e6a14d 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.exp @@ -1,7 +1,9 @@ error[E04001]: restricted visibility ┌─ tests/move_2024/matching/enum_visibility.move:15:13 │ + 3 │ public enum E { + │ - Enum defined in module '0x42::m' + · 15 │ m::E::A(t) => t, - │ ^^^^^^^^^^ Invalid pattern for '0x42::m::E::A'. - All enums can only be matched in the module in which they are declared + │ ^^^^^^^^^^ Enum variant '0x42::m::E::A' can only be matched within its defining module '0x42::m' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.exp index f99207139b65d..60ffee9f5a8c1 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.exp @@ -1,9 +1,32 @@ error[E04001]: restricted visibility - ┌─ tests/move_2024/parser/invalid_macro_locs.move:6:9 - │ -6 │ S{ u: $u } - │ ^^^^^^^^^^ Invalid instantiation of 'a::m::S'. -All structs can only be constructed in the module in which they are declared + ┌─ tests/move_2024/parser/invalid_macro_locs.move:6:9 + │ + 3 │ public struct S { u: T } + │ - Struct defined in module 'a::m' + · + 6 │ S{ u: $u } + │ ^^^^^^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +25 │ a::m!::make_s!(0u64) + │ ------------------------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::make_s' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/parser/invalid_macro_locs.move:6:9 + │ + 3 │ public struct S { u: T } + │ - Struct defined in module 'a::m' + · + 6 │ S{ u: $u } + │ ^^^^^^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +29 │ a!::m!::make_s!(0u64) + │ -------------------------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::make_s' + = Visibility inside of expanded macros is resolved in the scope of the caller. error[E04029]: invalid function call ┌─ tests/move_2024/parser/invalid_macro_locs.move:13:9 @@ -91,9 +114,17 @@ error[E01016]: invalid name error[E04001]: restricted visibility ┌─ tests/move_2024/parser/invalid_macro_locs.move:39:9 │ +36 │ public struct S { u: T } + │ - Struct defined in module '0x42::m' + · 39 │ S{ u: $u } - │ ^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. -All structs can only be constructed in the module in which they are declared + │ ^^^^^^^^^^ Struct '0x42::m::S' can only be instantiated within its defining module '0x42::m' + · +58 │ 0x42::m!::make_s!(0u64) + │ ---------------------------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro '0x42::m::make_s' + = Visibility inside of expanded macros is resolved in the scope of the caller. error[E01002]: unexpected token ┌─ tests/move_2024/parser/invalid_macro_locs.move:46:13 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.exp new file mode 100644 index 0000000000000..379b9a436be1d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.exp @@ -0,0 +1,30 @@ +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_higher_order_error.move:12:21 + │ + 8 │ public struct S { } + │ - Struct defined in module 'a::m' + · +12 │ let s = S { }; + │ ^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +22 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macros 'a::m::test' and 'a::l::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_higher_order_error.move:13:17 + │ + 8 │ public struct S { } + │ - Struct defined in module 'a::m' + · +13 │ let S { } = s; + │ ^^^^^ Struct 'a::m::S' can only be used in deconstruction binding within its defining module 'a::m' + · +22 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macros 'a::m::test' and 'a::l::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.move new file mode 100644 index 0000000000000..ca04dc84f47a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.move @@ -0,0 +1,24 @@ +module a::l { + public macro fun test($f: ||) { + $f() + } +} + +module a::m { + public struct S { } + + public macro fun test() { + a::l::test!(|| { + let s = S { }; + let S { } = s; + }) + } +} + +module a::n { + use a::m::test; + + public fun t() { + test!(); + } +} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.exp index 5846965c2a4eb..dda9440b645b8 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.exp @@ -1,11 +1,32 @@ error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:9:9 - │ -4 │ public(package) fun package() {} - │ --------------- A 'public(package)' function can only be called from the same address and package as module 'a::m' in package ''. This call is from address 'b' in package '' - · -9 │ package(); - │ ^^^^^^^^^ Invalid call to 'public(package)' visible function 'a::m::package' + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:9:9 + │ + 4 │ public(package) fun package() {} + │ --------------- A 'public(package)' function can only be called from the same address and package as module 'a::m' in package ''. This call is from address 'b' in package '' + · + 9 │ package(); + │ ^^^^^^^^^ Invalid call to 'public(package)' visible function 'a::m::package' + · +29 │ a::m::t0!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:10:9 + │ + 3 │ fun private() {} + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +10 │ private(); + │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +21 │ a::m::t0!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' + = Visibility inside of expanded macros is resolved in the scope of the caller. error[E04001]: restricted visibility ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:10:9 @@ -15,6 +36,27 @@ error[E04001]: restricted visibility · 10 │ private(); │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +29 │ a::m::t0!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:14:9 + │ + 3 │ fun private() {} + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +14 │ private(); + │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +22 │ a::m::t1!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t1' + = Visibility inside of expanded macros is resolved in the scope of the caller. error[E04001]: restricted visibility ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:14:9 @@ -24,6 +66,12 @@ error[E04001]: restricted visibility · 14 │ private(); │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +30 │ a::m::t1!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t1' + = Visibility inside of expanded macros is resolved in the scope of the caller. error[E04001]: restricted visibility ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:30:9 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.exp index 655173c91ec5f..f2f98b82e369d 100644 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.exp +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.exp @@ -10,9 +10,11 @@ error[E04015]: invalid use of native item error[E04001]: restricted visibility ┌─ tests/move_check/typing/native_structs_pack_unpack.move:9:9 │ +3 │ native struct T; + │ - Struct defined in module '0x42::C' + · 9 │ C::T {} - │ ^^^^^^^ Invalid instantiation of '0x42::C::T'. -All structs can only be constructed in the module in which they are declared + │ ^^^^^^^ Struct '0x42::C::T' can only be instantiated within its defining module '0x42::C' error[E04015]: invalid use of native item ┌─ tests/move_check/typing/native_structs_pack_unpack.move:12:13 @@ -26,9 +28,11 @@ error[E04015]: invalid use of native item error[E04001]: restricted visibility ┌─ tests/move_check/typing/native_structs_pack_unpack.move:12:13 │ + 3 │ native struct T; + │ - Struct defined in module '0x42::C' + · 12 │ let C::T {} = c; - │ ^^^^^^^ Invalid deconstruction binding of '0x42::C::T'. - All structs can only be deconstructed in the module in which they are declared + │ ^^^^^^^ Struct '0x42::C::T' can only be used in deconstruction binding within its defining module '0x42::C' error[E04001]: restricted visibility ┌─ tests/move_check/typing/native_structs_pack_unpack.move:15:18 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.exp index abfe6082a2900..f77919b74d63f 100644 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.exp +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.exp @@ -1,6 +1,9 @@ error[E04001]: restricted visibility ┌─ tests/move_check/typing/pack_private_with_field.move:19:11 │ + 3 │ struct S { + │ - Struct defined in module '0x42::m' + · 19 │ let s = S { │ ╭───────────^ 20 │ │ f1: 0, @@ -8,6 +11,5 @@ error[E04001]: restricted visibility 22 │ │ f2: 0, 23 │ │ f3: 0, 24 │ │ }; - │ ╰───^ Invalid instantiation of '0x42::m::S'. -All structs can only be constructed in the module in which they are declared + │ ╰───^ Struct '0x42::m::S' can only be instantiated within its defining module '0x42::m' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.exp index 5b501d41b78c7..5aa2d3fbf8ada 100644 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.exp +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.exp @@ -1,14 +1,18 @@ error[E04001]: restricted visibility ┌─ tests/move_check/typing/pack_unpack_private.move:8:9 │ +2 │ struct T {} + │ - Struct defined in module '0x43::C' + · 8 │ C::T {} - │ ^^^^^^^ Invalid instantiation of '0x43::C::T'. -All structs can only be constructed in the module in which they are declared + │ ^^^^^^^ Struct '0x43::C::T' can only be instantiated within its defining module '0x43::C' error[E04001]: restricted visibility ┌─ tests/move_check/typing/pack_unpack_private.move:11:13 │ + 2 │ struct T {} + │ - Struct defined in module '0x43::C' + · 11 │ let C::T {} = c; - │ ^^^^^^^ Invalid deconstruction binding of '0x43::C::T'. - All structs can only be deconstructed in the module in which they are declared + │ ^^^^^^^ Struct '0x43::C::T' can only be used in deconstruction binding within its defining module '0x43::C' diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.exp index 510e7acaf3af1..9736ca4c7aad2 100644 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.exp +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.exp @@ -1,7 +1,9 @@ error[E04001]: restricted visibility ┌─ tests/sui_mode/id_leak/private_pack.move:19:9 │ + 5 │ struct A has key { + │ - Struct defined in module 'a::a' + · 19 │ A { id } - │ ^^^^^^^^ Invalid instantiation of 'a::a::A'. -All structs can only be constructed in the module in which they are declared + │ ^^^^^^^^ Struct 'a::a::A' can only be instantiated within its defining module 'a::a' From d0e250aa5eb8b191fcb8004600607a0c5e3c2cae Mon Sep 17 00:00:00 2001 From: Xun Li Date: Fri, 19 Jul 2024 11:11:49 -0700 Subject: [PATCH 091/163] Increase timeout (#18736) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../tests/validator_tx_finalizer_e2e_tests.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs b/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs index 127c17402ec1f..b1e934520df0e 100644 --- a/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs +++ b/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs @@ -22,15 +22,15 @@ async fn test_validator_tx_finalizer_fastpath_tx() { .build(); let tx = cluster.sign_transaction(&tx_data); let tx_digest = *tx.digest(); + // Only broadcast to get a certificate, but do not execute it. cluster .authority_aggregator() - .authority_clients - .values() - .next() - .unwrap() - .handle_transaction(tx, None) + .process_transaction(tx, None) .await .unwrap(); + // Validators wait for 60s before the first one wakes up. Since 2f+1 signed the tx, i.e. + // 5 validators have signed the tx, in the worst case where the other 2 wake up first, + // it would take 60 + 3 * 10 = 90s for a validator to finalize this. tokio::time::sleep(Duration::from_secs(120)).await; for node in cluster.all_node_handles() { node.with(|n| assert!(n.state().is_tx_already_executed(&tx_digest).unwrap())); @@ -53,13 +53,10 @@ async fn test_validator_tx_finalizer_consensus_tx() { .build(); let tx = cluster.sign_transaction(&tx_data); let tx_digest = *tx.digest(); + // Only broadcast to get a certificate, but do not execute it. cluster .authority_aggregator() - .authority_clients - .values() - .next() - .unwrap() - .handle_transaction(tx, None) + .process_transaction(tx, None) .await .unwrap(); tokio::time::sleep(Duration::from_secs(120)).await; From 77bae85153529082e6c3e73b8dd55f3f5daa8bea Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Fri, 19 Jul 2024 15:28:31 -0400 Subject: [PATCH 092/163] Ignore randomness RPCs from byzantine peers (#18690) --- crates/sui-config/src/p2p.rs | 13 +++ crates/sui-network/src/randomness/builder.rs | 7 ++ crates/sui-network/src/randomness/metrics.rs | 13 +++ crates/sui-network/src/randomness/mod.rs | 70 ++++++++++-- crates/sui-network/src/randomness/tests.rs | 114 +++++++++++++++++++ 5 files changed, 208 insertions(+), 9 deletions(-) diff --git a/crates/sui-config/src/p2p.rs b/crates/sui-config/src/p2p.rs index 4e55f07d0a7f6..4be9e93ddde90 100644 --- a/crates/sui-config/src/p2p.rs +++ b/crates/sui-config/src/p2p.rs @@ -380,6 +380,12 @@ pub struct RandomnessConfig { /// If unspecified, this will default to 20. #[serde(skip_serializing_if = "Option::is_none")] pub send_partial_signatures_inflight_limit: Option, + + /// Maximum proportion of total peer weight to ignore in case of byzantine behavior. + /// + /// If unspecified, this will default to 0.2. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_ignored_peer_weight_factor: Option, } impl RandomnessConfig { @@ -417,4 +423,11 @@ impl RandomnessConfig { self.send_partial_signatures_inflight_limit .unwrap_or(SEND_PARTIAL_SIGNATURES_INFLIGHT_LIMIT) } + + pub fn max_ignored_peer_weight_factor(&self) -> f64 { + const MAX_IGNORED_PEER_WEIGHT_FACTOR: f64 = 0.2; + + self.max_ignored_peer_weight_factor + .unwrap_or(MAX_IGNORED_PEER_WEIGHT_FACTOR) + } } diff --git a/crates/sui-network/src/randomness/builder.rs b/crates/sui-network/src/randomness/builder.rs index 556b69fdb0a20..0c2c5a219df90 100644 --- a/crates/sui-network/src/randomness/builder.rs +++ b/crates/sui-network/src/randomness/builder.rs @@ -57,6 +57,7 @@ impl Builder { let config = config.unwrap_or_default(); let metrics = metrics.unwrap_or_else(Metrics::disabled); let (sender, mailbox) = mpsc::channel(config.mailbox_capacity()); + let mailbox_sender = sender.downgrade(); let handle = Handle { sender: sender.clone(), }; @@ -81,6 +82,7 @@ impl Builder { config, handle, mailbox, + mailbox_sender, allowed_peers, metrics, randomness_tx, @@ -96,6 +98,7 @@ pub struct UnstartedRandomness { pub(super) config: RandomnessConfig, pub(super) handle: Handle, pub(super) mailbox: mpsc::Receiver, + pub(super) mailbox_sender: mpsc::WeakSender, pub(super) allowed_peers: AllowedPeersUpdatable, pub(super) metrics: Metrics, pub(super) randomness_tx: mpsc::Sender<(EpochId, RandomnessRound, Vec)>, @@ -108,6 +111,7 @@ impl UnstartedRandomness { config, handle, mailbox, + mailbox_sender, allowed_peers, metrics, randomness_tx, @@ -117,14 +121,17 @@ impl UnstartedRandomness { name, config, mailbox, + mailbox_sender, network, allowed_peers, + allowed_peers_set: HashSet::new(), metrics, randomness_tx, epoch: 0, authority_info: Arc::new(HashMap::new()), peer_share_ids: None, + blocked_share_id_count: 0, dkg_output: None, aggregation_threshold: 0, highest_requested_round: BTreeMap::new(), diff --git a/crates/sui-network/src/randomness/metrics.rs b/crates/sui-network/src/randomness/metrics.rs index c6d4549be9951..1e762f5d78511 100644 --- a/crates/sui-network/src/randomness/metrics.rs +++ b/crates/sui-network/src/randomness/metrics.rs @@ -31,6 +31,7 @@ impl Metrics { if let Some(inner) = &self.0 { inner.current_epoch.set(epoch as i64); inner.highest_round_generated.set(-1); + inner.num_ignored_byzantine_peers.set(0); } } @@ -61,6 +62,12 @@ impl Metrics { .as_ref() .map(|inner| &inner.round_observation_latency) } + + pub fn inc_num_ignored_byzantine_peers(&self) { + if let Some(inner) = &self.0 { + inner.num_ignored_byzantine_peers.inc(); + } + } } struct Inner { @@ -69,6 +76,7 @@ struct Inner { num_rounds_pending: IntGauge, round_generation_latency: Histogram, round_observation_latency: Histogram, + num_ignored_byzantine_peers: IntGauge, } const LATENCY_SEC_BUCKETS: &[f64] = &[ @@ -107,6 +115,11 @@ impl Inner { LATENCY_SEC_BUCKETS.to_vec(), registry ).unwrap(), + num_ignored_byzantine_peers: register_int_gauge_with_registry!( + "randomness_num_ignored_byzantine_peers", + "The number of byzantine peers that have been ignored by the randomness newtork loop in the current epoch", + registry + ).unwrap(), } .pipe(Arc::new) } diff --git a/crates/sui-network/src/randomness/mod.rs b/crates/sui-network/src/randomness/mod.rs index e4f507e3ef4fc..cb83b4be80912 100644 --- a/crates/sui-network/src/randomness/mod.rs +++ b/crates/sui-network/src/randomness/mod.rs @@ -15,7 +15,7 @@ use mysten_metrics::spawn_monitored_task; use mysten_network::anemo_ext::NetworkExt; use serde::{Deserialize, Serialize}; use std::{ - collections::{btree_map::BTreeMap, HashMap}, + collections::{btree_map::BTreeMap, HashMap, HashSet}, ops::Bound, sync::Arc, time::{self, Duration}, @@ -191,6 +191,7 @@ enum RandomnessMessage { Vec>, Option, ), + MaybeIgnoreByzantinePeer(EpochId, PeerId), AdminGetPartialSignatures(RandomnessRound, oneshot::Sender>), AdminInjectPartialSignatures( AuthorityName, @@ -209,14 +210,17 @@ struct RandomnessEventLoop { name: AuthorityName, config: RandomnessConfig, mailbox: mpsc::Receiver, + mailbox_sender: mpsc::WeakSender, network: anemo::Network, allowed_peers: AllowedPeersUpdatable, + allowed_peers_set: HashSet, metrics: Metrics, randomness_tx: mpsc::Sender<(EpochId, RandomnessRound, Vec)>, epoch: EpochId, authority_info: Arc>, peer_share_ids: Option>>, + blocked_share_id_count: usize, dkg_output: Option>, aggregation_threshold: u16, highest_requested_round: BTreeMap, @@ -285,6 +289,9 @@ impl RandomnessEventLoop { self.receive_partial_signatures(peer_id, epoch, round, partial_sigs) } } + RandomnessMessage::MaybeIgnoreByzantinePeer(epoch, peer_id) => { + self.maybe_ignore_byzantine_peer(epoch, peer_id) + } RandomnessMessage::AdminGetPartialSignatures(round, tx) => { self.admin_get_partial_signatures(round, tx) } @@ -330,12 +337,12 @@ impl RandomnessEventLoop { Ok(acc) }, )?); - self.allowed_peers.update(Arc::new( - authority_info - .values() - .map(|(peer_id, _)| *peer_id) - .collect(), - )); + self.allowed_peers_set = authority_info + .values() + .map(|(peer_id, _)| *peer_id) + .collect(); + self.allowed_peers + .update(Arc::new(self.allowed_peers_set.clone())); self.epoch = new_epoch; self.authority_info = Arc::new(authority_info); self.dkg_output = Some(dkg_output); @@ -641,7 +648,13 @@ impl RandomnessEventLoop { warn!( "received invalid partial signatures from possibly-Byzantine peer {peer_id}" ); - // TODO: Ignore future messages from peers sending bad signatures. + if let Some(sender) = self.mailbox_sender.upgrade() { + sender.try_send(RandomnessMessage::MaybeIgnoreByzantinePeer( + epoch, + peer_id, + )) + .expect("RandomnessEventLoop mailbox should not overflow or be closed"); + } return false; } true @@ -713,11 +726,15 @@ impl RandomnessEventLoop { return; } - // TODO: ignore future messages from peers sending bad signatures. if let Err(e) = ThresholdBls12381MinSig::verify(vss_pk.c0(), &round.signature_message(), &sig) { info!("received invalid full signature from peer {peer_id}: {e:?}"); + if let Some(sender) = self.mailbox_sender.upgrade() { + sender + .try_send(RandomnessMessage::MaybeIgnoreByzantinePeer(epoch, peer_id)) + .expect("RandomnessEventLoop mailbox should not overflow or be closed"); + } return; } @@ -756,6 +773,41 @@ impl RandomnessEventLoop { .expect("RandomnessRoundReceiver mailbox should not overflow or be closed"); } + fn maybe_ignore_byzantine_peer(&mut self, epoch: EpochId, peer_id: PeerId) { + if epoch != self.epoch { + return; // make sure we're still on the same epoch + } + let Some(dkg_output) = &self.dkg_output else { + return; // can't ignore a peer if we haven't finished DKG + }; + if !self.allowed_peers_set.contains(&peer_id) { + return; // peer is already disallowed + } + let Some(peer_share_ids) = &self.peer_share_ids else { + return; // can't ignore a peer if we haven't finished DKG + }; + let Some(peer_shares) = peer_share_ids.get(&peer_id) else { + warn!("can't ignore unknown byzantine peer {peer_id:?}"); + return; + }; + let max_ignored_shares = (self.config.max_ignored_peer_weight_factor() + * (dkg_output.nodes.total_weight() as f64)) as usize; + if self.blocked_share_id_count + peer_shares.len() > max_ignored_shares { + warn!("ignoring byzantine peer {peer_id:?} with {} shares would exceed max ignored peer weight {max_ignored_shares}", peer_shares.len()); + return; + } + + warn!( + "ignoring byzantine peer {peer_id:?} with {} shares", + peer_shares.len() + ); + self.blocked_share_id_count += peer_shares.len(); + self.allowed_peers_set.remove(&peer_id); + self.allowed_peers + .update(Arc::new(self.allowed_peers_set.clone())); + self.metrics.inc_num_ignored_byzantine_peers(); + } + fn maybe_start_pending_tasks(&mut self) { let dkg_output = if let Some(dkg_output) = &self.dkg_output { dkg_output diff --git a/crates/sui-network/src/randomness/tests.rs b/crates/sui-network/src/randomness/tests.rs index 75bfc120a32f1..a98290061094e 100644 --- a/crates/sui-network/src/randomness/tests.rs +++ b/crates/sui-network/src/randomness/tests.rs @@ -366,6 +366,120 @@ async fn test_restart_recovery() { } } +#[tokio::test] +async fn test_byzantine_peer_handling() { + telemetry_subscribers::init_for_testing(); + let committee_fixture = CommitteeFixture::generate(rand::rngs::OsRng, 0, 4); + let committee = committee_fixture.committee(); + + let mut randomness_rxs = Vec::new(); + let mut networks: Vec = Vec::new(); + let mut nodes = Vec::new(); + let mut handles = Vec::new(); + let mut authority_info = HashMap::new(); + + for (authority, stake) in committee.members() { + let config = RandomnessConfig { + max_ignored_peer_weight_factor: Some(0.3), + ..Default::default() + }; + + let (tx, rx) = mpsc::channel(3); + randomness_rxs.push(rx); + let (unstarted, router) = Builder::new(*authority, tx).config(config).build(); + + let network = utils::build_network(|r| r.merge(router)); + for n in networks.iter() { + network.connect(n.local_addr()).await.unwrap(); + } + networks.push(network.clone()); + + let node = node_from_committee(committee, authority, *stake); + authority_info.insert(*authority, (network.peer_id(), node.id)); + nodes.push(node); + + let (r, handle) = unstarted.build(network); + handles.push((authority, handle)); + + let span = tracing::span!( + tracing::Level::INFO, + "RandomnessEventLoop", + authority = ?authority.concise(), + ); + tokio::spawn(r.start().instrument(span)); + } + info!(?authority_info, "authorities constructed"); + + let nodes = nodes::Nodes::new(nodes).unwrap(); + + // Send partial sigs from authorities 0 and 1, but give them different DKG output so they think + // each other are byzantine. + for (i, (authority, handle)) in handles.iter().enumerate() { + let mock_dkg_output = mocked_dkg::generate_mocked_output::( + nodes.clone(), + committee.validity_threshold().try_into().unwrap(), + if i < 2 { 100 + i as u128 } else { 0 }, + committee + .authority_index(authority) + .unwrap() + .try_into() + .unwrap(), + ); + handle.send_partial_signatures(0, RandomnessRound(0)); + handle.update_epoch( + 0, + authority_info.clone(), + mock_dkg_output, + committee.validity_threshold().try_into().unwrap(), + None, + ); + } + for rx in &mut randomness_rxs[2..] { + // Validators (2, 3) can communicate normally. + let (epoch, round, bytes) = rx.recv().await.unwrap(); + assert_eq!(0, epoch); + assert_eq!(0, round.0); + assert_ne!(0, bytes.len()); + } + for rx in &mut randomness_rxs[..2] { + // Validators (0, 1) are byzantine. + assert!(rx.try_recv().is_err()); + } + + // New epoch, they should forgive each other. + for (authority, handle) in handles.iter().take(2) { + let mock_dkg_output = mocked_dkg::generate_mocked_output::( + nodes.clone(), + committee.validity_threshold().try_into().unwrap(), + 0, + committee + .authority_index(authority) + .unwrap() + .try_into() + .unwrap(), + ); + handle.send_partial_signatures(1, RandomnessRound(0)); + handle.update_epoch( + 1, + authority_info.clone(), + mock_dkg_output, + committee.validity_threshold().try_into().unwrap(), + None, + ); + } + for rx in &mut randomness_rxs[..2] { + // Validators (0, 1) can communicate normally in new epoch. + let (epoch, round, bytes) = rx.recv().await.unwrap(); + assert_eq!(1, epoch); + assert_eq!(0, round.0); + assert_ne!(0, bytes.len()); + } + for rx in &mut randomness_rxs[2..] { + // Validators (2, 3) are still on old epoch. + assert!(rx.try_recv().is_err()); + } +} + fn node_from_committee( committee: &Committee, authority: &AuthorityPublicKeyBytes, From 090bec4cd3733ad0e8bb835e260cc731c7c90003 Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Fri, 19 Jul 2024 12:40:21 -0700 Subject: [PATCH 093/163] [move] Update external workflow to check formatting for _all_ packages (#18738) ## Description This updates the external workflow to check all crates. It appears that, without this, `cargo` will not check crates with `publish = false` by default. ## Test plan This updates tests to ensure formatting is applied uniformly in the external crates, plus a few commits explicitly tested behavior. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .github/workflows/external.yml | 2 +- .../move/crates/move-core-types/src/effects.rs | 6 +----- .../move-stackless-bytecode/src/function_target.rs | 2 +- .../move-stackless-bytecode/src/number_operation.rs | 2 +- .../move/crates/move-vm-runtime/src/data_cache.rs | 5 +---- .../move/crates/move-vm-runtime/src/move_vm.rs | 5 +---- .../move/crates/move-vm-runtime/src/session.rs | 7 +------ .../move/crates/move-vm-types/src/data_store.rs | 3 +-- .../move-bytecode-verifier/src/check_duplication.rs | 6 +++--- .../v0/crates/move-vm-runtime/src/data_cache.rs | 5 +---- .../v0/crates/move-vm-runtime/src/move_vm.rs | 5 +---- .../v0/crates/move-vm-runtime/src/session.rs | 7 +------ .../move-bytecode-verifier/src/check_duplication.rs | 6 +++--- .../v1/crates/move-vm-runtime/src/data_cache.rs | 5 +---- .../v1/crates/move-vm-runtime/src/move_vm.rs | 5 +---- .../v1/crates/move-vm-runtime/src/runtime.rs | 2 +- .../v1/crates/move-vm-runtime/src/session.rs | 9 ++------- .../v2/crates/move-vm-runtime/src/data_cache.rs | 5 +---- .../v2/crates/move-vm-runtime/src/move_vm.rs | 5 +---- .../v2/crates/move-vm-runtime/src/session.rs | 9 ++------- 20 files changed, 26 insertions(+), 75 deletions(-) diff --git a/.github/workflows/external.yml b/.github/workflows/external.yml index c6a9dd00af93f..2ded81bc787b3 100644 --- a/.github/workflows/external.yml +++ b/.github/workflows/external.yml @@ -118,7 +118,7 @@ jobs: uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3 with: command: fmt - args: --check + args: --check --all cargo-deny: name: cargo-deny (advisories, licenses, bans, ...) diff --git a/external-crates/move/crates/move-core-types/src/effects.rs b/external-crates/move/crates/move-core-types/src/effects.rs index cbe011cbb9a7a..79b9e0970ae97 100644 --- a/external-crates/move/crates/move-core-types/src/effects.rs +++ b/external-crates/move/crates/move-core-types/src/effects.rs @@ -2,11 +2,7 @@ // Copyright (c) The Move Contributors // SPDX-License-Identifier: Apache-2.0 -use crate::{ - account_address::AccountAddress, - identifier::Identifier, - language_storage::ModuleId, -}; +use crate::{account_address::AccountAddress, identifier::Identifier, language_storage::ModuleId}; use anyhow::{bail, Result}; use std::collections::btree_map::{self, BTreeMap}; diff --git a/external-crates/move/crates/move-stackless-bytecode/src/function_target.rs b/external-crates/move/crates/move-stackless-bytecode/src/function_target.rs index 1608e0304b666..3630a43199b2d 100644 --- a/external-crates/move/crates/move-stackless-bytecode/src/function_target.rs +++ b/external-crates/move/crates/move-stackless-bytecode/src/function_target.rs @@ -9,7 +9,7 @@ use crate::{ use itertools::Itertools; use move_binary_format::file_format::CodeOffset; use move_model::{ - model::{FunId, FunctionEnv, FunctionVisibility, GlobalEnv, Loc, ModuleEnv, DatatypeId}, + model::{DatatypeId, FunId, FunctionEnv, FunctionVisibility, GlobalEnv, Loc, ModuleEnv}, symbol::{Symbol, SymbolPool}, ty::{Type, TypeDisplayContext}, }; diff --git a/external-crates/move/crates/move-stackless-bytecode/src/number_operation.rs b/external-crates/move/crates/move-stackless-bytecode/src/number_operation.rs index 199e3efbbea1a..5ed95f3bb3e7f 100644 --- a/external-crates/move/crates/move-stackless-bytecode/src/number_operation.rs +++ b/external-crates/move/crates/move-stackless-bytecode/src/number_operation.rs @@ -8,7 +8,7 @@ use move_model::{ ast::TempIndex, - model::{FieldId, FunId, FunctionEnv, ModuleId, NodeId, StructEnv, DatatypeId}, + model::{DatatypeId, FieldId, FunId, FunctionEnv, ModuleId, NodeId, StructEnv}, ty::Type, }; use std::collections::BTreeMap; diff --git a/external-crates/move/crates/move-vm-runtime/src/data_cache.rs b/external-crates/move/crates/move-vm-runtime/src/data_cache.rs index b2767b7a114f9..dc04c9ec4f89a 100644 --- a/external-crates/move/crates/move-vm-runtime/src/data_cache.rs +++ b/external-crates/move/crates/move-vm-runtime/src/data_cache.rs @@ -61,10 +61,7 @@ impl TransactionDataCache { if !modules.is_empty() { change_set - .add_account_changeset( - addr, - AccountChangeSet::from_modules(modules), - ) + .add_account_changeset(addr, AccountChangeSet::from_modules(modules)) .expect("accounts should be unique"); } } diff --git a/external-crates/move/crates/move-vm-runtime/src/move_vm.rs b/external-crates/move/crates/move-vm-runtime/src/move_vm.rs index f6402d5485565..724e80c62449c 100644 --- a/external-crates/move/crates/move-vm-runtime/src/move_vm.rs +++ b/external-crates/move/crates/move-vm-runtime/src/move_vm.rs @@ -78,10 +78,7 @@ impl MoveVM { ) -> VMResult> { self.runtime .loader() - .load_module( - module_id, - &TransactionDataCache::new(remote), - ) + .load_module(module_id, &TransactionDataCache::new(remote)) .map(|(compiled, _)| compiled) } diff --git a/external-crates/move/crates/move-vm-runtime/src/session.rs b/external-crates/move/crates/move-vm-runtime/src/session.rs index 0473ef7918af0..55dffafc284bf 100644 --- a/external-crates/move/crates/move-vm-runtime/src/session.rs +++ b/external-crates/move/crates/move-vm-runtime/src/session.rs @@ -179,12 +179,7 @@ impl<'r, 'l, S: MoveResolver> Session<'r, 'l, S> { } /// Same like `finish`, but also extracts the native context extensions from the session. - pub fn finish_with_extensions( - self, - ) -> ( - VMResult<(ChangeSet, NativeContextExtensions<'r>)>, - S, - ) { + pub fn finish_with_extensions(self) -> (VMResult<(ChangeSet, NativeContextExtensions<'r>)>, S) { let Session { data_cache, native_extensions, diff --git a/external-crates/move/crates/move-vm-types/src/data_store.rs b/external-crates/move/crates/move-vm-types/src/data_store.rs index 9b80e5475836c..05d7de2ac2d65 100644 --- a/external-crates/move/crates/move-vm-types/src/data_store.rs +++ b/external-crates/move/crates/move-vm-types/src/data_store.rs @@ -4,8 +4,7 @@ use move_binary_format::errors::{PartialVMResult, VMResult}; use move_core_types::{ - account_address::AccountAddress, identifier::IdentStr, - language_storage::ModuleId, + account_address::AccountAddress, identifier::IdentStr, language_storage::ModuleId, }; /// Provide an implementation for bytecodes related to data with a given data store. diff --git a/external-crates/move/move-execution/v0/crates/move-bytecode-verifier/src/check_duplication.rs b/external-crates/move/move-execution/v0/crates/move-bytecode-verifier/src/check_duplication.rs index c44fe9ba50cb2..141ef3eca72b3 100644 --- a/external-crates/move/move-execution/v0/crates/move-bytecode-verifier/src/check_duplication.rs +++ b/external-crates/move/move-execution/v0/crates/move-bytecode-verifier/src/check_duplication.rs @@ -12,9 +12,9 @@ use move_binary_format::{ errors::{verification_error, Location, PartialVMResult, VMResult}, file_format::{ - CompiledModule, Constant, FunctionHandle, FunctionHandleIndex, FunctionInstantiation, - ModuleHandle, Signature, StructFieldInformation, DatatypeHandle, DatatypeHandleIndex, - TableIndex, + CompiledModule, Constant, DatatypeHandle, DatatypeHandleIndex, FunctionHandle, + FunctionHandleIndex, FunctionInstantiation, ModuleHandle, Signature, + StructFieldInformation, TableIndex, }, IndexKind, }; diff --git a/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/data_cache.rs b/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/data_cache.rs index c25773124f614..6816272548994 100644 --- a/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/data_cache.rs +++ b/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/data_cache.rs @@ -60,10 +60,7 @@ impl TransactionDataCache { } if !modules.is_empty() { change_set - .add_account_changeset( - addr, - AccountChangeSet::from_modules(modules), - ) + .add_account_changeset(addr, AccountChangeSet::from_modules(modules)) .expect("accounts should be unique"); } } diff --git a/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/move_vm.rs b/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/move_vm.rs index 5ca2d77717350..fc1486e93de0c 100644 --- a/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/move_vm.rs +++ b/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/move_vm.rs @@ -78,10 +78,7 @@ impl MoveVM { ) -> VMResult> { self.runtime .loader() - .load_module( - module_id, - &TransactionDataCache::new(remote), - ) + .load_module(module_id, &TransactionDataCache::new(remote)) .map(|(compiled, _)| compiled) } diff --git a/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/session.rs b/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/session.rs index e4c565e1521e4..4331d4ba581ec 100644 --- a/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/session.rs +++ b/external-crates/move/move-execution/v0/crates/move-vm-runtime/src/session.rs @@ -165,12 +165,7 @@ impl<'r, 'l, S: MoveResolver> Session<'r, 'l, S> { } /// Same like `finish`, but also extracts the native context extensions from the session. - pub fn finish_with_extensions( - self, - ) -> ( - VMResult<(ChangeSet, NativeContextExtensions<'r>)>, - S, - ) { + pub fn finish_with_extensions(self) -> (VMResult<(ChangeSet, NativeContextExtensions<'r>)>, S) { let Session { data_cache, native_extensions, diff --git a/external-crates/move/move-execution/v1/crates/move-bytecode-verifier/src/check_duplication.rs b/external-crates/move/move-execution/v1/crates/move-bytecode-verifier/src/check_duplication.rs index c44fe9ba50cb2..141ef3eca72b3 100644 --- a/external-crates/move/move-execution/v1/crates/move-bytecode-verifier/src/check_duplication.rs +++ b/external-crates/move/move-execution/v1/crates/move-bytecode-verifier/src/check_duplication.rs @@ -12,9 +12,9 @@ use move_binary_format::{ errors::{verification_error, Location, PartialVMResult, VMResult}, file_format::{ - CompiledModule, Constant, FunctionHandle, FunctionHandleIndex, FunctionInstantiation, - ModuleHandle, Signature, StructFieldInformation, DatatypeHandle, DatatypeHandleIndex, - TableIndex, + CompiledModule, Constant, DatatypeHandle, DatatypeHandleIndex, FunctionHandle, + FunctionHandleIndex, FunctionInstantiation, ModuleHandle, Signature, + StructFieldInformation, TableIndex, }, IndexKind, }; diff --git a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/data_cache.rs b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/data_cache.rs index c25773124f614..6816272548994 100644 --- a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/data_cache.rs +++ b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/data_cache.rs @@ -60,10 +60,7 @@ impl TransactionDataCache { } if !modules.is_empty() { change_set - .add_account_changeset( - addr, - AccountChangeSet::from_modules(modules), - ) + .add_account_changeset(addr, AccountChangeSet::from_modules(modules)) .expect("accounts should be unique"); } } diff --git a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/move_vm.rs b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/move_vm.rs index f6402d5485565..724e80c62449c 100644 --- a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/move_vm.rs +++ b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/move_vm.rs @@ -78,10 +78,7 @@ impl MoveVM { ) -> VMResult> { self.runtime .loader() - .load_module( - module_id, - &TransactionDataCache::new(remote), - ) + .load_module(module_id, &TransactionDataCache::new(remote)) .map(|(compiled, _)| compiled) } diff --git a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/runtime.rs b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/runtime.rs index e44ff84475781..2158f9ec187ad 100644 --- a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/runtime.rs +++ b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/runtime.rs @@ -30,7 +30,7 @@ use move_vm_config::runtime::VMConfig; use move_vm_types::{ data_store::DataStore, gas::GasMeter, - loaded_data::runtime_types::{CachedTypeIndex, CachedDatatype, Type}, + loaded_data::runtime_types::{CachedDatatype, CachedTypeIndex, Type}, values::{Locals, Reference, VMValueCast, Value}, }; use std::{borrow::Borrow, collections::BTreeSet, sync::Arc}; diff --git a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/session.rs b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/session.rs index 9fc5bc84b90c7..916a519eeb70f 100644 --- a/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/session.rs +++ b/external-crates/move/move-execution/v1/crates/move-vm-runtime/src/session.rs @@ -22,7 +22,7 @@ use move_core_types::{ use move_vm_types::{ data_store::DataStore, gas::GasMeter, - loaded_data::runtime_types::{CachedTypeIndex, CachedDatatype, Type}, + loaded_data::runtime_types::{CachedDatatype, CachedTypeIndex, Type}, }; use std::{borrow::Borrow, sync::Arc}; @@ -179,12 +179,7 @@ impl<'r, 'l, S: MoveResolver> Session<'r, 'l, S> { } /// Same like `finish`, but also extracts the native context extensions from the session. - pub fn finish_with_extensions( - self, - ) -> ( - VMResult<(ChangeSet, NativeContextExtensions<'r>)>, - S, - ) { + pub fn finish_with_extensions(self) -> (VMResult<(ChangeSet, NativeContextExtensions<'r>)>, S) { let Session { data_cache, native_extensions, diff --git a/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/data_cache.rs b/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/data_cache.rs index c25773124f614..6816272548994 100644 --- a/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/data_cache.rs +++ b/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/data_cache.rs @@ -60,10 +60,7 @@ impl TransactionDataCache { } if !modules.is_empty() { change_set - .add_account_changeset( - addr, - AccountChangeSet::from_modules(modules), - ) + .add_account_changeset(addr, AccountChangeSet::from_modules(modules)) .expect("accounts should be unique"); } } diff --git a/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/move_vm.rs b/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/move_vm.rs index f6402d5485565..724e80c62449c 100644 --- a/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/move_vm.rs +++ b/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/move_vm.rs @@ -78,10 +78,7 @@ impl MoveVM { ) -> VMResult> { self.runtime .loader() - .load_module( - module_id, - &TransactionDataCache::new(remote), - ) + .load_module(module_id, &TransactionDataCache::new(remote)) .map(|(compiled, _)| compiled) } diff --git a/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/session.rs b/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/session.rs index 9fc5bc84b90c7..916a519eeb70f 100644 --- a/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/session.rs +++ b/external-crates/move/move-execution/v2/crates/move-vm-runtime/src/session.rs @@ -22,7 +22,7 @@ use move_core_types::{ use move_vm_types::{ data_store::DataStore, gas::GasMeter, - loaded_data::runtime_types::{CachedTypeIndex, CachedDatatype, Type}, + loaded_data::runtime_types::{CachedDatatype, CachedTypeIndex, Type}, }; use std::{borrow::Borrow, sync::Arc}; @@ -179,12 +179,7 @@ impl<'r, 'l, S: MoveResolver> Session<'r, 'l, S> { } /// Same like `finish`, but also extracts the native context extensions from the session. - pub fn finish_with_extensions( - self, - ) -> ( - VMResult<(ChangeSet, NativeContextExtensions<'r>)>, - S, - ) { + pub fn finish_with_extensions(self) -> (VMResult<(ChangeSet, NativeContextExtensions<'r>)>, S) { let Session { data_cache, native_extensions, From e7d196eb3c342af2d0efc6f7dc7d5698bce434fb Mon Sep 17 00:00:00 2001 From: Ge Gao <106119108+gegaowp@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:47:06 -0400 Subject: [PATCH 094/163] indexer pruner: add pruner and prune unpartitioned tables (#18495) ## Description a separate pruner that use `epochs` table and `cp_tx` table to track progress of pruning and handle disaster recovery; and `checkpoints` table as available range data source. ## Test plan local run and verify via local client - progress tracking via epoch, cp, and tx ![epoch_progress](https://github.com/MystenLabs/sui/assets/106119108/f628c7b5-add7-4198-94e3-f2542dfd7890) ![tx_cp_progress](https://github.com/MystenLabs/sui/assets/106119108/4395ff7d-b79b-4a6d-aec6-243ac5c86c22) - verify on checkpoints & tx_ tables - make sure that the checkpoints table is indeed latest cp_tx cp + 1 ![check_cp](https://github.com/MystenLabs/sui/assets/106119108/13de7129-16b6-44e9-a922-c487100cb152) - make sure that all cp < min_tx in cp_tx have been pruned ![check_tx](https://github.com/MystenLabs/sui/assets/106119108/0708e667-135a-44be-be77-b1eb667ba640) --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../2024-04-24-180008_checkpoints/down.sql | 1 + .../2024-04-24-180008_checkpoints/up.sql | 6 + .../pg/2023-08-19-044044_checkpoints/down.sql | 1 + .../pg/2023-08-19-044044_checkpoints/up.sql | 6 + .../pg/2023-10-06-204335_tx_indices/up.sql | 3 + crates/sui-indexer/src/handlers/mod.rs | 1 + crates/sui-indexer/src/handlers/pruner.rs | 60 ++++ crates/sui-indexer/src/indexer.rs | 13 + crates/sui-indexer/src/metrics.rs | 29 +- crates/sui-indexer/src/models/checkpoints.rs | 20 +- crates/sui-indexer/src/schema/mod.rs | 3 + crates/sui-indexer/src/schema/mysql.rs | 9 + crates/sui-indexer/src/schema/pg.rs | 10 + crates/sui-indexer/src/store/indexer_store.rs | 6 + .../sui-indexer/src/store/pg_indexer_store.rs | 291 +++++++++++++++++- crates/sui-indexer/src/types.rs | 7 + 16 files changed, 461 insertions(+), 5 deletions(-) create mode 100644 crates/sui-indexer/src/handlers/pruner.rs diff --git a/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/down.sql b/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/down.sql index 6a9018e3c881a..738d8ffa2363b 100644 --- a/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/down.sql +++ b/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/down.sql @@ -1 +1,2 @@ DROP TABLE IF EXISTS checkpoints; +DROP TABLE IF EXISTS pruner_cp_watermark; diff --git a/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/up.sql b/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/up.sql index 7ab0fa8a3a5cd..5d044a4f0719c 100644 --- a/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/up.sql +++ b/crates/sui-indexer/migrations/mysql/2024-04-24-180008_checkpoints/up.sql @@ -26,3 +26,9 @@ CREATE TABLE checkpoints CREATE INDEX checkpoints_epoch ON checkpoints (epoch, sequence_number); CREATE INDEX checkpoints_digest ON checkpoints (checkpoint_digest(32)); + +CREATE TABLE pruner_cp_watermark ( + checkpoint_sequence_number BIGINT PRIMARY KEY, + min_tx_sequence_number BIGINT NOT NULL, + max_tx_sequence_number BIGINT NOT NULL +) diff --git a/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/down.sql b/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/down.sql index 48573ae779cbb..fba5a8b5468c6 100644 --- a/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/down.sql +++ b/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/down.sql @@ -1,2 +1,3 @@ -- This file should undo anything in `up.sql` DROP TABLE IF EXISTS checkpoints; +DROP TABLE IF EXISTS pruner_cp_watermark; diff --git a/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/up.sql b/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/up.sql index 8de09a7ff88e8..5f7281a2e1a1d 100644 --- a/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/up.sql +++ b/crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/up.sql @@ -26,3 +26,9 @@ CREATE TABLE checkpoints CREATE INDEX checkpoints_epoch ON checkpoints (epoch, sequence_number); CREATE INDEX checkpoints_digest ON checkpoints USING HASH (checkpoint_digest); + +CREATE TABLE pruner_cp_watermark ( + checkpoint_sequence_number BIGINT PRIMARY KEY, + min_tx_sequence_number BIGINT NOT NULL, + max_tx_sequence_number BIGINT NOT NULL +) diff --git a/crates/sui-indexer/migrations/pg/2023-10-06-204335_tx_indices/up.sql b/crates/sui-indexer/migrations/pg/2023-10-06-204335_tx_indices/up.sql index 3eba95bd19077..ed81a281f2b0a 100644 --- a/crates/sui-indexer/migrations/pg/2023-10-06-204335_tx_indices/up.sql +++ b/crates/sui-indexer/migrations/pg/2023-10-06-204335_tx_indices/up.sql @@ -23,6 +23,7 @@ CREATE TABLE tx_input_objects ( object_id BYTEA NOT NULL, PRIMARY KEY(object_id, tx_sequence_number, cp_sequence_number) ); +CREATE INDEX tx_input_objects_tx_sequence_number_index ON tx_input_objects (tx_sequence_number); CREATE TABLE tx_changed_objects ( cp_sequence_number BIGINT NOT NULL, @@ -31,6 +32,7 @@ CREATE TABLE tx_changed_objects ( object_id BYTEA NOT NULL, PRIMARY KEY(object_id, tx_sequence_number, cp_sequence_number) ); +CREATE INDEX tx_changed_objects_tx_sequence_number_index ON tx_changed_objects (tx_sequence_number); CREATE TABLE tx_calls ( cp_sequence_number BIGINT NOT NULL, @@ -52,3 +54,4 @@ CREATE TABLE tx_digests ( cp_sequence_number BIGINT NOT NULL, tx_sequence_number BIGINT NOT NULL ); +CREATE INDEX tx_digests_tx_sequence_number ON tx_digests (tx_sequence_number); diff --git a/crates/sui-indexer/src/handlers/mod.rs b/crates/sui-indexer/src/handlers/mod.rs index 587a13f22bb95..ca27e92a0bf41 100644 --- a/crates/sui-indexer/src/handlers/mod.rs +++ b/crates/sui-indexer/src/handlers/mod.rs @@ -14,6 +14,7 @@ use crate::{ pub mod checkpoint_handler; pub mod committer; pub mod objects_snapshot_processor; +pub mod pruner; pub mod tx_processor; #[derive(Debug)] diff --git a/crates/sui-indexer/src/handlers/pruner.rs b/crates/sui-indexer/src/handlers/pruner.rs new file mode 100644 index 0000000000000..389a375a0275c --- /dev/null +++ b/crates/sui-indexer/src/handlers/pruner.rs @@ -0,0 +1,60 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use std::time::Duration; + +use tokio_util::sync::CancellationToken; +use tracing::{error, info}; + +use crate::{metrics::IndexerMetrics, store::IndexerStore, types::IndexerResult}; + +pub struct Pruner { + pub store: S, + pub epochs_to_keep: u64, + pub metrics: IndexerMetrics, +} + +impl Pruner +where + S: IndexerStore + Clone + Sync + Send + 'static, +{ + pub fn new(store: S, epochs_to_keep: u64, metrics: IndexerMetrics) -> Self { + Self { + store, + epochs_to_keep, + metrics, + } + } + + pub async fn start(&self, cancel: CancellationToken) -> IndexerResult<()> { + loop { + if cancel.is_cancelled() { + info!("Pruner task cancelled."); + return Ok(()); + } + + let (mut min_epoch, mut max_epoch) = self.store.get_available_epoch_range().await?; + while min_epoch + self.epochs_to_keep > max_epoch { + if cancel.is_cancelled() { + info!("Pruner task cancelled."); + return Ok(()); + } + tokio::time::sleep(Duration::from_secs(5)).await; + (min_epoch, max_epoch) = self.store.get_available_epoch_range().await?; + } + + for epoch in min_epoch..=max_epoch - self.epochs_to_keep { + if cancel.is_cancelled() { + info!("Pruner task cancelled."); + return Ok(()); + } + info!("Pruning epoch {}", epoch); + self.store.prune_epoch(epoch).await.unwrap_or_else(|e| { + error!("Failed to prune epoch {}: {}", epoch, e); + }); + self.metrics.last_pruned_epoch.set(epoch as i64); + info!("Pruned epoch {}", epoch); + } + } + } +} diff --git a/crates/sui-indexer/src/indexer.rs b/crates/sui-indexer/src/indexer.rs index 6fede882c949f..72361e405e785 100644 --- a/crates/sui-indexer/src/indexer.rs +++ b/crates/sui-indexer/src/indexer.rs @@ -24,6 +24,7 @@ use crate::handlers::checkpoint_handler::new_handlers; use crate::handlers::objects_snapshot_processor::{ start_objects_snapshot_processor, SnapshotLagConfig, }; +use crate::handlers::pruner::Pruner; use crate::indexer_reader::IndexerReader; use crate::metrics::IndexerMetrics; use crate::store::IndexerStore; @@ -108,6 +109,18 @@ impl Indexer { ) .await?; + let epochs_to_keep = std::env::var("EPOCHS_TO_KEEP") + .map(|s| s.parse::().ok()) + .unwrap_or_else(|_e| None); + if let Some(epochs_to_keep) = epochs_to_keep { + info!( + "Starting indexer pruner with epochs to keep: {}", + epochs_to_keep + ); + let pruner = Pruner::new(store.clone(), epochs_to_keep, metrics.clone()); + spawn_monitored_task!(pruner.start(CancellationToken::new())); + } + let cancel_clone = cancel.clone(); let (exit_sender, exit_receiver) = oneshot::channel(); // Spawn a task that links the cancellation token to the exit sender diff --git a/crates/sui-indexer/src/metrics.rs b/crates/sui-indexer/src/metrics.rs index d549d4092e137..67dbf7fe1ff43 100644 --- a/crates/sui-indexer/src/metrics.rs +++ b/crates/sui-indexer/src/metrics.rs @@ -180,9 +180,13 @@ pub struct IndexerMetrics { // indexer state metrics pub db_conn_pool_size: IntGauge, pub idle_db_conn: IntGauge, - pub address_processor_failure: IntCounter, pub checkpoint_metrics_processor_failure: IntCounter, + // pruner metrics + pub last_pruned_epoch: IntGauge, + pub last_pruned_checkpoint: IntGauge, + pub last_pruned_transaction: IntGauge, + pub epoch_pruning_latency: Histogram, } impl IndexerMetrics { @@ -742,6 +746,29 @@ impl IndexerMetrics { registry, ) .unwrap(), + last_pruned_epoch: register_int_gauge_with_registry!( + "last_pruned_epoch", + "Last pruned epoch number", + registry, + ) + .unwrap(), + last_pruned_checkpoint: register_int_gauge_with_registry!( + "last_pruned_checkpoint", + "Last pruned checkpoint sequence number", + registry, + ) + .unwrap(), + last_pruned_transaction: register_int_gauge_with_registry!( + "last_pruned_transaction", + "Last pruned transaction sequence number", + registry, + ).unwrap(), + epoch_pruning_latency: register_histogram_with_registry!( + "epoch_pruning_latency", + "Time spent in pruning one epoch", + DB_UPDATE_QUERY_LATENCY_SEC_BUCKETS.to_vec(), + registry + ).unwrap(), } } } diff --git a/crates/sui-indexer/src/models/checkpoints.rs b/crates/sui-indexer/src/models/checkpoints.rs index b94d8e7e44106..ea3579eb624d9 100644 --- a/crates/sui-indexer/src/models/checkpoints.rs +++ b/crates/sui-indexer/src/models/checkpoints.rs @@ -9,7 +9,7 @@ use sui_types::digests::CheckpointDigest; use sui_types::gas::GasCostSummary; use crate::errors::IndexerError; -use crate::schema::checkpoints; +use crate::schema::{checkpoints, pruner_cp_watermark}; use crate::types::IndexedCheckpoint; #[derive(Queryable, Insertable, Selectable, Debug, Clone, Default)] @@ -205,3 +205,21 @@ impl TryFrom for RpcCheckpoint { }) } } + +#[derive(Queryable, Insertable, Selectable, Debug, Clone, Default)] +#[diesel(table_name = pruner_cp_watermark)] +pub struct StoredCpTx { + pub checkpoint_sequence_number: i64, + pub min_tx_sequence_number: i64, + pub max_tx_sequence_number: i64, +} + +impl From<&IndexedCheckpoint> for StoredCpTx { + fn from(c: &IndexedCheckpoint) -> Self { + Self { + checkpoint_sequence_number: c.sequence_number as i64, + min_tx_sequence_number: c.min_tx_sequence_number as i64, + max_tx_sequence_number: c.max_tx_sequence_number as i64, + } + } +} diff --git a/crates/sui-indexer/src/schema/mod.rs b/crates/sui-indexer/src/schema/mod.rs index 635a28dd7f93a..2d14fe31d765f 100644 --- a/crates/sui-indexer/src/schema/mod.rs +++ b/crates/sui-indexer/src/schema/mod.rs @@ -20,6 +20,7 @@ mod inner { pub use crate::schema::pg::objects_history; pub use crate::schema::pg::objects_snapshot; pub use crate::schema::pg::packages; + pub use crate::schema::pg::pruner_cp_watermark; pub use crate::schema::pg::transactions; pub use crate::schema::pg::tx_calls; pub use crate::schema::pg::tx_changed_objects; @@ -40,6 +41,7 @@ mod inner { pub use crate::schema::mysql::objects_history; pub use crate::schema::mysql::objects_snapshot; pub use crate::schema::mysql::packages; + pub use crate::schema::mysql::pruner_cp_watermark; pub use crate::schema::mysql::transactions; pub use crate::schema::mysql::tx_calls; pub use crate::schema::mysql::tx_changed_objects; @@ -57,6 +59,7 @@ pub use inner::objects; pub use inner::objects_history; pub use inner::objects_snapshot; pub use inner::packages; +pub use inner::pruner_cp_watermark; pub use inner::transactions; pub use inner::tx_calls; pub use inner::tx_changed_objects; diff --git a/crates/sui-indexer/src/schema/mysql.rs b/crates/sui-indexer/src/schema/mysql.rs index 4fb6f3a9a3aa5..fe5590929eed9 100644 --- a/crates/sui-indexer/src/schema/mysql.rs +++ b/crates/sui-indexer/src/schema/mysql.rs @@ -149,6 +149,14 @@ diesel::table! { } } +diesel::table! { + pruner_cp_watermark (checkpoint_sequence_number) { + checkpoint_sequence_number -> Bigint, + min_tx_sequence_number -> Bigint, + max_tx_sequence_number -> Bigint, + } +} + diesel::table! { transactions (tx_sequence_number, checkpoint_sequence_number) { tx_sequence_number -> Bigint, @@ -226,6 +234,7 @@ macro_rules! for_all_tables { objects_history, objects_snapshot, packages, + pruner_cp_watermark, transactions, tx_calls, tx_changed_objects, diff --git a/crates/sui-indexer/src/schema/pg.rs b/crates/sui-indexer/src/schema/pg.rs index 7193ce053355e..68975e8584c12 100644 --- a/crates/sui-indexer/src/schema/pg.rs +++ b/crates/sui-indexer/src/schema/pg.rs @@ -23,6 +23,14 @@ diesel::table! { } } +diesel::table! { + pruner_cp_watermark (checkpoint_sequence_number) { + checkpoint_sequence_number -> Int8, + min_tx_sequence_number -> Int8, + max_tx_sequence_number -> Int8, + } +} + diesel::table! { display (object_type) { object_type -> Text, @@ -277,6 +285,8 @@ macro_rules! for_all_tables { ($action:path) => { $action!( checkpoints, + pruner_cp_watermark, + display, epochs, events, events_partition_0, diff --git a/crates/sui-indexer/src/store/indexer_store.rs b/crates/sui-indexer/src/store/indexer_store.rs index 90e94207a8a52..868fe31416a6c 100644 --- a/crates/sui-indexer/src/store/indexer_store.rs +++ b/crates/sui-indexer/src/store/indexer_store.rs @@ -22,6 +22,10 @@ pub enum ObjectChangeToCommit { pub trait IndexerStore: Any + Clone + Sync + Send + 'static { async fn get_latest_checkpoint_sequence_number(&self) -> Result, IndexerError>; + async fn get_available_epoch_range(&self) -> Result<(u64, u64), IndexerError>; + + async fn get_available_checkpoint_range(&self) -> Result<(u64, u64), IndexerError>; + async fn get_latest_object_snapshot_checkpoint_sequence_number( &self, ) -> Result, IndexerError>; @@ -70,6 +74,8 @@ pub trait IndexerStore: Any + Clone + Sync + Send + 'static { async fn advance_epoch(&self, epoch: EpochToCommit) -> Result<(), IndexerError>; + async fn prune_epoch(&self, epoch: u64) -> Result<(), IndexerError>; + async fn get_network_total_transactions_by_end_of_epoch( &self, epoch: u64, diff --git a/crates/sui-indexer/src/store/pg_indexer_store.rs b/crates/sui-indexer/src/store/pg_indexer_store.rs index 98d1dbae29b2b..02ba0347a0774 100644 --- a/crates/sui-indexer/src/store/pg_indexer_store.rs +++ b/crates/sui-indexer/src/store/pg_indexer_store.rs @@ -10,7 +10,7 @@ use std::time::Instant; use async_trait::async_trait; use core::result::Result::Ok; -use diesel::dsl::max; +use diesel::dsl::{max, min}; use diesel::r2d2::R2D2Connection; use diesel::ExpressionMethods; use diesel::OptionalExtension; @@ -28,6 +28,7 @@ use crate::handlers::EpochToCommit; use crate::handlers::TransactionObjectChangesToCommit; use crate::metrics::IndexerMetrics; use crate::models::checkpoints::StoredCheckpoint; +use crate::models::checkpoints::StoredCpTx; use crate::models::display::StoredDisplay; use crate::models::epoch::StoredEpochInfo; use crate::models::events::StoredEvent; @@ -39,8 +40,8 @@ use crate::models::packages::StoredPackage; use crate::models::transactions::StoredTransaction; use crate::schema::{ checkpoints, display, epochs, events, objects, objects_history, objects_snapshot, packages, - transactions, tx_calls, tx_changed_objects, tx_digests, tx_input_objects, tx_recipients, - tx_senders, + pruner_cp_watermark, transactions, tx_calls, tx_changed_objects, tx_digests, tx_input_objects, + tx_recipients, tx_senders, }; use crate::types::{IndexedCheckpoint, IndexedEvent, IndexedPackage, IndexedTransaction, TxIndex}; use crate::{ @@ -67,6 +68,15 @@ macro_rules! chunk { }}; } +macro_rules! prune_tx_indice_table { + ($table:ident, $conn:expr, $min_tx:expr, $max_tx:expr, $context_msg:expr) => { + diesel::delete($table::table.filter($table::tx_sequence_number.between($min_tx, $max_tx))) + .execute($conn) + .map_err(IndexerError::from) + .context($context_msg)?; + }; +} + // In one DB transaction, the update could be chunked into // a few statements, this is the amount of rows to update in one statement // TODO: I think with the `per_db_tx` params, `PG_COMMIT_CHUNK_SIZE_INTRA_DB_TX` @@ -190,6 +200,80 @@ impl PgIndexerStore { .context("Failed reading latest checkpoint sequence number from PostgresDB") } + fn get_available_checkpoint_range(&self) -> Result<(u64, u64), IndexerError> { + read_only_blocking!(&self.blocking_cp, |conn| { + checkpoints::dsl::checkpoints + .select(( + min(checkpoints::sequence_number), + max(checkpoints::sequence_number), + )) + .first::<(Option, Option)>(conn) + .map(|(min, max)| { + ( + min.unwrap_or_default() as u64, + max.unwrap_or_default() as u64, + ) + }) + }) + .context("Failed reading min and max checkpoint sequence numbers from PostgresDB") + } + + fn get_prunable_epoch_range(&self) -> Result<(u64, u64), IndexerError> { + read_only_blocking!(&self.blocking_cp, |conn| { + epochs::dsl::epochs + .select((min(epochs::epoch), max(epochs::epoch))) + .first::<(Option, Option)>(conn) + .map(|(min, max)| { + ( + min.unwrap_or_default() as u64, + max.unwrap_or_default() as u64, + ) + }) + }) + .context("Failed reading min and max epoch numbers from PostgresDB") + } + + fn get_min_prunable_checkpoint(&self) -> Result { + read_only_blocking!(&self.blocking_cp, |conn| { + pruner_cp_watermark::dsl::pruner_cp_watermark + .select(min(pruner_cp_watermark::checkpoint_sequence_number)) + .first::>(conn) + .map(|v| v.unwrap_or_default() as u64) + }) + .context("Failed reading min prunable checkpoint sequence number from PostgresDB") + } + + fn get_checkpoint_range_for_epoch( + &self, + epoch: u64, + ) -> Result<(u64, Option), IndexerError> { + read_only_blocking!(&self.blocking_cp, |conn| { + epochs::dsl::epochs + .select((epochs::first_checkpoint_id, epochs::last_checkpoint_id)) + .filter(epochs::epoch.eq(epoch as i64)) + .first::<(i64, Option)>(conn) + .map(|(min, max)| (min as u64, max.map(|v| v as u64))) + }) + .context("Failed reading checkpoint range from PostgresDB") + } + + fn get_transaction_range_for_checkpoint( + &self, + checkpoint: u64, + ) -> Result<(u64, u64), IndexerError> { + read_only_blocking!(&self.blocking_cp, |conn| { + pruner_cp_watermark::dsl::pruner_cp_watermark + .select(( + pruner_cp_watermark::min_tx_sequence_number, + pruner_cp_watermark::max_tx_sequence_number, + )) + .filter(pruner_cp_watermark::checkpoint_sequence_number.eq(checkpoint as i64)) + .first::<(i64, i64)>(conn) + .map(|(min, max)| (min as u64, max as u64)) + }) + .context("Failed reading transaction range from PostgresDB") + } + fn get_latest_object_snapshot_checkpoint_sequence_number( &self, ) -> Result, IndexerError> { @@ -522,6 +606,27 @@ impl PgIndexerStore { .checkpoint_db_commit_latency_checkpoints .start_timer(); + let stored_cp_txs = checkpoints.iter().map(StoredCpTx::from).collect::>(); + transactional_blocking_with_retry!( + &self.blocking_cp, + |conn| { + for stored_cp_tx_chunk in stored_cp_txs.chunks(PG_COMMIT_CHUNK_SIZE_INTRA_DB_TX) { + insert_or_ignore_into!(pruner_cp_watermark::table, stored_cp_tx_chunk, conn); + } + Ok::<(), IndexerError>(()) + }, + PG_DB_COMMIT_SLEEP_DURATION + ) + .tap_ok(|_| { + info!( + "Persisted {} pruner_cp_watermark rows.", + stored_cp_txs.len(), + ); + }) + .tap_err(|e| { + tracing::error!("Failed to persist pruner_cp_watermark with error: {}", e); + })?; + let stored_checkpoints = checkpoints .iter() .map(StoredCheckpoint::from) @@ -993,6 +1098,107 @@ impl PgIndexerStore { Ok(()) } + fn prune_checkpoints_table(&self, cp: u64) -> Result<(), IndexerError> { + transactional_blocking_with_retry!( + &self.blocking_cp, + |conn| { + diesel::delete( + checkpoints::table.filter(checkpoints::sequence_number.eq(cp as i64)), + ) + .execute(conn) + .map_err(IndexerError::from) + .context("Failed to prune checkpoints table")?; + + Ok::<(), IndexerError>(()) + }, + PG_DB_COMMIT_SLEEP_DURATION + ) + } + + fn prune_epochs_table(&self, epoch: u64) -> Result<(), IndexerError> { + transactional_blocking_with_retry!( + &self.blocking_cp, + |conn| { + diesel::delete(epochs::table.filter(epochs::epoch.eq(epoch as i64))) + .execute(conn) + .map_err(IndexerError::from) + .context("Failed to prune epochs table")?; + Ok::<(), IndexerError>(()) + }, + PG_DB_COMMIT_SLEEP_DURATION + ) + } + + fn prune_tx_indices_table(&self, min_tx: u64, max_tx: u64) -> Result<(), IndexerError> { + let (min_tx, max_tx) = (min_tx as i64, max_tx as i64); + transactional_blocking_with_retry!( + &self.blocking_cp, + |conn| { + prune_tx_indice_table!( + tx_senders, + conn, + min_tx, + max_tx, + "Failed to prune tx_senders table" + ); + prune_tx_indice_table!( + tx_recipients, + conn, + min_tx, + max_tx, + "Failed to prune tx_recipients table" + ); + prune_tx_indice_table![ + tx_input_objects, + conn, + min_tx, + max_tx, + "Failed to prune tx_input_objects table" + ]; + prune_tx_indice_table![ + tx_changed_objects, + conn, + min_tx, + max_tx, + "Failed to prune tx_changed_objects table" + ]; + prune_tx_indice_table![ + tx_calls, + conn, + min_tx, + max_tx, + "Failed to prune tx_calls table" + ]; + prune_tx_indice_table![ + tx_digests, + conn, + min_tx, + max_tx, + "Failed to prune tx_digests table" + ]; + Ok::<(), IndexerError>(()) + }, + PG_DB_COMMIT_SLEEP_DURATION + ) + } + + fn prune_cp_tx_table(&self, cp: u64) -> Result<(), IndexerError> { + transactional_blocking_with_retry!( + &self.blocking_cp, + |conn| { + diesel::delete( + pruner_cp_watermark::table + .filter(pruner_cp_watermark::checkpoint_sequence_number.eq(cp as i64)), + ) + .execute(conn) + .map_err(IndexerError::from) + .context("Failed to prune pruner_cp_watermark table")?; + Ok::<(), IndexerError>(()) + }, + PG_DB_COMMIT_SLEEP_DURATION + ) + } + fn get_network_total_transactions_by_end_of_epoch( &self, epoch: u64, @@ -1060,6 +1266,16 @@ impl IndexerStore for PgIndexerStore { .await } + async fn get_available_epoch_range(&self) -> Result<(u64, u64), IndexerError> { + self.execute_in_blocking_worker(|this| this.get_prunable_epoch_range()) + .await + } + + async fn get_available_checkpoint_range(&self) -> Result<(u64, u64), IndexerError> { + self.execute_in_blocking_worker(|this| this.get_available_checkpoint_range()) + .await + } + async fn get_latest_object_snapshot_checkpoint_sequence_number( &self, ) -> Result, IndexerError> { @@ -1437,6 +1653,75 @@ impl IndexerStore for PgIndexerStore { .await } + async fn prune_epoch(&self, epoch: u64) -> Result<(), IndexerError> { + let (mut min_cp, max_cp) = match self.get_checkpoint_range_for_epoch(epoch)? { + (min_cp, Some(max_cp)) => Ok((min_cp, max_cp)), + _ => Err(IndexerError::PostgresReadError(format!( + "Failed to get checkpoint range for epoch {}", + epoch + ))), + }?; + + // NOTE: for disaster recovery, min_cp is the min cp of the current epoch, which is likely + // partially pruned already. min_prunable_cp is the min cp to be pruned. + // By std::cmp::max, we will resume the pruning process from the next checkpoint, instead of + // the first cp of the current epoch. + let min_prunable_cp = self.get_min_prunable_checkpoint()?; + min_cp = std::cmp::max(min_cp, min_prunable_cp); + for cp in min_cp..=max_cp { + // NOTE: the order of pruning tables is crucial: + // 1. prune checkpoints table, checkpoints table is the source table of available range, + // we prune it first to make sure that we always have full data for checkpoints within the available range; + // 2. then prune tx_* tables; + // 3. then prune pruner_cp_watermark table, which is the checkpoint pruning watermark table and also tx seq source + // of a checkpoint to prune tx_* tables; + // 4. lastly we prune epochs table when all checkpoints of the epoch have been pruned. + info!( + "Pruning checkpoint {} of epoch {} (min_prunable_cp: {})", + cp, epoch, min_prunable_cp + ); + self.execute_in_blocking_worker(move |this| this.prune_checkpoints_table(cp)) + .await + .unwrap_or_else(|e| { + tracing::error!("Failed to prune checkpoint {}: {}", cp, e); + }); + + let (min_tx, max_tx) = self.get_transaction_range_for_checkpoint(cp)?; + self.execute_in_blocking_worker(move |this| { + this.prune_tx_indices_table(min_tx, max_tx) + }) + .await + .unwrap_or_else(|e| { + tracing::error!("Failed to prune transactions for cp {}: {}", cp, e); + }); + info!( + "Pruned transactions for checkpoint {} from tx {} to tx {}", + cp, min_tx, max_tx + ); + self.metrics.last_pruned_transaction.set(max_tx as i64); + + self.execute_in_blocking_worker(move |this| this.prune_cp_tx_table(cp)) + .await + .unwrap_or_else(|e| { + tracing::error!( + "Failed to prune pruner_cp_watermark table for cp {}: {}", + cp, + e + ); + }); + info!("Pruned checkpoint {} of epoch {}", cp, epoch); + self.metrics.last_pruned_checkpoint.set(cp as i64); + } + + // NOTE: prune epochs table last, otherwise get_checkpoint_range_for_epoch would fail. + self.execute_in_blocking_worker(move |this| this.prune_epochs_table(epoch)) + .await + .unwrap_or_else(|e| { + tracing::error!("Failed to prune epoch table for epoch {}: {}", epoch, e); + }); + Ok(()) + } + async fn get_network_total_transactions_by_end_of_epoch( &self, epoch: u64, diff --git a/crates/sui-indexer/src/types.rs b/crates/sui-indexer/src/types.rs index c29bbd6c626b8..7eb2c0071ce7f 100644 --- a/crates/sui-indexer/src/types.rs +++ b/crates/sui-indexer/src/types.rs @@ -45,6 +45,8 @@ pub struct IndexedCheckpoint { pub successful_tx_num: usize, pub end_of_epoch_data: Option, pub end_of_epoch: bool, + pub min_tx_sequence_number: u64, + pub max_tx_sequence_number: u64, } impl IndexedCheckpoint { @@ -57,6 +59,9 @@ impl IndexedCheckpoint { + checkpoint.epoch_rolling_gas_cost_summary.storage_cost as i64 - checkpoint.epoch_rolling_gas_cost_summary.storage_rebate as i64; let tx_digests = contents.iter().map(|t| t.transaction).collect::>(); + let max_tx_sequence_number = checkpoint.network_total_transactions - 1; + // NOTE: + 1u64 first to avoid subtraction with overflow + let min_tx_sequence_number = max_tx_sequence_number + 1u64 - tx_digests.len() as u64; let auth_sig = &checkpoint.auth_sig().signature; Self { sequence_number: checkpoint.sequence_number, @@ -78,6 +83,8 @@ impl IndexedCheckpoint { timestamp_ms: checkpoint.timestamp_ms, validator_signature: auth_sig.clone(), checkpoint_commitments: checkpoint.checkpoint_commitments.clone(), + min_tx_sequence_number, + max_tx_sequence_number, } } } From 3781c364f972e4b16a301127bc587f873f647861 Mon Sep 17 00:00:00 2001 From: Nikhil-Mysten <128089541+Nikhil-Mysten@users.noreply.github.com> Date: Fri, 19 Jul 2024 18:27:58 -0400 Subject: [PATCH 095/163] [wallet]: add token metadata overrides (#18726) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../src/shared/experimentation/features.ts | 1 + .../src/ui/app/components/coin-icon/index.tsx | 6 +++++- .../ui/app/hooks/useCoinMetadataOverride.ts | 20 +++++++++++++++++++ .../app/pages/home/tokens/TokensDetails.tsx | 4 +++- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 apps/wallet/src/ui/app/hooks/useCoinMetadataOverride.ts diff --git a/apps/wallet/src/shared/experimentation/features.ts b/apps/wallet/src/shared/experimentation/features.ts index d887ea49262dd..44168f162820a 100644 --- a/apps/wallet/src/shared/experimentation/features.ts +++ b/apps/wallet/src/shared/experimentation/features.ts @@ -29,6 +29,7 @@ export enum FEATURES { WALLET_DEFI = 'wallet-defi', WALLET_FEE_ADDRESS = 'wallet-fee-address', DEEP_BOOK_CONFIGS = 'deep-book-configs', + TOKEN_METADATA_OVERRIDES = 'token-metadata-overrides', } export function setAttributes(network?: { apiEnv: API_ENV; customRPC?: string | null }) { diff --git a/apps/wallet/src/ui/app/components/coin-icon/index.tsx b/apps/wallet/src/ui/app/components/coin-icon/index.tsx index 4f11b17f47b26..7a4fc107c09a3 100644 --- a/apps/wallet/src/ui/app/components/coin-icon/index.tsx +++ b/apps/wallet/src/ui/app/components/coin-icon/index.tsx @@ -7,6 +7,8 @@ import { Sui, Unstaked } from '@mysten/icons'; import { SUI_TYPE_ARG } from '@mysten/sui/utils'; import { cva, type VariantProps } from 'class-variance-authority'; +import { useCoinMetadataOverrides } from '../../hooks/useCoinMetadataOverride'; + const imageStyle = cva(['rounded-full flex'], { variants: { size: { @@ -38,11 +40,13 @@ type NonSuiCoinProps = { function NonSuiCoin({ coinType }: NonSuiCoinProps) { const { data: coinMeta } = useCoinMetadata(coinType); + const coinMetadataOverrides = useCoinMetadataOverrides(); + return (
{coinMeta?.iconUrl ? ( ( + FEATURES.TOKEN_METADATA_OVERRIDES, + ).value; + + return coinMetadataOverrides || {}; +} diff --git a/apps/wallet/src/ui/app/pages/home/tokens/TokensDetails.tsx b/apps/wallet/src/ui/app/pages/home/tokens/TokensDetails.tsx index b2676a7fe0816..0f33077f2d644 100644 --- a/apps/wallet/src/ui/app/pages/home/tokens/TokensDetails.tsx +++ b/apps/wallet/src/ui/app/pages/home/tokens/TokensDetails.tsx @@ -27,6 +27,7 @@ import { AccountsList } from '_src/ui/app/components/accounts/AccountsList'; import { UnlockAccountButton } from '_src/ui/app/components/accounts/UnlockAccountButton'; import { BuyNLargeHomePanel } from '_src/ui/app/components/buynlarge/HomePanel'; import { useActiveAccount } from '_src/ui/app/hooks/useActiveAccount'; +import { useCoinMetadataOverrides } from '_src/ui/app/hooks/useCoinMetadataOverride'; import { usePinnedCoinTypes } from '_src/ui/app/hooks/usePinnedCoinTypes'; import FaucetRequestButton from '_src/ui/app/shared/faucet/FaucetRequestButton'; import PageTitle from '_src/ui/app/shared/PageTitle'; @@ -120,6 +121,7 @@ export function TokenRow({ const isRenderSwapButton = allowedSwapCoinsList.includes(coinType); + const coinMetadataOverrides = useCoinMetadataOverrides(); return (
- {coinMeta?.name || symbol} + {coinMetadataOverrides[coinBalance.coinType]?.name || coinMeta?.name || symbol} {renderActions && ( From 05cc24936158e0cc10191baeb39008cf4eb8cacd Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:50:05 -0700 Subject: [PATCH 096/163] [bridge] add url update event in rust (#18734) ## Description as title. ## Test plan unit test --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-bridge/src/events.rs | 64 +++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/crates/sui-bridge/src/events.rs b/crates/sui-bridge/src/events.rs index 1d0a26adaff12..6072f9fd8b23e 100644 --- a/crates/sui-bridge/src/events.rs +++ b/crates/sui-bridge/src/events.rs @@ -104,6 +104,13 @@ pub struct MoveCommitteeUpdateEvent { pub stake_participation_percentage: u64, } +// `CommitteeMemberUrlUpdateEvent` emitted in committee.move +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct MoveCommitteeMemberUrlUpdateEvent { + pub member: Vec, + pub new_url: Vec, +} + // `BlocklistValidatorEvent` emitted in committee.move #[derive(Debug, Serialize, Deserialize, Clone)] pub struct MoveBlocklistValidatorEvent { @@ -262,6 +269,27 @@ impl TryFrom for BlocklistValidatorEvent { } } +// Sanitized version of MoveCommitteeMemberUrlUpdateEvent +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] +pub struct CommitteeMemberUrlUpdateEvent { + pub member: BridgeAuthorityPublicKey, + pub new_url: String, +} + +impl TryFrom for CommitteeMemberUrlUpdateEvent { + type Error = BridgeError; + + fn try_from(event: MoveCommitteeMemberUrlUpdateEvent) -> BridgeResult { + let member = BridgeAuthorityPublicKey::from_bytes(&event.member).map_err(|e| + BridgeError::Generic(format!("Failed to convert MoveBlocklistValidatorEvent to BlocklistValidatorEvent. Failed to convert public key to BridgeAuthorityPublicKey: {:?}", e)) + )?; + let new_url = String::from_utf8(event.new_url).map_err(|e| + BridgeError::Generic(format!("Failed to convert MoveBlocklistValidatorEvent to BlocklistValidatorEvent. Failed to convert new_url to String: {:?}", e)) + )?; + Ok(Self { member, new_url }) + } +} + impl TryFrom for EmittedSuiToEthTokenBridgeV1 { type Error = BridgeError; @@ -327,6 +355,7 @@ crate::declare_events!( // because the info provided by validators could be invalid CommitteeMemberRegistration(MoveTypeCommitteeMemberRegistration) => ("committee::CommitteeMemberRegistration", MoveTypeCommitteeMemberRegistration), CommitteeUpdateEvent(CommitteeUpdate) => ("committee::CommitteeUpdateEvent", MoveCommitteeUpdateEvent), + CommitteeMemberUrlUpdateEvent(CommitteeMemberUrlUpdateEvent) => ("committee::CommitteeMemberUrlUpdateEvent", MoveCommitteeMemberUrlUpdateEvent), BlocklistValidatorEvent(BlocklistValidatorEvent) => ("committee::BlocklistValidatorEvent", MoveBlocklistValidatorEvent), TokenRegistrationEvent(TokenRegistrationEvent) => ("treasury::TokenRegistrationEvent", MoveTokenRegistrationEvent), NewTokenEvent(NewTokenEvent) => ("treasury::NewTokenEvent", MoveNewTokenEvent), @@ -393,6 +422,7 @@ impl SuiBridgeEvent { SuiBridgeEvent::EmergencyOpEvent(_event) => None, SuiBridgeEvent::CommitteeMemberRegistration(_event) => None, SuiBridgeEvent::CommitteeUpdateEvent(_event) => None, + SuiBridgeEvent::CommitteeMemberUrlUpdateEvent(_event) => None, SuiBridgeEvent::BlocklistValidatorEvent(_event) => None, SuiBridgeEvent::TokenRegistrationEvent(_event) => None, SuiBridgeEvent::NewTokenEvent(_event) => None, @@ -406,6 +436,7 @@ pub mod tests { use std::collections::HashSet; use super::*; + use crate::crypto::BridgeAuthorityKeyPair; use crate::e2e_tests::test_utils::BridgeTestClusterBuilder; use crate::types::BridgeAction; use crate::types::SuiToEthBridgeAction; @@ -415,6 +446,7 @@ pub mod tests { use sui_types::base_types::SuiAddress; use sui_types::bridge::BridgeChainId; use sui_types::bridge::TOKEN_ID_SUI; + use sui_types::crypto::get_key_pair; use sui_types::digests::TransactionDigest; use sui_types::event::EventID; use sui_types::Identifier; @@ -468,11 +500,11 @@ pub mod tests { } #[tokio::test(flavor = "multi_thread", worker_threads = 8)] - async fn test_bridge_events_conversion() { + async fn test_bridge_events_when_init() { telemetry_subscribers::init_for_testing(); init_all_struct_tags(); let mut bridge_test_cluster = BridgeTestClusterBuilder::new() - .with_eth_env(true) + .with_eth_env(false) .with_bridge_cluster(false) .build() .await; @@ -504,6 +536,34 @@ pub mod tests { // TODO: trigger other events and make sure they are converted correctly } + #[test] + fn test_conversion_for_committee_member_url_update_event() { + let (_, kp): (_, BridgeAuthorityKeyPair) = get_key_pair(); + let new_url = "https://example.com:443"; + let event: CommitteeMemberUrlUpdateEvent = MoveCommitteeMemberUrlUpdateEvent { + member: kp.public.as_bytes().to_vec(), + new_url: new_url.as_bytes().to_vec(), + } + .try_into() + .unwrap(); + assert_eq!(event.member, kp.public); + assert_eq!(event.new_url, new_url); + + CommitteeMemberUrlUpdateEvent::try_from(MoveCommitteeMemberUrlUpdateEvent { + member: vec![1, 2, 3], + new_url: new_url.as_bytes().to_vec(), + }) + .unwrap_err(); + + CommitteeMemberUrlUpdateEvent::try_from(MoveCommitteeMemberUrlUpdateEvent { + member: kp.public.as_bytes().to_vec(), + new_url: [240, 130, 130, 172].into(), + }) + .unwrap_err(); + } + + // TODO: add conversion tests for other events + #[test] fn test_0_sui_amount_conversion_for_sui_event() { let emitted_event = MoveTokenDepositedEvent { From e967cb7abe709d6b98e8c92b9ee460e8b6d17e26 Mon Sep 17 00:00:00 2001 From: Tim Zakian <2895723+tzakian@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:42:07 -0700 Subject: [PATCH 097/163] [move] Add printout of input commands in transactional test runner (#18601) ## Description Adds a printout of the command run in the expected files for the Move transactional test runner, and also adds a way for custom subcommands to change this (and this is then used for PTBs in transactional tests). The bottom commit contains the actual changes, and the top commit contains all of the changes to expected value files. ## Test plan Update existing tests with the new output. --- .../tests/call/simple.exp | 9 +- .../tests/child_count/count_decremented.exp | 48 +- .../tests/child_count/delete_by_wrap.exp | 15 +- .../child_count/delete_by_wrap_one_txn.exp | 6 +- .../child_count/delete_parent_invalid.exp | 15 +- .../tests/child_count/delete_parent_valid.exp | 18 +- .../delete_parent_valid_one_txn.exp | 15 +- .../child_count/freeze_parent_invalid.exp | 15 +- .../tests/child_count/freeze_parent_valid.exp | 18 +- .../freeze_parent_valid_one_txn.exp | 15 +- .../non_zero_child_count_valid.exp | 27 +- .../non_zero_child_count_valid_one_txn.exp | 9 +- .../tests/child_count/temp_parent_invalid.exp | 6 +- .../tests/child_count/unwrap_never_stored.exp | 9 +- .../unwrap_never_stored_transfer.exp | 9 +- .../unwrap_then_delete_invalid.exp | 12 +- .../tests/children/child_of_shared_object.exp | 24 +- .../deny_list_v1/coin_deny_and_undeny.exp | 39 +- .../coin_deny_multiple_per_module.exp | 45 +- .../tests/deny_list_v1/coin_deny_tto.exp | 36 +- .../coin_deny_and_undeny_receiver.exp | 30 +- .../coin_deny_and_undeny_sender.exp | 30 +- .../tests/deny_list_v2/coin_global_pause.exp | 63 +- .../delete_setting_object_same_epoch.exp | 33 +- .../delete_setting_object_set_once.exp | 51 +- .../delete_setting_object_set_twice.exp | 66 +- .../tests/deny_list_v2/double_add.exp | 30 +- .../send_many_coins_unregulated.exp | 15 +- .../tests/dev_inspect/load_old_object.exp | 35 +- .../tests/dynamic_fields/add_duplicate.exp | 9 +- .../dynamic_fields/add_duplicate_object.exp | 9 +- .../tests/dynamic_fields/bench.exp | 6 +- .../dynamic_fields/borrow_wrong_type.exp | 12 +- .../borrow_wrong_type_object.exp | 12 +- .../dynamic_object_field_swap.exp | 21 +- .../tests/dynamic_fields/exhaustive.exp | 30 +- .../dynamic_fields/exhaustive_object.exp | 30 +- .../read_field_from_immutable.exp | 9 +- ...eceive_remove_add_back_and_remove_type.exp | 27 +- .../remove_add_back_and_remove.exp | 24 +- .../remove_add_back_and_remove_type.exp | 12 +- .../dynamic_fields/remove_wrong_type.exp | 9 +- .../remove_wrong_type_object.exp | 9 +- .../tests/dynamic_fields/shared_object.exp | 24 +- .../tests/dynamic_fields/transfer_object.exp | 30 +- .../tests/dynamic_fields/unwrap_object.exp | 27 +- .../tests/dynamic_fields/wrap_object.exp | 33 +- .../wrapped_uid_after_delete.exp | 27 +- .../tests/entry_points/ascii.exp | 15 +- .../tests/entry_points/generic_by_ref.exp | 3 +- .../entry_points/generic_by_ref_invalid.exp | 12 +- .../tests/entry_points/imm_txn_context.exp | 12 +- .../tests/entry_points/missing_type.exp | 18 +- .../tests/entry_points/no_txn_context.exp | 9 +- .../tests/entry_points/obj_vector.exp | 54 +- .../tests/entry_points/obj_vector_generic.exp | 51 +- .../entry_points/obj_vector_generic_v20.exp | 51 +- .../tests/entry_points/obj_vector_v20.exp | 54 +- .../tests/entry_points/utf8.exp | 21 +- .../tests/entry_points/wrong_visibility.exp | 15 +- .../tests/enums/basic_enums.exp | 15 +- .../tests/enums/coin_wrapper.exp | 8 +- .../tests/enums/enum_events.exp | 15 +- .../tests/enums/enum_otw_check.exp | 6 +- .../tests/enums/enum_with_key_only.exp | 15 +- .../enums/enum_with_key_only_uid_field.exp | 15 +- .../tests/enums/enum_with_key_store.exp | 30 +- .../enums/enum_with_key_store_uid_field.exp | 30 +- .../tests/enums/enums_upgrade.exp | 27 +- .../tests/enums/enums_upgrade_add_variant.exp | 18 +- .../tests/epoch/advance.exp | 15 +- .../tests/init/entry_new.exp | 6 +- .../tests/init/entry_old.exp | 6 +- .../tests/mvcc/child_of_child.exp | 50 +- .../tests/mvcc/find_all_uids.exp | 50 +- .../tests/mvcc/find_all_uids_dof.exp | 50 +- .../tests/mvcc/find_all_uids_dof_enum.exp | 53 +- .../tests/mvcc/find_all_uids_enums.exp | 53 +- .../tests/mvcc/find_all_uids_on_child.exp | 50 +- .../mvcc/find_all_uids_on_child_enum.exp | 53 +- .../mvcc/middle_version_less_than_child.exp | 36 +- .../middle_version_less_than_child_enum.exp | 36 +- .../tests/mvcc/not_root_version.exp | 58 +- .../mvcc/not_root_version_flipped_case.exp | 50 +- ...eceive_object_access_through_parent_df.exp | 39 +- ...ceive_object_access_through_parent_dof.exp | 45 +- .../tests/mvcc/receive_object_dof.exp | 79 ++- .../tests/mvcc/v0/child_of_child.exp | 50 +- .../tests/mvcc/v0/find_all_uids.exp | 50 +- .../tests/mvcc/v0/find_all_uids_dof.exp | 50 +- .../tests/mvcc/v0/find_all_uids_on_child.exp | 50 +- .../v0/middle_version_less_than_child.exp | 36 +- .../tests/mvcc/v0/not_root_version.exp | 58 +- .../mvcc/v0/not_root_version_flipped_case.exp | 50 +- .../borrowed_arg_copyable_invalid.exp | 19 +- .../borrowed_arg_non_copyable_invalid.exp | 43 +- .../borrowed_arg_primitives_invalid.exp | 16 +- .../tests/programmable/borrowed_arg_valid.exp | 21 +- .../tests/programmable/cannot_call_emit.exp | 20 +- .../tests/programmable/cannot_call_init.exp | 7 +- .../programmable/cannot_call_private.exp | 7 +- .../tests/programmable/coin_negative.exp | 16 +- .../coin_operations_custom_coin.exp | 20 +- .../coin_operations_non_coins.exp | 28 +- .../tests/programmable/coin_overflow.exp | 17 +- .../delayed_invalid_gas_by_value.exp | 16 +- .../delayed_invalid_object_by_value.exp | 27 +- .../programmable/gas_coin_by_reference.exp | 33 +- .../tests/programmable/gas_coin_by_value.exp | 7 +- .../gas_coin_by_value_invalid.exp | 32 +- .../programmable/generics_substitution.exp | 24 +- .../tests/programmable/invalid_option.exp | 76 ++- .../invalid_public_function_return.exp | 15 +- .../programmable/invalid_result_arity.exp | 33 +- .../tests/programmable/make_vec_objects.exp | 44 +- .../make_vec_special_validation_invalid.exp | 15 +- .../merge_coin_mismatched_coin.exp | 32 +- .../programmable/nested_result_zero_zero.exp | 9 +- .../non_primitive_non_object_arguments.exp | 11 +- .../programmable/out_of_bounds_input.exp | 67 +- .../programmable/out_of_bounds_nested.exp | 83 ++- .../programmable/out_of_bounds_result.exp | 75 ++- ...value_restriction_by_ref_input_invalid.exp | 25 +- ...y_value_restriction_by_ref_input_valid.exp | 26 +- ...y_value_restriction_copied_input_valid.exp | 8 +- ...alue_restriction_make_move_vec_invalid.exp | 22 +- ..._value_restriction_make_move_vec_valid.exp | 23 +- ...lue_restriction_non_pure_input_invalid.exp | 19 +- ...e_entry_value_restriction_per_argument.exp | 20 +- ...ate_entry_value_restriction_type_check.exp | 17 +- .../programmable/private_transfer_invalid.exp | 50 +- .../programmable/private_transfer_valid.exp | 27 +- .../programmable/pure_arg_type_change.exp | 35 +- .../tests/programmable/split_coins.exp | 71 ++- .../programmable/split_coins_invalid.exp | 53 +- .../tests/programmable/transfer_objects.exp | 50 +- .../transfer_objects_invalid_address.exp | 22 +- .../transfer_objects_invalid_object.exp | 37 +- .../programmable/unused_values_invalid.exp | 26 +- .../programmable/unused_values_valid.exp | 29 +- .../bad_syntax.exp | 8 +- .../coin_limit.exp | 39 +- .../make_vec.exp | 40 +- .../make_vec_shared.exp | 14 +- .../merge_coin_shared.exp | 13 +- .../merge_coin_shared_real_coin.exp | 13 +- .../publish.exp | 19 +- .../receipt.exp | 12 +- .../split_coin_share.exp | 31 +- .../transfer_shared.exp | 13 +- .../upgrade.exp | 33 +- .../tests/publish/init.exp | 9 +- .../tests/publish/init_param.exp | 3 +- .../tests/publish/init_public.exp | 3 +- .../tests/publish/init_ret.exp | 3 +- .../tests/publish/multi_module_publish.exp | 6 +- .../tests/publish/publish_with_upgrade.exp | 6 +- .../tests/random/happy_flows.exp | 40 +- .../random/move_call_clock_after_random.exp | 8 +- ...e_call_clock_after_random_and_transfer.exp | 10 +- .../random/move_call_u64_after_random.exp | 8 +- .../random/two_move_calls_with_random.exp | 8 +- .../tests/receive_object/basic_receive.exp | 24 +- .../tests/receive_object/drop_receiving.exp | 21 +- .../duplicate_receive_argument.exp | 20 +- .../move_vec_receiving_types.exp | 56 +- .../pass_receiver_immut_then_reuse.exp | 17 +- .../pass_receiver_mut_then_reuse.exp | 17 +- .../receive_object/pt_receive_type_fixing.exp | 57 +- .../receive_add_dof_and_mutate.exp | 30 +- .../receive_object/receive_and_abort.exp | 21 +- .../receive_object/receive_and_deleted.exp | 24 +- .../receive_object/receive_and_send_back.exp | 24 +- .../tests/receive_object/receive_and_wrap.exp | 24 +- .../tests/receive_object/receive_by_ref.exp | 60 +- .../receive_by_value_flow_through.exp | 18 +- .../receive_object/receive_dof_and_mutate.exp | 33 +- .../receive_object/receive_duo_struct.exp | 32 +- .../receive_invalid_param_ty.exp | 42 +- .../receive_object/receive_invalid_type.exp | 15 +- .../receive_object/receive_many_move_vec.exp | 93 ++- .../receive_multiple_times_in_row.exp | 36 +- .../receive_object/receive_object_id.exp | 29 +- .../receive_object/receive_object_owner.exp | 21 +- .../receive_return_object_dont_touch.exp | 22 +- .../receive_return_object_then_transfer.exp | 23 +- .../receive_ticket_coin_operations.exp | 34 +- .../shared_parent/basic_receive.exp | 24 +- .../shared_parent/drop_receiving.exp | 21 +- .../shared_parent/receive_dof_and_mutate.exp | 33 +- .../receive_multiple_times_in_row.exp | 36 +- .../shared_parent/transfer_then_share.exp | 24 +- .../take_receiver_then_try_to_reuse.exp | 17 +- .../receive_object/transfer_object_cyclic.exp | 6 +- .../runtime_behavior/error_locations.exp | 15 +- .../versioned_check_swap_loc_new.exp | 9 +- .../versioned_check_swap_loc_old.exp | 9 +- .../tests/shared/add_dynamic_field.exp | 21 +- .../tests/shared/become_dynamic_field.exp | 21 +- .../shared/become_dynamic_object_field.exp | 21 +- .../by_value_shared_object_deletion.exp | 24 +- ...ared_object_deletion_via_make_move_vec.exp | 34 +- ...bject_deletion_via_make_move_vec_fails.exp | 124 +++- ...value_shared_object_deletion_via_merge.exp | 68 ++- ...shared_object_deletion_via_merge_fails.exp | 98 ++- ...e_shared_object_deletion_via_move_call.exp | 41 +- ...ed_object_deletion_via_move_call_fails.exp | 75 ++- .../shared/by_value_shared_object_v20.exp | 18 +- .../tests/shared/freeze.exp | 12 +- .../tests/shared/re_share.exp | 33 +- .../tests/shared/re_share_v45.exp | 33 +- .../tests/shared/transfer.exp | 12 +- .../tests/shared/upgrade.exp | 18 +- .../tests/shared/wrap.exp | 12 +- .../size_limits/deleted_id_limits_tests.exp | 18 +- .../tests/size_limits/event_limits_tests.exp | 27 +- .../event_limits_tests_out_of_gas.exp | 15 +- .../size_limits/identitifer_len_limits.exp | 9 +- .../size_limits/move_object_size_limit.exp | 12 +- .../tests/size_limits/new_id_limits_tests.exp | 18 +- .../size_limits/object_runtime_limits.exp | 15 +- .../transfered_id_limits_tests.exp | 24 +- .../tests/size_limits/vector_len_limits.exp | 15 +- .../tests/sui/coin_in_vec.exp | 14 +- .../tests/sui/coin_transfer.exp | 23 +- .../tests/sui/freeze.exp | 15 +- .../tests/sui/freeze_v20.exp | 15 +- .../sui/move_call_args_type_mismatch.exp | 9 +- .../sui/move_call_incorrect_function.exp | 9 +- .../tests/sui/object_basics.exp | 24 +- .../sui/publish_module_non_zero_address.exp | 3 +- .../tests/sui/unwrap.exp | 18 +- .../tests/sui/unwrap_then_delete.exp | 18 +- .../tests/sui/unwrap_then_freeze.exp | 18 +- .../transfer_object/does_not_have_store.exp | 27 +- .../does_not_have_store_receive.exp | 76 ++- .../does_not_have_store_receive_version30.exp | 65 +- .../tests/transfer_object/has_store.exp | 27 +- .../tests/transfer_object/immutable.exp | 15 +- .../tests/transfer_object/immutable_v20.exp | 15 +- .../tests/transfer_object/package.exp | 12 +- .../tests/transfer_object/quasi_shared.exp | 18 +- .../tests/transfer_object/shared.exp | 27 +- .../tests/transfer_object/shared_v20.exp | 15 +- .../tests/transfer_object/transfer_coin.exp | 13 +- .../tests/transfer_object/wrap_unwrap.exp | 21 +- .../tests/upgrade/abort_code_resolution.exp | 18 +- .../upgrade/abort_code_resolution_v46.exp | 18 +- .../upgrade/add_ability_during_upgrade.exp | 33 +- .../add_ability_during_upgrade_enum.exp | 27 +- .../add_ability_during_upgrade_generics.exp | 15 +- ...d_ability_during_upgrade_generics_enum.exp | 15 +- .../tests/upgrade/add_key_during_upgrade.exp | 6 +- .../tests/upgrade/add_new_type_with_key.exp | 6 +- .../tests/upgrade/basic.exp | 6 +- .../tests/upgrade/constants.exp | 27 +- .../tests/upgrade/dep_override.exp | 62 +- .../tests/upgrade/enum_struct_swap.exp | 6 +- .../tests/upgrade/enums.exp | 24 +- .../tests/upgrade/friend_fun_changes.exp | 21 +- .../upgrade/large_module_inclusion_checks.exp | 24 +- .../tests/upgrade/linkage.exp | 12 +- .../tests/upgrade/modules.exp | 15 +- .../tests/upgrade/multi_version.exp | 9 +- .../tests/upgrade/new_types.exp | 45 +- .../tests/upgrade/private_fun_changes.exp | 27 +- .../tests/upgrade/public_fun_changes.exp | 27 +- .../tests/upgrade/publisher.exp | 12 +- ...ve_ability_during_upgrade_fun_generics.exp | 15 +- ...remove_ability_during_upgrade_generics.exp | 18 +- .../tests/upgrade/remove_phantom.exp | 9 +- .../tests/upgrade/remove_phantom_enum.exp | 9 +- .../tests/upgrade/struct_enum_swap.exp | 6 +- .../tests/upgrade/structs.exp | 18 +- .../tests/upgrade/transitive_linkage.exp | 18 +- .../tests/upgrade/type_names.exp | 57 +- .../tests/upgrade/upgrade_ratchet.exp | 42 +- .../tests/available_range/available_range.exp | 12 +- .../call/checkpoint_connection_pagination.exp | 51 +- .../tests/call/coin_metadata.exp | 20 +- .../tests/call/dynamic_fields.exp | 36 +- .../tests/call/owned_objects.exp | 30 +- .../tests/call/simple.exp | 75 ++- .../tests/consistency/balances.exp | 89 ++- .../checkpoints/transaction_blocks.exp | 45 +- .../tests/consistency/coins.exp | 53 +- .../consistency/dynamic_fields/deleted_df.exp | 36 +- .../dynamic_fields/deleted_dof.exp | 38 +- .../dof_add_reclaim_transfer.exp | 26 +- .../dof_add_reclaim_transfer_reclaim_add.exp | 30 +- .../dynamic_fields/dynamic_fields.exp | 104 +++- .../dynamic_fields/immutable_dof.exp | 48 +- .../consistency/dynamic_fields/mutated_df.exp | 48 +- .../dynamic_fields/mutated_dof.exp | 41 +- .../consistency/dynamic_fields/nested_dof.exp | 48 +- .../tests/consistency/epochs/checkpoints.exp | 45 +- .../consistency/epochs/transaction_blocks.exp | 75 ++- .../tests/consistency/object_at_version.exp | 57 +- .../tests/consistency/objects_pagination.exp | 64 +- .../consistency/objects_pagination_single.exp | 42 +- .../consistency/performance/many_objects.exp | 36 +- .../tests/consistency/staked_sui.exp | 46 +- .../tests/consistency/tx_address_objects.exp | 53 +- .../tests/datetime/datetime.exp | 39 +- .../tests/epoch/epoch.exp | 35 +- .../tests/epoch/system_state.exp | 72 ++- .../tests/errors/clever_errors.exp | 84 ++- .../tests/errors/clever_errors_in_macros.exp | 18 +- .../event_connection/event_connection.exp | 48 +- .../event_connection/nested_emit_event.exp | 24 +- .../tests/event_connection/pagination.exp | 24 +- .../tests/limits/directives.exp | 21 +- .../tests/limits/output_node_estimation.exp | 45 +- .../tests/objects/coin.exp | 9 +- .../tests/objects/data.exp | 14 +- .../tests/objects/display.exp | 48 +- .../tests/objects/enum_data.exp | 14 +- .../tests/objects/filter_by_type.exp | 50 +- .../tests/objects/pagination.exp | 39 +- .../tests/objects/public_transfer.exp | 15 +- .../tests/objects/received.exp | 12 +- .../tests/objects/staked_sui.exp | 20 +- .../tests/owner/downcasts.exp | 11 +- .../tests/owner/root_version.exp | 48 +- .../tests/packages/datatypes.exp | 24 +- .../tests/packages/enums.exp | 21 +- .../tests/packages/friends.exp | 24 +- .../tests/packages/functions.exp | 27 +- .../tests/packages/modules.exp | 15 +- .../tests/packages/structs.exp | 30 +- .../tests/packages/types.exp | 33 +- .../balance_changes.exp | 28 +- .../dependencies.exp | 37 +- .../transaction_block_effects/events.exp | 27 +- .../object_changes.exp | 15 +- .../tests/transactions/errors.exp | 25 +- .../tests/transactions/programmable.exp | 73 ++- .../tests/transactions/random.exp | 15 +- .../tests/transactions/shared.exp | 22 +- .../tests/transactions/system.exp | 15 +- .../tests/validator/validator.exp | 84 ++- .../src/test_adapter.rs | 33 +- .../tests/entry_points/clock_mut.exp | 3 +- .../tests/entry_points/clock_ref.exp | 3 +- .../tests/entry_points/clock_val.exp | 3 +- .../generic_and_generic_object_params.exp | 3 +- .../generic_obj_mut_ref_vector.exp | 3 +- .../entry_points/generic_obj_ref_vector.exp | 3 +- .../generic_param_after_primitive.exp | 3 +- .../entry_points/generic_with_key_invalid.exp | 6 +- .../entry_points/generic_with_key_valid.exp | 3 +- .../tests/entry_points/id.exp | 3 +- .../nested_generic_vector_param.exp | 3 +- .../nested_key_generic_vector_param.exp | 3 +- .../tests/entry_points/non_key_struct.exp | 3 +- .../entry_points/non_key_struct_generic.exp | 6 +- .../non_key_struct_generic_valid.exp | 3 +- .../entry_points/non_key_struct_vector.exp | 3 +- .../tests/entry_points/obj_mut_ref_vector.exp | 3 +- .../tests/entry_points/obj_ref_vector.exp | 3 +- .../tests/entry_points/ok.exp | 6 +- .../tests/entry_points/option.exp | 3 +- .../entry_points/optional_txn_context.exp | 6 +- .../tests/entry_points/random_mut.exp | 3 +- .../tests/entry_points/random_ref.exp | 3 +- .../tests/entry_points/random_val.exp | 3 +- .../tests/entry_points/return_values.exp | 15 +- .../entry_points/return_values_invalid.exp | 18 +- .../single_generic_vector_param.exp | 3 +- .../tests/entry_points/single_type_param.exp | 3 +- .../single_type_param_generic_object.exp | 3 +- .../entry_points/single_type_param_key.exp | 3 +- .../tests/entry_points/string.exp | 3 +- .../tests/enums/enum_with_key_only.exp | 3 +- .../enums/enum_with_key_only_uid_field.exp | 3 +- ...num_with_key_only_uid_field_version_48.exp | 3 +- .../enums/enum_with_key_only_version_48.exp | 3 +- .../tests/enums/enum_with_key_store.exp | 3 +- .../enums/enum_with_key_store_uid_field.exp | 3 +- ...um_with_key_store_uid_field_version_48.exp | 3 +- .../enums/enum_with_key_store_version_48.exp | 3 +- ...mut_borrow_generic_key_struct_id_field.exp | 3 +- .../mut_borrow_key_struct_id_field.exp | 3 +- .../mut_borrow_key_struct_non_id_field.exp | 3 +- .../mut_borrow_non_key_struct_id_field.exp | 3 +- .../tests/id_immutable/write_id_field.exp | 3 +- .../id_leak/direct_leak_through_call.exp | 3 +- .../id_leak/indirect_leak_through_call.exp | 6 +- .../tests/id_leak/infinite_loop.exp | 6 +- .../tests/id_leak/loop.exp | 3 +- .../through_call_with_borrow_field.exp | 3 +- .../tests/id_leak/through_direct_return.exp | 3 +- .../tests/id_leak/through_indirect_return.exp | 3 +- .../tests/id_leak/through_pack.exp | 6 +- .../tests/id_leak/through_reference.exp | 3 +- .../tests/id_leak/through_vector.exp | 3 +- .../tests/id_leak/transmute.exp | 3 +- .../tests/init/cannot_call_init.exp | 3 +- .../tests/init/imm_tx_context.exp | 3 +- .../tests/init/must_have_txn_context.exp | 6 +- .../tests/init/not_generic.exp | 3 +- .../tests/init/not_private.exp | 9 +- .../tests/init/not_txn_context.exp | 9 +- .../tests/init/ok.exp | 3 +- .../tests/init/return_values.exp | 3 +- .../tests/one_time_witness/bool_field.exp | 3 +- .../tests/one_time_witness/enum_no_drop.exp | 3 +- .../enum_single_variant_bool_field.exp | 3 +- .../enum_single_variant_no_field.exp | 3 +- .../one_time_witness/enum_wrong_name.exp | 3 +- .../tests/one_time_witness/instantiate.exp | 3 +- .../one_time_witness/many_fields_invalid.exp | 3 +- .../one_time_witness/many_fields_valid.exp | 3 +- .../tests/one_time_witness/more_abilities.exp | 9 +- .../tests/one_time_witness/no_drop.exp | 3 +- .../tests/one_time_witness/no_field.exp | 3 +- .../tests/one_time_witness/no_init_arg.exp | 3 +- .../tests/one_time_witness/other_mod_def.exp | 3 +- .../tests/one_time_witness/type_param.exp | 3 +- .../one_time_witness/wrong_field_type.exp | 6 +- .../wrong_field_type_with_init.exp | 3 +- .../one_time_witness/wrong_init_type.exp | 3 +- .../tests/one_time_witness/wrong_name.exp | 3 +- .../one_time_witness/wrong_name_format.exp | 3 +- .../private_generics/no_public_transfer.exp | 12 +- .../no_public_transfer_explicit.exp | 42 +- .../no_public_transfer_generic.exp | 12 +- .../no_public_transfer_store.exp | 12 +- .../no_public_transfer_store_generic.exp | 12 +- .../private_generics/private_event_emit.exp | 24 +- .../public_transfer_with_store.exp | 12 +- .../public_transfer_with_store_generic.exp | 12 +- .../receive_with_and_without_store.exp | 12 +- .../private_generics/receive_without_key.exp | 6 +- .../receive_without_key_version30.exp | 6 +- .../private_transfer/transfer_invalid.exp | 12 +- .../key_struct_first_field_not_id.exp | 3 +- ...ruct_id_field_incorrect_struct_address.exp | 3 +- ..._struct_id_field_incorrect_struct_name.exp | 3 +- .../key_struct_id_field_incorrect_type.exp | 3 +- .../key_struct_id_field_valid.exp | 3 +- .../key_struct_second_field_id.exp | 3 +- .../struct_with_key/key_struct_with_drop.exp | 3 +- .../procedure_args.exp | 3 +- .../unrestricted_enum_has_resource_field.exp | 9 +- .../unrestricted_has_resource_field.exp | 3 +- .../128_params_and_128_locals.exp | 3 +- .../check_bounds/1_param_and_255_locals.exp | 3 +- .../tests/check_bounds/256_locals.exp | 3 +- .../tests/check_bounds/256_params.exp | 3 +- .../check_bounds/too_few_type_actuals.exp | 3 +- .../too_few_type_actuals_enum.exp | 3 +- .../check_bounds/too_many_type_actuals.exp | 3 +- .../too_many_type_actuals_enum.exp | 3 +- .../duplicate_enum_and_struct_names.exp | 3 +- .../check_duplication/duplicate_enum_name.exp | 3 +- .../duplicate_field_name.exp | 3 +- .../duplicate_field_name_enum.exp | 3 +- .../duplicate_function_name.exp | 3 +- .../duplicate_struct_name.exp | 3 +- .../duplicate_variant_name.exp | 3 +- .../tests/check_duplication/empty_enums.exp | 3 +- .../tests/check_duplication/empty_structs.exp | 3 +- .../friend_decl_duplicated.exp | 3 +- .../control_flow/if_branch_diverges_5.exp | 3 +- .../control_flow/if_branch_diverges_6.exp | 3 +- .../control_flow/if_branch_diverges_8.exp | 3 +- .../control_flow/invalid_fallthrough1.exp | 3 +- .../control_flow/invalid_fallthrough2.exp | 3 +- .../control_flow/invalid_fallthrough3.exp | 3 +- .../last_jump_unconditional_drop.exp | 3 +- .../last_jump_unconditional_reference.exp | 3 +- .../tests/control_flow/variant_switch.exp | 6 +- .../control_flow/variant_switch_successor.exp | 3 +- .../access_friend_function_invalid.exp | 3 +- .../dependencies/access_private_function.exp | 3 +- .../internal_function_invalid_call.exp | 3 +- .../dependencies/use_unpublished_module.exp | 3 +- .../enum_defs/enum_match_out_of_bounds.exp | 3 +- .../module_enum_struct_shared_name.exp | 3 +- .../tests/enum_defs/mutual_recursive_enum.exp | 3 +- .../tests/enum_defs/recursive_enum.exp | 15 +- .../tests/enum_defs/ref_in_enum.exp | 12 +- .../friends/friend_decl_different_address.exp | 3 +- .../tests/friends/friend_decl_self.exp | 3 +- .../tests/instantiation_loops/complex_1.exp | 9 +- .../instantiation_loops/complex_1_enum.exp | 9 +- ...recursive_three_args_type_con_shifting.exp | 3 +- ...sive_three_args_type_con_shifting_enum.exp | 3 +- ...y_recursive_two_args_swapping_type_con.exp | 3 +- ...ursive_two_args_swapping_type_con_enum.exp | 3 +- .../mutually_recursive_type_con.exp | 3 +- .../mutually_recursive_type_con_enum.exp | 3 +- .../instantiation_loops/nested_types_1.exp | 3 +- .../nested_types_1_enum.exp | 3 +- .../instantiation_loops/nested_types_2.exp | 3 +- .../nested_types_2_enum.exp | 3 +- .../nested_types_2_enum_struct.exp | 3 +- .../recursive_infinite_type_terminates.exp | 3 +- .../recursive_one_arg_type_con.exp | 3 +- .../recursive_one_arg_type_con_enum.exp | 3 +- .../recursive_two_args_swapping_type_con.exp | 3 +- ...ursive_two_args_swapping_type_con_enum.exp | 3 +- .../tests/instantiation_loops/two_loops.exp | 3 +- .../instantiation_loops/two_loops_enum.exp | 3 +- .../abort_unreleased_reference.exp | 3 +- .../locals_safety/abort_unused_resource.exp | 3 +- .../locals_safety/assign_enum_resource.exp | 6 +- .../locals_safety/assign_in_one_if_branch.exp | 3 +- .../tests/locals_safety/assign_resource.exp | 3 +- .../locals_safety/assign_wrong_if_branch.exp | 3 +- .../assign_wrong_if_branch_no_else.exp | 3 +- .../branch_assigns_then_moves.exp | 3 +- .../locals_safety/else_assigns_if_doesnt.exp | 3 +- .../locals_safety/else_moves_if_doesnt.exp | 3 +- .../enum_non_drop_assignment.exp | 6 +- .../locals_safety/if_assigns_else_doesnt.exp | 3 +- .../locals_safety/if_assigns_no_else.exp | 3 +- .../locals_safety/if_moves_else_doesnt.exp | 3 +- .../tests/locals_safety/if_moves_no_else.exp | 3 +- .../tests/locals_safety/join_failure.exp | 15 +- .../locals_safety/move_before_assign.exp | 3 +- .../tests/locals_safety/use_before_assign.exp | 3 +- ...s_non_droppable_resource_not_destroyed.exp | 3 +- .../tests/locals_safety/while_move_local.exp | 3 +- .../locals_safety/while_move_local_2.exp | 3 +- .../assign_field_after_local.exp | 3 +- .../assign_local_after_move.exp | 3 +- .../assign_local_struct_invalidated.exp | 3 +- .../tests/reference_safety/borrow_if.exp | 3 +- .../borrow_return_mutable_borrow_bad.exp | 3 +- .../copy_loc_borrowed_field_invalid.exp | 3 +- .../copy_loc_borrowed_indirect_invalid.exp | 3 +- .../copy_loc_borrowed_invalid.exp | 3 +- .../tests/reference_safety/deref_copy_bad.exp | 3 +- .../tests/reference_safety/deref_eq_bad.exp | 3 +- .../reference_safety/enum_variant_factor.exp | 18 +- .../tests/reference_safety/eq_bad.exp | 12 +- .../reference_safety/factor_invalid_1.exp | 6 +- .../reference_safety/factor_invalid_2.exp | 3 +- .../factor_invalid_2_enum.exp | 3 +- .../imm_borrow_on_mut_invalid.exp | 6 +- .../imm_borrow_on_mut_invalid_enum.exp | 6 +- .../imm_borrow_on_mut_trivial_invalid.exp | 3 +- ...imm_borrow_on_mut_trivial_invalid_enum.exp | 3 +- .../invalid_enum_ref_unpack.exp | 21 +- .../invalid_enum_ref_unpack_loop.exp | 15 +- .../mutable_borrow_invalid.exp | 6 +- .../mutable_borrow_local_twice_invalid.exp | 3 +- .../mutate_resource_holder.exp | 3 +- .../mutate_with_borrowed_loc_invalid.exp | 3 +- ...utate_with_borrowed_loc_struct_invalid.exp | 6 +- .../tests/reference_safety/no_borrow_ref.exp | 3 +- .../read_field_after_assign_local.exp | 3 +- .../read_local_ref_after_assign.exp | 3 +- .../read_local_ref_after_move.exp | 3 +- .../reference_safety/return_local_ref.exp | 3 +- .../return_with_borrowed_loc_invalid.exp | 12 +- ...urn_with_borrowed_loc_resource_invalid.exp | 3 +- .../tests/reference_safety/use_after_move.exp | 3 +- .../use_suffix_after_move.exp | 3 +- .../vector_ops_double_borrow.exp | 9 +- .../vector_ops_move_after_borrow.exp | 6 +- .../vector_ops_pop_after_borrow.exp | 6 +- .../writeref_borrow_invalid.exp | 3 +- .../script_with_type_parameters.exp | 3 +- .../script_signature/signer_double_signer.exp | 6 +- .../script_signature/struct_arguments.exp | 6 +- .../tests/signature/all_as_resource.exp | 3 +- .../tests/signature/all_as_unrestricted.exp | 3 +- .../signature/check_constraints_script.exp | 24 +- .../check_constraints_script_invalid.exp | 24 +- ...s_type_actual_for_bytecode_instruction.exp | 3 +- .../reference_as_type_actual_for_struct.exp | 3 +- ...n_struct_inst_for_bytecode_instruction.exp | 15 +- .../tests/signature/reference_in_fields.exp | 3 +- .../signature/resource_as_unrestricted.exp | 3 +- .../two_type_actuals_reverse_order.exp | 6 +- .../signature/unrestricted_as_resource.exp | 3 +- .../vector_ops_invalid_type_args.exp | 9 +- .../abort_negative_stack_size.exp | 3 +- .../stack_usage_verifier/abort_no_return.exp | 3 +- .../abort_positive_stack_size.exp | 3 +- .../cast_negative_stack.exp | 18 +- .../cast_positive_stack.exp | 18 +- .../exp_in_if_and_else_branch.exp | 3 +- .../function_call_negative_stack_err_1.exp | 3 +- .../function_call_negative_stack_err_2.exp | 3 +- ...tion_composition_pos_and_neg_stack_err.exp | 3 +- ...ction_composition_positive_stack_err_1.exp | 3 +- ...ction_composition_positive_stack_err_2.exp | 3 +- .../integer_stack_negative.exp | 18 +- .../integer_stack_positive.exp | 18 +- .../load_positive_stack.exp | 18 +- .../multiple_bindings_negative_stack.exp | 3 +- .../multiple_bindings_positive_stack.exp | 3 +- .../multiple_return_values_extra_binding.exp | 3 +- .../multiple_return_values_extra_value.exp | 3 +- ...multiple_return_values_missing_binding.exp | 3 +- .../multiple_return_values_missing_value.exp | 3 +- .../pack_invalid_number_arguments_enum.exp | 12 +- .../stack_usage_verifier/pop_negative.exp | 3 +- .../stack_usage_verifier/pop_positive.exp | 3 +- .../unpack_extra_binding.exp | 3 +- .../unpack_extra_binding_enum.exp | 12 +- .../unpack_missing_binding.exp | 3 +- .../unpack_missing_binding_enum.exp | 12 +- .../vector_ops_pack_unpack.exp | 12 +- .../struct_defs/mutual_recursive_struct.exp | 3 +- .../tests/struct_defs/recursive_struct.exp | 15 +- .../tests/struct_defs/ref_in_struct.exp | 12 +- .../type_safety/assign_local_resource.exp | 6 +- .../assign_local_resource_twice.exp | 6 +- .../type_safety/assign_resource_type.exp | 3 +- .../type_safety/assign_resource_type_enum.exp | 3 +- .../tests/type_safety/assign_wrong_type.exp | 3 +- .../type_safety/boolean_not_non_boolean.exp | 3 +- .../tests/type_safety/cant_deref_resource.exp | 6 +- .../casting_operators_types_mismatch.exp | 54 +- .../tests/type_safety/deref_non_reference.exp | 3 +- .../type_safety/deref_not_reference_bad.exp | 3 +- .../type_safety/destroy_resource_holder.exp | 3 +- .../tests/type_safety/equality_one_ref.exp | 3 +- .../type_safety/equality_resource_values.exp | 6 +- .../tests/type_safety/freeze_makes_imm.exp | 3 +- .../tests/type_safety/freeze_on_imm.exp | 3 +- .../tests/type_safety/freeze_wrong_type.exp | 3 +- .../type_safety/generic_abilities_call.exp | 3 +- ..._abilities_struct_non_nominal_resource.exp | 6 +- .../generic_abilities_type_param_all.exp | 3 +- .../generic_abilities_type_param_resource.exp | 3 +- .../type_safety/generic_abilities_unpack.exp | 6 +- .../type_safety/generic_import_function.exp | 6 +- .../generic_pack_type_mismatch.exp | 24 +- .../generic_unpack_type_mismatch.exp | 6 +- ...nteger_binary_operators_types_mismatch.exp | 573 ++++++++++++------ .../tests/type_safety/invalid_field_write.exp | 3 +- .../invalid_field_write_mut_unpack_enum.exp | 6 +- .../invalid_resouce_write_unpack_mut_enum.exp | 3 +- .../type_safety/invalid_resource_write.exp | 3 +- .../type_safety/mut_borrow_from_imm_ref.exp | 3 +- .../mut_borrow_from_imm_ref_enum.exp | 6 +- .../type_safety/mut_call_with_imm_ref.exp | 3 +- .../mut_call_with_imm_ref_enum.exp | 3 +- .../tests/type_safety/pack_enum_with_refs.exp | 27 +- ...ck_generic_enum_invalid_type_arguments.exp | 24 +- .../pack_generic_enum_non_generically.exp | 3 +- .../pack_non_generic_enum_generically.exp | 3 +- .../bytecode_ops_abilities_bad.exp | 30 +- .../constraints_abilities_bad.exp | 24 +- .../phantom_params/fields_abilities_bad.exp | 24 +- .../phantom_params/struct_definition_bad.exp | 36 +- .../type_safety/procedure_args_subtype.exp | 3 +- .../procedure_return_invalid_subtype.exp | 3 +- .../procedure_return_invalid_type.exp | 3 +- .../tests/type_safety/ref_type_param.exp | 24 +- .../type_safety/ref_type_param_exploits.exp | 30 +- .../tests/type_safety/release.exp | 6 +- .../resource_instantiate_bad_type.exp | 6 +- ...turn_type_mismatch_and_unused_resource.exp | 18 +- .../tests/type_safety/signer_copy_loc.exp | 3 +- .../signer_copy_loc_transitive.exp | 3 +- .../signer_does_not_have_store.exp | 3 +- .../tests/type_safety/signer_read_ref.exp | 3 +- .../signer_read_ref_transitive.exp | 6 +- .../type_safety/struct_kind_inference.exp | 30 +- .../type_safety/type_error_after_branch.exp | 3 +- .../unpack_generic_enum_non_generically.exp | 27 +- .../unpack_generic_enum_wrong_type_arg.exp | 27 +- .../unpack_non_generic_enum_generically.exp | 27 +- .../tests/type_safety/unpack_wrong_type.exp | 6 +- .../unrestricted_instantiate_bad_type.exp | 6 +- .../type_safety/unused_resource_holder.exp | 6 +- .../variant_switch_invalid_head_type.exp | 30 +- .../variant_switch_partial_enum_switch.exp | 6 +- .../type_safety/vector_ops_type_mismatch.exp | 24 +- .../type_safety/vector_pack_mismatch.exp | 12 +- .../tests/type_safety/vector_type_param.exp | 18 +- .../vector_type_param_exploits.exp | 12 +- .../tests/constants/default_int_size.exp | 3 +- .../derived_line_number_assertion.exp | 3 +- .../tests/constants/error_annotation.exp | 3 +- .../constants/error_annotation_abort.exp | 3 +- .../macro_call_line_number_assertion.exp | 6 +- .../constants/non_constant_empty_vec.exp | 21 +- .../control_flow/named_block_nesting.exp | 18 +- .../unused_signer_infinite_loop.exp | 3 +- .../tests/dependencies/public_package.exp | 3 +- .../public_package_different_packages.exp | 3 +- .../tests/evaluation_order/binop_aborts.exp | 21 +- .../tests/evaluation_order/lazy_assert.exp | 6 +- .../short_circuiting_invalid.exp | 15 +- .../evaluation_order/struct_arguments.exp | 15 +- .../tests/macros/break_from_macro_arg.exp | 3 +- .../tests/macros/lambda_return.exp | 6 +- .../tests/macros/method_is_by_value.exp | 12 +- .../method_is_by_value_even_when_ignored.exp | 6 +- .../operators/arithmetic_operators_u128.exp | 36 +- .../operators/arithmetic_operators_u16.exp | 36 +- .../operators/arithmetic_operators_u256.exp | 33 +- .../operators/arithmetic_operators_u32.exp | 33 +- .../operators/arithmetic_operators_u64.exp | 36 +- .../operators/arithmetic_operators_u8.exp | 36 +- .../tests/operators/casting_operators.exp | 84 ++- .../tests/operators/shift_operators.exp | 30 +- .../parser/control_exp_associativity.exp | 3 +- .../tests/parser/return_not_binary.exp | 6 +- .../declarations/function.exp | 6 +- .../bytecode-generation/declarations/let.exp | 6 +- .../expressions/binary_add.exp | 3 +- .../expressions/borrow.exp | 24 +- .../expressions/borrow_mut.exp | 9 +- .../expressions/builtins/vector.exp | 3 +- .../expressions/combined.exp | 3 +- .../bytecode-generation/expressions/pack.exp | 9 +- .../expressions/unpack.exp | 6 +- .../bytecode-generation/statements/assert.exp | 3 +- .../bytecode-generation/statements/assign.exp | 3 +- .../bytecode-generation/statements/enums.exp | 3 +- .../bytecode-generation/statements/jump.exp | 9 +- .../statements/jump_if.exp | 12 +- .../statements/jump_if_false.exp | 12 +- .../bytecode-generation/types/struct.exp | 3 +- .../tests/parsing/comments.exp | 18 +- .../tests/parsing/crlf.exp | 18 +- .../tests/parsing/enums.exp | 3 +- .../tests/parsing/keywords.exp | 3 +- .../tests/parsing/named_addresses.exp | 3 +- .../tests/parsing/structs.exp | 3 +- .../tests/parsing/types.exp | 6 +- .../src/framework.rs | 35 +- .../src/tasks.rs | 17 +- .../tests/vm_test_harness/example.exp | 9 +- .../vm_test_harness/multiple_modules.exp | 3 +- .../named_addresses_in_commands.exp | 3 +- .../tests/vm_test_harness/print_bytecode.exp | 6 +- .../builtins/vector_ops_out_of_bound.exp | 9 +- .../tests/builtins/vector_ops_pop_empty.exp | 6 +- .../tests/builtins/vector_ops_unpack_less.exp | 9 +- .../tests/builtins/vector_ops_unpack_more.exp | 9 +- .../tests/commands/abort_in_module.exp | 3 +- .../control_flow/fields_packed_in_order.exp | 3 +- .../tests/entry_points/call_native.exp | 9 +- .../entry_points/expected_0_args_got_1.exp | 3 +- .../expected_0_signer_args_got_1_ok.exp | 3 +- .../entry_points/expected_1_arg_got_0.exp | 3 +- .../entry_points/expected_1_arg_got_2.exp | 3 +- .../entry_points/expected_2_args_got_3.exp | 3 +- .../expected_2_signer_args_got_1.exp | 3 +- .../expected_u64_addr_got_addr.exp | 3 +- .../expected_u64_addr_got_addr_u64.exp | 3 +- .../expected_u64_addr_got_u64_u64.exp | 3 +- .../entry_points/expected_u64_got_address.exp | 3 +- .../entry_points/generic_return_values.exp | 48 +- .../modify_mutable_ref_inputs.exp | 6 +- .../tests/entry_points/ref_inputs.exp | 18 +- .../tests/entry_points/return_values.exp | 3 +- .../entry_points/script_too_few_type_args.exp | 3 +- .../script_too_few_type_args_inner.exp | 3 +- .../script_too_many_type_args.exp | 3 +- .../script_too_many_type_args_inner.exp | 3 +- .../script_type_arg_kind_mismatch_1.exp | 3 +- .../script_type_arg_kind_mismatch_2.exp | 3 +- .../entry_points/serializer_deserializer.exp | 3 +- .../tests/entry_points/struct_arguments.exp | 12 +- .../enums/basic_poly_enum_type_mismatch.exp | 6 +- .../enums/enum_variant_jump_same_label.exp | 9 +- .../tests/enums/enum_variant_mismatch.exp | 6 +- .../enums/enum_variant_tag_unpack_invalid.exp | 36 +- .../enums/mono/enum_decl_monomorphic.exp | 3 +- .../enum_decl_monomorphic_fail_unpack.exp | 6 +- ...m_decl_monomorphic_mismatched_variants.exp | 3 +- .../tests/enums/mono/mut_ref_update.exp | 3 +- .../enums/mono/mut_ref_update_variant.exp | 3 +- .../tests/enums/poly/basic_poly_enum.exp | 3 +- .../enum_decl_poly_mismatched_variants.exp | 3 +- .../tests/enums/poly/poly_mut_ref_update.exp | 3 +- .../poly/poly_mut_ref_update_variant.exp | 3 +- .../tests/enums/variant_switch_loop.exp | 6 +- .../arithmetic_operators_u128.exp | 36 +- .../instructions/arithmetic_operators_u16.exp | 36 +- .../arithmetic_operators_u256.exp | 36 +- .../instructions/arithmetic_operators_u32.exp | 36 +- .../instructions/arithmetic_operators_u64.exp | 36 +- .../instructions/arithmetic_operators_u8.exp | 36 +- .../instructions/assign_struct_field.exp | 3 +- .../tests/instructions/casting_operators.exp | 96 ++- .../instructions/equality_reference_value.exp | 6 +- .../tests/instructions/shift_operators.exp | 30 +- .../use_modules_published.exp | 9 +- .../clever_non_existant_native_function.exp | 9 +- .../non_existant_native_function.exp | 3 +- ...ector_resource_not_destroyed_at_return.exp | 3 +- .../non_existant_native_struct.exp | 3 +- .../runtime_layout_deeply_nested.exp | 12 +- .../recursion/runtime_type_deeply_nested.exp | 6 +- .../tests/references/borrow_in_loop.exp | 9 +- 797 files changed, 9681 insertions(+), 4199 deletions(-) diff --git a/crates/sui-adapter-transactional-tests/tests/call/simple.exp b/crates/sui-adapter-transactional-tests/tests/call/simple.exp index 077688f342b1f..a29b44b63a756 100644 --- a/crates/sui-adapter-transactional-tests/tests/call/simple.exp +++ b/crates/sui-adapter-transactional-tests/tests/call/simple.exp @@ -1,16 +1,19 @@ processed 4 tasks -task 1 'publish'. lines 6-25: +task 1, lines 6-25: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5570800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run Test::M1::create --args 0 @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 29-29: +task 3, line 29: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: Test::M1::Object { diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/count_decremented.exp b/crates/sui-adapter-transactional-tests/tests/child_count/count_decremented.exp index ebabb9f47fe91..0698bf30028bd 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/count_decremented.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/count_decremented.exp @@ -3,17 +3,20 @@ processed 17 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-51: +task 1, lines 9-51: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 7516400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 53-53: +task 2, line 53: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 55-55: +task 3, line 55: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -24,17 +27,20 @@ Contents: test::m::S { }, } -task 4 'run'. lines 57-57: +task 4, line 57: +//# run test::m::add --sender A --args object(2,0) 1 created: object(4,0), object(4,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 5 'run'. lines 59-59: +task 5, line 59: +//# run test::m::remove --sender A --args object(2,0) 1 mutated: object(0,0), object(2,0) deleted: object(4,0), object(4,1) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 5801004, non_refundable_storage_fee: 58596 -task 6 'view-object'. lines 61-65: +task 6, lines 61-65: +//# view-object 2,0 Owner: Account Address ( A ) Version: 4 Contents: test::m::S { @@ -45,12 +51,14 @@ Contents: test::m::S { }, } -task 7 'run'. lines 67-67: +task 7, line 67: +//# run test::m::mint --sender A created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'view-object'. lines 69-69: +task 8, line 69: +//# view-object 7,0 Owner: Account Address ( A ) Version: 5 Contents: test::m::S { @@ -61,16 +69,19 @@ Contents: test::m::S { }, } -task 9 'run'. lines 71-71: +task 9, line 71: +//# run test::m::add --sender A --args object(7,0) 1 created: object(9,0), object(9,1) mutated: object(0,0), object(7,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 10 'run'. lines 73-73: +task 10, line 73: +//# run test::m::remove_and_add --sender A --args object(7,0) 1 mutated: object(0,0), object(7,0), object(9,0), object(9,1) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 5801004, non_refundable_storage_fee: 58596 -task 11 'view-object'. lines 75-79: +task 11, lines 75-79: +//# view-object 7,0 Owner: Account Address ( A ) Version: 7 Contents: test::m::S { @@ -81,12 +92,14 @@ Contents: test::m::S { }, } -task 12 'run'. lines 81-81: +task 12, line 81: +//# run test::m::mint --sender A created: object(12,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 13 'view-object'. lines 83-83: +task 13, line 83: +//# view-object 12,0 Owner: Account Address ( A ) Version: 8 Contents: test::m::S { @@ -97,18 +110,21 @@ Contents: test::m::S { }, } -task 14 'run'. lines 85-85: +task 14, line 85: +//# run test::m::add --sender A --args object(12,0) 1 created: object(14,0), object(14,1) mutated: object(0,0), object(12,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 15 'run'. lines 87-87: +task 15, line 87: +//# run test::m::remove_and_wrap --sender A --args object(12,0) 1 created: object(15,0) mutated: object(0,0), object(12,0), object(14,0) wrapped: object(14,1) gas summary: computation_cost: 1000000, storage_cost: 6102800, storage_rebate: 5801004, non_refundable_storage_fee: 58596 -task 16 'view-object'. lines 89-89: +task 16, line 89: +//# view-object 12,0 Owner: Account Address ( A ) Version: 10 Contents: test::m::S { diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap.exp b/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap.exp index 1017e2e60c433..60a7ee7507993 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap.exp @@ -3,22 +3,26 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-37: +task 1, lines 9-37: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6513200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 39-39: +task 2, line 39: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 41-41: +task 3, line 41: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 43-43: +task 4, line 43: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -29,7 +33,8 @@ Contents: test::m::S { }, } -task 5 'run'. lines 45-45: +task 5, line 45: +//# run test::m::wrap --sender A --args object(2,0) created: object(5,0) mutated: object(0,0) wrapped: object(2,0) diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap_one_txn.exp b/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap_one_txn.exp index b754dc6b3f79b..a30398551a826 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap_one_txn.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/delete_by_wrap_one_txn.exp @@ -3,12 +3,14 @@ processed 3 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-31: +task 1, lines 9-31: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6102800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-33: +task 2, line 33: +//# run test::m::test_wrap --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6102800, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_invalid.exp b/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_invalid.exp index 5eccc69f1cb4b..eff21ad36e01f 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_invalid.exp @@ -3,22 +3,26 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-32: +task 1, lines 9-32: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6026800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-34: +task 2, line 34: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 36-36: +task 3, line 36: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 38-38: +task 4, line 38: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -29,7 +33,8 @@ Contents: test::m::S { }, } -task 5 'run'. lines 40-40: +task 5, line 40: +//# run test::m::delete --sender A --args object(2,0) mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2174436, non_refundable_storage_fee: 21964 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid.exp b/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid.exp index f0a4d29a2a860..ece9cad433248 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid.exp @@ -3,22 +3,26 @@ processed 7 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-57: +task 1, lines 9-57: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 7987600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 58-58: +task 2, line 58: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 60-60: +task 3, line 60: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 62-62: +task 4, line 62: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -29,12 +33,14 @@ Contents: test::m::S { }, } -task 5 'run'. lines 64-64: +task 5, line 64: +//# run test::m::remove --sender A --args object(2,0) 0 mutated: object(0,0), object(2,0) deleted: object(3,0), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 5801004, non_refundable_storage_fee: 58596 -task 6 'run'. lines 66-66: +task 6, line 66: +//# run test::m::delete --sender A --args object(2,0) mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2174436, non_refundable_storage_fee: 21964 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid_one_txn.exp b/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid_one_txn.exp index 7d41f1507bc15..6bfc0fe13f297 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid_one_txn.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/delete_parent_valid_one_txn.exp @@ -3,22 +3,26 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 10-69: +task 1, lines 10-69: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 8382800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 71-71: +task 2, line 71: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 73-73: +task 3, line 73: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 75-75: +task 4, line 75: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -29,7 +33,8 @@ Contents: test::m::S { }, } -task 5 'run'. lines 77-77: +task 5, line 77: +//# run test::m::remove_and_delete --sender A --args object(2,0) 0 mutated: object(0,0) deleted: object(2,0), object(3,0), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 5801004, non_refundable_storage_fee: 58596 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_invalid.exp b/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_invalid.exp index 31346a8d01427..c5fd4ee8cd8fe 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_invalid.exp @@ -3,22 +3,26 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-61: +task 1, lines 9-61: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 8458800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 63-63: +task 2, line 63: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 65-65: +task 3, line 65: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 67-67: +task 4, line 67: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -29,6 +33,7 @@ Contents: test::m::S { }, } -task 5 'run'. lines 69-69: +task 5, line 69: +//# run test::m::freeze_object --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid.exp b/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid.exp index c1dde3f330210..68cae8aefc4e5 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid.exp @@ -3,22 +3,26 @@ processed 7 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-61: +task 1, lines 9-61: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 8458800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 63-63: +task 2, line 63: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 65-65: +task 3, line 65: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 67-67: +task 4, line 67: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -29,11 +33,13 @@ Contents: test::m::S { }, } -task 5 'run'. lines 69-69: +task 5, line 69: +//# run test::m::remove --sender A --args object(2,0) 0 mutated: object(0,0), object(2,0) deleted: object(3,0), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 5801004, non_refundable_storage_fee: 58596 -task 6 'run'. lines 71-71: +task 6, line 71: +//# run test::m::freeze_object --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid_one_txn.exp b/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid_one_txn.exp index 0ef139284d97f..a397264673d63 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid_one_txn.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/freeze_parent_valid_one_txn.exp @@ -3,22 +3,26 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 10-64: +task 1, lines 10-64: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 8610800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 66-66: +task 2, line 66: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 68-68: +task 3, line 68: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 70-70: +task 4, line 70: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -29,7 +33,8 @@ Contents: test::m::S { }, } -task 5 'run'. lines 72-72: +task 5, line 72: +//# run test::m::remove_and_freeze --sender A --args object(2,0) 0 mutated: object(0,0), object(2,0) deleted: object(3,0), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 5801004, non_refundable_storage_fee: 58596 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid.exp b/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid.exp index 8ef03fce40fbe..b2aa81d5b4dbb 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid.exp @@ -3,17 +3,20 @@ processed 10 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-45: +task 1, lines 9-45: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6976800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 47-47: +task 2, line 47: +//# run test::m::mint_and_share --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 49-53: +task 3, lines 49-53: +//# view-object 2,1 Owner: Shared( 2 ) Version: 2 Contents: test::m::S { @@ -24,16 +27,19 @@ Contents: test::m::S { }, } -task 4 'run'. lines 55-55: +task 4, line 55: +//# run test::m::mint --sender A created: object(4,0), object(4,1), object(4,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 57-57: +task 5, line 57: +//# run test::m::transfer --sender A --args object(4,2) @B mutated: object(0,0), object(4,2) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 6 'view-object'. lines 59-63: +task 6, lines 59-63: +//# view-object 4,2 Owner: Account Address ( B ) Version: 4 Contents: test::m::S { @@ -44,16 +50,19 @@ Contents: test::m::S { }, } -task 7 'run'. lines 65-65: +task 7, line 65: +//# run test::m::mint --sender A created: object(7,0), object(7,1), object(7,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'transfer-object'. lines 67-67: +task 8, line 67: +//# transfer-object 7,1 --sender A --recipient B mutated: object(0,0), object(7,1) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 9 'view-object'. lines 69-69: +task 9, line 69: +//# view-object 7,1 Owner: Account Address ( B ) Version: 6 Contents: test::m::S { diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid_one_txn.exp b/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid_one_txn.exp index ba63f86559cf5..025f1ba6aa2c2 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid_one_txn.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/non_zero_child_count_valid_one_txn.exp @@ -3,17 +3,20 @@ processed 4 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 10-35: +task 1, lines 10-35: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5950800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 37-37: +task 2, line 37: +//# run test::m::share --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 39-39: +task 3, line 39: +//# view-object 2,1 Owner: Shared( 2 ) Version: 2 Contents: test::m::S { diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/temp_parent_invalid.exp b/crates/sui-adapter-transactional-tests/tests/child_count/temp_parent_invalid.exp index cbecdb6dbb902..a9f9dd825812e 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/temp_parent_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/temp_parent_invalid.exp @@ -3,12 +3,14 @@ processed 3 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-22: +task 1, lines 9-22: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5266800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 24-24: +task 2, line 24: +//# run test::m::t --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4651200, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored.exp b/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored.exp index cd0197863757d..e248cfe7e1a87 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored.exp @@ -3,17 +3,20 @@ processed 4 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-37: +task 1, lines 9-37: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5836800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 39-39: +task 2, line 39: +//# run test::m::create --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2439600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 41-41: +task 3, line 41: +//# run test::m::delete --args object(2,0) --sender A mutated: object(0,0) deleted: object(2,0) unwrapped_then_deleted: object(_) diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored_transfer.exp b/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored_transfer.exp index 299b0ae7533b4..7350332af8274 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored_transfer.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_never_stored_transfer.exp @@ -3,17 +3,20 @@ processed 4 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-36: +task 1, lines 9-36: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6072400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 38-38: +task 2, line 38: +//# run test::m::create --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2439600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 40-40: +task 3, line 40: +//# run test::m::unwrap_and_transfer --args object(2,0) --sender A mutated: object(0,0) unwrapped: object(3,0) deleted: object(2,0) diff --git a/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_then_delete_invalid.exp b/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_then_delete_invalid.exp index bb440aa6b5643..e5e6275dde75b 100644 --- a/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_then_delete_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/child_count/unwrap_then_delete_invalid.exp @@ -3,22 +3,26 @@ processed 5 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-44: +task 1, lines 9-44: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6688000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 46-46: +task 2, line 46: +//# run test::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 48-48: +task 3, line 48: +//# run test::m::add --sender A --args object(2,0) 0 created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'run'. lines 50-50: +task 4, line 50: +//# run test::m::wrap --sender A --args object(2,0) created: object(4,0) mutated: object(0,0) wrapped: object(2,0) diff --git a/crates/sui-adapter-transactional-tests/tests/children/child_of_shared_object.exp b/crates/sui-adapter-transactional-tests/tests/children/child_of_shared_object.exp index 6d842863bb7ea..50606a46cb29c 100644 --- a/crates/sui-adapter-transactional-tests/tests/children/child_of_shared_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/children/child_of_shared_object.exp @@ -3,32 +3,38 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 6-17: +task 1, lines 6-17: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5183200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'publish'. lines 19-45: +task 2, lines 19-45: +//# publish --dependencies t3 created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7668400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'publish'. lines 48-72: +task 3, lines 48-72: +//# publish --dependencies t2 t3 created: object(3,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8215600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 74-74: +task 4, line 74: +//# run t3::o3::create --sender A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 5 'run'. lines 76-76: +task 5, line 76: +//# run t2::o2::create_shared --args object(4,0) --sender A created: object(5,0), object(5,1) mutated: object(0,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 5920400, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 6 'view-object'. lines 78-78: +task 6, line 78: +//# view-object 4,0 Owner: Object ID: ( fake(5,0) ) Version: 3 Contents: t3::o3::Obj3 { @@ -39,7 +45,8 @@ Contents: t3::o3::Obj3 { }, } -task 7 'view-object'. lines 80-82: +task 7, lines 80-82: +//# view-object 5,1 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -50,5 +57,6 @@ Contents: t2::o2::Obj2 { }, } -task 8 'run'. lines 83-83: +task 8, line 83: +//# run t1::o1::use_o2_o3 --args object(5,1) object(4,0) --sender A Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(4,0), parent_id: object(5,0) } diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_and_undeny.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_and_undeny.exp index 9b9560640f4ff..dd9905b7af3dd 100644 --- a/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_and_undeny.exp +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_and_undeny.exp @@ -3,16 +3,19 @@ processed 14 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 12-35: +task 1, lines 12-35: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 18316000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 37-37: +task 2, line 37: +//# view-object 1,0 1,0::regulated_coin -task 3 'view-object'. lines 39-39: +task 3, line 39: +//# view-object 1,1 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::Coin { @@ -26,7 +29,8 @@ Contents: sui::coin::Coin { }, } -task 4 'view-object'. lines 41-41: +task 4, line 41: +//# view-object 1,2 Owner: Immutable Version: 2 Contents: sui::coin::CoinMetadata { @@ -89,7 +93,8 @@ Contents: sui::coin::CoinMetadata { }, } -task 5 'view-object'. lines 43-43: +task 5, line 43: +//# view-object 1,3 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::DenyCap { @@ -100,7 +105,8 @@ Contents: sui::coin::DenyCap { }, } -task 6 'view-object'. lines 45-45: +task 6, line 45: +//# view-object 1,4 Owner: Immutable Version: 2 Contents: sui::coin::RegulatedCoinMetadata { @@ -117,7 +123,8 @@ Contents: sui::coin::RegulatedCoinMetadata }, } -task 7 'view-object'. lines 47-49: +task 7, lines 47-49: +//# view-object 1,5 Owner: Immutable Version: 2 Contents: sui::coin::TreasuryCap { @@ -131,29 +138,35 @@ Contents: sui::coin::TreasuryCap { }, } -task 8 'run'. lines 50-52: +task 8, lines 50-52: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(8,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 9 'run'. lines 53-55: +task 9, lines 53-55: +//# run sui::coin::deny_list_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(9,0), object(9,1) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) gas summary: computation_cost: 1000000, storage_cost: 11415200, storage_rebate: 2723688, non_refundable_storage_fee: 27512 -task 10 'transfer-object'. lines 56-58: +task 10, lines 56-58: +//# transfer-object 8,0 --sender B --recipient A Error: Error checking transaction input objects: AddressDeniedForCoin { address: @B, coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 11 'run'. lines 59-61: +task 11, lines 59-61: +//# run sui::pay::split_and_transfer --args object(8,0) 1 @A --type-args test::regulated_coin::REGULATED_COIN --sender B Error: Error checking transaction input objects: AddressDeniedForCoin { address: @B, coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 12 'run'. lines 62-64: +task 12, lines 62-64: +//# run sui::coin::deny_list_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(9,1) deleted: object(9,0) gas summary: computation_cost: 1000000, storage_cost: 9522800, storage_rebate: 11301048, non_refundable_storage_fee: 114152 -task 13 'transfer-object'. lines 65-65: +task 13, line 65: +//# transfer-object 8,0 --sender B --recipient A mutated: object(0,1), object(8,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2462400, storage_rebate: 1459656, non_refundable_storage_fee: 14744 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_multiple_per_module.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_multiple_per_module.exp index 7378bbf95380f..967ae5fae8523 100644 --- a/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_multiple_per_module.exp +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_multiple_per_module.exp @@ -3,16 +3,19 @@ processed 16 tasks init: A: object(0,0) -task 1 'publish'. lines 9-56: +task 1, lines 9-56: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5), object(1,6), object(1,7), object(1,8), object(1,9), object(1,10) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 33082800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 58-58: +task 2, line 58: +//# view-object 1,0 1,0::{first_coin, second_coin} -task 3 'view-object'. lines 60-60: +task 3, line 60: +//# view-object 1,1 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::Coin { @@ -26,7 +29,8 @@ Contents: sui::coin::Coin { }, } -task 4 'view-object'. lines 62-62: +task 4, line 62: +//# view-object 1,2 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::Coin { @@ -40,7 +44,8 @@ Contents: sui::coin::Coin { }, } -task 5 'view-object'. lines 64-64: +task 5, line 64: +//# view-object 1,3 Owner: Immutable Version: 2 Contents: sui::coin::CoinMetadata { @@ -103,7 +108,8 @@ Contents: sui::coin::CoinMetadata { }, } -task 6 'view-object'. lines 66-66: +task 6, line 66: +//# view-object 1,4 Owner: Immutable Version: 2 Contents: sui::coin::CoinMetadata { @@ -166,7 +172,8 @@ Contents: sui::coin::CoinMetadata { }, } -task 7 'view-object'. lines 68-68: +task 7, line 68: +//# view-object 1,5 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::DenyCap { @@ -177,7 +184,8 @@ Contents: sui::coin::DenyCap { }, } -task 8 'view-object'. lines 70-70: +task 8, line 70: +//# view-object 1,6 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::DenyCap { @@ -188,7 +196,8 @@ Contents: sui::coin::DenyCap { }, } -task 9 'view-object'. lines 72-72: +task 9, line 72: +//# view-object 1,7 Owner: Immutable Version: 2 Contents: sui::coin::RegulatedCoinMetadata { @@ -205,7 +214,8 @@ Contents: sui::coin::RegulatedCoinMetadata { }, } -task 10 'view-object'. lines 74-74: +task 10, line 74: +//# view-object 1,8 Owner: Immutable Version: 2 Contents: sui::coin::RegulatedCoinMetadata { @@ -222,7 +232,8 @@ Contents: sui::coin::RegulatedCoinMetadata { }, } -task 11 'view-object'. lines 76-76: +task 11, line 76: +//# view-object 1,9 Owner: Immutable Version: 2 Contents: sui::coin::TreasuryCap { @@ -236,7 +247,8 @@ Contents: sui::coin::TreasuryCap { }, } -task 12 'view-object'. lines 78-80: +task 12, lines 78-80: +//# view-object 1,10 Owner: Immutable Version: 2 Contents: sui::coin::TreasuryCap { @@ -250,15 +262,18 @@ Contents: sui::coin::TreasuryCap { }, } -task 13 'run'. lines 81-83: +task 13, lines 81-83: +//# run sui::coin::deny_list_add --args object(0x403) object(1,5) @A --type-args test::first_coin::FIRST_COIN --sender A created: object(13,0), object(13,1) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,5) gas summary: computation_cost: 1000000, storage_cost: 11293600, storage_rebate: 2663496, non_refundable_storage_fee: 26904 -task 14 'transfer-object'. lines 84-86: +task 14, lines 84-86: +//# transfer-object 1,1 --sender A --recipient A Error: Error checking transaction input objects: AddressDeniedForCoin { address: @A, coin_type: "object(1,0)::first_coin::FIRST_COIN" } -task 15 'transfer-object'. lines 87-87: +task 15, line 87: +//# transfer-object 1,2 --sender A --recipient A mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2416800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_tto.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_tto.exp index f48eafa74987b..b2ddbd85a258f 100644 --- a/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_tto.exp +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v1/coin_deny_tto.exp @@ -3,13 +3,15 @@ processed 13 tasks init: A: object(0,0) -task 1 'publish'. lines 8-47: +task 1, lines 8-47: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5), object(1,6) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 21766400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 49-49: +task 2, line 49: +//# view-object 1,0 Owner: Account Address ( A ) Version: 2 Contents: test::regulated_coin::Wallet { @@ -20,10 +22,12 @@ Contents: test::regulated_coin::Wallet { }, } -task 3 'view-object'. lines 51-51: +task 3, line 51: +//# view-object 1,1 1,1::regulated_coin -task 4 'view-object'. lines 53-53: +task 4, line 53: +//# view-object 1,2 Owner: Account Address ( fake(1,0) ) Version: 2 Contents: sui::coin::Coin { @@ -37,7 +41,8 @@ Contents: sui::coin::Coin { }, } -task 5 'view-object'. lines 55-55: +task 5, line 55: +//# view-object 1,3 Owner: Immutable Version: 2 Contents: sui::coin::CoinMetadata { @@ -100,7 +105,8 @@ Contents: sui::coin::CoinMetadata { }, } -task 6 'view-object'. lines 57-57: +task 6, line 57: +//# view-object 1,4 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::DenyCap { @@ -111,7 +117,8 @@ Contents: sui::coin::DenyCap { }, } -task 7 'view-object'. lines 59-59: +task 7, line 59: +//# view-object 1,5 Owner: Immutable Version: 2 Contents: sui::coin::RegulatedCoinMetadata { @@ -128,7 +135,8 @@ Contents: sui::coin::RegulatedCoinMetadata }, } -task 8 'view-object'. lines 61-63: +task 8, lines 61-63: +//# view-object 1,6 Owner: Immutable Version: 2 Contents: sui::coin::TreasuryCap { @@ -142,20 +150,24 @@ Contents: sui::coin::TreasuryCap { }, } -task 9 'run'. lines 64-66: +task 9, lines 64-66: +//# run sui::coin::deny_list_add --args object(0x403) object(1,4) @A --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(9,0), object(9,1) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,4) gas summary: computation_cost: 1000000, storage_cost: 11415200, storage_rebate: 2723688, non_refundable_storage_fee: 27512 -task 10 'run'. lines 67-69: +task 10, lines 67-69: +//# run test::regulated_coin::receive_coin --args object(1,0) receiving(1,2) --sender A Error: Error checking transaction input objects: AddressDeniedForCoin { address: @A, coin_type: "object(1,1)::regulated_coin::REGULATED_COIN" } -task 11 'run'. lines 70-72: +task 11, lines 70-72: +//# run sui::coin::deny_list_remove --args object(0x403) object(1,4) @A --type-args test::regulated_coin::REGULATED_COIN --sender A mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,4), object(9,1) deleted: object(9,0) gas summary: computation_cost: 1000000, storage_cost: 9522800, storage_rebate: 11301048, non_refundable_storage_fee: 114152 -task 12 'run'. lines 73-73: +task 12, line 73: +//# run test::regulated_coin::receive_coin --args object(1,0) receiving(1,2) --sender A mutated: object(0,0), object(1,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 3807600, storage_rebate: 3769524, non_refundable_storage_fee: 38076 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_receiver.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_receiver.exp index 0346f766948e9..69b28c7550c5c 100644 --- a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_receiver.exp +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_receiver.exp @@ -3,49 +3,59 @@ processed 11 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 12-37: +task 1, lines 12-37: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 18392000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 38-40: +task 2, lines 38-40: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(2,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 3 'run'. lines 41-43: +task 3, lines 41-43: +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 99, 99, 98, 54, 101, 48, 54, 98, 100, 51, 53, 102, 54, 52, 99, 102, 101, 57, 54, 54, 52, 51, 51, 53, 51, 57, 57, 99, 98, 51, 48, 101, 98, 52, 55, 54, 49, 49, 101, 49, 99, 56, 97, 50, 56, 56, 102, 56, 48, 56, 52, 52, 57, 52, 56, 51, 98, 98, 51, 102, 50, 102, 51, 101, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 111, 92, 117, 216, 246, 218, 26, 172, 163, 34, 123, 188, 238, 245, 77, 153, 179, 41, 124, 6, 21, 158, 75, 211, 154, 61, 181, 219, 3, 222, 9, 251] } created: object(3,0), object(3,1), object(3,2) mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2746260, non_refundable_storage_fee: 27740 -task 4 'run'. lines 44-44: +task 4, line 44: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(4,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 5 'advance-epoch'. lines 46-48: +task 5, lines 46-48: +//# advance-epoch Epoch advanced: 1 -task 6 'run'. lines 49-51: +task 6, lines 49-51: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A Error: Transaction Effects Status: Address B is denied for coin test::regulated_coin::REGULATED_COIN Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: AddressDeniedForCoin { address: B, coin_type: "test::regulated_coin::REGULATED_COIN" }, source: None, command: None } } -task 7 'run'. lines 52-54: +task 7, lines 52-54: +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 6862800, storage_rebate: 6794172, non_refundable_storage_fee: 68628 -task 8 'run'. lines 55-55: +task 8, line 55: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A Error: Transaction Effects Status: Address B is denied for coin test::regulated_coin::REGULATED_COIN Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: AddressDeniedForCoin { address: B, coin_type: "test::regulated_coin::REGULATED_COIN" }, source: None, command: None } } -task 9 'advance-epoch'. lines 57-59: +task 9, lines 57-59: +//# advance-epoch Epoch advanced: 2 -task 10 'run'. lines 60-60: +task 10, line 60: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(10,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_sender.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_sender.exp index f89821c918df6..d375ea62d6c1c 100644 --- a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_sender.exp +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_deny_and_undeny_sender.exp @@ -3,13 +3,15 @@ processed 11 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 13-48: +task 1, lines 13-48: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 19471200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 49-51: +task 2, lines 49-51: +//# view-object 1,3 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::DenyCapV2 { @@ -21,40 +23,48 @@ Contents: sui::coin::DenyCapV2 { allow_global_pause: false, } -task 3 'run'. lines 52-54: +task 3, lines 52-54: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(3,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 4 'run'. lines 55-57: +task 4, lines 55-57: +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 51, 57, 57, 50, 48, 100, 100, 53, 50, 49, 99, 56, 48, 55, 101, 54, 98, 97, 99, 54, 99, 56, 97, 98, 51, 52, 102, 54, 49, 52, 48, 54, 49, 49, 53, 56, 56, 56, 49, 57, 57, 55, 56, 56, 52, 52, 98, 52, 51, 53, 57, 52, 53, 56, 57, 100, 55, 102, 56, 56, 98, 100, 57, 57, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 79, 194, 17, 174, 74, 227, 253, 26, 173, 100, 153, 228, 250, 55, 174, 175, 17, 33, 34, 53, 27, 207, 230, 188, 240, 54, 6, 177, 124, 66, 182, 148] } created: object(4,0), object(4,1), object(4,2) mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2746260, non_refundable_storage_fee: 27740 -task 5 'run'. lines 58-60: +task 5, lines 58-60: +//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B true --sender A mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'transfer-object'. lines 61-63: +task 6, lines 61-63: +//# transfer-object 3,0 --sender B --recipient A Error: Error checking transaction input objects: AddressDeniedForCoin { address: @B, coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 7 'run'. lines 64-66: +task 7, lines 64-66: +//# run sui::pay::split_and_transfer --args object(3,0) 1 @A --type-args test::regulated_coin::REGULATED_COIN --sender B Error: Error checking transaction input objects: AddressDeniedForCoin { address: @B, coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 8 'run'. lines 67-69: +task 8, lines 67-69: +//# run sui::coin::deny_list_v2_remove --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) deleted: object(4,1) gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6794172, non_refundable_storage_fee: 68628 -task 9 'run'. lines 70-72: +task 9, lines 70-72: +//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B false --sender A mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'transfer-object'. lines 73-73: +task 10, line 73: +//# transfer-object 3,0 --sender B --recipient A mutated: object(0,1), object(3,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2462400, storage_rebate: 1459656, non_refundable_storage_fee: 14744 diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_global_pause.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_global_pause.exp index eb440d6ba1d85..fb65a0feb6335 100644 --- a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_global_pause.exp +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/coin_global_pause.exp @@ -3,99 +3,120 @@ processed 22 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 10-72: +task 1, lines 10-72: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 21964000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 73-75: +task 2, lines 73-75: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(2,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 3 'run'. lines 76-78: +task 3, lines 76-78: +//# run test::regulated_coin::partial_wrap --args object(1,1) --sender A created: object(3,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4119200, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 4 'run'. lines 79-81: +task 4, lines 79-81: +//# run test::regulated_coin::partial_wrap --args object(1,1) --sender A created: object(4,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4119200, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 5 'run'. lines 82-84: +task 5, lines 82-84: +//# run sui::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 54, 101, 99, 53, 53, 52, 55, 102, 50, 98, 99, 101, 48, 55, 97, 49, 48, 97, 102, 50, 57, 49, 57, 101, 97, 48, 101, 97, 57, 54, 97, 97, 102, 97, 56, 57, 54, 57, 56, 55, 56, 55, 50, 49, 50, 56, 55, 101, 98, 102, 54, 54, 102, 52, 48, 51, 100, 50, 100, 54, 99, 53, 57, 50, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 254, 127, 25, 0, 75, 139, 142, 51, 141, 181, 23, 12, 237, 165, 178, 199, 150, 191, 43, 48, 121, 145, 70, 28, 15, 98, 69, 101, 83, 67, 172, 114] } created: object(5,0), object(5,1), object(5,2) mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) gas summary: computation_cost: 1000000, storage_cost: 11985200, storage_rebate: 2746260, non_refundable_storage_fee: 27740 -task 6 'run'. lines 85-87: +task 6, lines 85-87: +//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) true --sender A mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 88-90: +task 7, lines 88-90: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A Error: Error checking transaction input objects: CoinTypeGlobalPause { coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 8 'transfer-object'. lines 91-93: +task 8, lines 91-93: +//# transfer-object 2,0 --sender B --recipient A Error: Error checking transaction input objects: CoinTypeGlobalPause { coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 9 'run'. lines 94-97: +task 9, lines 94-97: +//# run sui::pay::split_and_transfer --args object(2,0) 1 @A --type-args test::regulated_coin::REGULATED_COIN --sender B Error: Error checking transaction input objects: CoinTypeGlobalPause { coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 10 'run'. lines 98-98: +task 10, line 98: +//# run test::regulated_coin::unwrap --args object(3,0) --sender A mutated: object(0,0) unwrapped: object(10,0) deleted: object(3,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2462400, storage_rebate: 2618352, non_refundable_storage_fee: 26448 -task 11 'advance-epoch'. lines 100-103: +task 11, lines 100-103: +//# advance-epoch Epoch advanced: 1 -task 12 'run'. lines 104-106: +task 12, lines 104-106: +//# run test::regulated_coin::unwrap --args object(4,0) --sender A Error: Transaction Effects Status: Coin type is globally paused for use: test::regulated_coin::REGULATED_COIN Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CoinTypeGlobalPause { coin_type: "test::regulated_coin::REGULATED_COIN" }, source: None, command: None } } -task 13 'run'. lines 107-109: +task 13, lines 107-109: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A Error: Error checking transaction input objects: CoinTypeGlobalPause { coin_type: "object(1,0)::regulated_coin::REGULATED_COIN" } -task 14 'run'. lines 110-112: +task 14, lines 110-112: +//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) true --sender A mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'run'. lines 113-115: +task 15, lines 113-115: +//# run sui::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3), object(5,1) gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 6591024, non_refundable_storage_fee: 66576 -task 16 'run'. lines 116-118: +task 16, lines 116-118: +//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) false --sender A mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 17 'run'. lines 119-121: +task 17, lines 119-121: +//# run sui::pay::split_and_transfer --args object(1,1) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A Error: Transaction Effects Status: Coin type is globally paused for use: test::regulated_coin::REGULATED_COIN Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CoinTypeGlobalPause { coin_type: "test::regulated_coin::REGULATED_COIN" }, source: None, command: None } } -task 18 'run'. lines 122-125: +task 18, lines 122-125: +//# run test::regulated_coin::full_wrap --args object(1,1) --sender A created: object(18,0) mutated: object(0,0) wrapped: object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2644800, storage_rebate: 2437776, non_refundable_storage_fee: 24624 -task 19 'run'. lines 126-126: +task 19, line 126: +//# run test::regulated_coin::unwrap --args object(18,0) --sender A Error: Transaction Effects Status: Coin type is globally paused for use: test::regulated_coin::REGULATED_COIN Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CoinTypeGlobalPause { coin_type: "test::regulated_coin::REGULATED_COIN" }, source: None, command: None } } -task 20 'advance-epoch'. lines 128-130: +task 20, lines 128-130: +//# advance-epoch Epoch advanced: 2 -task 21 'run'. lines 131-131: +task 21, line 131: +//# run test::regulated_coin::unwrap --args object(18,0) --sender A mutated: object(0,0) unwrapped: object(1,1) deleted: object(18,0) diff --git a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp index 966917bd65198..e01bfc13ed5ff 100644 --- a/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp +++ b/crates/sui-adapter-transactional-tests/tests/deny_list_v2/delete_setting_object_same_epoch.exp @@ -3,24 +3,28 @@ processed 12 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-53: +task 1, lines 9-53: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 20428800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 54-56: +task 2, lines 54-56: +//# run sui::coin::deny_list_v2_add --args object(0x403) object(1,3) @B --type-args test::regulated_coin::REGULATED_COIN --sender A events: Event { package_id: sui, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: sui, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 48, 51, 51, 49, 100, 56, 101, 49, 98, 99, 98, 101, 55, 102, 100, 51, 97, 54, 101, 48, 97, 102, 102, 55, 99, 56, 56, 98, 50, 53, 97, 57, 54, 51, 102, 48, 51, 56, 102, 48, 51, 98, 97, 49, 53, 48, 51, 101, 48, 53, 98, 57, 56, 49, 102, 102, 101, 98, 56, 56, 98, 101, 98, 52, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 116, 239, 154, 198, 227, 43, 235, 247, 62, 51, 2, 238, 1, 255, 251, 178, 127, 24, 217, 192, 109, 173, 216, 65, 206, 45, 158, 164, 2, 239, 79, 140] } created: object(2,0), object(2,1), object(2,2) mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2746260, non_refundable_storage_fee: 27740 -task 3 'run'. lines 57-59: +task 3, lines 57-59: +//# run sui::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,3) --type-args test::regulated_coin::REGULATED_COIN --sender A created: object(3,0) mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,3) gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 4356396, non_refundable_storage_fee: 44004 -task 4 'view-object'. lines 60-60: +task 4, line 60: +//# view-object 2,1 Owner: Object ID: ( fake(2,0) ) Version: 3 Contents: sui::dynamic_field::Field> { @@ -51,7 +55,8 @@ Contents: sui::dynamic_field::Field> { @@ -82,28 +87,34 @@ Contents: sui::dynamic_field::Field> { @@ -51,7 +55,8 @@ Contents: sui::dynamic_field::Field> { @@ -82,18 +87,22 @@ Contents: sui::dynamic_field::Field> { @@ -124,7 +133,8 @@ Contents: sui::dynamic_field::Field> { @@ -155,31 +165,38 @@ Contents: sui::dynamic_field::Field> { @@ -51,7 +55,8 @@ Contents: sui::dynamic_field::Field> { @@ -82,18 +87,22 @@ Contents: sui::dynamic_field::Field> { @@ -126,7 +135,8 @@ Contents: sui::dynamic_field::Field> { @@ -159,18 +169,22 @@ Contents: sui::dynamic_field::Field> { @@ -201,7 +215,8 @@ Contents: sui::dynamic_field::Field> { @@ -232,31 +247,38 @@ Contents: sui::dynamic_field::Field { @@ -23,19 +25,22 @@ Contents: sui::coin::Coin { }, } -task 3 'run'. lines 56-56: +task 3, line 56: +//# run test::coin::send_1 --args object(1,1) --sender A created: object(3,0) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 3632800, storage_rebate: 2287296, non_refundable_storage_fee: 23104 -task 4 'run'. lines 58-58: +task 4, line 58: +//# run test::coin::send_10 --args object(1,1) --sender A created: object(4,0), object(4,1), object(4,2), object(4,3), object(4,4), object(4,5), object(4,6), object(4,7), object(4,8), object(4,9) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 2000000, storage_cost: 15534400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 -task 5 'run'. lines 60-60: +task 5, line 60: +//# run test::coin::send_100 --args object(1,1) --sender A created: object(5,0), object(5,1), object(5,2), object(5,3), object(5,4), object(5,5), object(5,6), object(5,7), object(5,8), object(5,9), object(5,10), object(5,11), object(5,12), object(5,13), object(5,14), object(5,15), object(5,16), object(5,17), object(5,18), object(5,19), object(5,20), object(5,21), object(5,22), object(5,23), object(5,24), object(5,25), object(5,26), object(5,27), object(5,28), object(5,29), object(5,30), object(5,31), object(5,32), object(5,33), object(5,34), object(5,35), object(5,36), object(5,37), object(5,38), object(5,39), object(5,40), object(5,41), object(5,42), object(5,43), object(5,44), object(5,45), object(5,46), object(5,47), object(5,48), object(5,49), object(5,50), object(5,51), object(5,52), object(5,53), object(5,54), object(5,55), object(5,56), object(5,57), object(5,58), object(5,59), object(5,60), object(5,61), object(5,62), object(5,63), object(5,64), object(5,65), object(5,66), object(5,67), object(5,68), object(5,69), object(5,70), object(5,71), object(5,72), object(5,73), object(5,74), object(5,75), object(5,76), object(5,77), object(5,78), object(5,79), object(5,80), object(5,81), object(5,82), object(5,83), object(5,84), object(5,85), object(5,86), object(5,87), object(5,88), object(5,89), object(5,90), object(5,91), object(5,92), object(5,93), object(5,94), object(5,95), object(5,96), object(5,97), object(5,98), object(5,99) mutated: object(0,0), object(1,1) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 diff --git a/crates/sui-adapter-transactional-tests/tests/dev_inspect/load_old_object.exp b/crates/sui-adapter-transactional-tests/tests/dev_inspect/load_old_object.exp index 9c7081a1e55ca..e96c9e7b170d6 100644 --- a/crates/sui-adapter-transactional-tests/tests/dev_inspect/load_old_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dev_inspect/load_old_object.exp @@ -3,17 +3,22 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 8-30: +task 1, lines 8-30: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5274400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 32-34: +task 2, lines 32-34: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 36-36: +task 3, line 36: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -25,11 +30,14 @@ Contents: test::m::S { value: 0u64, } -task 4 'programmable'. lines 38-39: +task 4, lines 38-39: +//# programmable --sender A --inputs object(2,0) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 2234628, non_refundable_storage_fee: 22572 -task 5 'view-object'. lines 41-44: +task 5, lines 41-44: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -41,18 +49,27 @@ Contents: test::m::S { value: 112u64, } -task 6 'programmable'. lines 46-47: +task 6, lines 46-47: +//# programmable --sender A --inputs object(2,0)@2 0 --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,0) gas summary: computation_cost: 500000, storage_cost: 2257200, storage_rebate: 1256508, non_refundable_storage_fee: 12692 -task 7 'programmable'. lines 49-53: +task 7, lines 49-53: +//# programmable --sender A --inputs object(2,0)@3 112 --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,0) gas summary: computation_cost: 500000, storage_cost: 2257200, storage_rebate: 1256508, non_refundable_storage_fee: 12692 -task 8 'programmable'. lines 55-56: +task 8, lines 55-56: +//# programmable --sender A --inputs object(2,0)@2 112 --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 2, instruction: 8, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 2, instruction: 8, function_name: Some("check") }, 0) in command 0 -task 9 'programmable'. lines 58-59: +task 9, lines 58-59: +//# programmable --sender A --inputs object(2,0)@3 0 --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 2, instruction: 8, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 2, instruction: 8, function_name: Some("check") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate.exp index 68190f5392a68..bfe08830ee72f 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 9-28: +task 1, lines 9-28: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5867200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 30-30: +task 2, line 30: +//# run a::m::t1 --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3678400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 32-32: +task 3, line 32: +//# run a::m::t2 --sender A --args object(2,0) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::add (function index 0) at offset 15, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 0, instruction: 15, function_name: Some("add") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("sui::dynamic_field::add at offset 15"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 15)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate_object.exp index 8fa87f1b59aa3..348313e963c8c 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/add_duplicate_object.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 10-29: +task 1, lines 10-29: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6026800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run a::m::t1 --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 33-33: +task 3, line 33: +//# run a::m::t2 --sender A --args object(2,0) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::add (function index 0) at offset 15, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 0, instruction: 15, function_name: Some("add") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("sui::dynamic_field::add at offset 15"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 15)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/bench.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/bench.exp index 038c3c14b702c..5245576b9a043 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/bench.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/bench.exp @@ -3,12 +3,14 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 9-60: +task 1, lines 9-60: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8603200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 62-62: +task 2, line 62: +//# run a::m::t0 --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type.exp index 2b739c74dc2b4..2e41ae1801082 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type.exp @@ -3,20 +3,24 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 9-32: +task 1, lines 9-32: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6505600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-34: +task 2, line 34: +//# run a::m::t1 --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3678400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 36-36: +task 3, line 36: +//# run a::m::t2 --sender A --args object(2,0) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::borrow_child_object (function index 11) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(11), 0)] }), command: Some(0) } } -task 4 'run'. lines 38-38: +task 4, line 38: +//# run a::m::t3 --sender A --args object(2,0) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::borrow_child_object_mut (function index 12) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 12, instruction: 0, function_name: Some("borrow_child_object_mut") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type_object.exp index 1e859ff9e344a..52ec75749a4fc 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/borrow_wrong_type_object.exp @@ -3,20 +3,24 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 10-37: +task 1, lines 10-37: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7075600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 39-39: +task 2, line 39: +//# run a::m::t1 --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 41-41: +task 3, line 41: +//# run a::m::t2 --sender A --args object(2,1) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::borrow_child_object (function index 11) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(11), 0)] }), command: Some(0) } } -task 4 'run'. lines 43-43: +task 4, line 43: +//# run a::m::t3 --sender A --args object(2,1) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::borrow_child_object_mut (function index 12) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 12, instruction: 0, function_name: Some("borrow_child_object_mut") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/dynamic_object_field_swap.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/dynamic_object_field_swap.exp index 914a47e70c554..78f6f0053e551 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/dynamic_object_field_swap.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/dynamic_object_field_swap.exp @@ -3,27 +3,32 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 6-59: +task 1, lines 6-59: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8937600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 61-61: +task 2, line 61: +//# run test::m::parent --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2470000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 63-63: +task 3, line 63: +//# run test::m::child --sender A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2287600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 65-65: +task 4, line 65: +//# run test::m::add_field --sender A --args object(2,0) object(3,0) created: object(4,0) mutated: object(0,0), object(2,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 6224400, storage_rebate: 3731904, non_refundable_storage_fee: 37696 -task 5 'view-object'. lines 67-67: +task 5, line 67: +//# view-object 3,0 Owner: Object ID: ( fake(4,0) ) Version: 4 Contents: test::m::Child { @@ -35,13 +40,15 @@ Contents: test::m::Child { value: 0u64, } -task 6 'run'. lines 69-69: +task 6, line 69: +//# run test::m::buy --sender A --args object(2,0) created: object(6,0) mutated: object(0,0), object(2,0), object(3,0) deleted: object(4,0) gas summary: computation_cost: 1000000, storage_cost: 5251600, storage_rebate: 6162156, non_refundable_storage_fee: 62244 -task 7 'view-object'. lines 71-71: +task 7, line 71: +//# view-object 3,0 Owner: Account Address ( A ) Version: 5 Contents: test::m::Child { diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive.exp index 88749a0ec05a7..acffb3adead09 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive.exp @@ -3,47 +3,57 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 9-77: +task 1, lines 9-77: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12205600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 79-79: +task 2, line 79: +//# run a::m::t0 --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 81-81: +task 3, line 81: +//# run a::m::t1 --sender A --args object(2,0) created: object(3,0), object(3,1), object(3,2) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 6513200, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 4 'run'. lines 83-83: +task 4, line 83: +//# run a::m::t2 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 5 'run'. lines 85-85: +task 5, line 85: +//# run a::m::t3 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 6 'run'. lines 87-87: +task 6, line 87: +//# run a::m::t4 --sender A --args object(2,0) mutated: object(0,0), object(2,0), object(3,0), object(3,1), object(3,2) gas summary: computation_cost: 1000000, storage_cost: 6513200, storage_rebate: 6448068, non_refundable_storage_fee: 65132 -task 7 'run'. lines 89-89: +task 7, line 89: +//# run a::m::t5 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 8 'run'. lines 91-91: +task 8, line 91: +//# run a::m::t6 --sender A --args object(2,0) mutated: object(0,0), object(2,0) deleted: object(3,1), object(3,2) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 5048604, non_refundable_storage_fee: 50996 -task 9 'run'. lines 93-93: +task 9, line 93: +//# run a::m::t7 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 10 'run'. lines 95-95: +task 10, line 95: +//# run a::m::t8 --sender A --args object(2,0) mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2189484, non_refundable_storage_fee: 22116 diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive_object.exp index 13ec07f8e4727..09a5182880387 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/exhaustive_object.exp @@ -3,47 +3,57 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 10-102: +task 1, lines 10-102: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 13482400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 104-104: +task 2, line 104: +//# run a::m::t0 --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 106-106: +task 3, line 106: +//# run a::m::t1 --sender A --args object(2,0) created: object(3,0), object(3,1), object(3,2), object(3,3), object(3,4), object(3,5) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 13421600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 4 'run'. lines 108-108: +task 4, line 108: +//# run a::m::t2 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 5 'run'. lines 110-110: +task 5, line 110: +//# run a::m::t3 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 6 'run'. lines 112-112: +task 6, line 112: +//# run a::m::t4 --sender A --args object(2,0) mutated: object(0,0), object(2,0), object(3,0), object(3,1), object(3,2) gas summary: computation_cost: 1000000, storage_cost: 6156000, storage_rebate: 6094440, non_refundable_storage_fee: 61560 -task 7 'run'. lines 114-114: +task 7, line 114: +//# run a::m::t5 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 8 'run'. lines 116-116: +task 8, line 116: +//# run a::m::t6 --sender A --args object(2,0) mutated: object(0,0), object(2,0) deleted: object(3,1), object(3,2), object(3,4), object(3,5) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 9608148, non_refundable_storage_fee: 97052 -task 9 'run'. lines 118-118: +task 9, line 118: +//# run a::m::t7 --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 10 'run'. lines 120-120: +task 10, line 120: +//# run a::m::t8 --sender A --args object(2,0) mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2189484, non_refundable_storage_fee: 22116 diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/read_field_from_immutable.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/read_field_from_immutable.exp index 1bd04f8a30a13..39788273c8bfb 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/read_field_from_immutable.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/read_field_from_immutable.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 9-28: +task 1, lines 9-28: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6133200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 30-30: +task 2, line 30: +//# run a::m::add_then_freeze --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3678400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 32-32: +task 3, line 32: +//# run a::m::read_from_frozen --sender A --args object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/receive_remove_add_back_and_remove_type.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/receive_remove_add_back_and_remove_type.exp index 96a171bdbc13b..80ab758630ff0 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/receive_remove_add_back_and_remove_type.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/receive_remove_add_back_and_remove_type.exp @@ -3,48 +3,57 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 11-87: +task 1, lines 11-87: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12897200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 89-89: +task 2, line 89: +//# run test::m1::create --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4689200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 91-91: +task 3, line 91: +//# run test::m1::test_dof --args object(2,2) receiving(2,0) receiving(2,1) --sender A mutated: object(0,0), object(2,0), object(2,2) deleted: object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 4642308, non_refundable_storage_fee: 46892 -task 4 'run'. lines 93-93: +task 4, line 93: +//# run test::m1::create --sender A created: object(4,0), object(4,1), object(4,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4689200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 95-95: +task 5, line 95: +//# run test::m1::test_df --args object(4,2) receiving(4,0) receiving(4,1) --sender A mutated: object(0,0), object(4,0), object(4,2) deleted: object(4,1) gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 4642308, non_refundable_storage_fee: 46892 -task 6 'run'. lines 97-97: +task 6, line 97: +//# run test::m1::create --sender A created: object(6,0), object(6,1), object(6,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4689200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 99-99: +task 7, line 99: +//# run test::m1::test_dof_wrapper --args object(6,2) receiving(6,0) receiving(6,1) --sender A created: object(7,0) mutated: object(0,0), object(6,2) wrapped: object(6,0) gas summary: computation_cost: 1000000, storage_cost: 4050800, storage_rebate: 3430944, non_refundable_storage_fee: 34656 -task 8 'run'. lines 101-101: +task 8, line 101: +//# run test::m1::create --sender A created: object(8,0), object(8,1), object(8,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4689200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'run'. lines 103-103: +task 9, line 103: +//# run test::m1::test_df_wrapper --args object(8,2) receiving(8,0) receiving(8,1) --sender A created: object(9,0) mutated: object(0,0), object(8,2) wrapped: object(8,0) diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove.exp index 7971695029a80..25e84e85a3d0a 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove.exp @@ -3,42 +3,50 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 11-52: +task 1, lines 11-52: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9614000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 54-56: +task 2, lines 54-56: +//# run test::m1::create --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2249600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 57-57: +task 3, line 57: +//# run test::m1::add_child --args object(2,0) --sender A created: object(3,0), object(3,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5950800, storage_rebate: 2227104, non_refundable_storage_fee: 22496 -task 4 'run'. lines 59-61: +task 4, lines 59-61: +//# run test::m1::transfer_child --args object(2,0) --sender A mutated: object(0,0), object(2,0), object(3,1) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3496000, storage_rebate: 5891292, non_refundable_storage_fee: 59508 -task 5 'run'. lines 62-62: +task 5, line 62: +//# run test::m1::add_child --args object(2,0) --sender A created: object(3,0), object(5,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5950800, storage_rebate: 2227104, non_refundable_storage_fee: 22496 -task 6 'run'. lines 64-66: +task 6, lines 64-66: +//# run test::m1::delete_child --args object(2,0) --sender A mutated: object(0,0), object(2,0) deleted: object(3,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 2249600, storage_rebate: 5891292, non_refundable_storage_fee: 59508 -task 7 'run'. lines 67-67: +task 7, line 67: +//# run test::m1::add_child --args object(2,0) --sender A created: object(3,0), object(7,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5950800, storage_rebate: 2227104, non_refundable_storage_fee: 22496 -task 8 'run'. lines 69-69: +task 8, line 69: +//# run test::m1::wrap_child --args object(2,0) --sender A mutated: object(0,0), object(2,0) deleted: object(3,0) wrapped: object(7,0) diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove_type.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove_type.exp index 62efeacf4f8d6..2a6416a6d3095 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove_type.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_add_back_and_remove_type.exp @@ -3,20 +3,24 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 11-48: +task 1, lines 11-48: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8762800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 50-50: +task 2, line 50: +//# run test::m1::create --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2242000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 52-52: +task 3, line 52: +//# run test::m1::test_dof --args object(2,0) --sender A mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2242000, storage_rebate: 2219580, non_refundable_storage_fee: 22420 -task 4 'run'. lines 54-54: +task 4, line 54: +//# run test::m1::test_df --args object(2,0) --sender A mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2242000, storage_rebate: 2219580, non_refundable_storage_fee: 22420 diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type.exp index 0dc8bb4f79c43..db2e7c92f9aca 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 9-29: +task 1, lines 9-29: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6019200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run a::m::t1 --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3678400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 33-33: +task 3, line 33: +//# run a::m::t2 --sender A --args object(2,0) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::remove_child_object (function index 13) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 13, instruction: 0, function_name: Some("remove_child_object") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(13), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type_object.exp index 6e646b87c5200..9a253c6513722 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/remove_wrong_type_object.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 10-34: +task 1, lines 10-34: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6695600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 36-36: +task 2, line 36: +//# run a::m::t1 --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 38-38: +task 3, line 38: +//# run a::m::t2 --sender A --args object(2,1) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::remove_child_object (function index 13) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 13, instruction: 0, function_name: Some("remove_child_object") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(13), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/shared_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/shared_object.exp index e37673ebf90fb..e920aa9b07ba4 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/shared_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/shared_object.exp @@ -3,26 +3,31 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 8-72: +task 1, lines 8-72: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9690000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 74-74: +task 2, line 74: +//# run test::m::parent --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2470000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 76-78: +task 3, lines 76-78: +//# run test::m::child --sender A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2287600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 79-79: +task 4, line 79: +//# run test::m::add_field --sender A --args object(2,0) object(3,0) Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 5 'view-object'. lines 81-81: +task 5, line 81: +//# view-object 3,0 Owner: Shared( 3 ) Version: 4 Contents: test::m::Child { @@ -34,11 +39,13 @@ Contents: test::m::Child { value: 0u64, } -task 6 'run'. lines 83-83: +task 6, line 83: +//# run test::m::buy --sender A --args object(2,0) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::borrow_child_object (function index 11) at offset 0, Abort Code: 1 Debug of error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) at command Some(0) -task 7 'view-object'. lines 85-85: +task 7, line 85: +//# view-object 3,0 Owner: Shared( 3 ) Version: 4 Contents: test::m::Child { @@ -50,6 +57,7 @@ Contents: test::m::Child { value: 0u64, } -task 8 'run'. lines 87-87: +task 8, line 87: +//# run test::m::make_dynamic_remove_and_then_share Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::borrow_child_object (function index 11) at offset 0, Abort Code: 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1), source: Some(VMError { major_status: ABORTED, sub_status: Some(1), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(11), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/transfer_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/transfer_object.exp index 2b0aa95ade003..e160db7b95b1f 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/transfer_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/transfer_object.exp @@ -3,48 +3,58 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 10-65: +task 1, lines 10-65: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9317600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 67-67: +task 2, line 67: +//# run a::m::create --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 69-69: +task 3, line 69: +//# run a::m::create --sender A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 71-71: +task 4, line 71: +//# run a::m::add_counter --sender A --args object(2,0) created: object(4,0), object(4,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5981200, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 5 'run'. lines 73-73: +task 5, line 73: +//# run a::m::obj_bump --sender A --args object(2,0) mutated: object(0,0), object(2,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 3526400, storage_rebate: 3491136, non_refundable_storage_fee: 35264 -task 6 'run'. lines 75-75: +task 6, line 75: +//# run a::m::assert_count --sender A --args object(2,0) 1 mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 7 'run'. lines 77-77: +task 7, line 77: +//# run a::m::transfer --sender A --args object(2,0) object(3,0) created: object(7,0) mutated: object(0,0), object(2,0), object(3,0), object(4,0) deleted: object(4,1) gas summary: computation_cost: 1000000, storage_cost: 7204800, storage_rebate: 7132752, non_refundable_storage_fee: 72048 -task 8 'run'. lines 79-79: +task 8, line 79: +//# run a::m::obj_bump --sender A --args object(3,0) mutated: object(0,0), object(3,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 3526400, storage_rebate: 3491136, non_refundable_storage_fee: 35264 -task 9 'run'. lines 81-81: +task 9, line 81: +//# run a::m::assert_count --sender A --args object(3,0) 2 mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 10 'run'. lines 83-83: +task 10, line 83: +//# run a::m::obj_bump --sender A --args object(2,0) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_field::borrow_child_object_mut (function index 12) at offset 0, Abort Code: 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 12, instruction: 0, function_name: Some("borrow_child_object_mut") }, 1), source: Some(VMError { major_status: ABORTED, sub_status: Some(1), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/unwrap_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/unwrap_object.exp index 58f165cbbe97a..a34226c7b2b70 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/unwrap_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/unwrap_object.exp @@ -3,24 +3,28 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 8-39: +task 1, lines 8-39: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7478400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 41-41: +task 2, line 41: +//# run a::m::mint --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4157200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 43-43: +task 3, line 43: +//# run a::m::take_and_wrap --sender A --args object(2,0) created: object(3,1) mutated: object(0,0), object(2,0) unwrapped: object(3,0) deleted: object(2,1) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 4115628, non_refundable_storage_fee: 41572 -task 4 'view-object'. lines 45-45: +task 4, line 45: +//# view-object 3,0 Owner: Object ID: ( fake(3,1) ) Version: 3 Contents: a::m::Obj { @@ -31,29 +35,34 @@ Contents: a::m::Obj { }, } -task 5 'run'. lines 48-48: +task 5, line 48: +//# run a::m::mint --sender A created: object(5,0), object(5,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4157200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 50-50: +task 6, line 50: +//# run a::m::take_and_destroy --sender A --args object(5,0) mutated: object(0,0), object(5,0) deleted: object(5,1) unwrapped_then_deleted: object(_) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 4115628, non_refundable_storage_fee: 41572 -task 7 'run'. lines 53-53: +task 7, line 53: +//# run a::m::mint --sender A created: object(7,0), object(7,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4157200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'run'. lines 56-56: +task 8, line 56: +//# run a::m::take_and_take --sender A --args object(7,0) mutated: object(0,0), object(7,0) unwrapped: object(8,0) deleted: object(7,1) gas summary: computation_cost: 1000000, storage_cost: 3435200, storage_rebate: 4115628, non_refundable_storage_fee: 41572 -task 9 'view-object'. lines 58-58: +task 9, line 58: +//# view-object 7,0 Owner: Account Address ( A ) Version: 7 Contents: a::m::Obj { diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrap_object.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrap_object.exp index e9d4d32f48624..8e2a09abe3f97 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrap_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrap_object.exp @@ -3,17 +3,20 @@ processed 12 tasks init: A: object(0,0) -task 1 'publish'. lines 8-39: +task 1, lines 8-39: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7478400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 41-41: +task 2, line 41: +//# run a::m::mint --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 43-43: +task 3, line 43: +//# view-object 2,1 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: a::m::Obj { @@ -24,19 +27,22 @@ Contents: a::m::Obj { }, } -task 4 'run'. lines 45-45: +task 4, line 45: +//# run a::m::take_and_wrap --sender A --args object(2,0) created: object(4,0) mutated: object(0,0), object(2,0) deleted: object(2,2) wrapped: object(2,1) gas summary: computation_cost: 1000000, storage_cost: 4157200, storage_rebate: 5831100, non_refundable_storage_fee: 58900 -task 5 'run'. lines 48-48: +task 5, line 48: +//# run a::m::mint --sender A created: object(5,0), object(5,1), object(5,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'view-object'. lines 50-50: +task 6, line 50: +//# view-object 5,2 Owner: Object ID: ( fake(5,1) ) Version: 4 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -53,17 +59,20 @@ Contents: sui::dynamic_field::Field, sui }, } -task 7 'run'. lines 52-52: +task 7, line 52: +//# run a::m::take_and_destroy --sender A --args object(5,1) mutated: object(0,0), object(5,1) deleted: object(5,0), object(5,2) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 5831100, non_refundable_storage_fee: 58900 -task 8 'run'. lines 55-55: +task 8, line 55: +//# run a::m::mint --sender A created: object(8,0), object(8,1), object(8,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'view-object'. lines 57-57: +task 9, line 57: +//# view-object 8,2 Owner: Object ID: ( fake(8,0) ) Version: 6 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -80,10 +89,12 @@ Contents: sui::dynamic_field::Field, sui }, } -task 10 'run'. lines 59-59: +task 10, line 59: +//# run a::m::take_and_take --sender A --args object(8,0) mutated: object(0,0), object(8,0), object(8,1) deleted: object(8,2) gas summary: computation_cost: 1000000, storage_cost: 3435200, storage_rebate: 5831100, non_refundable_storage_fee: 58900 -task 11 'view-object'. lines 61-61: +task 11, line 61: +//# view-object 8,2 No object at id 8,2 diff --git a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrapped_uid_after_delete.exp b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrapped_uid_after_delete.exp index 7d8a2e0ce9c22..689f3bf788e1e 100644 --- a/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrapped_uid_after_delete.exp +++ b/crates/sui-adapter-transactional-tests/tests/dynamic_fields/wrapped_uid_after_delete.exp @@ -3,32 +3,38 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 10-82: +task 1, lines 10-82: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 10229600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 84-84: +task 2, line 84: +//# run a::m::t0 --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 86-86: +task 3, line 86: +//# run a::m::t1 --sender A --args object(2,0) created: object(3,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 4248400, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 4 'run'. lines 88-88: +task 4, line 88: +//# run a::m::t2 --sender A --args object(2,0) mutated: object(0,0), object(2,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 4248400, storage_rebate: 4205916, non_refundable_storage_fee: 42484 -task 5 'run'. lines 90-90: +task 5, line 90: +//# run a::m::t3 --sender A --args object(2,0) created: object(5,0) mutated: object(0,0) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2485200, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 6 'view-object'. lines 92-92: +task 6, line 92: +//# view-object 3,0 Owner: Object ID: ( fake(2,0) ) Version: 4 Contents: sui::dynamic_field::Field { @@ -48,17 +54,20 @@ Contents: sui::dynamic_field::Field { }, } -task 7 'run'. lines 94-94: +task 7, line 94: +//# run a::m::t4 --sender A --args object(5,0) mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 2485200, storage_rebate: 2460348, non_refundable_storage_fee: 24852 -task 8 'run'. lines 96-96: +task 8, line 96: +//# run a::m::t5 --sender A --args object(5,0) mutated: object(0,0) deleted: object(5,0) unwrapped_then_deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2460348, non_refundable_storage_fee: 24852 -task 9 'view-object'. lines 98-98: +task 9, line 98: +//# view-object 3,0 Owner: Object ID: ( fake(2,0) ) Version: 4 Contents: sui::dynamic_field::Field { diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/ascii.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/ascii.exp index 26ddb3232f67d..40f380dc4f7e5 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/ascii.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/ascii.exp @@ -3,23 +3,28 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 6-25: +task 1, lines 6-25: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5745600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-30: +task 2, lines 27-30: +//# run Test::M::ascii_arg --sender A --args b"SomeString" mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 32-35: +task 3, lines 32-35: +//# run Test::M::ascii_arg --sender A --args "SomeString" mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 37-45: +task 4, lines 37-45: +//# run Test::M::ascii_vec_arg --sender A --args vector[b"Some",b"String"] mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 47-47: +task 5, line 47: +//# run Test::M::ascii_arg --sender A --args "Some∫tring" Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::ascii::String but provided argument's value does not match"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref.exp index 9326bb637bf54..dd14354f47c7e 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref.exp @@ -3,7 +3,8 @@ processed 2 tasks init: A: object(0,0) -task 1 'publish'. lines 6-14: +task 1, lines 6-14: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4149600, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref_invalid.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref_invalid.exp index 4ba95571e90e0..90ad1089c9d98 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/generic_by_ref_invalid.exp @@ -3,18 +3,22 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-11: +task 1, lines 8-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &T0"), command: Some(0) } } -task 2 'publish'. lines 13-16: +task 2, lines 13-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &mut T0"), command: Some(0) } } -task 3 'publish'. lines 18-21: +task 3, lines 18-21: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &T0"), command: Some(0) } } -task 4 'publish'. lines 23-26: +task 4, lines 23-26: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &mut T0"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/imm_txn_context.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/imm_txn_context.exp index fff39946568e0..db78f3217b65a 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/imm_txn_context.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/imm_txn_context.exp @@ -3,20 +3,24 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 6-27: +task 1, lines 6-27: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6034400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 29-29: +task 2, line 29: +//# run Test::M::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 31-31: +task 3, line 31: +//# run Test::M::set_to_epoch --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 4 'run'. lines 33-33: +task 4, line 33: +//# run Test::M::check_is_epoch --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/missing_type.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/missing_type.exp index dc19b15d004bf..07ea9cd668a44 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/missing_type.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/missing_type.exp @@ -3,27 +3,33 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3876000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 17-17: +task 2, line 17: +//# run test::m::foo --type-args test::x::x Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: LINKER_ERROR, sub_status: None, message: Some("Cannot find ModuleId { address: test, name: Identifier(\"x\") } in data cache"), exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } -task 3 'run'. lines 19-19: +task 3, line 19: +//# run test::m::foo --type-args test::m::SUI Error: Transaction Effects Status: Error for type argument at index 0: A type was not found in the module specified. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: TypeArgumentError { argument_idx: 0, kind: TypeNotFound }, source: None, command: Some(0) } } -task 4 'run'. lines 21-21: +task 4, line 21: +//# run test::m::foo --type-args test::m::S Error: Transaction Effects Status: Type arity mismatch for Move function. Mismatch between the number of actual versus expected type arguments. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: TypeArityMismatch, source: None, command: Some(0) } } -task 5 'run'. lines 23-23: +task 5, line 23: +//# run test::m::foo --type-args test::m::S Error: Transaction Effects Status: Type arity mismatch for Move function. Mismatch between the number of actual versus expected type arguments. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: TypeArityMismatch, source: None, command: Some(0) } } -task 6 'run'. lines 25-25: +task 6, line 25: +//# run test::m::foo --type-args test::m::S Error: Transaction Effects Status: Error for type argument at index 0: A type provided did not match the specified constraints. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: TypeArgumentError { argument_idx: 0, kind: ConstraintNotSatisfied }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/no_txn_context.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/no_txn_context.exp index 20baf868a3e96..3299f1af43cb2 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/no_txn_context.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/no_txn_context.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 6-23: +task 1, lines 6-23: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5494800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 25-25: +task 2, line 25: +//# run Test::M::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 27-27: +task 3, line 27: +//# run Test::M::incr --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector.exp index 24ffe2dca6486..709aa1320e41d 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector.exp @@ -3,85 +3,103 @@ processed 19 tasks init: A: object(0,0) -task 1 'publish'. lines 8-111: +task 1, lines 8-111: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12646400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 113-113: +task 2, line 113: +//# run Test::M::prim_vec_len --sender A --args vector[7,42] mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 115-119: +task 3, lines 115-119: +//# run Test::M::mint --sender A --args 42 created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 121-121: +task 4, line 121: +//# run Test::M::obj_vec_destroy --sender A --args vector[object(3,0)] mutated: object(0,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 5 'run'. lines 123-123: +task 5, line 123: +//# run Test::M::mint --sender A --args 42 created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 125-125: +task 6, line 125: +//# run Test::M::mint_child --sender A --args 42 object(5,0) created: object(6,0), object(6,1) mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 6011600, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 7 'run'. lines 127-131: +task 7, lines 127-131: +//# run Test::M::child_access --sender A --args object(5,0) vector[object(6,0)] Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(6,0), parent_id: object(6,1) } -task 8 'run'. lines 133-133: +task 8, line 133: +//# run Test::M::mint_another --sender A --args 42 created: object(8,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'run'. lines 135-138: +task 9, lines 135-138: +//# run Test::M::obj_vec_destroy --sender A --args vector[object(8,0)] Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 10 'run'. lines 140-140: +task 10, line 140: +//# run Test::M::mint_another --sender A --args 42 created: object(10,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'run'. lines 142-142: +task 11, line 142: +//# run Test::M::mint --sender A --args 42 created: object(11,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 12 'run'. lines 144-147: +task 12, lines 144-147: +//# run Test::M::two_obj_vec_destroy --sender A --args vector[object(10,0),object(11,0)] Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(0) } } -task 13 'run'. lines 149-149: +task 13, line 149: +//# run Test::M::mint_shared --sender A --args 42 created: object(13,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 14 'run'. lines 151-154: +task 14, lines 151-154: +//# run Test::M::obj_vec_destroy --sender A --args vector[object(13,0)] mutated: object(0,0) deleted: object(13,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 15 'run'. lines 156-156: +task 15, line 156: +//# run Test::M::mint --sender A --args 42 created: object(15,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'run'. lines 158-161: +task 16, lines 158-161: +//# run Test::M::same_objects --sender A --args object(15,0) vector[object(15,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 17 'run'. lines 163-163: +task 17, line 163: +//# run Test::M::mint --sender A --args 42 created: object(17,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 18 'run'. lines 165-165: +task 18, line 165: +//# run Test::M::same_objects_ref --sender A --args object(17,0) vector[object(17,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic.exp index 127f07f2f3b55..77d0ebe7e6e34 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic.exp @@ -3,81 +3,98 @@ processed 18 tasks init: A: object(0,0) -task 1 'publish'. lines 8-110: +task 1, lines 8-110: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 13452000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 112-112: +task 2, line 112: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 114-118: +task 3, lines 114-118: +//# run Test::M::obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(2,0)] mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2573208, non_refundable_storage_fee: 25992 -task 4 'run'. lines 120-120: +task 4, line 120: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 122-122: +task 5, line 122: +//# run Test::M::mint_child_any --sender A --type-args Test::M::Any --args 42 object(4,0) created: object(5,0), object(5,1) mutated: object(0,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 6665200, storage_rebate: 2573208, non_refundable_storage_fee: 25992 -task 6 'run'. lines 124-128: +task 6, lines 124-128: +//# run Test::M::child_access_any --sender A --type-args Test::M::Any --args object(4,0) vector[object(5,0)] Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(5,0), parent_id: object(5,1) } -task 7 'run'. lines 130-130: +task 7, line 130: +//# run Test::M::mint_another_any --type-args Test::M::Any --sender A --args 42 created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2652400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'run'. lines 132-135: +task 8, lines 132-135: +//# run Test::M::obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(7,0)] Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 9 'run'. lines 137-137: +task 9, line 137: +//# run Test::M::mint_another_any --sender A --type-args Test::M::Any --args 42 created: object(9,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2652400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'run'. lines 139-139: +task 10, line 139: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(10,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'run'. lines 141-144: +task 11, lines 141-144: +//# run Test::M::two_obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(9,0),object(10,0)] Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(0) } } -task 12 'run'. lines 146-146: +task 12, line 146: +//# run Test::M::mint_shared_any --sender A --type-args Test::M::Any --args 42 created: object(12,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 13 'run'. lines 148-151: +task 13, lines 148-151: +//# run Test::M::obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(12,0)] mutated: object(0,0) deleted: object(12,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2573208, non_refundable_storage_fee: 25992 -task 14 'run'. lines 153-153: +task 14, line 153: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(14,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'run'. lines 155-158: +task 15, lines 155-158: +//# run Test::M::same_objects_any --sender A --type-args Test::M::Any --args object(14,0) vector[object(14,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 16 'run'. lines 160-160: +task 16, line 160: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(16,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 17 'run'. lines 162-162: +task 17, line 162: +//# run Test::M::same_objects_ref_any --sender A --type-args Test::M::Any --args object(16,0) vector[object(16,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic_v20.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic_v20.exp index 4c0c9ec6e4052..517e09d01a731 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic_v20.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_generic_v20.exp @@ -3,80 +3,97 @@ processed 18 tasks init: A: object(0,0) -task 1 'publish'. lines 8-110: +task 1, lines 8-110: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 13452000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 112-112: +task 2, line 112: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 114-118: +task 3, lines 114-118: +//# run Test::M::obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(2,0)] mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2573208, non_refundable_storage_fee: 25992 -task 4 'run'. lines 120-120: +task 4, line 120: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 122-122: +task 5, line 122: +//# run Test::M::mint_child_any --sender A --type-args Test::M::Any --args 42 object(4,0) created: object(5,0), object(5,1) mutated: object(0,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 6665200, storage_rebate: 2573208, non_refundable_storage_fee: 25992 -task 6 'run'. lines 124-128: +task 6, lines 124-128: +//# run Test::M::child_access_any --sender A --type-args Test::M::Any --args object(4,0) vector[object(5,0)] Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(5,0), parent_id: object(5,1) } -task 7 'run'. lines 130-130: +task 7, line 130: +//# run Test::M::mint_another_any --type-args Test::M::Any --sender A --args 42 created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2652400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'run'. lines 132-135: +task 8, lines 132-135: +//# run Test::M::obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(7,0)] Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 9 'run'. lines 137-137: +task 9, line 137: +//# run Test::M::mint_another_any --sender A --type-args Test::M::Any --args 42 created: object(9,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2652400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'run'. lines 139-139: +task 10, line 139: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(10,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'run'. lines 141-144: +task 11, lines 141-144: +//# run Test::M::two_obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(9,0),object(10,0)] Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(0) } } -task 12 'run'. lines 146-146: +task 12, line 146: +//# run Test::M::mint_shared_any --sender A --type-args Test::M::Any --args 42 created: object(12,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 13 'run'. lines 148-151: +task 13, lines 148-151: +//# run Test::M::obj_vec_destroy_any --sender A --type-args Test::M::Any --args vector[object(12,0)] Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue } at command Some(0) -task 14 'run'. lines 153-153: +task 14, line 153: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(14,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'run'. lines 155-158: +task 15, lines 155-158: +//# run Test::M::same_objects_any --sender A --type-args Test::M::Any --args object(14,0) vector[object(14,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 16 'run'. lines 160-160: +task 16, line 160: +//# run Test::M::mint_any --sender A --type-args Test::M::Any --args 42 created: object(16,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2599200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 17 'run'. lines 162-162: +task 17, line 162: +//# run Test::M::same_objects_ref_any --sender A --type-args Test::M::Any --args object(16,0) vector[object(16,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_v20.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_v20.exp index 2df368a33040f..0452f52dd5139 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_v20.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/obj_vector_v20.exp @@ -3,84 +3,102 @@ processed 19 tasks init: A: object(0,0) -task 1 'publish'. lines 8-111: +task 1, lines 8-111: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12646400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 113-113: +task 2, line 113: +//# run Test::M::prim_vec_len --sender A --args vector[7,42] mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 115-119: +task 3, lines 115-119: +//# run Test::M::mint --sender A --args 42 created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 121-121: +task 4, line 121: +//# run Test::M::obj_vec_destroy --sender A --args vector[object(3,0)] mutated: object(0,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 5 'run'. lines 123-123: +task 5, line 123: +//# run Test::M::mint --sender A --args 42 created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 125-125: +task 6, line 125: +//# run Test::M::mint_child --sender A --args 42 object(5,0) created: object(6,0), object(6,1) mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 6011600, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 7 'run'. lines 127-131: +task 7, lines 127-131: +//# run Test::M::child_access --sender A --args object(5,0) vector[object(6,0)] Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(6,0), parent_id: object(6,1) } -task 8 'run'. lines 133-133: +task 8, line 133: +//# run Test::M::mint_another --sender A --args 42 created: object(8,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'run'. lines 135-138: +task 9, lines 135-138: +//# run Test::M::obj_vec_destroy --sender A --args vector[object(8,0)] Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 10 'run'. lines 140-140: +task 10, line 140: +//# run Test::M::mint_another --sender A --args 42 created: object(10,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'run'. lines 142-142: +task 11, line 142: +//# run Test::M::mint --sender A --args 42 created: object(11,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 12 'run'. lines 144-147: +task 12, lines 144-147: +//# run Test::M::two_obj_vec_destroy --sender A --args vector[object(10,0),object(11,0)] Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(0) } } -task 13 'run'. lines 149-149: +task 13, line 149: +//# run Test::M::mint_shared --sender A --args 42 created: object(13,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 14 'run'. lines 151-154: +task 14, lines 151-154: +//# run Test::M::obj_vec_destroy --sender A --args vector[object(13,0)] Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue } at command Some(0) -task 15 'run'. lines 156-156: +task 15, line 156: +//# run Test::M::mint --sender A --args 42 created: object(15,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'run'. lines 158-161: +task 16, lines 158-161: +//# run Test::M::same_objects --sender A --args object(15,0) vector[object(15,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 17 'run'. lines 163-163: +task 17, line 163: +//# run Test::M::mint --sender A --args 42 created: object(17,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 18 'run'. lines 165-165: +task 18, line 165: +//# run Test::M::same_objects_ref --sender A --args object(17,0) vector[object(17,0)] Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/utf8.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/utf8.exp index 38c9a48f6287e..1912e70ab2def 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/utf8.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/utf8.exp @@ -3,31 +3,38 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 6-24: +task 1, lines 6-24: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6011600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 26-29: +task 2, lines 26-29: +//# run Test::M::utf8_arg --sender A --args b"SomeStringPlusSomeString" mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 31-34: +task 3, lines 31-34: +//# run Test::M::utf8_arg --sender A --args "SomeStringPlusSomeString" mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 36-39: +task 4, lines 36-39: +//# run Test::M::utf8_arg --sender A --args "çå∞≠¢õß∂ƒ∫" mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 41-44: +task 5, lines 41-44: +//# run Test::M::utf8_vec_arg --sender A --args vector[b"SomeStringPlus",b"SomeString"] mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 46-49: +task 6, lines 46-49: +//# run Test::M::utf8_vec_arg --sender A --args vector["SomeStringPlus","SomeString"] mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 51-51: +task 7, line 51: +//# run Test::M::utf8_vec_arg --sender A --args vector["çå∞≠¢","õß∂ƒ∫"] mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/entry_points/wrong_visibility.exp b/crates/sui-adapter-transactional-tests/tests/entry_points/wrong_visibility.exp index fe372e35a8920..572473d020e66 100644 --- a/crates/sui-adapter-transactional-tests/tests/entry_points/wrong_visibility.exp +++ b/crates/sui-adapter-transactional-tests/tests/entry_points/wrong_visibility.exp @@ -1,22 +1,27 @@ processed 6 tasks -task 1 'publish'. lines 8-26: +task 1, lines 8-26: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4522000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 28-28: +task 2, line 28: +//# run Test::M::t2 Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Can only call `entry` or `public` functions"), command: Some(0) } } -task 3 'run'. lines 30-30: +task 3, line 30: +//# run Test::M::t3 Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Can only call `entry` or `public` functions"), command: Some(0) } } -task 4 'run'. lines 32-32: +task 4, line 32: +//# run Test::M::t4 --args 0 Error: Transaction Effects Status: Invalid public Move function signature. Unsupported return type for return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidPublicFunctionReturnType { idx: 0 }, source: None, command: Some(0) } } -task 5 'run'. lines 34-34: +task 5, line 34: +//# run Test::M::t5 --args 0 Error: Transaction Effects Status: Invalid public Move function signature. Unsupported return type for return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidPublicFunctionReturnType { idx: 0 }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/enums/basic_enums.exp b/crates/sui-adapter-transactional-tests/tests/enums/basic_enums.exp index c2d80889d062a..36be47fd59003 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/basic_enums.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/basic_enums.exp @@ -1,16 +1,19 @@ processed 6 tasks -task 1 'publish'. lines 6-31: +task 1, lines 6-31: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6262400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-33: +task 2, line 33: +//# run Test::f::create_and_test created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 35-35: +task 3, line 35: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: Test::f::S { @@ -22,11 +25,13 @@ Contents: Test::f::S { data: Test::f::F::V1{}, } -task 4 'run'. lines 37-37: +task 4, line 37: +//# run Test::f::update_inner --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2264800, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 5 'view-object'. lines 39-39: +task 5, line 39: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: Test::f::S { diff --git a/crates/sui-adapter-transactional-tests/tests/enums/coin_wrapper.exp b/crates/sui-adapter-transactional-tests/tests/enums/coin_wrapper.exp index a0c0d94ab170d..ef977d816b3a5 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/coin_wrapper.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/coin_wrapper.exp @@ -3,12 +3,16 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 6-48: +task 1, lines 6-48: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 9492400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 50-52: +task 2, lines 50-52: +//# programmable --sender A --inputs 10 @A +//> 0: Test::f::create_sui(Gas, Input(0)); +//> 1: TransferObjects([Result(0)], Input(1)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2576400, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enum_events.exp b/crates/sui-adapter-transactional-tests/tests/enums/enum_events.exp index b214d7a7231de..0d0babac3fd71 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enum_events.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enum_events.exp @@ -1,26 +1,31 @@ processed 6 tasks -task 1 'publish'. lines 6-32: +task 1, lines 6-32: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5213600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-34: +task 2, line 34: +//# run Test::f::f1 events: Event { package_id: Test, transaction_module: Identifier("f"), sender: _, type_: StructTag { address: Test, module: Identifier("f"), name: Identifier("F"), type_params: [] }, contents: [0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 36-36: +task 3, line 36: +//# run Test::f::f2 --args 42 events: Event { package_id: Test, transaction_module: Identifier("f"), sender: _, type_: StructTag { address: Test, module: Identifier("f"), name: Identifier("F"), type_params: [] }, contents: [1, 42, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 38-38: +task 4, line 38: +//# run Test::f::f3 --args 42 43 events: Event { package_id: Test, transaction_module: Identifier("f"), sender: _, type_: StructTag { address: Test, module: Identifier("f"), name: Identifier("F"), type_params: [] }, contents: [2, 42, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 40-40: +task 5, line 40: +//# run Test::f::f4 --args 42 events: Event { package_id: Test, transaction_module: Identifier("f"), sender: _, type_: StructTag { address: Test, module: Identifier("f"), name: Identifier("F"), type_params: [] }, contents: [3, 42, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enum_otw_check.exp b/crates/sui-adapter-transactional-tests/tests/enums/enum_otw_check.exp index 89cf5dde4bc74..406727bfa5745 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enum_otw_check.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enum_otw_check.exp @@ -1,10 +1,12 @@ processed 3 tasks -task 1 'publish'. lines 6-15: +task 1, lines 6-15: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4636000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 17-17: +task 2, line 17: +//# run Test::f::test mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only.exp b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only.exp index 0d17cff248fa2..0322eccd7746d 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only.exp @@ -1,17 +1,22 @@ processed 6 tasks -task 1 'publish'. lines 6-37: +task 1, lines 6-37: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } -task 2 'set-address'. lines 39-39: +task 2, line 39: +//# set-address test object(1,0) Error: INVALID TEST. Unknown object, object(1,0) -task 3 'run'. lines 41-41: +task 3, line 41: +//# run test::f::transfer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 4 'run'. lines 43-43: +task 4, line 43: +//# run test::f::share Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 5 'run'. lines 45-45: +task 5, line 45: +//# run test::f::freezer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp index cb3c93e44d27a..7e80ec0b01982 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp @@ -1,17 +1,22 @@ processed 6 tasks -task 1 'publish'. lines 6-45: +task 1, lines 6-45: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } -task 2 'set-address'. lines 47-47: +task 2, line 47: +//# set-address test object(1,0) Error: INVALID TEST. Unknown object, object(1,0) -task 3 'run'. lines 49-49: +task 3, line 49: +//# run test::f::transfer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 4 'run'. lines 51-51: +task 4, line 51: +//# run test::f::share Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 5 'run'. lines 53-53: +task 5, line 53: +//# run test::f::freezer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store.exp b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store.exp index ce1c629c6755d..2659713b6bba9 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store.exp @@ -1,32 +1,42 @@ processed 11 tasks -task 1 'publish'. lines 6-88: +task 1, lines 6-88: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } -task 2 'set-address'. lines 90-90: +task 2, line 90: +//# set-address test object(1,0) Error: INVALID TEST. Unknown object, object(1,0) -task 3 'run'. lines 92-92: +task 3, line 92: +//# run test::f::transfer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 4 'run'. lines 94-94: +task 4, line 94: +//# run test::f::share Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 5 'run'. lines 96-96: +task 5, line 96: +//# run test::f::public_transfer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 6 'run'. lines 98-98: +task 6, line 98: +//# run test::f::public_share Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 7 'run'. lines 100-100: +task 7, line 100: +//# run test::f::freezer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 8 'run'. lines 102-102: +task 8, line 102: +//# run test::f::public_freezer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 9 'run'. lines 104-104: +task 9, line 104: +//# run test::f::add_df Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 10 'run'. lines 106-106: +task 10, line 106: +//# run test::f::add_dof Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp index 60dc6389ac3b8..38bbf911b5645 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp @@ -1,32 +1,42 @@ processed 11 tasks -task 1 'publish'. lines 6-104: +task 1, lines 6-104: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } -task 2 'set-address'. lines 106-106: +task 2, line 106: +//# set-address test object(1,0) Error: INVALID TEST. Unknown object, object(1,0) -task 3 'run'. lines 108-108: +task 3, line 108: +//# run test::f::transfer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 4 'run'. lines 110-110: +task 4, line 110: +//# run test::f::share Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 5 'run'. lines 112-112: +task 5, line 112: +//# run test::f::public_transfer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 6 'run'. lines 114-114: +task 6, line 114: +//# run test::f::public_share Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 7 'run'. lines 116-116: +task 7, line 116: +//# run test::f::freezer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 8 'run'. lines 118-118: +task 8, line 118: +//# run test::f::public_freezer Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 9 'run'. lines 120-120: +task 9, line 120: +//# run test::f::add_df Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } -task 10 'run'. lines 122-122: +task 10, line 122: +//# run test::f::add_dof Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade.exp b/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade.exp index b42d54d70a1e1..6ff501def53d3 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade.exp @@ -3,17 +3,20 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 6-31: +task 1, lines 6-31: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7896400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-33: +task 2, line 33: +//# run Test::f::create_and_test created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 35-35: +task 3, line 35: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 2 Contents: Test::f::S { @@ -25,11 +28,13 @@ Contents: Test::f::S { data: Test::f::F::V1{}, } -task 4 'run'. lines 37-37: +task 4, line 37: +//# run Test::f::update_inner --args object(2,0) mutated: object(0,1), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2264800, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 5 'view-object'. lines 39-39: +task 5, line 39: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: Test::f::S { @@ -43,12 +48,14 @@ Contents: Test::f::S { }, } -task 6 'upgrade'. lines 41-70: +task 6, lines 41-70: +//# upgrade --package Test --upgrade-capability 1,1 --sender A created: object(6,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 8314400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 7 'view-object'. lines 72-72: +task 7, line 72: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: fake(1,0)::f::S { @@ -62,11 +69,13 @@ Contents: fake(1,0)::f::S { }, } -task 8 'run'. lines 74-74: +task 8, line 74: +//# run Test::f::update_inner2 --args object(2,0) mutated: object(0,1), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 2242152, non_refundable_storage_fee: 22648 -task 9 'view-object'. lines 76-76: +task 9, line 76: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: fake(1,0)::f::S { diff --git a/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade_add_variant.exp b/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade_add_variant.exp index 59e9ee60fedc5..5e7eda539c785 100644 --- a/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade_add_variant.exp +++ b/crates/sui-adapter-transactional-tests/tests/enums/enums_upgrade_add_variant.exp @@ -3,17 +3,20 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-31: +task 1, lines 6-31: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7896400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-33: +task 2, line 33: +//# run Test::f::create_and_test created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 35-35: +task 3, line 35: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 2 Contents: Test::f::S { @@ -25,11 +28,13 @@ Contents: Test::f::S { data: Test::f::F::V1{}, } -task 4 'run'. lines 37-37: +task 4, line 37: +//# run Test::f::update_inner --args object(2,0) mutated: object(0,1), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2264800, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 5 'view-object'. lines 39-39: +task 5, line 39: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: Test::f::S { @@ -43,6 +48,7 @@ Contents: Test::f::S { }, } -task 6 'upgrade'. lines 41-72: +task 6, lines 41-72: +//# upgrade --package Test --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/epoch/advance.exp b/crates/sui-adapter-transactional-tests/tests/epoch/advance.exp index e99c1ab9d5099..a1b3532c73600 100644 --- a/crates/sui-adapter-transactional-tests/tests/epoch/advance.exp +++ b/crates/sui-adapter-transactional-tests/tests/epoch/advance.exp @@ -1,22 +1,27 @@ processed 6 tasks -task 1 'publish'. lines 6-24: +task 1, lines 6-24: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5639200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 26-26: +task 2, line 26: +//# run test::m::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 28-28: +task 3, line 28: +//# run test::m::check --args object(2,0) 0 mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 2234628, non_refundable_storage_fee: 22572 -task 4 'advance-epoch'. lines 30-30: +task 4, line 30: +//# advance-epoch Epoch advanced: 1 -task 5 'run'. lines 32-32: +task 5, line 32: +//# run test::m::check --args object(2,0) 1 mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 2234628, non_refundable_storage_fee: 22572 diff --git a/crates/sui-adapter-transactional-tests/tests/init/entry_new.exp b/crates/sui-adapter-transactional-tests/tests/init/entry_new.exp index 7374d6e10fc0d..1bf7afc28b28e 100644 --- a/crates/sui-adapter-transactional-tests/tests/init/entry_new.exp +++ b/crates/sui-adapter-transactional-tests/tests/init/entry_new.exp @@ -1,8 +1,10 @@ processed 3 tasks -task 1 'publish'. lines 8-17: +task 1, lines 8-17: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m. 'init' cannot be 'entry'"), command: Some(0) } } -task 2 'run'. lines 18-18: +task 2, line 18: +//# run test::m::init Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000000 } diff --git a/crates/sui-adapter-transactional-tests/tests/init/entry_old.exp b/crates/sui-adapter-transactional-tests/tests/init/entry_old.exp index 9bc25b97c5553..fce467916c792 100644 --- a/crates/sui-adapter-transactional-tests/tests/init/entry_old.exp +++ b/crates/sui-adapter-transactional-tests/tests/init/entry_old.exp @@ -3,11 +3,13 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 8-20: +task 1, lines 8-20: +//# publish --sender A --upgradeable created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5639200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 24-39: +task 3, lines 24-39: +//# run test::m::init mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/child_of_child.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/child_of_child.exp index e55cd9da8c09f..e3dbfb1edbf08 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/child_of_child.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/child_of_child.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-66: +task 1, lines 8-66: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9218800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 68-70: +task 2, lines 68-70: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 9750800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 72-72: +task 3, line 72: +//# view-object 2,4 Owner: Account Address ( A ) Version: 2 Contents: test::m::Obj { @@ -25,11 +30,14 @@ Contents: test::m::Obj { value: 0u64, } -task 4 'programmable'. lines 74-75: +task 4, lines 74-75: +//# programmable --sender A --inputs object(2,4) 1 2 3 +//> test::m::set(Input(0), Input(1), Input(2), Input(3)) mutated: object(0,0), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 4841200, storage_rebate: 4792788, non_refundable_storage_fee: 48412 -task 5 'view-object'. lines 77-77: +task 5, line 77: +//# view-object 2,4 Owner: Account Address ( A ) Version: 3 Contents: test::m::Obj { @@ -41,12 +49,15 @@ Contents: test::m::Obj { value: 1u64, } -task 6 'programmable'. lines 79-80: +task 6, lines 79-80: +//# programmable --sender A --inputs object(2,4) +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,4) deleted: object(2,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 5951484, non_refundable_storage_fee: 60116 -task 7 'view-object'. lines 82-85: +task 7, lines 82-85: +//# view-object 2,4 Owner: Account Address ( A ) Version: 4 Contents: test::m::Obj { @@ -58,26 +69,39 @@ Contents: test::m::Obj { value: 1u64, } -task 8 'programmable'. lines 87-88: +task 8, lines 87-88: +//# programmable --sender A --inputs object(2,4)@2 0 0 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) mutated: object(_), object(2,4) gas summary: computation_cost: 500000, storage_cost: 2272400, storage_rebate: 1271556, non_refundable_storage_fee: 12844 -task 9 'programmable'. lines 90-91: +task 9, lines 90-91: +//# programmable --sender A --inputs object(2,4)@3 1 2 vector[3] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) mutated: object(_), object(2,4) gas summary: computation_cost: 500000, storage_cost: 2272400, storage_rebate: 1271556, non_refundable_storage_fee: 12844 -task 10 'programmable'. lines 93-97: +task 10, lines 93-97: +//# programmable --sender A --inputs object(2,4)@4 1 2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,4) gas summary: computation_cost: 500000, storage_cost: 2272400, storage_rebate: 1271556, non_refundable_storage_fee: 12844 -task 11 'programmable'. lines 99-100: +task 11, lines 99-100: +//# programmable --sender A --inputs object(2,4)@3 0 0 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 -task 12 'programmable'. lines 102-103: +task 12, lines 102-103: +//# programmable --sender A --inputs object(2,4)@4 1 2 vector[3] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 105-106: +task 13, lines 105-106: +//# programmable --sender A --inputs object(2,4)@2 1 2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids.exp index 24876f2538240..5a58986b3c942 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-117: +task 1, lines 8-117: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12205600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 119-121: +task 2, lines 119-121: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 15640800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 123-123: +task 3, line 123: +//# view-object 2,8 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -67,11 +72,14 @@ Contents: test::m::S { ], } -task 4 'programmable'. lines 125-126: +task 4, lines 125-126: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) gas summary: computation_cost: 1000000, storage_cost: 15640800, storage_rebate: 15484392, non_refundable_storage_fee: 156408 -task 5 'view-object'. lines 128-128: +task 5, line 128: +//# view-object 2,8 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -125,12 +133,15 @@ Contents: test::m::S { ], } -task 6 'programmable'. lines 130-131: +task 6, lines 130-131: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,8) deleted: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7) gas summary: computation_cost: 1000000, storage_cost: 3906400, storage_rebate: 15484392, non_refundable_storage_fee: 156408 -task 7 'view-object'. lines 133-136: +task 7, lines 133-136: +//# view-object 2,8 Owner: Account Address ( A ) Version: 4 Contents: test::m::S { @@ -184,26 +195,39 @@ Contents: test::m::S { ], } -task 8 'programmable'. lines 138-139: +task 8, lines 138-139: +//# programmable --sender A --inputs object(2,8)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 9 'programmable'. lines 141-142: +task 9, lines 141-142: +//# programmable --sender A --inputs object(2,8)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 10 'programmable'. lines 144-148: +task 10, lines 144-148: +//# programmable --sender A --inputs object(2,8)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 11 'programmable'. lines 150-151: +task 11, lines 150-151: +//# programmable --sender A --inputs object(2,8)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 12, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 12, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 153-154: +task 12, lines 153-154: +//# programmable --sender A --inputs object(2,8)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 156-157: +task 13, lines 156-157: +//# programmable --sender A --inputs object(2,8)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 20, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 20, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof.exp index 2e42891f8fc01..46fd75dddc187 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-130: +task 1, lines 8-130: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 13353200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 132-134: +task 2, lines 132-134: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 33941600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 136-136: +task 3, line 136: +//# view-object 2,8 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -67,11 +72,14 @@ Contents: test::m::S { ], } -task 4 'programmable'. lines 138-139: +task 4, lines 138-139: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,8), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) gas summary: computation_cost: 1000000, storage_cost: 14303200, storage_rebate: 14160168, non_refundable_storage_fee: 143032 -task 5 'view-object'. lines 141-141: +task 5, line 141: +//# view-object 2,8 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -125,12 +133,15 @@ Contents: test::m::S { ], } -task 6 'programmable'. lines 143-144: +task 6, lines 143-144: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,8) deleted: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) gas summary: computation_cost: 1000000, storage_cost: 3906400, storage_rebate: 33602184, non_refundable_storage_fee: 339416 -task 7 'view-object'. lines 146-149: +task 7, lines 146-149: +//# view-object 2,8 Owner: Account Address ( A ) Version: 4 Contents: test::m::S { @@ -184,26 +195,39 @@ Contents: test::m::S { ], } -task 8 'programmable'. lines 151-152: +task 8, lines 151-152: +//# programmable --sender A --inputs object(2,8)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 9 'programmable'. lines 154-155: +task 9, lines 154-155: +//# programmable --sender A --inputs object(2,8)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 10 'programmable'. lines 157-161: +task 10, lines 157-161: +//# programmable --sender A --inputs object(2,8)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 11 'programmable'. lines 163-164: +task 11, lines 163-164: +//# programmable --sender A --inputs object(2,8)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 18, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 18, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 166-167: +task 12, lines 166-167: +//# programmable --sender A --inputs object(2,8)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 169-170: +task 13, lines 169-170: +//# programmable --sender A --inputs object(2,8)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 26, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 26, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof_enum.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof_enum.exp index ead923a6b0924..a4c0f668deea4 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof_enum.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_dof_enum.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-167: +task 1, lines 8-167: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 18164000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 169-171: +task 2, lines 169-171: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 34002400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 173-173: +task 3, line 173: +//# view-object 2,8 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -83,11 +88,14 @@ Contents: test::m::S { ], } -task 4 'programmable'. lines 175-176: +task 4, lines 175-176: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,8), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) gas summary: computation_cost: 1000000, storage_cost: 14364000, storage_rebate: 14220360, non_refundable_storage_fee: 143640 -task 5 'view-object'. lines 178-178: +task 5, line 178: +//# view-object 2,8 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -157,12 +165,15 @@ Contents: test::m::S { ], } -task 6 'programmable'. lines 180-181: +task 6, lines 180-181: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,8) deleted: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) gas summary: computation_cost: 1000000, storage_cost: 3967200, storage_rebate: 33662376, non_refundable_storage_fee: 340024 -task 7 'view-object'. lines 183-185: +task 7, lines 183-185: +//# view-object 2,8 Owner: Account Address ( A ) Version: 4 Contents: test::m::S { @@ -232,26 +243,42 @@ Contents: test::m::S { ], } -task 8 'programmable'. lines 187-188: +task 8, lines 187-188: +//# programmable --sender A --inputs object(2,8)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3967200, storage_rebate: 2949408, non_refundable_storage_fee: 29792 -task 9 'programmable'. lines 190-191: +task 9, lines 190-191: +//# programmable --sender A --inputs object(2,8)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3967200, storage_rebate: 2949408, non_refundable_storage_fee: 29792 -task 10 'programmable'. lines 193-198: +task 10, lines 193-198: +//# programmable --sender A --inputs object(2,8)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values +// Should fail since the field exists but with a different field. mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3967200, storage_rebate: 2949408, non_refundable_storage_fee: 29792 -task 11 'programmable'. lines 199-202: +task 11, lines 199-202: +//# programmable --sender A --inputs object(2,8)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// Should fail since the field has been deleted. Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 18, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 18, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 203-206: +task 12, lines 203-206: +//# programmable --sender A --inputs object(2,8)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// Should fail since at the version of the object we're passing in the field exists still Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 207-208: +task 13, lines 207-208: +//# programmable --sender A --inputs object(2,8)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 26, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 26, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_enums.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_enums.exp index 5645aa0934c71..0c87c8ffa51ef 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_enums.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_enums.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-134: +task 1, lines 8-134: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 14136000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 136-138: +task 2, lines 136-138: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 15671200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 140-140: +task 3, line 140: +//# view-object 2,8 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -75,11 +80,14 @@ Contents: test::m::S { ], } -task 4 'programmable'. lines 142-143: +task 4, lines 142-143: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) gas summary: computation_cost: 1000000, storage_cost: 15671200, storage_rebate: 15514488, non_refundable_storage_fee: 156712 -task 5 'view-object'. lines 145-145: +task 5, line 145: +//# view-object 2,8 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -141,12 +149,15 @@ Contents: test::m::S { ], } -task 6 'programmable'. lines 147-148: +task 6, lines 147-148: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,8) deleted: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7) gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 15514488, non_refundable_storage_fee: 156712 -task 7 'view-object'. lines 150-152: +task 7, lines 150-152: +//# view-object 2,8 Owner: Account Address ( A ) Version: 4 Contents: test::m::S { @@ -208,26 +219,42 @@ Contents: test::m::S { ], } -task 8 'programmable'. lines 154-155: +task 8, lines 154-155: +//# programmable --sender A --inputs object(2,8)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3936800, storage_rebate: 2919312, non_refundable_storage_fee: 29488 -task 9 'programmable'. lines 157-158: +task 9, lines 157-158: +//# programmable --sender A --inputs object(2,8)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3936800, storage_rebate: 2919312, non_refundable_storage_fee: 29488 -task 10 'programmable'. lines 160-165: +task 10, lines 160-165: +//# programmable --sender A --inputs object(2,8)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values +// Should fail since the field exists but with a different field. mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3936800, storage_rebate: 2919312, non_refundable_storage_fee: 29488 -task 11 'programmable'. lines 166-169: +task 11, lines 166-169: +//# programmable --sender A --inputs object(2,8)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// Should fail since the field has been deleted. Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 12, instruction: 12, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 12, instruction: 12, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 170-173: +task 12, lines 170-173: +//# programmable --sender A --inputs object(2,8)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// Should fail since at the version of the object we're passing in the field exists still Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 174-175: +task 13, lines 174-175: +//# programmable --sender A --inputs object(2,8)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 12, instruction: 20, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 12, instruction: 20, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child.exp index 16e1cdb409727..ec7e7983926b5 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-140: +task 1, lines 8-140: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 13862400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 142-144: +task 2, lines 142-144: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 17609200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 146-146: +task 3, line 146: +//# view-object 2,9 Owner: Account Address ( A ) Version: 2 Contents: test::m::Parent { @@ -24,11 +29,14 @@ Contents: test::m::Parent { }, } -task 4 'programmable'. lines 148-149: +task 4, lines 148-149: +//# programmable --sender A --inputs object(2,9) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9) gas summary: computation_cost: 1000000, storage_cost: 13968800, storage_rebate: 13829112, non_refundable_storage_fee: 139688 -task 5 'view-object'. lines 151-151: +task 5, line 151: +//# view-object 2,9 Owner: Account Address ( A ) Version: 3 Contents: test::m::Parent { @@ -39,12 +47,15 @@ Contents: test::m::Parent { }, } -task 6 'programmable'. lines 153-154: +task 6, lines 153-154: +//# programmable --sender A --inputs object(2,9) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,9) deleted: object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 13829112, non_refundable_storage_fee: 139688 -task 7 'view-object'. lines 156-159: +task 7, lines 156-159: +//# view-object 2,9 Owner: Account Address ( A ) Version: 4 Contents: test::m::Parent { @@ -55,26 +66,39 @@ Contents: test::m::Parent { }, } -task 8 'programmable'. lines 161-162: +task 8, lines 161-162: +//# programmable --sender A --inputs object(2,9)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 9 'programmable'. lines 164-165: +task 9, lines 164-165: +//# programmable --sender A --inputs object(2,9)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 10 'programmable'. lines 167-171: +task 10, lines 167-171: +//# programmable --sender A --inputs object(2,9)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 11 'programmable'. lines 173-174: +task 11, lines 173-174: +//# programmable --sender A --inputs object(2,9)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 12, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 12, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 176-177: +task 12, lines 176-177: +//# programmable --sender A --inputs object(2,9)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 179-180: +task 13, lines 179-180: +//# programmable --sender A --inputs object(2,9)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 20, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 20, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child_enum.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child_enum.exp index 850962b579521..c2540c893494b 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child_enum.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/find_all_uids_on_child_enum.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-219: +task 1, lines 8-219: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 20869600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 221-223: +task 2, lines 221-223: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 17654800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 225-225: +task 3, line 225: +//# view-object 2,9 Owner: Account Address ( A ) Version: 2 Contents: test::m::Parent { @@ -24,11 +29,14 @@ Contents: test::m::Parent { }, } -task 4 'programmable'. lines 227-228: +task 4, lines 227-228: +//# programmable --sender A --inputs object(2,9) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9) gas summary: computation_cost: 1000000, storage_cost: 13968800, storage_rebate: 13829112, non_refundable_storage_fee: 139688 -task 5 'view-object'. lines 230-230: +task 5, line 230: +//# view-object 2,9 Owner: Account Address ( A ) Version: 3 Contents: test::m::Parent { @@ -39,12 +47,15 @@ Contents: test::m::Parent { }, } -task 6 'programmable'. lines 232-233: +task 6, lines 232-233: +//# programmable --sender A --inputs object(2,9) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,9) deleted: object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 13829112, non_refundable_storage_fee: 139688 -task 7 'view-object'. lines 235-238: +task 7, lines 235-238: +//# view-object 2,9 Owner: Account Address ( A ) Version: 4 Contents: test::m::Parent { @@ -55,26 +66,42 @@ Contents: test::m::Parent { }, } -task 8 'programmable'. lines 240-241: +task 8, lines 240-241: +//# programmable --sender A --inputs object(2,9)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 9 'programmable'. lines 243-244: +task 9, lines 243-244: +//# programmable --sender A --inputs object(2,9)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 10 'programmable'. lines 246-251: +task 10, lines 246-251: +//# programmable --sender A --inputs object(2,9)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values +// Should fail since the field exists but with a different field. mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 11 'programmable'. lines 252-255: +task 11, lines 252-255: +//# programmable --sender A --inputs object(2,9)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// Should fail since the field has been deleted. Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 15, instruction: 12, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 15, instruction: 12, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 256-259: +task 12, lines 256-259: +//# programmable --sender A --inputs object(2,9)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// Should fail since at the version of the object we're passing in the field exists still Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 260-261: +task 13, lines 260-261: +//# programmable --sender A --inputs object(2,9)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 15, instruction: 20, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 15, instruction: 20, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child.exp index 8747c1cea802b..88c475f6b7274 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child.exp @@ -3,17 +3,23 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 8-51: +task 1, lines 8-51: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7493600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 53-57: +task 2, lines 53-57: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) +// All 3 objects have version 2 created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6285200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 59-59: +task 3, line 59: +//# view-object 2,0 Owner: Object ID: ( _ ) Version: 2 Contents: sui::dynamic_field::Field { @@ -33,7 +39,8 @@ Contents: sui::dynamic_field::Field { }, } -task 4 'view-object'. lines 61-61: +task 4, line 61: +//# view-object 2,1 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -53,7 +60,8 @@ Contents: sui::dynamic_field::Field { }, } -task 5 'view-object'. lines 63-63: +task 5, line 63: +//# view-object 2,2 Owner: Account Address ( A ) Version: 2 Contents: test::m::Obj { @@ -65,11 +73,15 @@ Contents: test::m::Obj { value: 0u64, } -task 6 'programmable'. lines 65-68: +task 6, lines 65-68: +//# programmable --sender A --inputs object(2,2) 112 +//> test::m::set(Input(0), Input(1)) +// The middle object has version 2, while the root and modified leaf have version 3 mutated: object(0,0), object(2,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 4278800, storage_rebate: 4236012, non_refundable_storage_fee: 42788 -task 7 'view-object'. lines 70-70: +task 7, line 70: +//# view-object 2,0 Owner: Object ID: ( _ ) Version: 3 Contents: sui::dynamic_field::Field { @@ -89,7 +101,8 @@ Contents: sui::dynamic_field::Field { }, } -task 8 'view-object'. lines 72-72: +task 8, line 72: +//# view-object 2,1 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -109,7 +122,8 @@ Contents: sui::dynamic_field::Field { }, } -task 9 'view-object'. lines 74-77: +task 9, lines 74-77: +//# view-object 2,2 Owner: Account Address ( A ) Version: 3 Contents: test::m::Obj { @@ -121,6 +135,8 @@ Contents: test::m::Obj { value: 0u64, } -task 10 'programmable'. lines 79-80: +task 10, lines 79-80: +//# programmable --sender A --inputs object(2,2) 112 +//> test::m::check(Input(0), Input(1)) mutated: object(0,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child_enum.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child_enum.exp index e03cc5409f710..c7e24854e1802 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child_enum.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/middle_version_less_than_child_enum.exp @@ -3,17 +3,23 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 8-76: +task 1, lines 8-76: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9317600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 78-82: +task 2, lines 78-82: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) +// All 3 objects have version 2 created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6315600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 84-84: +task 3, line 84: +//# view-object 2,0 Owner: Object ID: ( _ ) Version: 2 Contents: sui::dynamic_field::Field { @@ -33,7 +39,8 @@ Contents: sui::dynamic_field::Field { }, } -task 4 'view-object'. lines 86-86: +task 4, line 86: +//# view-object 2,1 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -53,7 +60,8 @@ Contents: sui::dynamic_field::Field { }, } -task 5 'view-object'. lines 88-88: +task 5, line 88: +//# view-object 2,2 Owner: Account Address ( A ) Version: 2 Contents: test::m::Obj { @@ -65,11 +73,15 @@ Contents: test::m::Obj { value: 0u64, } -task 6 'programmable'. lines 90-93: +task 6, lines 90-93: +//# programmable --sender A --inputs object(2,2) 112 +//> test::m::set(Input(0), Input(1)) +// The middle object has version 2, while the root and modified leaf have version 3 mutated: object(0,0), object(2,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 4294000, storage_rebate: 4251060, non_refundable_storage_fee: 42940 -task 7 'view-object'. lines 95-95: +task 7, line 95: +//# view-object 2,0 Owner: Object ID: ( _ ) Version: 3 Contents: sui::dynamic_field::Field { @@ -89,7 +101,8 @@ Contents: sui::dynamic_field::Field { }, } -task 8 'view-object'. lines 97-97: +task 8, line 97: +//# view-object 2,1 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -109,7 +122,8 @@ Contents: sui::dynamic_field::Field { }, } -task 9 'view-object'. lines 99-102: +task 9, lines 99-102: +//# view-object 2,2 Owner: Account Address ( A ) Version: 3 Contents: test::m::Obj { @@ -121,6 +135,8 @@ Contents: test::m::Obj { value: 0u64, } -task 10 'programmable'. lines 104-105: +task 10, lines 104-105: +//# programmable --sender A --inputs object(2,2) 112 +//> test::m::check(Input(0), Input(1)) mutated: object(0,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version.exp index 8d99f28799cc4..5705077894f72 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version.exp @@ -3,25 +3,34 @@ processed 14 tasks init: P1: object(0,0), P2: object(0,1) -task 1 'publish'. lines 8-53: +task 1, lines 8-53: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 7432800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 55-57: +task 2, lines 55-57: +//# programmable --sender P1 --inputs @P1 +//> 0: test::m::a(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 59-60: +task 3, lines 59-60: +//# programmable --sender P1 --inputs object(2,0) +//> test::m::nop(); mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'programmable'. lines 62-63: +task 4, lines 62-63: +//# programmable --sender P1 --inputs object(2,0) +//> test::m::nop(); mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 5 'view-object'. lines 65-68: +task 5, lines 65-68: +//# view-object 2,0 Owner: Account Address ( P1 ) Version: 4 Contents: test::m::A { @@ -32,12 +41,16 @@ Contents: test::m::A { }, } -task 6 'programmable'. lines 70-72: +task 6, lines 70-72: +//# programmable --sender P2 --inputs @P2 +//> 0: test::m::b(); +//> TransferObjects([Result(0)], Input(0)) created: object(6,0), object(6,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 7 'view-object'. lines 74-74: +task 7, line 74: +//# view-object 6,0 Owner: Object ID: ( fake(6,1) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -50,11 +63,14 @@ Contents: sui::dynamic_field::Field { value: 0u64, } -task 8 'programmable'. lines 76-77: +task 8, lines 76-77: +//# programmable --sender P2 --inputs object(6,1) +//> 0: test::m::bump(Input(0)); mutated: object(0,1), object(6,0), object(6,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 3626568, non_refundable_storage_fee: 36632 -task 9 'view-object'. lines 79-83: +task 9, lines 79-83: +//# view-object 6,0 Owner: Object ID: ( fake(6,1) ) Version: 3 Contents: sui::dynamic_field::Field { @@ -67,22 +83,38 @@ Contents: sui::dynamic_field::Field { value: 1u64, } -task 10 'programmable'. lines 85-90: +task 10, lines 85-90: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@2 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// checking that with version 3 we get the other value, then flip them to ensure +// they abort created: object(10,0) mutated: object(_), object(2,0) wrapped: object(6,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 11 'programmable'. lines 92-96: +task 11, lines 92-96: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@3 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @2 with value 1 aborts created: object(10,0) mutated: object(_), object(2,0) wrapped: object(6,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 12 'programmable'. lines 98-102: +task 12, lines 98-102: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@2 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @3 with value 0 aborts Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 -task 13 'programmable'. lines 104-106: +task 13, lines 104-106: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@3 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version_flipped_case.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version_flipped_case.exp index 26346d5843b91..c7b3b31c3d479 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version_flipped_case.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/not_root_version_flipped_case.exp @@ -3,17 +3,22 @@ processed 12 tasks init: P1: object(0,0), P2: object(0,1) -task 1 'publish'. lines 8-53: +task 1, lines 8-53: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 7432800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 55-57: +task 2, lines 55-57: +//# programmable --sender P1 --inputs @P1 +//> 0: test::m::a(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 60-63: +task 3, lines 60-63: +//# view-object 2,0 Owner: Account Address ( P1 ) Version: 2 Contents: test::m::A { @@ -24,12 +29,16 @@ Contents: test::m::A { }, } -task 4 'programmable'. lines 65-67: +task 4, lines 65-67: +//# programmable --sender P2 --inputs @P2 +//> 0: test::m::b(); +//> TransferObjects([Result(0)], Input(0)) created: object(4,0), object(4,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 5 'view-object'. lines 69-69: +task 5, line 69: +//# view-object 4,0 Owner: Object ID: ( fake(4,1) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -42,11 +51,14 @@ Contents: sui::dynamic_field::Field { value: 0u64, } -task 6 'programmable'. lines 71-72: +task 6, lines 71-72: +//# programmable --sender P2 --inputs object(4,1) +//> 0: test::m::bump(Input(0)); mutated: object(0,1), object(4,0), object(4,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 3626568, non_refundable_storage_fee: 36632 -task 7 'view-object'. lines 74-77: +task 7, lines 74-77: +//# view-object 4,0 Owner: Object ID: ( fake(4,1) ) Version: 3 Contents: sui::dynamic_field::Field { @@ -59,22 +71,38 @@ Contents: sui::dynamic_field::Field { value: 1u64, } -task 8 'programmable'. lines 79-84: +task 8, lines 79-84: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@3 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// checking that with version 3 we get the other value, then flip them to ensure +// they abort created: object(8,0) mutated: object(_), object(2,0) wrapped: object(4,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 9 'programmable'. lines 86-90: +task 9, lines 86-90: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@2 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @2 with value 1 aborts created: object(8,0) mutated: object(_), object(2,0) wrapped: object(4,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 10 'programmable'. lines 92-96: +task 10, lines 92-96: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@2 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @3 with value 0 aborts Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 -task 11 'programmable'. lines 98-100: +task 11, lines 98-100: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@3 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_df.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_df.exp index f1a27ff7a0892..0e3da1bcdc20d 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_df.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_df.exp @@ -3,17 +3,20 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 6-76: +task 1, lines 6-76: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12524800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 78-78: +task 2, line 78: +//# run tto::M1::start --sender A created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 15298800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 80-80: +task 3, line 80: +//# view-object 2,0 Owner: Object ID: ( _ ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -30,7 +33,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 4 'view-object'. lines 82-82: +task 4, line 82: +//# view-object 2,1 Owner: Object ID: ( fake(2,6) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -58,7 +62,8 @@ Contents: sui::dynamic_field::Field { }, } -task 5 'view-object'. lines 84-84: +task 5, line 84: +//# view-object 2,2 Owner: Object ID: ( _ ) Version: 2 Contents: sui::dynamic_field::Field { @@ -92,7 +97,8 @@ Contents: sui::dynamic_field::Field { }, } -task 6 'view-object'. lines 86-86: +task 6, line 86: +//# view-object 2,3 Owner: Object ID: ( _ ) Version: 2 Contents: sui::dynamic_field::Field { @@ -124,7 +130,8 @@ Contents: sui::dynamic_field::Field { }, } -task 7 'view-object'. lines 88-88: +task 7, line 88: +//# view-object 2,4 Owner: Account Address ( A ) Version: 2 Contents: tto::M1::A { @@ -145,7 +152,8 @@ Contents: tto::M1::A { ], } -task 8 'view-object'. lines 90-90: +task 8, line 90: +//# view-object 2,5 Owner: Object ID: ( fake(2,0) ) Version: 2 Contents: tto::M1::A { @@ -175,7 +183,8 @@ Contents: tto::M1::A { ], } -task 9 'view-object'. lines 92-92: +task 9, line 92: +//# view-object 2,6 Owner: Account Address ( fake(2,4) ) Version: 2 Contents: tto::M1::A { @@ -196,7 +205,8 @@ Contents: tto::M1::A { ], } -task 10 'view-object'. lines 94-97: +task 10, lines 94-97: +//# view-object 2,7 Owner: Account Address ( fake(2,4) ) Version: 2 Contents: tto::M1::Wrapper { @@ -223,17 +233,20 @@ Contents: tto::M1::Wrapper { }, } -task 11 'run'. lines 98-98: +task 11, line 98: +//# run tto::M1::receive_b_parent --args object(2,4) receiving(2,7) --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } -task 12 'run'. lines 100-100: +task 12, line 100: +//# run tto::M1::receive_b_parent --args object(2,4) receiving(2,6) --sender A created: object(12,0) mutated: object(0,0), object(2,4) wrapped: object(2,6) gas summary: computation_cost: 1000000, storage_cost: 4278800, storage_rebate: 3521232, non_refundable_storage_fee: 35568 -task 13 'run'. lines 102-102: +task 13, line 102: +//# run tto::M1::receive_wrapped --args object(2,4) receiving(2,7) --sender A created: object(13,0) mutated: object(0,0), object(2,4) wrapped: object(2,7) diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_dof.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_dof.exp index 006b91f1ae1eb..cdae791138546 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_dof.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_access_through_parent_dof.exp @@ -3,17 +3,20 @@ processed 16 tasks init: A: object(0,0) -task 1 'publish'. lines 6-76: +task 1, lines 6-76: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12509600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 78-78: +task 2, line 78: +//# run tto::M1::start --sender A created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 18749200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 80-80: +task 3, line 80: +//# view-object 2,0 Owner: Object ID: ( fake(2,7) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -30,7 +33,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 4 'view-object'. lines 82-82: +task 4, line 82: +//# view-object 2,1 Owner: Object ID: ( _ ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -47,7 +51,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 5 'view-object'. lines 84-84: +task 5, line 84: +//# view-object 2,2 Owner: Object ID: ( fake(2,6) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -64,7 +69,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 6 'view-object'. lines 86-86: +task 6, line 86: +//# view-object 2,3 Owner: Object ID: ( fake(2,7) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -101,7 +107,8 @@ Contents: sui::dynamic_field::Field { }, } -task 7 'view-object'. lines 88-88: +task 7, line 88: +//# view-object 2,4 Owner: Object ID: ( fake(2,0) ) Version: 2 Contents: tto::M1::A { @@ -127,7 +134,8 @@ Contents: tto::M1::A { ], } -task 8 'view-object'. lines 90-90: +task 8, line 90: +//# view-object 2,5 Owner: Object ID: ( fake(2,1) ) Version: 2 Contents: tto::M1::A { @@ -150,7 +158,8 @@ Contents: tto::M1::A { ], } -task 9 'view-object'. lines 92-92: +task 9, line 92: +//# view-object 2,6 Owner: Account Address ( fake(2,8) ) Version: 2 Contents: tto::M1::A { @@ -171,7 +180,8 @@ Contents: tto::M1::A { ], } -task 10 'view-object'. lines 94-94: +task 10, line 94: +//# view-object 2,7 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: tto::M1::A { @@ -191,7 +201,8 @@ Contents: tto::M1::A { ], } -task 11 'view-object'. lines 96-96: +task 11, line 96: +//# view-object 2,8 Owner: Account Address ( A ) Version: 2 Contents: tto::M1::A { @@ -212,7 +223,8 @@ Contents: tto::M1::A { ], } -task 12 'view-object'. lines 98-101: +task 12, lines 98-101: +//# view-object 2,9 Owner: Account Address ( fake(2,8) ) Version: 2 Contents: tto::M1::Wrapper { @@ -239,16 +251,19 @@ Contents: tto::M1::Wrapper { }, } -task 13 'run'. lines 102-102: +task 13, line 102: +//# run tto::M1::receive_b_parent --args object(2,8) receiving(2,9) --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } -task 14 'run'. lines 104-104: +task 14, line 104: +//# run tto::M1::receive_b_parent --args object(2,8) receiving(2,6) --sender A created: object(14,0) mutated: object(0,0), object(2,6), object(2,8) gas summary: computation_cost: 1000000, storage_cost: 6011600, storage_rebate: 3521232, non_refundable_storage_fee: 35568 -task 15 'run'. lines 106-106: +task 15, line 106: +//# run tto::M1::receive_wrapped --args object(2,8) receiving(2,9) --sender A created: object(15,0) mutated: object(0,0), object(2,8), object(2,9) gas summary: computation_cost: 1000000, storage_cost: 6589200, storage_rebate: 4093056, non_refundable_storage_fee: 41344 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_dof.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_dof.exp index 29baf4bcc3670..a365fe3698304 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_dof.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/receive_object_dof.exp @@ -3,17 +3,20 @@ processed 24 tasks init: A: object(0,0) -task 1 'publish'. lines 6-58: +task 1, lines 6-58: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 10533600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 60-60: +task 2, line 60: +//# run tto::M1::start --sender A created: object(2,0), object(2,1), object(2,2), object(2,3) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7273200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 62-62: +task 3, line 62: +//# view-object 2,0 Owner: Object ID: ( fake(2,1) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -30,7 +33,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 4 'view-object'. lines 64-64: +task 4, line 64: +//# view-object 2,3 Owner: Object ID: ( fake(2,0) ) Version: 2 Contents: tto::M1::A { @@ -42,7 +46,8 @@ Contents: tto::M1::A { value: 0u64, } -task 5 'view-object'. lines 66-66: +task 5, line 66: +//# view-object 2,1 Owner: Account Address ( fake(2,2) ) Version: 2 Contents: tto::M1::A { @@ -54,7 +59,8 @@ Contents: tto::M1::A { value: 0u64, } -task 6 'view-object'. lines 68-68: +task 6, line 68: +//# view-object 2,2 Owner: Account Address ( A ) Version: 2 Contents: tto::M1::A { @@ -66,12 +72,14 @@ Contents: tto::M1::A { value: 0u64, } -task 7 'run'. lines 70-70: +task 7, line 70: +//# run tto::M1::receive --args object(2,2) receiving(2,1) --sender A created: object(7,0) mutated: object(0,0), object(2,1), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 5996400, storage_rebate: 3506184, non_refundable_storage_fee: 35416 -task 8 'view-object'. lines 72-74: +task 8, lines 72-74: +//# view-object 2,0 Owner: Object ID: ( fake(2,1) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -88,7 +96,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 9 'view-object'. lines 75-75: +task 9, line 75: +//# view-object 2,3 Owner: Object ID: ( fake(2,0) ) Version: 2 Contents: tto::M1::A { @@ -100,7 +109,8 @@ Contents: tto::M1::A { value: 0u64, } -task 10 'view-object'. lines 77-77: +task 10, line 77: +//# view-object 2,1 Owner: Object ID: ( fake(7,0) ) Version: 3 Contents: tto::M1::A { @@ -112,7 +122,8 @@ Contents: tto::M1::A { value: 0u64, } -task 11 'view-object'. lines 79-79: +task 11, line 79: +//# view-object 2,2 Owner: Account Address ( A ) Version: 3 Contents: tto::M1::A { @@ -124,11 +135,14 @@ Contents: tto::M1::A { value: 0u64, } -task 12 'programmable'. lines 81-82: +task 12, lines 81-82: +//# programmable --sender A --inputs object(2,2) 1 2 3 +//> tto::M1::set(Input(0), Input(1), Input(2), Input(3)) mutated: object(0,0), object(2,1), object(2,2), object(2,3) gas summary: computation_cost: 1000000, storage_cost: 4818400, storage_rebate: 4770216, non_refundable_storage_fee: 48184 -task 13 'view-object'. lines 84-86: +task 13, lines 84-86: +//# view-object 2,0 Owner: Object ID: ( fake(2,1) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -145,7 +159,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 14 'view-object'. lines 87-87: +task 14, line 87: +//# view-object 2,3 Owner: Object ID: ( fake(2,0) ) Version: 4 Contents: tto::M1::A { @@ -157,7 +172,8 @@ Contents: tto::M1::A { value: 3u64, } -task 15 'view-object'. lines 89-89: +task 15, line 89: +//# view-object 2,1 Owner: Object ID: ( fake(7,0) ) Version: 4 Contents: tto::M1::A { @@ -169,7 +185,8 @@ Contents: tto::M1::A { value: 2u64, } -task 16 'view-object'. lines 91-91: +task 16, line 91: +//# view-object 2,2 Owner: Account Address ( A ) Version: 4 Contents: tto::M1::A { @@ -181,31 +198,47 @@ Contents: tto::M1::A { value: 1u64, } -task 17 'programmable'. lines 93-96: +task 17, lines 93-96: +//# programmable --sender A --inputs object(2,2) +//> tto::M1::remove(Input(0)) +// dev-inspect with 'check' and correct values mutated: object(0,0), object(2,2) deleted: object(2,0), object(2,3) gas summary: computation_cost: 1000000, storage_cost: 2264800, storage_rebate: 5936436, non_refundable_storage_fee: 59964 -task 18 'programmable'. lines 98-99: +task 18, lines 98-99: +//# programmable --sender A --inputs object(2,2)@3 0 0 vector[0] --dev-inspect +//> tto::M1::check(Input(0), Input(1), Input(2), Input(3)) mutated: object(_), object(2,2) gas summary: computation_cost: 500000, storage_cost: 2264800, storage_rebate: 1264032, non_refundable_storage_fee: 12768 -task 19 'programmable'. lines 101-102: +task 19, lines 101-102: +//# programmable --sender A --inputs object(2,2)@4 1 2 vector[3] --dev-inspect +//> tto::M1::check(Input(0), Input(1), Input(2), Input(3)) mutated: object(_), object(2,2) gas summary: computation_cost: 500000, storage_cost: 2264800, storage_rebate: 1264032, non_refundable_storage_fee: 12768 -task 20 'programmable'. lines 104-107: +task 20, lines 104-107: +//# programmable --sender A --inputs object(2,2)@5 1 2 vector[] --dev-inspect +//> tto::M1::check(Input(0), Input(1), Input(2), Input(3)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,2) gas summary: computation_cost: 500000, storage_cost: 2264800, storage_rebate: 1264032, non_refundable_storage_fee: 12768 -task 21 'programmable'. lines 109-110: +task 21, lines 109-110: +//# programmable --sender A --inputs object(2,2)@4 0 0 vector[0] --dev-inspect +//> tto::M1::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: tto, name: Identifier("M1") }, function: 4, instruction: 10, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: tto, name: Identifier("M1") }, function: 4, instruction: 10, function_name: Some("check") }, 0) in command 0 -task 22 'programmable'. lines 112-113: +task 22, lines 112-113: +//# programmable --sender A --inputs object(2,2)@5 1 2 vector[3] --dev-inspect +//> tto::M1::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 23 'programmable'. lines 115-116: +task 23, lines 115-116: +//# programmable --sender A --inputs object(2,2)@3 1 2 vector[] --dev-inspect +//> tto::M1::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: tto, name: Identifier("M1") }, function: 4, instruction: 10, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: tto, name: Identifier("M1") }, function: 4, instruction: 10, function_name: Some("check") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/child_of_child.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/child_of_child.exp index e55cd9da8c09f..e3dbfb1edbf08 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/child_of_child.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/child_of_child.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-66: +task 1, lines 8-66: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9218800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 68-70: +task 2, lines 68-70: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 9750800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 72-72: +task 3, line 72: +//# view-object 2,4 Owner: Account Address ( A ) Version: 2 Contents: test::m::Obj { @@ -25,11 +30,14 @@ Contents: test::m::Obj { value: 0u64, } -task 4 'programmable'. lines 74-75: +task 4, lines 74-75: +//# programmable --sender A --inputs object(2,4) 1 2 3 +//> test::m::set(Input(0), Input(1), Input(2), Input(3)) mutated: object(0,0), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 4841200, storage_rebate: 4792788, non_refundable_storage_fee: 48412 -task 5 'view-object'. lines 77-77: +task 5, line 77: +//# view-object 2,4 Owner: Account Address ( A ) Version: 3 Contents: test::m::Obj { @@ -41,12 +49,15 @@ Contents: test::m::Obj { value: 1u64, } -task 6 'programmable'. lines 79-80: +task 6, lines 79-80: +//# programmable --sender A --inputs object(2,4) +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,4) deleted: object(2,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 5951484, non_refundable_storage_fee: 60116 -task 7 'view-object'. lines 82-85: +task 7, lines 82-85: +//# view-object 2,4 Owner: Account Address ( A ) Version: 4 Contents: test::m::Obj { @@ -58,26 +69,39 @@ Contents: test::m::Obj { value: 1u64, } -task 8 'programmable'. lines 87-88: +task 8, lines 87-88: +//# programmable --sender A --inputs object(2,4)@2 0 0 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) mutated: object(_), object(2,4) gas summary: computation_cost: 500000, storage_cost: 2272400, storage_rebate: 1271556, non_refundable_storage_fee: 12844 -task 9 'programmable'. lines 90-91: +task 9, lines 90-91: +//# programmable --sender A --inputs object(2,4)@3 1 2 vector[3] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) mutated: object(_), object(2,4) gas summary: computation_cost: 500000, storage_cost: 2272400, storage_rebate: 1271556, non_refundable_storage_fee: 12844 -task 10 'programmable'. lines 93-97: +task 10, lines 93-97: +//# programmable --sender A --inputs object(2,4)@4 1 2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,4) gas summary: computation_cost: 500000, storage_cost: 2272400, storage_rebate: 1271556, non_refundable_storage_fee: 12844 -task 11 'programmable'. lines 99-100: +task 11, lines 99-100: +//# programmable --sender A --inputs object(2,4)@3 0 0 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 -task 12 'programmable'. lines 102-103: +task 12, lines 102-103: +//# programmable --sender A --inputs object(2,4)@4 1 2 vector[3] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 105-106: +task 13, lines 105-106: +//# programmable --sender A --inputs object(2,4)@2 1 2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1), Input(2), Input(3)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 10, function_name: Some("check") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids.exp index 24876f2538240..5a58986b3c942 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-117: +task 1, lines 8-117: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 12205600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 119-121: +task 2, lines 119-121: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 15640800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 123-123: +task 3, line 123: +//# view-object 2,8 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -67,11 +72,14 @@ Contents: test::m::S { ], } -task 4 'programmable'. lines 125-126: +task 4, lines 125-126: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) gas summary: computation_cost: 1000000, storage_cost: 15640800, storage_rebate: 15484392, non_refundable_storage_fee: 156408 -task 5 'view-object'. lines 128-128: +task 5, line 128: +//# view-object 2,8 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -125,12 +133,15 @@ Contents: test::m::S { ], } -task 6 'programmable'. lines 130-131: +task 6, lines 130-131: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,8) deleted: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7) gas summary: computation_cost: 1000000, storage_cost: 3906400, storage_rebate: 15484392, non_refundable_storage_fee: 156408 -task 7 'view-object'. lines 133-136: +task 7, lines 133-136: +//# view-object 2,8 Owner: Account Address ( A ) Version: 4 Contents: test::m::S { @@ -184,26 +195,39 @@ Contents: test::m::S { ], } -task 8 'programmable'. lines 138-139: +task 8, lines 138-139: +//# programmable --sender A --inputs object(2,8)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 9 'programmable'. lines 141-142: +task 9, lines 141-142: +//# programmable --sender A --inputs object(2,8)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 10 'programmable'. lines 144-148: +task 10, lines 144-148: +//# programmable --sender A --inputs object(2,8)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 11 'programmable'. lines 150-151: +task 11, lines 150-151: +//# programmable --sender A --inputs object(2,8)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 12, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 12, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 153-154: +task 12, lines 153-154: +//# programmable --sender A --inputs object(2,8)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 156-157: +task 13, lines 156-157: +//# programmable --sender A --inputs object(2,8)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 20, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 10, instruction: 20, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_dof.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_dof.exp index 2e42891f8fc01..46fd75dddc187 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_dof.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_dof.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-130: +task 1, lines 8-130: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 13353200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 132-134: +task 2, lines 132-134: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 33941600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 136-136: +task 3, line 136: +//# view-object 2,8 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -67,11 +72,14 @@ Contents: test::m::S { ], } -task 4 'programmable'. lines 138-139: +task 4, lines 138-139: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,8), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) gas summary: computation_cost: 1000000, storage_cost: 14303200, storage_rebate: 14160168, non_refundable_storage_fee: 143032 -task 5 'view-object'. lines 141-141: +task 5, line 141: +//# view-object 2,8 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -125,12 +133,15 @@ Contents: test::m::S { ], } -task 6 'programmable'. lines 143-144: +task 6, lines 143-144: +//# programmable --sender A --inputs object(2,8) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,8) deleted: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16) gas summary: computation_cost: 1000000, storage_cost: 3906400, storage_rebate: 33602184, non_refundable_storage_fee: 339416 -task 7 'view-object'. lines 146-149: +task 7, lines 146-149: +//# view-object 2,8 Owner: Account Address ( A ) Version: 4 Contents: test::m::S { @@ -184,26 +195,39 @@ Contents: test::m::S { ], } -task 8 'programmable'. lines 151-152: +task 8, lines 151-152: +//# programmable --sender A --inputs object(2,8)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 9 'programmable'. lines 154-155: +task 9, lines 154-155: +//# programmable --sender A --inputs object(2,8)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 10 'programmable'. lines 157-161: +task 10, lines 157-161: +//# programmable --sender A --inputs object(2,8)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,8) gas summary: computation_cost: 500000, storage_cost: 3906400, storage_rebate: 2889216, non_refundable_storage_fee: 29184 -task 11 'programmable'. lines 163-164: +task 11, lines 163-164: +//# programmable --sender A --inputs object(2,8)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 18, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 18, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 166-167: +task 12, lines 166-167: +//# programmable --sender A --inputs object(2,8)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 169-170: +task 13, lines 169-170: +//# programmable --sender A --inputs object(2,8)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 26, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 11, instruction: 26, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_on_child.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_on_child.exp index 16e1cdb409727..ec7e7983926b5 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_on_child.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/find_all_uids_on_child.exp @@ -3,17 +3,22 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 8-140: +task 1, lines 8-140: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 13862400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 142-144: +task 2, lines 142-144: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 17609200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 146-146: +task 3, line 146: +//# view-object 2,9 Owner: Account Address ( A ) Version: 2 Contents: test::m::Parent { @@ -24,11 +29,14 @@ Contents: test::m::Parent { }, } -task 4 'programmable'. lines 148-149: +task 4, lines 148-149: +//# programmable --sender A --inputs object(2,9) 112 +//> test::m::set(Input(0), Input(1)) mutated: object(0,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9) gas summary: computation_cost: 1000000, storage_cost: 13968800, storage_rebate: 13829112, non_refundable_storage_fee: 139688 -task 5 'view-object'. lines 151-151: +task 5, line 151: +//# view-object 2,9 Owner: Account Address ( A ) Version: 3 Contents: test::m::Parent { @@ -39,12 +47,15 @@ Contents: test::m::Parent { }, } -task 6 'programmable'. lines 153-154: +task 6, lines 153-154: +//# programmable --sender A --inputs object(2,9) 112 +//> test::m::remove(Input(0)) mutated: object(0,0), object(2,9) deleted: object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 13829112, non_refundable_storage_fee: 139688 -task 7 'view-object'. lines 156-159: +task 7, lines 156-159: +//# view-object 2,9 Owner: Account Address ( A ) Version: 4 Contents: test::m::Parent { @@ -55,26 +66,39 @@ Contents: test::m::Parent { }, } -task 8 'programmable'. lines 161-162: +task 8, lines 161-162: +//# programmable --sender A --inputs object(2,9)@2 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 9 'programmable'. lines 164-165: +task 9, lines 164-165: +//# programmable --sender A --inputs object(2,9)@3 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 10 'programmable'. lines 167-171: +task 10, lines 167-171: +//# programmable --sender A --inputs object(2,9)@4 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) +// dev-inspect with 'check' and _incorrect_ values mutated: object(_), object(2,9) gas summary: computation_cost: 500000, storage_cost: 2234400, storage_rebate: 1233936, non_refundable_storage_fee: 12464 -task 11 'programmable'. lines 173-174: +task 11, lines 173-174: +//# programmable --sender A --inputs object(2,9)@3 vector[0] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 12, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 12, function_name: Some("check_") }, 0) in command 0 -task 12 'programmable'. lines 176-177: +task 12, lines 176-177: +//# programmable --sender A --inputs object(2,9)@4 vector[112] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) in command 0 -task 13 'programmable'. lines 179-180: +task 13, lines 179-180: +//# programmable --sender A --inputs object(2,9)@2 vector[] --dev-inspect +//> test::m::check(Input(0), Input(1)) Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 20, function_name: Some("check_") }, 0) in command 0 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 14, instruction: 20, function_name: Some("check_") }, 0) in command 0 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/middle_version_less_than_child.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/middle_version_less_than_child.exp index 8747c1cea802b..88c475f6b7274 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/middle_version_less_than_child.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/middle_version_less_than_child.exp @@ -3,17 +3,23 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 8-51: +task 1, lines 8-51: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7493600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 53-57: +task 2, lines 53-57: +//# programmable --sender A --inputs @A +//> 0: test::m::new(); +//> TransferObjects([Result(0)], Input(0)) +// All 3 objects have version 2 created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6285200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 59-59: +task 3, line 59: +//# view-object 2,0 Owner: Object ID: ( _ ) Version: 2 Contents: sui::dynamic_field::Field { @@ -33,7 +39,8 @@ Contents: sui::dynamic_field::Field { }, } -task 4 'view-object'. lines 61-61: +task 4, line 61: +//# view-object 2,1 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -53,7 +60,8 @@ Contents: sui::dynamic_field::Field { }, } -task 5 'view-object'. lines 63-63: +task 5, line 63: +//# view-object 2,2 Owner: Account Address ( A ) Version: 2 Contents: test::m::Obj { @@ -65,11 +73,15 @@ Contents: test::m::Obj { value: 0u64, } -task 6 'programmable'. lines 65-68: +task 6, lines 65-68: +//# programmable --sender A --inputs object(2,2) 112 +//> test::m::set(Input(0), Input(1)) +// The middle object has version 2, while the root and modified leaf have version 3 mutated: object(0,0), object(2,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 4278800, storage_rebate: 4236012, non_refundable_storage_fee: 42788 -task 7 'view-object'. lines 70-70: +task 7, line 70: +//# view-object 2,0 Owner: Object ID: ( _ ) Version: 3 Contents: sui::dynamic_field::Field { @@ -89,7 +101,8 @@ Contents: sui::dynamic_field::Field { }, } -task 8 'view-object'. lines 72-72: +task 8, line 72: +//# view-object 2,1 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -109,7 +122,8 @@ Contents: sui::dynamic_field::Field { }, } -task 9 'view-object'. lines 74-77: +task 9, lines 74-77: +//# view-object 2,2 Owner: Account Address ( A ) Version: 3 Contents: test::m::Obj { @@ -121,6 +135,8 @@ Contents: test::m::Obj { value: 0u64, } -task 10 'programmable'. lines 79-80: +task 10, lines 79-80: +//# programmable --sender A --inputs object(2,2) 112 +//> test::m::check(Input(0), Input(1)) mutated: object(0,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version.exp index 8d99f28799cc4..5705077894f72 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version.exp @@ -3,25 +3,34 @@ processed 14 tasks init: P1: object(0,0), P2: object(0,1) -task 1 'publish'. lines 8-53: +task 1, lines 8-53: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 7432800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 55-57: +task 2, lines 55-57: +//# programmable --sender P1 --inputs @P1 +//> 0: test::m::a(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 59-60: +task 3, lines 59-60: +//# programmable --sender P1 --inputs object(2,0) +//> test::m::nop(); mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'programmable'. lines 62-63: +task 4, lines 62-63: +//# programmable --sender P1 --inputs object(2,0) +//> test::m::nop(); mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 5 'view-object'. lines 65-68: +task 5, lines 65-68: +//# view-object 2,0 Owner: Account Address ( P1 ) Version: 4 Contents: test::m::A { @@ -32,12 +41,16 @@ Contents: test::m::A { }, } -task 6 'programmable'. lines 70-72: +task 6, lines 70-72: +//# programmable --sender P2 --inputs @P2 +//> 0: test::m::b(); +//> TransferObjects([Result(0)], Input(0)) created: object(6,0), object(6,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 7 'view-object'. lines 74-74: +task 7, line 74: +//# view-object 6,0 Owner: Object ID: ( fake(6,1) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -50,11 +63,14 @@ Contents: sui::dynamic_field::Field { value: 0u64, } -task 8 'programmable'. lines 76-77: +task 8, lines 76-77: +//# programmable --sender P2 --inputs object(6,1) +//> 0: test::m::bump(Input(0)); mutated: object(0,1), object(6,0), object(6,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 3626568, non_refundable_storage_fee: 36632 -task 9 'view-object'. lines 79-83: +task 9, lines 79-83: +//# view-object 6,0 Owner: Object ID: ( fake(6,1) ) Version: 3 Contents: sui::dynamic_field::Field { @@ -67,22 +83,38 @@ Contents: sui::dynamic_field::Field { value: 1u64, } -task 10 'programmable'. lines 85-90: +task 10, lines 85-90: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@2 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// checking that with version 3 we get the other value, then flip them to ensure +// they abort created: object(10,0) mutated: object(_), object(2,0) wrapped: object(6,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 11 'programmable'. lines 92-96: +task 11, lines 92-96: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@3 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @2 with value 1 aborts created: object(10,0) mutated: object(_), object(2,0) wrapped: object(6,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 12 'programmable'. lines 98-102: +task 12, lines 98-102: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@2 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @3 with value 0 aborts Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 -task 13 'programmable'. lines 104-106: +task 13, lines 104-106: +//# programmable --sender P2 --inputs object(2,0)@4 object(6,1)@3 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 diff --git a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version_flipped_case.exp b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version_flipped_case.exp index 26346d5843b91..c7b3b31c3d479 100644 --- a/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version_flipped_case.exp +++ b/crates/sui-adapter-transactional-tests/tests/mvcc/v0/not_root_version_flipped_case.exp @@ -3,17 +3,22 @@ processed 12 tasks init: P1: object(0,0), P2: object(0,1) -task 1 'publish'. lines 8-53: +task 1, lines 8-53: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 7432800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 55-57: +task 2, lines 55-57: +//# programmable --sender P1 --inputs @P1 +//> 0: test::m::a(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 60-63: +task 3, lines 60-63: +//# view-object 2,0 Owner: Account Address ( P1 ) Version: 2 Contents: test::m::A { @@ -24,12 +29,16 @@ Contents: test::m::A { }, } -task 4 'programmable'. lines 65-67: +task 4, lines 65-67: +//# programmable --sender P2 --inputs @P2 +//> 0: test::m::b(); +//> TransferObjects([Result(0)], Input(0)) created: object(4,0), object(4,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 5 'view-object'. lines 69-69: +task 5, line 69: +//# view-object 4,0 Owner: Object ID: ( fake(4,1) ) Version: 2 Contents: sui::dynamic_field::Field { @@ -42,11 +51,14 @@ Contents: sui::dynamic_field::Field { value: 0u64, } -task 6 'programmable'. lines 71-72: +task 6, lines 71-72: +//# programmable --sender P2 --inputs object(4,1) +//> 0: test::m::bump(Input(0)); mutated: object(0,1), object(4,0), object(4,1) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 3626568, non_refundable_storage_fee: 36632 -task 7 'view-object'. lines 74-77: +task 7, lines 74-77: +//# view-object 4,0 Owner: Object ID: ( fake(4,1) ) Version: 3 Contents: sui::dynamic_field::Field { @@ -59,22 +71,38 @@ Contents: sui::dynamic_field::Field { value: 1u64, } -task 8 'programmable'. lines 79-84: +task 8, lines 79-84: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@3 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// checking that with version 3 we get the other value, then flip them to ensure +// they abort created: object(8,0) mutated: object(_), object(2,0) wrapped: object(4,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 9 'programmable'. lines 86-90: +task 9, lines 86-90: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@2 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @2 with value 1 aborts created: object(8,0) mutated: object(_), object(2,0) wrapped: object(4,1) gas summary: computation_cost: 500000, storage_cost: 4126800, storage_rebate: 2392632, non_refundable_storage_fee: 24168 -task 10 'programmable'. lines 92-96: +task 10, lines 92-96: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@2 1 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); +// @3 with value 0 aborts Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 -task 11 'programmable'. lines 98-100: +task 11, lines 98-100: +//# programmable --sender P2 --inputs object(2,0)@2 object(4,1)@3 0 --dev-inspect +//> 0: test::m::append(Input(0), Input(1)); +//> 1: test::m::check(Input(0), Input(2)); Error: Transaction Effects Status: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 Execution Error: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 4, instruction: 13, function_name: Some("check") }, 0) in command 1 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_copyable_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_copyable_invalid.exp index d30efaa3979bf..f25d583164493 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_copyable_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_copyable_invalid.exp @@ -3,23 +3,32 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4461200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 17-18: +task 2, lines 17-18: +//# programmable --inputs 0 +//> test::m1::imm_and_mut(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 3 'programmable'. lines 20-21: +task 3, lines 20-21: +//# programmable --inputs 0 +//> test::m1::mut_and_imm(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 4 'programmable'. lines 23-24: +task 4, lines 23-24: +//# programmable --inputs 0 +//> test::m1::imm_mut_imm(Input(0), Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 5 'programmable'. lines 26-27: +task 5, lines 26-27: +//# programmable --inputs 0 +//> test::m1::imm_copy_mut(Input(0), Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 2. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 2, kind: InvalidValueUsage }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_non_copyable_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_non_copyable_invalid.exp index 9350fc34bc324..7be507a65d11b 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_non_copyable_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_non_copyable_invalid.exp @@ -3,39 +3,64 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 8-24: +task 1, lines 8-24: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6414400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-28: +task 2, lines 26-28: +//# programmable +//> 0: test::m1::r(); +//> test::m1::take_and_imm(Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 3 'programmable'. lines 30-32: +task 3, lines 30-32: +//# programmable +//> 0: test::m1::r(); +//> test::m1::imm_and_take(Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 4 'programmable'. lines 34-36: +task 4, lines 34-36: +//# programmable +//> 0: test::m1::r(); +//> test::m1::take_and_mut(Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 5 'programmable'. lines 38-40: +task 5, lines 38-40: +//# programmable +//> 0: test::m1::r(); +//> test::m1::mut_and_take(Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 6 'programmable'. lines 42-44: +task 6, lines 42-44: +//# programmable +//> 0: test::m1::r(); +//> test::m1::imm_and_mut(Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 7 'programmable'. lines 46-48: +task 7, lines 46-48: +//# programmable +//> 0: test::m1::r(); +//> test::m1::mut_and_imm(Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 8 'programmable'. lines 50-52: +task 8, lines 50-52: +//# programmable +//> 0: test::m1::r(); +//> test::m1::imm_mut_imm(Result(0), Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 9 'programmable'. lines 54-56: +task 9, lines 54-56: +//# programmable +//> 0: test::m1::r(); +//> test::m1::imm_take_mut(Result(0), Result(0), Result(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_primitives_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_primitives_invalid.exp index 8acb01b475af1..259010b53586c 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_primitives_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_primitives_invalid.exp @@ -3,18 +3,26 @@ processed 5 tasks init: A: object(0,0), B: object(0,1) -task 1 'programmable'. lines 8-9: +task 1, lines 8-9: +//# programmable --sender A +//> MergeCoins(Gas, [Gas]) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 2 'programmable'. lines 11-12: +task 2, lines 11-12: +//# programmable --sender B --inputs @A +//> TransferObjects([Gas], Input(0)) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 14-15: +task 3, lines 14-15: +//# programmable --sender A --inputs object(0,1) +//> MergeCoins(Input(0), [Input(0)]) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 4 'programmable'. lines 17-18: +task 4, lines 17-18: +//# programmable --sender A --inputs object(0,1) +//> MakeMoveVec([Input(0), Input(0), Input(0)]) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_valid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_valid.exp index bcd5f023bbc21..660ed534d2265 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/borrowed_arg_valid.exp @@ -3,15 +3,30 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 8-24: +task 1, lines 8-24: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5388400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-35: +task 2, lines 26-35: +//# programmable --inputs 0 +// imm borrow and copy +//> test::m1::copy_imm(Input(0), Input(0)); +//> test::m1::copy_imm(Input(0), Input(0)); +// can copy even after being mutably borrowed +//> test::m1::copy_mut(Input(0), Input(0)); +//> test::m1::mut_copy(Input(0), Input(0)); +//> test::m1::copy_mut_copy(Input(0), Input(0), Input(0)); +// mix all and borrow multiple times +//> test::m1::multiple_copy(Input(0), Input(0), Input(0), Input(0)); mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 37-40: +task 3, lines 37-40: +//# programmable +//> 0: test::m1::r(); +// double borrow without copy +//> test::m1::double_r(Result(0), Result(0)) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_emit.exp b/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_emit.exp index c58143a2d6b9e..2cffa920c120e 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_emit.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_emit.exp @@ -3,19 +3,31 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-12: +task 1, lines 8-12: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3906400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 14-16: +task 2, lines 14-16: +//# programmable +//> 0: test::m1::a(); +//> sui::event::emit(Result(0)); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } } -task 3 'programmable'. lines 18-21: +task 3, lines 18-21: +//# programmable +//> 0: test::m1::a(); +// wrong type annotation doesn't matter +//> sui::event::emit(Result(0)); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } } -task 4 'programmable'. lines 23-26: +task 4, lines 23-26: +//# programmable +//> 0: test::m1::a(); +// function doesn't exist +//> sui::event::does_not_exist(Result(0)); Error: Transaction Effects Status: Function Not Found. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: FunctionNotFound, source: Some("Could not resolve function 'does_not_exist' in module sui::event"), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_init.exp b/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_init.exp index db77f58872546..6cde27e4bb0f2 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_init.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_init.exp @@ -3,11 +3,14 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 8-11: +task 1, lines 8-11: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3898800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 13-14: +task 2, lines 13-14: +//# programmable +//> 0: test::m1::init(); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot call 'init'"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_private.exp b/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_private.exp index 098b779ff4570..9b3adc8d9427a 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_private.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_private.exp @@ -3,11 +3,14 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 8-11: +task 1, lines 8-11: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3898800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 13-14: +task 2, lines 13-14: +//# programmable +//> 0: test::m1::priv(); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Can only call `entry` or `public` functions"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/coin_negative.exp b/crates/sui-adapter-transactional-tests/tests/programmable/coin_negative.exp index 948a7eaa0130a..ff7bca3220cf5 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/coin_negative.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/coin_negative.exp @@ -3,21 +3,29 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-20: +task 1, lines 8-20: +//# publish --sender A created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10617200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 22-24: +task 2, lines 22-24: +//# programmable --sender A --inputs object(1,2) 1 @A +//> 0: sui::coin::mint(Input(0), Input(1)); +//> TransferObjects([Result(0)], Input(2)) created: object(2,0) mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 2663496, non_refundable_storage_fee: 26904 -task 3 'programmable'. lines 26-27: +task 3, lines 26-27: +//# programmable --sender A --inputs object(2,0) 2 +//> SplitCoins(Input(0), [Input(1)]); Error: Transaction Effects Status: Insufficient coin balance for operation. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InsufficientCoinBalance, source: Some("balance: 1 required: 2"), command: Some(0) } } -task 4 'programmable'. lines 29-30: +task 4, lines 29-30: +//# programmable --sender A --inputs 18446744073709551615 --gas-budget 10000000000 +//> SplitCoins(Gas, [Input(0)]) Error: Transaction Effects Status: Insufficient coin balance for operation. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InsufficientCoinBalance, source: Some("balance: 299989985010392 required: 18446744073709551615"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_custom_coin.exp b/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_custom_coin.exp index 83154d8471e4d..2c49a86361f7f 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_custom_coin.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_custom_coin.exp @@ -3,18 +3,23 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-20: +task 1, lines 8-20: +//# publish --sender A created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10617200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 22-24: +task 2, lines 22-24: +//# programmable --sender A --inputs object(1,2) 100 @A +//> 0: sui::coin::mint(Input(0), Input(1)); +//> TransferObjects([Result(0)], Input(2)) created: object(2,0) mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 2663496, non_refundable_storage_fee: 26904 -task 3 'view-object'. lines 26-26: +task 3, line 26: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: sui::coin::Coin { @@ -28,7 +33,14 @@ Contents: sui::coin::Coin { }, } -task 4 'programmable'. lines 28-34: +task 4, lines 28-34: +//# programmable --sender A --inputs object(1,2) 100 object(2,0) 1 @A +//> 0: sui::coin::mint(Input(0), Input(1)); +//> 1: sui::coin::mint(Input(0), Input(1)); +//> 2: SplitCoins(Result(0), [Input(3)]); +//> 3: SplitCoins(Input(2), [Input(3)]); +//> MergeCoins(Result(1), [Result(0), Input(2), Result(2), Result(3)]); +//> TransferObjects([Result(1)], Input(4)) created: object(4,0) mutated: object(0,0), object(1,2) deleted: object(2,0) diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_non_coins.exp b/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_non_coins.exp index d9b20f8bed7a6..6c2e4903fa84a 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_non_coins.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/coin_operations_non_coins.exp @@ -3,27 +3,43 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 8-25: +task 1, lines 8-25: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4894400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-30: +task 2, lines 26-30: +//# programmable --sender A --inputs 0 +//> 0: test::m1::mint(); +//> SplitCoins(Result(0), [Input(0)]) +// merge into non-coin Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: Some("Expected a coin but got an non coin object"), command: Some(1) } } -task 3 'programmable'. lines 31-35: +task 3, lines 31-35: +//# programmable --sender A --inputs 0 +//> 0: test::m1::mint(); +//> MergeCoins(Result(0), [Gas]) +// merge non-coin into gas Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: Some("Expected a coin but got an non coin object"), command: Some(1) } } -task 4 'programmable'. lines 36-38: +task 4, lines 36-38: +//# programmable --sender A --inputs 0 +//> 0: test::m1::mint(); +//> MergeCoins(Gas, [Result(0)]) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: Some("Coins do not have the same type"), command: Some(1) } } -task 5 'programmable'. lines 40-41: +task 5, lines 40-41: +//# programmable --sender A --inputs 10000u64 +//> MergeCoins(Gas, [Input(0)]) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(0) } } -task 6 'programmable'. lines 43-44: +task 6, lines 43-44: +//# programmable --sender A --inputs 10000u64 +//> MergeCoins(Gas, [Input(0)]) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/coin_overflow.exp b/crates/sui-adapter-transactional-tests/tests/programmable/coin_overflow.exp index 69772bcaf2e82..e6e848167094d 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/coin_overflow.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/coin_overflow.exp @@ -3,21 +3,30 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-20: +task 1, lines 8-20: +//# publish --sender A created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10617200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 22-24: +task 2, lines 22-24: +//# programmable --sender A --inputs object(1,2) 18446744073709551614 @A +//> 0: sui::coin::mint(Input(0), Input(1)); +//> TransferObjects([Result(0)], Input(2)) created: object(2,0) mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 2663496, non_refundable_storage_fee: 26904 -task 3 'programmable'. lines 26-28: +task 3, lines 26-28: +//# programmable --sender A --inputs object(1,2) 1 @A +//> 0: sui::coin::mint(Input(0), Input(1)); +//> TransferObjects([Result(0)], Input(2)) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::balance::increase_supply (function index 3) at offset 12, Abort Code: 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("balance") }, function: 3, instruction: 12, function_name: Some("increase_supply") }, 1), source: Some(VMError { major_status: ABORTED, sub_status: Some(1), message: Some("sui::balance::increase_supply at offset 12"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("balance") }), indices: [], offsets: [(FunctionDefinitionIndex(3), 12)] }), command: Some(0) } } -task 4 'programmable'. lines 30-31: +task 4, lines 30-31: +//# programmable --sender A --inputs object(2,0) +//> MergeCoins(Input(0), [Input(0)]); Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_gas_by_value.exp b/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_gas_by_value.exp index 2443e1dd02e96..5127e312f7eb0 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_gas_by_value.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_gas_by_value.exp @@ -3,19 +3,27 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-13: +task 1, lines 8-13: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3990000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 15-17: +task 2, lines 15-17: +//# programmable --sender A --inputs @A +//> TransferObjects([Gas], Input(0)); +//> test::m1::take>(Gas) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } -task 3 'programmable'. lines 19-20: +task 3, lines 19-20: +//# programmable +//> test::m1::imm>(Gas, Gas) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 4 'programmable'. lines 22-23: +task 4, lines 22-23: +//# programmable +//> test::m1::mut_>(Gas, Gas) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_object_by_value.exp b/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_object_by_value.exp index 79e049acd9edd..c48055d2da2e4 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_object_by_value.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/delayed_invalid_object_by_value.exp @@ -3,33 +3,46 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 8-28: +task 1, lines 8-28: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5760800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 30-31: +task 2, lines 30-31: +//# programmable +//> test::m1::share_r(); created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 33-34: +task 3, lines 33-34: +//# programmable --inputs object(2,0) +//> test::m1::imm(Input(0), Input(0)); Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage } at command Some(0) -task 4 'programmable'. lines 36-37: +task 4, lines 36-37: +//# programmable --inputs object(2,0) +//> test::m1::mut_(Input(0), Input(0)); Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage } at command Some(0) -task 5 'programmable'. lines 39-40: +task 5, lines 39-40: +//# programmable +//> test::m1::freeze_r(); created: object(5,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'programmable'. lines 42-43: +task 6, lines 42-43: +//# programmable --inputs object(5,0) +//> test::m1::imm(Input(0), Input(0)); Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage } at command Some(0) -task 7 'programmable'. lines 45-46: +task 7, lines 45-46: +//# programmable --inputs object(5,0) +//> test::m1::mut_(Input(0), Input(0)); Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage } at command Some(0) diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_reference.exp b/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_reference.exp index f685124dc99f9..b287b0920ccaf 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_reference.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_reference.exp @@ -3,35 +3,52 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 8-24: +task 1, lines 8-24: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4058400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 25-26: +task 2, lines 25-26: +//# programmable --sender A +//> test::m1::t1>(Gas) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 28-29: +task 3, lines 28-29: +//# programmable --sender A +//> test::m1::t2>(Gas) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'programmable'. lines 31-32: +task 4, lines 31-32: +//# programmable --sender A +//> test::m1::t2>(Gas) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'programmable'. lines 34-35: +task 5, lines 34-35: +//# programmable --sender A +//> test::m1::t4>(Gas) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'programmable'. lines 37-38: +task 6, lines 37-38: +//# programmable --sender A +//> test::m1::t5>(Gas) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'programmable'. lines 40-43: +task 7, lines 40-43: +//# programmable --sender A +//> test::m1::t6>(Gas) +// can pass to merge and split mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'programmable'. lines 44-46: +task 8, lines 44-46: +//# programmable --sender A --inputs 10 --gas-budget 10000000000 +//> 0: SplitCoins(Gas, [Input(0)]); +//> MergeCoins(Gas, [Result(0)]) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value.exp b/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value.exp index 8e0756dce54d9..56b901ebf9888 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value.exp @@ -3,11 +3,14 @@ processed 3 tasks init: A: object(0,0), B: object(0,1) -task 1 'programmable'. lines 8-9: +task 1, lines 8-9: +//# programmable --sender A --inputs @B +//> TransferObjects([Gas], Input(0)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 11-11: +task 2, line 11: +//# view-object 0,0 Owner: Account Address ( B ) Version: 2 Contents: sui::coin::Coin { diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value_invalid.exp index f6e6c531add1f..b026d764dd81f 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/gas_coin_by_value_invalid.exp @@ -3,31 +3,49 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 8-23: +task 1, lines 8-23: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3860800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 24-25: +task 2, lines 24-25: +//# programmable --sender A +//> test::m1::t1>(Gas) Error: Transaction Effects Status: Invalid command argument at 0. Invalid taking of the Gas coin. It can only be used by-value with TransferObjects Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidGasCoinUsage }, source: None, command: Some(0) } } -task 3 'programmable'. lines 27-28: +task 3, lines 27-28: +//# programmable --sender A +//> test::m1::t2>(Gas) Error: Transaction Effects Status: Invalid command argument at 0. Invalid taking of the Gas coin. It can only be used by-value with TransferObjects Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidGasCoinUsage }, source: None, command: Some(0) } } -task 4 'programmable'. lines 30-33: +task 4, lines 30-33: +//# programmable --sender A +//> test::m1::t2>(Gas) +// cannot merge gas coin Error: Transaction Effects Status: Invalid command argument at 0. Invalid taking of the Gas coin. It can only be used by-value with TransferObjects Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidGasCoinUsage }, source: None, command: Some(0) } } -task 5 'programmable'. lines 34-38: +task 5, lines 34-38: +//# programmable --sender A --inputs 10 --gas-budget 10000000000 +//> 0: SplitCoins(Gas, [Input(0)]); +//> MergeCoins(Result(0), [Gas]) +// cannot use gas coin in a vector Error: Transaction Effects Status: Invalid command argument at 1. Invalid taking of the Gas coin. It can only be used by-value with TransferObjects Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidGasCoinUsage }, source: None, command: Some(1) } } -task 6 'programmable'. lines 39-42: +task 6, lines 39-42: +//# programmable --sender A +//> MakeMoveVec([Gas]) +// we give the error that the gas coin was taken, even though this call is invalid Error: Transaction Effects Status: Invalid command argument at 0. Invalid taking of the Gas coin. It can only be used by-value with TransferObjects Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidGasCoinUsage }, source: None, command: Some(0) } } -task 7 'programmable'. lines 43-45: +task 7, lines 43-45: +//# programmable --sender A --inputs @A +//> TransferObjects([Gas], Input(0)); +//> test::m1::t1>(Gas) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/generics_substitution.exp b/crates/sui-adapter-transactional-tests/tests/programmable/generics_substitution.exp index d29462e84924e..f8462f7826130 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/generics_substitution.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/generics_substitution.exp @@ -3,15 +3,33 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 8-26: +task 1, lines 8-26: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5456800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 27-36: +task 2, lines 27-36: +//# programmable +//> 0: test::m1::a(); +//> 1: test::m1::b(); +//> 2: MakeMoveVec([Result(0)]); +//> 3: MakeMoveVec([Result(1)]); +//> 4: test::m1::swap(Result(2), Result(3)); +// correct usage A B A +//> test::m1::eat(NestedResult(4,1), NestedResult(4,0), NestedResult(4,1)); +// invalid mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 37-44: +task 3, lines 37-44: +//# programmable +//> 0: test::m1::a(); +//> 1: test::m1::b(); +//> 2: MakeMoveVec([Result(0)]); +//> 3: MakeMoveVec([Result(1)]); +//> 4: test::m1::swap(Result(2), Result(3)); +// incorrect usage B B A +//> test::m1::eat(NestedResult(4,0), NestedResult(4,0), NestedResult(4,1)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(5) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/invalid_option.exp b/crates/sui-adapter-transactional-tests/tests/programmable/invalid_option.exp index a49ec72534841..bfa5f8e4c6809 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/invalid_option.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/invalid_option.exp @@ -3,79 +3,117 @@ processed 20 tasks init: A: object(0,0) -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4423200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 17-18: +task 2, lines 17-18: +//# programmable --inputs vector[false,true] +//> test::m1::option_prim(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 3 'programmable'. lines 20-21: +task 3, lines 20-21: +//# programmable --inputs vector[0u8,0u8] +//> test::m1::option_prim(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 4 'programmable'. lines 23-24: +task 4, lines 23-24: +//# programmable --inputs vector[0u16,0u16] +//> test::m1::option_prim(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 5 'programmable'. lines 26-27: +task 5, lines 26-27: +//# programmable --inputs vector[0u32,0u32] +//> test::m1::option_prim(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 6 'programmable'. lines 29-30: +task 6, lines 29-30: +//# programmable --inputs vector[0u64,0u64] +//> test::m1::option_prim(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 7 'programmable'. lines 32-33: +task 7, lines 32-33: +//# programmable --inputs vector[0u128,0u128] +//> test::m1::option_prim(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 8 'programmable'. lines 35-36: +task 8, lines 35-36: +//# programmable --inputs vector[0u256,0u256] +//> test::m1::option_prim(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 9 'programmable'. lines 38-39: +task 9, lines 38-39: +//# programmable --inputs vector[@0,@0] +//> test::m1::option_prim
(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option
but provided argument's value does not match"), command: Some(0) } } -task 10 'programmable'. lines 41-45: +task 10, lines 41-45: +//# programmable --inputs vector[@0,@0] +//> test::m1::option_prim(Input(0)); +// vectors Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option
but provided argument's value does not match"), command: Some(0) } } -task 11 'programmable'. lines 47-48: +task 11, lines 47-48: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 12 'programmable'. lines 50-51: +task 12, lines 50-51: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 13 'programmable'. lines 53-54: +task 13, lines 53-54: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 14 'programmable'. lines 56-57: +task 14, lines 56-57: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 15 'programmable'. lines 59-60: +task 15, lines 59-60: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 16 'programmable'. lines 62-63: +task 16, lines 62-63: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 17 'programmable'. lines 65-66: +task 17, lines 65-66: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 18 'programmable'. lines 68-69: +task 18, lines 68-69: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } -task 19 'programmable'. lines 71-72: +task 19, lines 71-72: +//# programmable --inputs vector[vector[],vector[]] +//> test::m1::option_prim>(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option> but provided argument's value does not match"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/invalid_public_function_return.exp b/crates/sui-adapter-transactional-tests/tests/programmable/invalid_public_function_return.exp index 8eaa4a089e781..e9b08d48a68f3 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/invalid_public_function_return.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/invalid_public_function_return.exp @@ -3,19 +3,26 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-16: +task 1, lines 8-16: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4681600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 18-19: +task 2, lines 18-19: +//# programmable +//> 0: test::m1::t1(); Error: Transaction Effects Status: Invalid public Move function signature. Unsupported return type for return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidPublicFunctionReturnType { idx: 0 }, source: None, command: Some(0) } } -task 3 'programmable'. lines 21-22: +task 3, lines 21-22: +//# programmable +//> 0: test::m1::t2(); Error: Transaction Effects Status: Invalid public Move function signature. Unsupported return type for return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidPublicFunctionReturnType { idx: 0 }, source: None, command: Some(0) } } -task 4 'programmable'. lines 24-25: +task 4, lines 24-25: +//# programmable +//> 0: test::m1::t3(); Error: Transaction Effects Status: Invalid public Move function signature. Unsupported return type for return value 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidPublicFunctionReturnType { idx: 1 }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/invalid_result_arity.exp b/crates/sui-adapter-transactional-tests/tests/programmable/invalid_result_arity.exp index a33b9e0d33d6d..c8b4350023fcc 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/invalid_result_arity.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/invalid_result_arity.exp @@ -3,31 +3,50 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4544800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 17-19: +task 2, lines 17-19: +//# programmable +//> 0: test::m1::nop(); +//> test::m1::take(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of result 0, expected a single result but found either no return values or multiple. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidResultArity { result_idx: 0 } }, source: None, command: Some(1) } } -task 3 'programmable'. lines 20-22: +task 3, lines 20-22: +//# programmable +//> 0: test::m1::nop(); +//> test::m1::take_vec(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of result 0, expected a single result but found either no return values or multiple. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidResultArity { result_idx: 0 } }, source: None, command: Some(1) } } -task 4 'programmable'. lines 24-26: +task 4, lines 24-26: +//# programmable +//> 0: test::m1::r(); +//> test::m1::take(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of result 0, expected a single result but found either no return values or multiple. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidResultArity { result_idx: 0 } }, source: None, command: Some(1) } } -task 5 'programmable'. lines 27-29: +task 5, lines 27-29: +//# programmable +//> 0: test::m1::r(); +//> test::m1::take_vec(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of result 0, expected a single result but found either no return values or multiple. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidResultArity { result_idx: 0 } }, source: None, command: Some(1) } } -task 6 'programmable'. lines 31-33: +task 6, lines 31-33: +//# programmable +//> 0: test::m1::r(); +//> MakeMoveVec([Result(0)]) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of result 0, expected a single result but found either no return values or multiple. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidResultArity { result_idx: 0 } }, source: None, command: Some(1) } } -task 7 'programmable'. lines 34-36: +task 7, lines 34-36: +//# programmable +//> 0: test::m1::r(); +//> MakeMoveVec([Result(0)]) Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of result 0, expected a single result but found either no return values or multiple. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidResultArity { result_idx: 0 } }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_objects.exp b/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_objects.exp index 495f29a130baf..d802aa56ab0d8 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_objects.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_objects.exp @@ -3,29 +3,52 @@ processed 8 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-44: +task 1, lines 8-44: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 7159200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 45-52: +task 2, lines 45-52: +//# programmable --sender A +//> 0: test::m1::new(); +//> 1: test::m1::new(); +//> 2: test::m1::new(); +//> 3: MakeMoveVec([Result(0), Result(1), Result(2)]); +//> test::m1::pubs(Result(3)); +// annotated objects mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 53-60: +task 3, lines 53-60: +//# programmable --sender A +//> 0: test::m1::new(); +//> 1: test::m1::new(); +//> 2: test::m1::new(); +//> 3: MakeMoveVec([Result(0), Result(1), Result(2)]); +//> test::m1::pubs(Result(3)); +// empty objects mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'programmable'. lines 61-65: +task 4, lines 61-65: +//# programmable --sender A +//> 0: MakeMoveVec([]); +//> test::m1::pubs(Result(0)); +// mixed new and old. Send an object to A and mix it in a vector with the newly created ones. mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'programmable'. lines 66-68: +task 5, lines 66-68: +//# programmable --sender A --inputs @A +//> 0: test::m1::new(); +//> TransferObjects([Result(0)], Input(0)); created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2280000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'view-object'. lines 70-70: +task 6, line 70: +//# view-object 5,0 Owner: Account Address ( A ) Version: 5 Contents: test::m1::Pub { @@ -37,7 +60,14 @@ Contents: test::m1::Pub { value: 112u64, } -task 7 'programmable'. lines 72-78: +task 7, lines 72-78: +//# programmable --sender A --inputs object(5,0) +//> 0: test::m1::new(); +//> 1: test::m1::new(); +//> 2: test::m1::new(); +// use Input and new objects +//> 3: MakeMoveVec([Result(0), Result(1), Input(0), Result(2)]); +//> test::m1::pubs(Result(3)); mutated: object(0,0) deleted: object(5,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2257200, non_refundable_storage_fee: 22800 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_special_validation_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_special_validation_invalid.exp index d33e7dc199460..b48aa9a691e01 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_special_validation_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/make_vec_special_validation_invalid.exp @@ -3,15 +3,24 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 8-29: +task 1, lines 8-29: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6072400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 31-34: +task 2, lines 31-34: +//# programmable --inputs vector[0u64,0u64] +// INVALID option, using a vetor of length 2 +//> 0: MakeMoveVec>([Input(0)]); +//> 1: test::m1::vec_option_u64(Result(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::option::Option but provided argument's value does not match"), command: Some(0) } } -task 3 'programmable'. lines 36-39: +task 3, lines 36-39: +//# programmable --inputs vector[255u8,157u8,164u8,239u8,184u8,143u8] +// INVALID string ^^^ modified the bytes to make an invalid UTF8 string +//> 0: MakeMoveVec([Input(0), Input(0)]); +//> 1: test::m1::vec_string(Result(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::string::String but provided argument's value does not match"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/merge_coin_mismatched_coin.exp b/crates/sui-adapter-transactional-tests/tests/programmable/merge_coin_mismatched_coin.exp index 4d416dfd57fec..2fb6189db2c50 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/merge_coin_mismatched_coin.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/merge_coin_mismatched_coin.exp @@ -3,18 +3,23 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 8-20: +task 1, lines 8-20: +//# publish --sender A created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10617200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 22-24: +task 2, lines 22-24: +//# programmable --sender A --inputs object(1,2) 100 @A +//> 0: sui::coin::mint(Input(0), Input(1)); +//> TransferObjects([Result(0)], Input(2)) created: object(2,0) mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 2663496, non_refundable_storage_fee: 26904 -task 3 'view-object'. lines 26-26: +task 3, line 26: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: sui::coin::Coin { @@ -28,18 +33,31 @@ Contents: sui::coin::Coin { }, } -task 4 'programmable'. lines 28-30: +task 4, lines 28-30: +//# programmable --sender A --inputs object(1,2) 100 +//> 0: sui::coin::mint(Input(0), Input(1)); +//> MergeCoins(Gas, [Result(0)]) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: Some("Coins do not have the same type"), command: Some(1) } } -task 5 'programmable'. lines 32-33: +task 5, lines 32-33: +//# programmable --sender A --inputs object(2,0) +//> MergeCoins(Gas, [Input(0)]) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: Some("Coins do not have the same type"), command: Some(0) } } -task 6 'programmable'. lines 36-39: +task 6, lines 36-39: +//# programmable --sender A --inputs object(1,2) 100 object(2,0) +//> 0: sui::coin::mint(Input(0), Input(1)); +//> 1: SplitCoins(Gas, [Input(1)]); +//> MergeCoins(Result(0), [Input(2), Result(1)]) Error: Transaction Effects Status: Invalid command argument at 2. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 2, kind: TypeMismatch }, source: Some("Coins do not have the same type"), command: Some(2) } } -task 7 'programmable'. lines 41-44: +task 7, lines 41-44: +//# programmable --sender A --inputs object(1,2) 100 +//> 0: sui::coin::mint(Input(0), Input(1)); +//> 1: SplitCoins(Result(0), [Input(1)]); +//> MergeCoins(Gas, [Result(1)]) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: Some("Coins do not have the same type"), command: Some(2) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/nested_result_zero_zero.exp b/crates/sui-adapter-transactional-tests/tests/programmable/nested_result_zero_zero.exp index 996e9f4130c60..48ac076aa3d87 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/nested_result_zero_zero.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/nested_result_zero_zero.exp @@ -3,11 +3,16 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 8-13: +task 1, lines 8-13: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4043200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 15-18: +task 2, lines 15-18: +//# programmable +//> 0: test::m1::r(); +//> test::m1::copy_(Result(0)); +//> test::m1::copy_(NestedResult(0, 0)); mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/non_primitive_non_object_arguments.exp b/crates/sui-adapter-transactional-tests/tests/programmable/non_primitive_non_object_arguments.exp index eed070956bf8c..7041ba5defa4f 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/non_primitive_non_object_arguments.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/non_primitive_non_object_arguments.exp @@ -3,11 +3,18 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 8-19: +task 1, lines 8-19: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4666400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 21-26: +task 2, lines 21-26: +//# programmable +//> 0: test::m1::potato(); +//> 1: test::m1::pass(Result(0)); +//> test::m1::imm(Result(1)); +//> test::m1::mut_(Result(1)); +//> test::m1::otatop(Result(1)); mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_input.exp b/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_input.exp index cd1c6c924f91e..3661576cc84a0 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_input.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_input.exp @@ -3,71 +3,104 @@ processed 18 tasks init: A: object(0,0) -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4666400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 17-18: +task 2, lines 17-18: +//# programmable +//> test::m1::copy_(Input(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 3 'programmable'. lines 19-20: +task 3, lines 19-20: +//# programmable --inputs 0 +//> test::m1::copy_(Input(1)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(0) } } -task 4 'programmable'. lines 22-23: +task 4, lines 22-23: +//# programmable +//> test::m1::take(Input(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 5 'programmable'. lines 24-25: +task 5, lines 24-25: +//# programmable --inputs 0 +//> test::m1::take(Input(2)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 2 } }, source: None, command: Some(0) } } -task 6 'programmable'. lines 27-28: +task 6, lines 27-28: +//# programmable +//> test::m1::by_imm(Input(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 7 'programmable'. lines 29-30: +task 7, lines 29-30: +//# programmable --inputs 0 +//> test::m1::by_imm(Input(1)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(0) } } -task 8 'programmable'. lines 32-33: +task 8, lines 32-33: +//# programmable +//> test::m1::by_mut(Input(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 9 'programmable'. lines 34-35: +task 9, lines 34-35: +//# programmable --inputs 0 +//> test::m1::by_mut(Input(1)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(0) } } -task 10 'programmable'. lines 37-38: +task 10, lines 37-38: +//# programmable +//> MakeMoveVec([Input(0)]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 11 'programmable'. lines 39-40: +task 11, lines 39-40: +//# programmable --inputs 0 +//> MakeMoveVec([Input(0), Input(1)]) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(0) } } -task 12 'programmable'. lines 42-43: +task 12, lines 42-43: +//# programmable +//> SplitCoins(Input(0), [Gas]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 13 'programmable'. lines 44-45: +task 13, lines 44-45: +//# programmable --inputs 0 +//> SplitCoins(Gas, [Input(1)]) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(0) } } -task 14 'programmable'. lines 47-48: +task 14, lines 47-48: +//# programmable +//> MergeCoins(Input(0), [Gas]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 15 'programmable'. lines 49-50: +task 15, lines 49-50: +//# programmable --inputs 0 +//> MergeCoins(Gas, [Input(1), Input(0)]) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(0) } } -task 16 'programmable'. lines 52-53: +task 16, lines 52-53: +//# programmable +//> TransferObjects([Input(0)], Gas) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 17 'programmable'. lines 54-55: +task 17, lines 54-55: +//# programmable --inputs 0 +//> TransferObjects([Gas], Input(1)) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_nested.exp b/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_nested.exp index e343a8b4a8d3e..c597514e1212d 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_nested.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_nested.exp @@ -3,71 +3,120 @@ processed 18 tasks init: A: object(0,0) -task 1 'publish'. lines 8-16: +task 1, lines 8-16: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4864000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 18-20: +task 2, lines 18-20: +//# programmable +//> 0: test::m1::r(); +//> test::m1::copy_(NestedResult(0, 2)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 3 'programmable'. lines 21-23: +task 3, lines 21-23: +//# programmable +//> 0: test::m1::r(); +//> test::m1::copy_(NestedResult(1, 0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 4 'programmable'. lines 25-27: +task 4, lines 25-27: +//# programmable +//> 0: test::m1::r(); +//> test::m1::take(NestedResult(0, 2)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 5 'programmable'. lines 28-30: +task 5, lines 28-30: +//# programmable +//> 0: test::m1::r(); +//> test::m1::take(NestedResult(1, 0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 6 'programmable'. lines 32-34: +task 6, lines 32-34: +//# programmable +//> 0: test::m1::r(); +//> test::m1::by_imm(NestedResult(0, 2)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 7 'programmable'. lines 35-37: +task 7, lines 35-37: +//# programmable +//> 0: test::m1::r(); +//> test::m1::by_imm(NestedResult(1, 0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 8 'programmable'. lines 39-41: +task 8, lines 39-41: +//# programmable +//> 0: test::m1::r(); +//> test::m1::by_mut(NestedResult(0, 2)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 9 'programmable'. lines 42-44: +task 9, lines 42-44: +//# programmable +//> 0: test::m1::r(); +//> test::m1::by_mut(NestedResult(1, 0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 10 'programmable'. lines 46-48: +task 10, lines 46-48: +//# programmable +//> 0: test::m1::r(); +//> MakeMoveVec([NestedResult(0, 2)]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 11 'programmable'. lines 49-51: +task 11, lines 49-51: +//# programmable +//> 0: test::m1::r(); +//> MakeMoveVec([NestedResult(0, 2), NestedResult(1, 0)]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 12 'programmable'. lines 53-55: +task 12, lines 53-55: +//# programmable +//> 0: test::m1::r(); +//> SplitCoins(NestedResult(0, 2), [Gas]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 13 'programmable'. lines 56-58: +task 13, lines 56-58: +//# programmable +//> 0: test::m1::r(); +//> SplitCoins(Gas, [NestedResult(1, 0)]) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 14 'programmable'. lines 60-62: +task 14, lines 60-62: +//# programmable +//> 0: test::m1::r(); +//> MergeCoins(NestedResult(0, 2), [Gas]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 15 'programmable'. lines 63-65: +task 15, lines 63-65: +//# programmable +//> 0: test::m1::r(); +//> MergeCoins(Gas, [NestedResult(1, 0), NestedResult(0, 2)]) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 16 'programmable'. lines 67-69: +task 16, lines 67-69: +//# programmable +//> 0: test::m1::r(); +//> TransferObjects([NestedResult(0, 2)], Gas) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds secondary access to result vector 0 at secondary index 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: SecondaryIndexOutOfBounds { result_idx: 0, secondary_idx: 2 } }, source: None, command: Some(1) } } -task 17 'programmable'. lines 70-72: +task 17, lines 70-72: +//# programmable +//> 0: test::m1::r(); +//> TransferObjects([Gas], NestedResult(1, 0)) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_result.exp b/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_result.exp index b4f8575554923..b04b6143bb4a8 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_result.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/out_of_bounds_result.exp @@ -3,71 +3,112 @@ processed 18 tasks init: A: object(0,0) -task 1 'publish'. lines 8-16: +task 1, lines 8-16: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4795600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 18-19: +task 2, lines 18-19: +//# programmable +//> test::m1::copy_(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 3 'programmable'. lines 20-22: +task 3, lines 20-22: +//# programmable +//> 0: test::m1::r(); +//> test::m1::copy_(Result(1)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 4 'programmable'. lines 24-25: +task 4, lines 24-25: +//# programmable +//> test::m1::take(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 5 'programmable'. lines 26-28: +task 5, lines 26-28: +//# programmable +//> 0: test::m1::r(); +//> test::m1::take(Result(2)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 2 } }, source: None, command: Some(1) } } -task 6 'programmable'. lines 30-31: +task 6, lines 30-31: +//# programmable +//> test::m1::by_imm(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 7 'programmable'. lines 32-34: +task 7, lines 32-34: +//# programmable +//> 0: test::m1::r(); +//> test::m1::by_imm(Result(1)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 8 'programmable'. lines 36-37: +task 8, lines 36-37: +//# programmable +//> test::m1::by_mut(Result(0)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 9 'programmable'. lines 38-40: +task 9, lines 38-40: +//# programmable +//> 0: test::m1::r(); +//> test::m1::by_mut(Result(1)) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 10 'programmable'. lines 42-43: +task 10, lines 42-43: +//# programmable +//> MakeMoveVec([Result(0)]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 11 'programmable'. lines 44-46: +task 11, lines 44-46: +//# programmable +//> 0: test::m1::r(); +//> MakeMoveVec([Result(0), Result(1)]) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 12 'programmable'. lines 48-49: +task 12, lines 48-49: +//# programmable +//> SplitCoins(Result(0), [Gas]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 13 'programmable'. lines 50-52: +task 13, lines 50-52: +//# programmable +//> 0: test::m1::r(); +//> SplitCoins(Gas, [Result(1)]) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 14 'programmable'. lines 54-55: +task 14, lines 54-55: +//# programmable +//> MergeCoins(Result(0), [Gas]) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 15 'programmable'. lines 56-58: +task 15, lines 56-58: +//# programmable +//> 0: test::m1::r(); +//> MergeCoins(Gas, [Result(1), Result(0)]) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } -task 16 'programmable'. lines 60-61: +task 16, lines 60-61: +//# programmable +//> TransferObjects([Result(0)], Gas) Error: Transaction Effects Status: Invalid command argument at 0. Out of bounds access to input or result vector 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: IndexOutOfBounds { idx: 0 } }, source: None, command: Some(0) } } -task 17 'programmable'. lines 62-64: +task 17, lines 62-64: +//# programmable +//> 0: test::m1::r(); +//> TransferObjects([Gas], Result(1)) Error: Transaction Effects Status: Invalid command argument at 1. Out of bounds access to input or result vector 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: IndexOutOfBounds { idx: 1 } }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_invalid.exp index 77f55947b167d..8f787cd616708 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_invalid.exp @@ -3,24 +3,39 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 9-18: +task 1, lines 9-18: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5054000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 20-25: +task 2, lines 20-25: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> TransferObjects([Result(0)], Input(0)) +// cannot use results from other functions created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 27-29: +task 3, lines 27-29: +//# programmable +//> 0: test::m1::r(); +//> test::m1::priv(Result(0)); Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } -task 4 'programmable'. lines 31-35: +task 4, lines 31-35: +//# programmable --sender A --inputs object(2,0) +//> 0: test::m1::id(Input(0)); +//> test::m1::priv(Result(0)); +// cannot use an object once it has been used in a non-entry function Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } -task 5 'programmable'. lines 37-39: +task 5, lines 37-39: +//# programmable --sender A --inputs object(2,0) +//> 0: test::m1::dirty(Input(0)); +//> test::m1::priv(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_valid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_valid.exp index 2f2e2a8c6501f..3e292e6c80056 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_by_ref_input_valid.exp @@ -3,21 +3,39 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 9-23: +task 1, lines 9-23: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5502400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 25-27: +task 2, lines 25-27: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 29-36: +task 3, lines 29-36: +//# programmable --sender A --inputs object(2,0) 200 +//> 0: test::m1::v(); +//> test::m1::clean(Input(0), Result(0)); +//> test::m1::priv(Input(0)); +//> test::m1::clean(Input(0), Input(1)); +//> test::m1::priv(Input(0)); +//> test::m1::priv(Input(0)); +//> test::m1::priv(Input(0)); mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 4 'programmable'. lines 38-43: +task 4, lines 38-43: +//# programmable --sender A --inputs @A --gas-budget 10000000000 +//> 0: test::m1::v(); +//> 1: SplitCoins(Gas, [Result(0)]); +//> test::m1::coin(Gas); +//> test::m1::coin(Result(1)); +//> TransferObjects([Result(1)], Input(0)) created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_copied_input_valid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_copied_input_valid.exp index 628292c34cb8d..69072a387a7d2 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_copied_input_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_copied_input_valid.exp @@ -3,11 +3,15 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 9-13: +task 1, lines 9-13: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3549200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 15-17: +task 2, lines 15-17: +//# programmable --inputs 0 +//> test::m1::clean(Input(0)); +//> test::m1::priv(Input(0)); mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_invalid.exp index 0022f442741f3..22ae3453ee814 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_invalid.exp @@ -3,20 +3,34 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 9-18: +task 1, lines 9-18: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5403600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 20-24: +task 2, lines 20-24: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> 1: test::m1::r(); +//> 2: test::m1::r(); +//> TransferObjects([Result(0), Result(1), Result(2)], Input(0)) created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4636000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 26-29: +task 3, lines 26-29: +//# programmable --sender A --inputs object(2,0) object(2,1) object(2,2) +//> 0: test::m1::dirty(Input(2)); +//> 1: MakeMoveVec([Input(0), Input(1), Input(2)]); +//> test::m1::priv(Result(1)) Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(2) } } -task 4 'programmable'. lines 31-34: +task 4, lines 31-34: +//# programmable --sender A --inputs 0 0 0 +//> 0: test::m1::dirty_u64(Input(1)); +//> 1: MakeMoveVec([Input(0), Input(1), Input(2)]); +//> test::m1::priv(Result(1)) Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(2) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_valid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_valid.exp index 0394a8c90fe3d..06a7e3a7af6c1 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_make_move_vec_valid.exp @@ -3,21 +3,36 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 9-26: +task 1, lines 9-26: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6247200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 28-32: +task 2, lines 28-32: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> 1: test::m1::r(); +//> 2: test::m1::r(); +//> TransferObjects([Result(0), Result(1), Result(2)], Input(0)) created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4636000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 34-38: +task 3, lines 34-38: +//# programmable --sender A --inputs object(2,0) object(2,1) object(2,2) +//> 0: test::m1::clean(Input(2)); +//> 1: test::m1::priv1(Input(2)); +//> 2: MakeMoveVec([Input(0), Input(1), Input(2)]); +//> test::m1::priv2(Result(2)) mutated: object(0,0) deleted: object(2,0), object(2,1), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 4589640, non_refundable_storage_fee: 46360 -task 4 'programmable'. lines 40-43: +task 4, lines 40-43: +//# programmable --sender A --inputs 0 0 0 +//> 0: test::m1::clean_u64(Input(1)); +//> 1: MakeMoveVec([Input(0), Input(1), Input(2)]); +//> test::m1::priv3(Result(1)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_non_pure_input_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_non_pure_input_invalid.exp index aea26fc75bc81..1d6bbaeff748a 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_non_pure_input_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_non_pure_input_invalid.exp @@ -3,19 +3,30 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-16: +task 1, lines 8-16: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4005200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 17-19: +task 2, lines 17-19: +//# programmable +//> 0: test::m1::v1(); +//> test::m1::priv(Result(0)); Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } -task 3 'programmable'. lines 21-25: +task 3, lines 21-25: +//# programmable +//> 0: test::m1::v2(); +//> test::m1::priv(Result(0)); +// pure value has been "dirtied" and cannot be used Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } -task 4 'programmable'. lines 26-28: +task 4, lines 26-28: +//# programmable --inputs 0 +//> test::m1::dirty(Input(0)); +//> test::m1::priv(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_per_argument.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_per_argument.exp index da01665434c89..fb26f33cb2b7b 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_per_argument.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_per_argument.exp @@ -3,20 +3,32 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4932400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 17-20: +task 2, lines 17-20: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> 1: test::m1::r(); +//> TransferObjects([Result(0), Result(1)], Input(0)) created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 22-24: +task 3, lines 22-24: +//# programmable --sender A --inputs object(2,0) object(2,1) +//> test::m1::dirty(Input(1)); +//> test::m1::priv(Input(0), Input(1)); Error: Transaction Effects Status: Invalid command argument at 1. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } -task 4 'programmable'. lines 26-29: +task 4, lines 26-29: +//# programmable --sender A --inputs 0u64 object(2,1) +//> test::m1::dirty(Input(1)); +// type error instead of dirty error +//> test::m1::priv(Input(0), Input(1)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be instantiated from raw bytes Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidUsageOfPureArg }, source: Some("Non-primitive argument at index 0. If it is an object, it must be populated by an object"), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_type_check.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_type_check.exp index 96dd915304d13..ae1523008f8c4 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_type_check.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_entry_value_restriction_type_check.exp @@ -3,20 +3,29 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4902000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 17-19: +task 2, lines 17-19: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 21-23: +task 3, lines 21-23: +//# programmable --sender A --inputs object(2,0) +//> 0: test::m1::dirty(Input(0)); +//> test::m1::priv1(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. Invalid argument to private entry function. These functions cannot take arguments from other Move functions Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidArgumentToPrivateEntryFunction }, source: None, command: Some(1) } } -task 4 'programmable'. lines 25-26: +task 4, lines 25-26: +//# programmable --sender A --inputs object(2,0) +//> test::m1::priv1(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_invalid.exp index 78878d8f9b6c6..8d8a5caeaff2a 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_invalid.exp @@ -3,43 +3,73 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 8-17: +task 1, lines 8-17: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5228800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 19-21: +task 2, lines 19-21: +//# programmable --sender A --inputs @A +//> 0: test::m1::pub(); +//> sui::transfer::transfer(Result(0), Input(0)); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::transfer. Use the public variant instead, sui::transfer::public_transfer"), command: Some(1) } } -task 3 'programmable'. lines 23-25: +task 3, lines 23-25: +//# programmable +//> 0: test::m1::pub(); +//> sui::transfer::share_object(Result(0)); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::share_object. Use the public variant instead, sui::transfer::public_share_object"), command: Some(1) } } -task 4 'programmable'. lines 27-32: +task 4, lines 27-32: +//# programmable +//> 0: test::m1::pub(); +//> sui::transfer::freeze_object(Result(0)); +// Does not have store, cannot be used with internal variants Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::freeze_object. Use the public variant instead, sui::transfer::public_freeze_object"), command: Some(1) } } -task 5 'programmable'. lines 34-36: +task 5, lines 34-36: +//# programmable --sender A --inputs @A +//> 0: test::m1::priv(); +//> sui::transfer::transfer(Result(0), Input(0)); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::transfer. Use the public variant instead, sui::transfer::public_transfer"), command: Some(1) } } -task 6 'programmable'. lines 38-40: +task 6, lines 38-40: +//# programmable +//> 0: test::m1::priv(); +//> sui::transfer::share_object(Result(0)); Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::share_object. Use the public variant instead, sui::transfer::public_share_object"), command: Some(1) } } -task 7 'programmable'. lines 42-47: +task 7, lines 42-47: +//# programmable +//> 0: test::m1::priv(); +//> sui::transfer::freeze_object(Result(0)); +// Does not have store, cannot be used with public variants Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::freeze_object. Use the public variant instead, sui::transfer::public_freeze_object"), command: Some(1) } } -task 8 'programmable'. lines 49-51: +task 8, lines 49-51: +//# programmable --sender A --inputs @A +//> 0: test::m1::priv(); +//> sui::transfer::public_transfer(Result(0), Input(0)); Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [] }), command: Some(1) } } -task 9 'programmable'. lines 53-55: +task 9, lines 53-55: +//# programmable +//> 0: test::m1::priv(); +//> sui::transfer::public_share_object(Result(0)); Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [] }), command: Some(1) } } -task 10 'programmable'. lines 57-59: +task 10, lines 57-59: +//# programmable +//> 0: test::m1::priv(); +//> sui::transfer::public_freeze_object(Result(0)); Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_valid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_valid.exp index 76169ff9127e6..e7b3ae7e09903 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_valid.exp @@ -3,17 +3,22 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 8-12: +task 1, lines 8-12: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4628400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 14-16: +task 2, lines 14-16: +//# programmable --sender A --inputs @A +//> 0: test::m1::pub(); +//> sui::transfer::public_transfer(Result(0), Input(0)); created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2219200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 18-18: +task 3, line 18: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::m1::Pub { @@ -24,12 +29,16 @@ Contents: test::m1::Pub { }, } -task 4 'programmable'. lines 20-22: +task 4, lines 20-22: +//# programmable +//> 0: test::m1::pub(); +//> sui::transfer::public_share_object(Result(0)); created: object(4,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2219200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'view-object'. lines 24-24: +task 5, line 24: +//# view-object 4,0 Owner: Shared( 3 ) Version: 3 Contents: test::m1::Pub { @@ -40,12 +49,16 @@ Contents: test::m1::Pub { }, } -task 6 'programmable'. lines 26-28: +task 6, lines 26-28: +//# programmable +//> 0: test::m1::pub(); +//> sui::transfer::public_freeze_object(Result(0)); created: object(6,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2219200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 30-30: +task 7, line 30: +//# view-object 6,0 Owner: Immutable Version: 4 Contents: test::m1::Pub { diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/pure_arg_type_change.exp b/crates/sui-adapter-transactional-tests/tests/programmable/pure_arg_type_change.exp index db88b31595f63..c5c197cc31521 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/pure_arg_type_change.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/pure_arg_type_change.exp @@ -3,23 +3,48 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 8-25: +task 1, lines 8-25: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5380800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 27-33: +task 2, lines 27-33: +//# programmable --inputs "hello" +//> 0: test::m1::ascii_(Input(0)); +//> 1: test::m1::string(Input(0)); +//> 2: test::m1::fix(Input(0)); +// now will fail as Input(0) if always a String +//> 3: test::m1::string(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(3) } } -task 3 'programmable'. lines 35-41: +task 3, lines 35-41: +//# programmable --inputs @A +//> 0: test::m1::addr(Input(0)); +//> 1: test::m1::id(Input(0)); +//> 2: test::m1::fix(Input(0)); +// now will fail as Input(0) if always an ID +//> 3: test::m1::addr(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(3) } } -task 4 'programmable'. lines 43-49: +task 4, lines 43-49: +//# programmable --inputs vector[0u64] +//> 0: test::m1::vec(Input(0)); +//> 1: test::m1::opt(Input(0)); +//> 2: test::m1::fix>(Input(0)); +// now will fail as Input(0) if always a vector +//> 3: test::m1::opt(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(3) } } -task 5 'programmable'. lines 51-57: +task 5, lines 51-57: +//# programmable --inputs vector[] +//> 0: test::m1::vec(Input(0)); +//> 1: test::m1::opt(Input(0)); +//> 2: test::m1::fix>(Input(0)); +// now will fail as Input(0) if always an Option +//> 3: test::m1::vec(Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(3) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp index 4b3a66dd88196..220540ce069e5 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins.exp @@ -3,22 +3,29 @@ processed 20 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-22: +task 1, lines 9-22: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5677200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 24-28: +task 2, lines 24-28: +//# programmable --sender A --inputs 100000 @A +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) +// let's get ourselves a coin worth 1000 created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 29-29: +task 3, line 29: +//# run sui::pay::split_and_transfer --type-args sui::sui::SUI --args object(2,0) 1000 @A --sender A created: object(3,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 4 'view-object'. lines 31-33: +task 4, lines 31-33: +//# view-object 3,0 Owner: Account Address ( A ) Version: 3 Contents: sui::coin::Coin { @@ -32,12 +39,16 @@ Contents: sui::coin::Coin { }, } -task 5 'programmable'. lines 34-36: +task 5, lines 34-36: +//# programmable --sender A --inputs object(3,0) 100 @B +//> 0: SplitCoins(Input(0), [Input(1)]); +//> TransferObjects([NestedResult(0,0)], Input(2)); created: object(5,0) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 6 'view-object'. lines 38-38: +task 6, line 38: +//# view-object 3,0 Owner: Account Address ( A ) Version: 4 Contents: sui::coin::Coin { @@ -51,7 +62,8 @@ Contents: sui::coin::Coin { }, } -task 7 'view-object'. lines 40-43: +task 7, lines 40-43: +//# view-object 5,0 Owner: Account Address ( B ) Version: 4 Contents: sui::coin::Coin { @@ -65,12 +77,16 @@ Contents: sui::coin::Coin { }, } -task 8 'programmable'. lines 44-46: +task 8, lines 44-46: +//# programmable --sender A --inputs object(3,0) 100 @B +//> 0: SplitCoins(Input(0), [Input(1), Input(1)]); +//> TransferObjects([NestedResult(0,0), NestedResult(0,1)], Input(2)); created: object(8,0), object(8,1) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3952000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 9 'view-object'. lines 48-48: +task 9, line 48: +//# view-object 3,0 Owner: Account Address ( A ) Version: 5 Contents: sui::coin::Coin { @@ -84,7 +100,8 @@ Contents: sui::coin::Coin { }, } -task 10 'view-object'. lines 50-50: +task 10, line 50: +//# view-object 8,0 Owner: Account Address ( B ) Version: 5 Contents: sui::coin::Coin { @@ -98,7 +115,8 @@ Contents: sui::coin::Coin { }, } -task 11 'view-object'. lines 52-54: +task 11, lines 52-54: +//# view-object 8,1 Owner: Account Address ( B ) Version: 5 Contents: sui::coin::Coin { @@ -112,12 +130,17 @@ Contents: sui::coin::Coin { }, } -task 12 'programmable'. lines 55-58: +task 12, lines 55-58: +//# programmable --sender A --inputs object(3,0) 100 @B +//> 0: test::m1::ret_one_amount(); +//> 1: SplitCoins(Input(0), [Result(0), Input(1)]); +//> TransferObjects([NestedResult(1,0), NestedResult(1,1)], Input(2)); created: object(12,0), object(12,1) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3952000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 13 'view-object'. lines 60-60: +task 13, line 60: +//# view-object 3,0 Owner: Account Address ( A ) Version: 6 Contents: sui::coin::Coin { @@ -131,7 +154,8 @@ Contents: sui::coin::Coin { }, } -task 14 'view-object'. lines 62-62: +task 14, line 62: +//# view-object 12,0 Owner: Account Address ( B ) Version: 6 Contents: sui::coin::Coin { @@ -145,7 +169,8 @@ Contents: sui::coin::Coin { }, } -task 15 'view-object'. lines 64-67: +task 15, lines 64-67: +//# view-object 12,1 Owner: Account Address ( B ) Version: 6 Contents: sui::coin::Coin { @@ -159,12 +184,18 @@ Contents: sui::coin::Coin { }, } -task 16 'programmable'. lines 68-72: +task 16, lines 68-72: +//# programmable --sender A --inputs object(3,0) 100 @B +//> 0: test::m1::ret_one_amount(); +//> 1: SplitCoins(Input(0), [Result(0), Input(1)]); +//> 2: MakeMoveVec>([NestedResult(1,0), NestedResult(1,1)]); +//> test::m1::transfer_(Result(2), Input(2)); created: object(16,0), object(16,1) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3952000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 17 'view-object'. lines 74-74: +task 17, line 74: +//# view-object 3,0 Owner: Account Address ( A ) Version: 7 Contents: sui::coin::Coin { @@ -178,7 +209,8 @@ Contents: sui::coin::Coin { }, } -task 18 'view-object'. lines 76-76: +task 18, line 76: +//# view-object 16,0 Owner: Account Address ( B ) Version: 7 Contents: sui::coin::Coin { @@ -192,7 +224,8 @@ Contents: sui::coin::Coin { }, } -task 19 'view-object'. lines 78-78: +task 19, line 78: +//# view-object 16,1 Owner: Account Address ( B ) Version: 7 Contents: sui::coin::Coin { diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins_invalid.exp index d7f9b7d795a2f..5d564e21f8e54 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/split_coins_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/split_coins_invalid.exp @@ -3,22 +3,29 @@ processed 12 tasks init: A: object(0,0), B: object(0,1), C: object(0,2) -task 1 'publish'. lines 9-24: +task 1, lines 9-24: +//# publish created: object(1,0) mutated: object(0,3) gas summary: computation_cost: 1000000, storage_cost: 5639200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-30: +task 2, lines 26-30: +//# programmable --sender A --inputs 100000 @A +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) +// let's get ourselves a coin worth 1000 created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 31-31: +task 3, line 31: +//# run sui::pay::split_and_transfer --type-args sui::sui::SUI --args object(2,0) 1000 @A --sender A created: object(3,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 4 'view-object'. lines 33-35: +task 4, lines 33-35: +//# view-object 3,0 Owner: Account Address ( A ) Version: 3 Contents: sui::coin::Coin { @@ -32,30 +39,54 @@ Contents: sui::coin::Coin { }, } -task 5 'programmable'. lines 36-39: +task 5, lines 36-39: +//# programmable --sender A --inputs object(3,0) 10001 @B +//> 0: SplitCoins(Input(0), [Input(1)]); +// split off more than it's available using vector of amounts Error: Transaction Effects Status: Insufficient coin balance for operation. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InsufficientCoinBalance, source: Some("balance: 1000 required: 10001"), command: Some(0) } } -task 6 'programmable'. lines 40-43: +task 6, lines 40-43: +//# programmable --sender A --inputs object(3,0) 333 333 335 +//> 0: SplitCoins(Input(0), [Input(1), Input(2), Input(3)]); +// use incorrect amount type for split Error: Transaction Effects Status: Insufficient coin balance for operation. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InsufficientCoinBalance, source: Some("balance: 334 required: 335"), command: Some(0) } } -task 7 'programmable'. lines 44-47: +task 7, lines 44-47: +//# programmable --sender A --inputs object(3,0) @C +//> 0: SplitCoins(Input(0), [Input(1)]); +// use incorrect amount type for split with the first one being correct Error: Transaction Effects Status: Invalid command argument at 1. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidBCSBytes }, source: None, command: Some(0) } } -task 8 'programmable'. lines 48-51: +task 8, lines 48-51: +//# programmable --sender A --inputs object(3,0) 100 @C +//> 0: SplitCoins(Input(0), [Input(1), Input(2)]); +// use incorrect arg type for split coming from a Move function Error: Transaction Effects Status: Invalid command argument at 1. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidBCSBytes }, source: None, command: Some(0) } } -task 9 'programmable'. lines 52-56: +task 9, lines 52-56: +//# programmable --sender A --inputs object(3,0) +//> 0: test::m1::ret_one_amount(); +//> 1: SplitCoins(Input(0), [Result(0)]); +// use incorrect arg type for split by creating a vector of u64s Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(1) } } -task 10 'programmable'. lines 57-62: +task 10, lines 57-62: +//# programmable --sender A --inputs object(3,0) 100 +//> 0: MakeMoveVec([Input(1), Input(1), Input(1)]); +//> 1: SplitCoins(Input(0), [Result(0)]); +// pass result of SplitCoins directly as another function argument without creating and intermediate +// vector first Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(1) } } -task 11 'programmable'. lines 63-65: +task 11, lines 63-65: +//# programmable --sender A --inputs object(3,0) 100 100 @B +//> 0: SplitCoins(Input(0), [Input(1), Input(2)]); +//> test::m1::transfer_(Result(0), Input(3)); Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of result 0, expected a single result but found either no return values or multiple. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidResultArity { result_idx: 0 } }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects.exp b/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects.exp index b1910f1e4bb31..9163db8d3b290 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects.exp @@ -3,17 +3,22 @@ processed 12 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-32: +task 1, lines 8-32: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6004000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 33-35: +task 2, lines 33-35: +//# programmable --sender A --inputs @A +//> 0: test::m1::new(); +//> TransferObjects([Result(0)], Input(0)); created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2280000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 37-39: +task 3, lines 37-39: +//# view-object 0,0 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::Coin { @@ -27,12 +32,17 @@ Contents: sui::coin::Coin { }, } -task 4 'programmable'. lines 40-43: +task 4, lines 40-43: +//# programmable --sender A --inputs 0u256 +//> 0: sui::address::from_u256(Input(0)); +//> 1: test::m1::new(); +//> TransferObjects([Result(1)], Result(0)); created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2280000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'view-object'. lines 45-47: +task 5, lines 45-47: +//# view-object 4,0 Owner: Account Address ( _ ) Version: 3 Contents: test::m1::Pub { @@ -44,12 +54,19 @@ Contents: test::m1::Pub { value: 112u64, } -task 6 'programmable'. lines 48-53: +task 6, lines 48-53: +//# programmable --sender A --inputs @B true +//> 0: sui::address::to_u256(Input(0)); +//> 1: sui::address::from_u256(Result(0)); +//> 2: test::m1::new(); +//> 3: test::m1::addr(Result(1), Input(1)); +//> TransferObjects([Result(2)], Result(3)); created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2280000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 55-57: +task 7, lines 55-57: +//# view-object 6,0 Owner: Account Address ( B ) Version: 4 Contents: test::m1::Pub { @@ -61,12 +78,21 @@ Contents: test::m1::Pub { value: 112u64, } -task 8 'programmable'. lines 58-65: +task 8, lines 58-65: +//# programmable --sender A --inputs @B true +//> 0: sui::address::to_u256(Input(0)); +//> 1: sui::address::from_u256(Result(0)); +//> 2: test::m1::new(); +//> 3: test::m1::addr(Result(1), Input(1)); +//> 4: test::m1::cup(); +//> 5: test::m1::cup(); +//> TransferObjects([Result(4), Result(2), Result(5)], Result(3)); created: object(8,0), object(8,1), object(8,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5388400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'view-object'. lines 67-67: +task 9, line 67: +//# view-object 8,0 Owner: Account Address ( B ) Version: 5 Contents: test::m1::Cup { @@ -77,7 +103,8 @@ Contents: test::m1::Cup { }, } -task 10 'view-object'. lines 69-69: +task 10, line 69: +//# view-object 8,1 Owner: Account Address ( B ) Version: 5 Contents: test::m1::Cup { @@ -88,7 +115,8 @@ Contents: test::m1::Cup { }, } -task 11 'view-object'. lines 71-71: +task 11, line 71: +//# view-object 8,2 Owner: Account Address ( B ) Version: 5 Contents: test::m1::Pub { diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_address.exp b/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_address.exp index 32273119e33d4..e3be889edd9ea 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_address.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_address.exp @@ -3,19 +3,33 @@ processed 5 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-28: +task 1, lines 8-28: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5631600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 29-33: +task 2, lines 29-33: +//# programmable --sender A --inputs 0u64 +//> 0: test::m1::new(); +//> TransferObjects([Result(0)], Input(0)); +// not an address Error: Transaction Effects Status: Invalid command argument at 1. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidBCSBytes }, source: None, command: Some(1) } } -task 3 'programmable'. lines 34-39: +task 3, lines 34-39: +//# programmable --sender A +//> 0: test::m1::new(); +//> 1: test::m1::value(); +//> TransferObjects([Result(0)], Result(1)); +// not an address Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(2) } } -task 4 'programmable'. lines 40-43: +task 4, lines 40-43: +//# programmable --sender A +//> 0: test::m1::new(); +//> 1: test::m1::vec(); +//> TransferObjects([Result(0)], Result(1)); Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(2) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_object.exp b/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_object.exp index 44b1d6fe8745a..5af17d7695eeb 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_object.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/transfer_objects_invalid_object.exp @@ -3,26 +3,51 @@ processed 7 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-35: +task 1, lines 8-35: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6148400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 36-39: +task 2, lines 36-39: +//# programmable --sender A --inputs @A +//> TransferObjects([], Input(0)); +// not an object Error: Error checking transaction input objects: EmptyCommandInput -task 3 'programmable'. lines 40-44: +task 3, lines 40-44: +//# programmable --sender A --inputs @A +//> 0: test::m1::cap(); +//> TransferObjects([Result(0)], Input(0)); +// not an object (but sneaky) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 4 'programmable'. lines 45-51: +task 4, lines 45-51: +//# programmable --sender A --inputs @A +//> 0: test::m1::cap(); +// Cup is not an object since Cap does not have store +//> 1: test::m1::cup(Result(0)); +//> TransferObjects([Result(1)], Input(0)); +// one object, one not Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(2) } } -task 5 'programmable'. lines 52-57: +task 5, lines 52-57: +//# programmable --sender A --inputs @A +//> 0: test::m1::new(); +//> 1: test::m1::cap(); +//> TransferObjects([Result(0), Result(1)], Input(0)); +// one object, one not (but sneaky) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(2) } } -task 6 'programmable'. lines 58-63: +task 6, lines 58-63: +//# programmable --sender A --inputs @A +//> 0: test::m1::new(); +//> 1: test::m1::cap(); +// Cup is not an object since Cap does not have store +//> 2: test::m1::cup(Result(0)); +//> TransferObjects([Result(0), Result(2)], Input(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(2) } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_invalid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_invalid.exp index 25cdcb13baff3..8c20bfed8d97e 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_invalid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_invalid.exp @@ -3,19 +3,37 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-24: +task 1, lines 8-24: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6604400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-31: +task 2, lines 26-31: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> 1: TransferObjects([Result(0)], Input(0)); +//> 2: test::m1::r(); +// unconsumed copyable value, and most recent usage was not by-value Error: Transaction Effects Status: Unused result without the drop ability. Command result 2, return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: UnusedValueWithoutDrop { result_idx: 2, secondary_idx: 0 }, source: None, command: None } } -task 3 'programmable'. lines 32-40: +task 3, lines 32-40: +//# programmable --sender A +//> 0: test::m1::copyable(); +//> 1: test::m1::borrow(Result(0)); +//> 2: test::m1::copy_(Result(0)); +//> 3: test::m1::borrow(Result(0)); +//> 4: test::m1::copy_(Result(0)); +//> 5: test::m1::borrow(Result(0)); +// unconsumed copyable value, and most recent usage was not by-value Error: Transaction Effects Status: Unused result without the drop ability. Command result 0, return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: UnusedValueWithoutDrop { result_idx: 0, secondary_idx: 0 }, source: Some("The value has copy, but not drop. Its last usage must be by-value so it can be taken."), command: None } } -task 4 'programmable'. lines 41-44: +task 4, lines 41-44: +//# programmable --sender A +//> 0: test::m1::copyable(); +//> 1: test::m1::cup(Result(0)); +//> 2: test::m1::destroy_cup(Result(1)); Error: Transaction Effects Status: Unused result without the drop ability. Command result 2, return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: UnusedValueWithoutDrop { result_idx: 2, secondary_idx: 0 }, source: Some("The value has copy, but not drop. Its last usage must be by-value so it can be taken."), command: None } } diff --git a/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_valid.exp b/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_valid.exp index de1d60fa19f8d..053a5b396a95b 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_valid.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable/unused_values_valid.exp @@ -3,24 +3,43 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 8-30: +task 1, lines 8-30: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7242800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 31-35: +task 2, lines 31-35: +//# programmable --sender A --inputs @A +//> 0: test::m1::r(); +//> TransferObjects([Result(0)], Input(0)) +// unused inputs and unused objects and unused results of various kinds created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 36-41: +task 3, lines 36-41: +//# programmable --sender A --inputs object(2,0) 0 vector[@0,@0] +//> 0: test::m1::droppable(); +//> 1: test::m1::droppable(); +//> 2: test::m1::cup(Result(0)); +// unconsumed copyable value, but most recent usage was by-value mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 4 'programmable'. lines 42-49: +task 4, lines 42-49: +//# programmable --sender A +//> 0: test::m1::copyable(); +//> 1: test::m1::borrow(Result(0)); +//> 2: test::m1::copy_(Result(0)); +//> 3: test::m1::borrow(Result(0)); +//> 4: test::m1::copy_(Result(0)); +// unused pure that was cast mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'programmable'. lines 50-51: +task 5, lines 50-51: +//# programmable --sender A --inputs 0 +//> test::m1::num_mut(Input(0)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/bad_syntax.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/bad_syntax.exp index d69ba7650e28e..99acb1e7845ec 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/bad_syntax.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/bad_syntax.exp @@ -1,7 +1,11 @@ processed 2 tasks -task 0 'programmable'. lines 4-5: +task 0, lines 4-5: +//# programmable +// > 0: SplitCoins(Gas, [Input(0)]); Error: Remove whitespace between // and > to start a command -task 1 'programmable'. lines 7-8: +task 1, lines 7-8: +//# programmable +//> 1: SplitCoins(Gas, [Input(0)]); Error: Actual command index of 0 does not match annotated index 1 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/coin_limit.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/coin_limit.exp index 11ad78e51cf6d..ba9f343a27d12 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/coin_limit.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/coin_limit.exp @@ -3,17 +3,22 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 6-25: +task 1, lines 6-25: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6650000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-29: +task 2, lines 26-29: +//# programmable --sender A --inputs 100 --gas-budget 10000000000 +//> 0: SplitCoins(Gas, [Input(0)]); // split the coin as a limit +//> 1: test::m1::purchase(Result(0)); created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3260400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 31-31: +task 3, line 31: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 2 Contents: sui::coin::Coin { @@ -27,7 +32,8 @@ Contents: sui::coin::Coin { }, } -task 4 'view-object'. lines 33-35: +task 4, lines 33-35: +//# view-object 2,1 Owner: Account Address ( A ) Version: 2 Contents: test::m1::CoolMarker { @@ -38,16 +44,26 @@ Contents: test::m1::CoolMarker { }, } -task 5 'programmable'. lines 36-41: +task 5, lines 36-41: +//# programmable --sender A --inputs 100 --gas-budget 10000000000 +//> 0: SplitCoins(Gas, [Input(0)]); /* split the coin as a limit */ +//> 1: test::m1::purchase_(Result(0)); +// call a non-entry function, and transfer the object Error: Transaction Effects Status: Unused result without the drop ability. Command result 1, return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: UnusedValueWithoutDrop { result_idx: 1, secondary_idx: 0 }, source: None, command: None } } -task 6 'programmable'. lines 42-47: +task 6, lines 42-47: +//# programmable --sender A --inputs 100 @A --gas-budget 10000000000 +//> 0: SplitCoins(Gas, [Input(0), Input(0)]); /* /* nested */*/ +//> 1: test::m1::purchase_(NestedResult(0, 0)); +//> 2: test::m1::purchase_(NestedResult(0, 1)); +//> TransferObjects([Result(1), Result(2)], Input(1)); created: object(6,0), object(6,1), object(6,2), object(6,3) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5532800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 49-49: +task 7, line 49: +//# view-object 6,0 Owner: Account Address ( _ ) Version: 4 Contents: sui::coin::Coin { @@ -61,7 +77,8 @@ Contents: sui::coin::Coin { }, } -task 8 'view-object'. lines 51-51: +task 8, line 51: +//# view-object 6,1 Owner: Account Address ( _ ) Version: 4 Contents: sui::coin::Coin { @@ -75,7 +92,8 @@ Contents: sui::coin::Coin { }, } -task 9 'view-object'. lines 53-53: +task 9, line 53: +//# view-object 6,2 Owner: Account Address ( A ) Version: 4 Contents: test::m1::CoolMarker { @@ -86,7 +104,8 @@ Contents: test::m1::CoolMarker { }, } -task 10 'view-object'. lines 55-55: +task 10, line 55: +//# view-object 6,3 Owner: Account Address ( A ) Version: 4 Contents: test::m1::CoolMarker { diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec.exp index ce9e5281083e6..cf534fdd6fcf0 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec.exp @@ -3,27 +3,55 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-49: +task 1, lines 6-49: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8732400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 51-57: +task 2, lines 51-57: +//# programmable --inputs 112u64 +// vector +//> 0: MakeMoveVec([Input(0), Input(0)]); +//> 1: test::m1::vec_u64(Result(0)); +// vector> +//> 2: MakeMoveVec>([Result(0), Result(0)]); +//> 3: test::m1::vec_vec_u64(Result(2)); mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 59-65: +task 3, lines 59-65: +//# programmable --inputs vector[226u8,157u8,164u8,239u8,184u8,143u8] +// vector +//> 0: MakeMoveVec([Input(0), Input(0)]); +//> 1: test::m1::vec_string(Result(0)); +// vector> +//> 2: MakeMoveVec>([Result(0), Result(0)]); +//> 3: test::m1::vec_vec_string(Result(2)); mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'programmable'. lines 67-70: +task 4, lines 67-70: +//# programmable --inputs vector[vector[226u8,157u8,164u8,239u8,184u8,143u8]] vector[] +// Option +//> 0: MakeMoveVec>([Input(0), Input(1)]); +//> 1: test::m1::vec_option_string(Result(0)); mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'programmable'. lines 72-75: +task 5, lines 72-75: +//# programmable --inputs vector[255u8,157u8,164u8,239u8,184u8,143u8] +// INVALID string ^^^ modified the bytes to make an invalid UTF8 string +//> 0: MakeMoveVec([Input(0), Input(0)]); +//> 1: test::m1::vec_string(Result(0)); Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidBCSBytes }, source: Some("Function expects std::string::String but provided argument's value does not match"), command: Some(0) } } -task 6 'programmable'. lines 77-81: +task 6, lines 77-81: +//# programmable --sender A +//> 0: test::m1::marker(); +//> 1: test::m1::marker(); +//> 2: MakeMoveVec([Result(0), Result(1)]); +//> 3: test::m1::burn_markers(Result(2)); mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec_shared.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec_shared.exp index fafa552b1aaaf..56d2e665278e0 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec_shared.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/make_vec_shared.exp @@ -3,17 +3,20 @@ processed 5 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-29: +task 1, lines 8-29: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6034400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run t2::o2::create created: object(2,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 33-33: +task 3, line 33: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -24,7 +27,10 @@ Contents: t2::o2::Obj2 { }, } -task 4 'programmable'. lines 35-37: +task 4, lines 35-37: +//# programmable --sender A --inputs object(2,0) +//> 0: MakeMoveVec([Input(0)]); +//> t2::o2::consume(Result(0)) mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 1226412, non_refundable_storage_fee: 12388 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared.exp index 9985e5561af61..b41f94500d125 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared.exp @@ -3,17 +3,20 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-26: +task 1, lines 8-26: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5198400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 28-28: +task 2, line 28: +//# run test::m1::mint_shared created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2287600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 30-30: +task 3, line 30: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: test::m1::Coin { @@ -25,6 +28,8 @@ Contents: test::m1::Coin { value: 1000000u64, } -task 4 'programmable'. lines 32-33: +task 4, lines 32-33: +//# programmable --sender A --inputs object(2,0) +//> MergeCoins(Gas, [Input(0)]) Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Debug of error: CommandArgumentError { arg_idx: 1, kind: TypeMismatch } at command Some(0) diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared_real_coin.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared_real_coin.exp index 9888ee15d388f..a05faa6ba487e 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared_real_coin.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/merge_coin_shared_real_coin.exp @@ -3,17 +3,20 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-17: +task 1, lines 8-17: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4810800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 19-19: +task 2, line 19: +//# run test::m1::mint_shared created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 21-21: +task 3, line 21: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: sui::coin::Coin { @@ -27,7 +30,9 @@ Contents: sui::coin::Coin { }, } -task 4 'programmable'. lines 23-24: +task 4, lines 23-24: +//# programmable --sender A --inputs object(2,0) +//> MergeCoins(Gas, [Input(0)]) mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/publish.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/publish.exp index b4021cac1a932..dd0b24aa2f8a8 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/publish.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/publish.exp @@ -3,20 +3,31 @@ processed 9 tasks init: A: object(0,0) -task 3 'programmable'. lines 27-32: +task 3, lines 27-32: +//# programmable --sender A --inputs 10 @A +//> 0: SplitCoins(Gas, [Input(0)]); +//> 1: Publish(q, []); +//> 2: TransferObjects([Result(0)], Input(1)); +//> 3: Publish(p, []); +//> TransferObjects([Result(1), Result(3)], Input(1)) created: object(3,0), object(3,1), object(3,2), object(3,3), object(3,4) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 8876800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 6 'programmable'. lines 38-40: +task 6, lines 38-40: +//# programmable --sender A +//> 0: q::m::x(); +//> p::m::foo(Result(0)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'publish'. lines 42-47: +task 7, lines 42-47: +//# publish --dependencies p q created: object(7,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5221200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 8 'run'. lines 49-49: +task 8, line 49: +//# run r::all::foo_x mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/receipt.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/receipt.exp index 4f5407e8d9b0c..8d27d07ea3be9 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/receipt.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/receipt.exp @@ -1,16 +1,22 @@ processed 4 tasks -task 1 'publish'. lines 6-23: +task 1, lines 6-23: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6224400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 25-29: +task 2, lines 25-29: +//# programmable +//> 0: test::m1::prologue(); +//> test::m1::execute(Result(0)); +//> test::m1::epilogue(Result(0)); created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2249600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 31-31: +task 3, line 31: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: test::m1::Witness { diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/split_coin_share.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/split_coin_share.exp index 96c32e249b333..6e659f486edf5 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/split_coin_share.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/split_coin_share.exp @@ -3,27 +3,36 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 6-18: +task 1, lines 6-18: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4993200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 20-22: +task 2, lines 20-22: +//# programmable --sender A --inputs 10 +//> 0: SplitCoins(Gas, [Input(0)]); +//> 1: sui::transfer::public_share_object>(Result(0)); created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'programmable'. lines 24-26: +task 3, lines 24-26: +//# programmable --sender A --inputs 10 +//> 0: SplitCoins(Gas, [Input(0)]); +//> 1: p::m::sharer>(Result(0)); created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 28-28: +task 4, line 28: +//# run p::m::mint_shared created: object(4,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'view-object'. lines 30-32: +task 5, lines 30-32: +//# view-object 4,0 Owner: Shared( 3 ) Version: 3 Contents: sui::coin::Coin { @@ -37,11 +46,19 @@ Contents: sui::coin::Coin { }, } -task 6 'programmable'. lines 33-37: +task 6, lines 33-37: +//# programmable --sender A --inputs 0 object(4,0) @A +//> 0: SplitCoins(Input(1), [Input(0)]); +//> 1: TransferObjects([Result(0)], Input(2)); +// This is not OK -- split off from a shared object and transfer shared object created: object(6,0) mutated: object(0,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 7 'programmable'. lines 38-41: +task 7, lines 38-41: +//# programmable --sender A --inputs 0 object(4,0) @A +//> 0: SplitCoins(Input(1), [Input(0)]); +//> 1: TransferObjects([Result(0)], Input(2)); +//> 2: TransferObjects([Input(1)], Input(2)); Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/transfer_shared.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/transfer_shared.exp index ed38ee01e69dc..676a73d2d0c75 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/transfer_shared.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/transfer_shared.exp @@ -3,17 +3,20 @@ processed 5 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-22: +task 1, lines 8-22: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5031200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 24-24: +task 2, line 24: +//# run t2::o2::create created: object(2,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 26-26: +task 3, line 26: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -24,6 +27,8 @@ Contents: t2::o2::Obj2 { }, } -task 4 'programmable'. lines 28-29: +task 4, lines 28-29: +//# programmable --sender A --inputs object(2,0) @B +//> TransferObjects([Input(0)], Input(1)) Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/upgrade.exp b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/upgrade.exp index ae6251ac9be31..95e036b36e049 100644 --- a/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/upgrade.exp +++ b/crates/sui-adapter-transactional-tests/tests/programmable_transaction_examples/upgrade.exp @@ -3,39 +3,56 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 8-18: +task 1, lines 8-18: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4354800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'publish'. lines 20-23: +task 2, lines 20-23: +//# publish --upgradeable --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5076800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'publish'. lines 25-28: +task 3, lines 25-28: +//# publish created: object(3,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3442800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'programmable'. lines 36-41: +task 5, lines 36-41: +//# programmable --sender A --inputs 10 @A object(2,1) 0u8 digest(q_2) +//> 0: sui::package::authorize_upgrade(Input(2), Input(3), Input(4)); +//> 1: SplitCoins(Gas, [Input(0)]); +//> 2: Upgrade(q_2, [sui,std,r], q, Result(0)); +//> TransferObjects([Result(1)], Input(1)); +//> sui::package::commit_upgrade(Input(2), Result(2)) created: object(5,0), object(5,1) mutated: object(0,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 7052800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'programmable'. lines 43-45: +task 6, lines 43-45: +//# programmable --sender A +//> 0: q::m::x(); +//> p::m::foo(Result(0)) Error: Transaction Effects Status: Move Runtime Abort. Location: p::n::bar (function index 0) at offset 6, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: p, name: Identifier("n") }, function: 0, instruction: 6, function_name: Some("bar") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("p::n::bar at offset 6"), exec_state: None, location: Module(ModuleId { address: p, name: Identifier("n") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 6)] }), command: Some(1) } } -task 8 'programmable'. lines 49-51: +task 8, lines 49-51: +//# programmable --sender A +//> 0: q_2::m::x(); +//> p::m::foo(Result(0)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'publish'. lines 53-58: +task 9, lines 53-58: +//# publish --dependencies p q_2 r created: object(9,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5768400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'run'. lines 60-60: +task 10, line 60: +//# run s::all::foo_x mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/publish/init.exp b/crates/sui-adapter-transactional-tests/tests/publish/init.exp index 5899be700def0..e4335f95b93dc 100644 --- a/crates/sui-adapter-transactional-tests/tests/publish/init.exp +++ b/crates/sui-adapter-transactional-tests/tests/publish/init.exp @@ -1,11 +1,13 @@ processed 4 tasks -task 1 'publish'. lines 6-19: +task 1, lines 6-19: +//# publish created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6642400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 21-21: +task 2, line 21: +//# view-object 1,1 Owner: Account Address ( _ ) Version: 2 Contents: Test::M1::Object { @@ -17,5 +19,6 @@ Contents: Test::M1::Object { value: 42u64, } -task 3 'view-object'. lines 23-23: +task 3, line 23: +//# view-object 1,0 1,0::M1 diff --git a/crates/sui-adapter-transactional-tests/tests/publish/init_param.exp b/crates/sui-adapter-transactional-tests/tests/publish/init_param.exp index 8fdabd2f78f77..3bcffdff4c31b 100644 --- a/crates/sui-adapter-transactional-tests/tests/publish/init_param.exp +++ b/crates/sui-adapter-transactional-tests/tests/publish/init_param.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 5-27: +task 1, lines 5-27: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last parameter for _::M1::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext, but found &mut sui::tx_context::TxContext"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/publish/init_public.exp b/crates/sui-adapter-transactional-tests/tests/publish/init_public.exp index 2d35bee0c04f2..129504d613ce5 100644 --- a/crates/sui-adapter-transactional-tests/tests/publish/init_public.exp +++ b/crates/sui-adapter-transactional-tests/tests/publish/init_public.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 5-27: +task 1, lines 5-27: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::M1. 'init' function must be private"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/publish/init_ret.exp b/crates/sui-adapter-transactional-tests/tests/publish/init_ret.exp index bca6b63f25cf5..fb241d82367db 100644 --- a/crates/sui-adapter-transactional-tests/tests/publish/init_ret.exp +++ b/crates/sui-adapter-transactional-tests/tests/publish/init_ret.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 5-27: +task 1, lines 5-27: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::M1, 'init' function cannot have return values"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/publish/multi_module_publish.exp b/crates/sui-adapter-transactional-tests/tests/publish/multi_module_publish.exp index de747ee98fcaa..fb233ebdf5dc1 100644 --- a/crates/sui-adapter-transactional-tests/tests/publish/multi_module_publish.exp +++ b/crates/sui-adapter-transactional-tests/tests/publish/multi_module_publish.exp @@ -1,9 +1,11 @@ processed 3 tasks -task 1 'publish'. lines 6-13: +task 1, lines 6-13: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5046400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 15-15: +task 2, line 15: +//# view-object 1,0 1,0::{M1, M2} diff --git a/crates/sui-adapter-transactional-tests/tests/publish/publish_with_upgrade.exp b/crates/sui-adapter-transactional-tests/tests/publish/publish_with_upgrade.exp index 828da25ec2b4c..15c3d17668f3f 100644 --- a/crates/sui-adapter-transactional-tests/tests/publish/publish_with_upgrade.exp +++ b/crates/sui-adapter-transactional-tests/tests/publish/publish_with_upgrade.exp @@ -1,11 +1,13 @@ processed 3 tasks -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5532800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 11-11: +task 2, line 11: +//# view-object 1,1 Owner: Account Address ( _ ) Version: 2 Contents: sui::package::UpgradeCap { diff --git a/crates/sui-adapter-transactional-tests/tests/random/happy_flows.exp b/crates/sui-adapter-transactional-tests/tests/random/happy_flows.exp index 0dc3cc0ed1e78..61942028c3710 100644 --- a/crates/sui-adapter-transactional-tests/tests/random/happy_flows.exp +++ b/crates/sui-adapter-transactional-tests/tests/random/happy_flows.exp @@ -3,38 +3,64 @@ processed 8 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 6-25: +task 1, lines 6-25: +//# publish --sender A created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6209200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 26-29: +task 2, lines 26-29: +//# programmable --sender A --inputs immshared(8) +//> test::random::use_random(Input(0)); +// Good tx - use Clock and then Random mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000008 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 30-34: +task 3, lines 30-34: +//# programmable --sender A --inputs immshared(6) immshared(8) @A +//> test::random::use_clock(Input(0)); +//> test::random::use_random(Input(1)); +// Good tx - use value and then Random mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000006, 0x0000000000000000000000000000000000000000000000000000000000000008 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'programmable'. lines 35-39: +task 4, lines 35-39: +//# programmable --sender A --inputs 10 immshared(8) @A +//> test::random::use_value(Input(0)); +//> test::random::use_random(Input(1)); +// Good tx - use Clock, then Random, then transfer mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000008 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'programmable'. lines 40-46: +task 5, lines 40-46: +//# programmable --sender A --inputs 10 immshared(6) immshared(8) @B +//> SplitCoins(Gas, [Input(0)]); +//> test::random::use_clock(Input(1)); +//> test::random::use_random(Input(2)); +//> TransferObjects([Result(0)], Input(3)); +// Good tx - use Clock, then Random, then merge created: object(5,0) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000006, 0x0000000000000000000000000000000000000000000000000000000000000008 gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'programmable'. lines 47-53: +task 6, lines 47-53: +//# programmable --sender A --inputs 10 immshared(6) immshared(8) @B +//> SplitCoins(Gas, [Input(0)]); +//> test::random::use_clock(Input(1)); +//> test::random::use_random(Input(2)); +//> MergeCoins(Gas, [Result(0)]); +// Good tx - use Random twice in the same call mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000006, 0x0000000000000000000000000000000000000000000000000000000000000008 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'programmable'. lines 54-55: +task 7, lines 54-55: +//# programmable --sender A --inputs immshared(8) +//> test::random::use_random_twice(Input(0), Input(0)); mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000008 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random.exp b/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random.exp index 7ae9807f095e3..272f1039c9dbf 100644 --- a/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random.exp +++ b/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random.exp @@ -3,10 +3,14 @@ processed 3 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 6-15: +task 1, lines 6-15: +//# publish --sender A created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4240800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 16-18: +task 2, lines 16-18: +//# programmable --sender A --inputs immshared(8) immshared(6) @A +//> test::random::use_random(Input(0)); +//> test::random::use_clock(Input(1)) Error: Error checking transaction input objects: PostRandomCommandRestrictions diff --git a/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random_and_transfer.exp b/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random_and_transfer.exp index 19c06b65a918a..c1c8aa03e5c5f 100644 --- a/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random_and_transfer.exp +++ b/crates/sui-adapter-transactional-tests/tests/random/move_call_clock_after_random_and_transfer.exp @@ -3,10 +3,16 @@ processed 3 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 6-15: +task 1, lines 6-15: +//# publish --sender A created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4240800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 16-20: +task 2, lines 16-20: +//# programmable --sender A --inputs 10 immshared(8) immshared(6) @B +//> SplitCoins(Gas, [Input(0)]); +//> test::random::use_random(Input(1)); +//> TransferObjects([Result(0)], Input(3)); +//> test::random::use_clock(Input(0)) Error: Error checking transaction input objects: PostRandomCommandRestrictions diff --git a/crates/sui-adapter-transactional-tests/tests/random/move_call_u64_after_random.exp b/crates/sui-adapter-transactional-tests/tests/random/move_call_u64_after_random.exp index fed3b481b61a9..ad1c05f45d241 100644 --- a/crates/sui-adapter-transactional-tests/tests/random/move_call_u64_after_random.exp +++ b/crates/sui-adapter-transactional-tests/tests/random/move_call_u64_after_random.exp @@ -3,10 +3,14 @@ processed 3 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 6-14: +task 1, lines 6-14: +//# publish --sender A created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4081200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 15-17: +task 2, lines 15-17: +//# programmable --sender A --inputs 16 immshared(8) +//> test::random::use_random(Input(1)); +//> test::random::use_value(Input(0)) Error: Error checking transaction input objects: PostRandomCommandRestrictions diff --git a/crates/sui-adapter-transactional-tests/tests/random/two_move_calls_with_random.exp b/crates/sui-adapter-transactional-tests/tests/random/two_move_calls_with_random.exp index 7f83c1dd1b565..963c3269eb376 100644 --- a/crates/sui-adapter-transactional-tests/tests/random/two_move_calls_with_random.exp +++ b/crates/sui-adapter-transactional-tests/tests/random/two_move_calls_with_random.exp @@ -3,10 +3,14 @@ processed 3 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 6-13: +task 1, lines 6-13: +//# publish --sender A created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3898800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 14-16: +task 2, lines 14-16: +//# programmable --sender A --inputs immshared(8) @A +//> test::random::use_random(Input(0)); +//> test::random::use_random(Input(0)); Error: Error checking transaction input objects: PostRandomCommandRestrictions diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/basic_receive.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/basic_receive.exp index d9bc7f3ec010f..934582fc6745b 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/basic_receive.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/basic_receive.exp @@ -1,16 +1,19 @@ processed 9 tasks -task 1 'publish'. lines 6-30: +task 1, lines 6-30: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6923600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 32-32: +task 2, line 32: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 34-34: +task 3, line 34: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 36-38: +task 4, lines 36-38: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,11 +36,13 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 39-39: +task 5, line 39: +//# run tto::M1::receiver --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'view-object'. lines 41-41: +task 6, line 41: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -47,7 +53,8 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 43-45: +task 7, lines 43-45: +//# view-object 2,1 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::B { @@ -58,6 +65,7 @@ Contents: tto::M1::B { }, } -task 8 'run'. lines 46-46: +task 8, line 46: +//# run tto::M1::receiver --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3), source: Some(VMError { major_status: ABORTED, sub_status: Some(3), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/drop_receiving.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/drop_receiving.exp index 3826a2a6b6de3..a3d8d972883c8 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/drop_receiving.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/drop_receiving.exp @@ -1,23 +1,34 @@ processed 6 tasks -task 1 'publish'. lines 6-34: +task 1, lines 6-34: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7144000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 36-36: +task 2, line 36: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 38-41: +task 3, lines 38-41: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::send_back(Input(0), Input(1)) +// Include the receiving argument, but don't use it at the PTB level mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 4 'programmable'. lines 42-46: +task 4, lines 42-46: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::nop(Input(0)) +// Include the receiving argument, but don't use it at the Move level. The +// receiving object should not be mutated by this. mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 5 'programmable'. lines 47-48: +task 5, lines 47-48: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::nop_with_receiver(Input(0), Input(1)) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/duplicate_receive_argument.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/duplicate_receive_argument.exp index 76734f173e7c8..716362a2af559 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/duplicate_receive_argument.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/duplicate_receive_argument.exp @@ -1,21 +1,31 @@ processed 6 tasks -task 1 'publish'. lines 6-31: +task 1, lines 6-31: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6756400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-33: +task 2, line 33: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 35-38: +task 3, lines 35-38: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::send_back(Input(0), Input(1)) +// Duplicate object ref in input mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 4 'programmable'. lines 39-42: +task 4, lines 39-42: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,1) +//> tto::M1::send_back(Input(0), Input(1)) +// Invalid signature for the receiving object since we try to use it as a normal input Error: Error checking transaction input objects: DuplicateObjectRefInput -task 5 'programmable'. lines 43-44: +task 5, lines 43-44: +//# programmable --inputs object(2,1) receiving(2,1) +//> tto::M1::send_back(Input(0), Input(1)) Error: Error checking transaction input objects: IncorrectUserSignature { error: "Object object(2,1) is owned by account address object(2,0), but given owner/signer address is 0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/move_vec_receiving_types.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/move_vec_receiving_types.exp index 3c9292e911421..13c14b77e9f3c 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/move_vec_receiving_types.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/move_vec_receiving_types.exp @@ -1,16 +1,19 @@ processed 14 tasks -task 1 'publish'. lines 6-63: +task 1, lines 6-63: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10579200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 65-65: +task 2, line 65: +//# run tto::M1::start created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 67-67: +task 3, line 67: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 69-69: +task 4, line 69: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,7 +36,8 @@ Contents: tto::M1::B { }, } -task 5 'view-object'. lines 71-71: +task 5, line 71: +//# view-object 2,2 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -43,7 +48,8 @@ Contents: tto::M1::B { }, } -task 6 'view-object'. lines 73-73: +task 6, line 73: +//# view-object 2,3 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::C { @@ -54,7 +60,8 @@ Contents: tto::M1::C { }, } -task 7 'view-object'. lines 75-77: +task 7, lines 75-77: +//# view-object 2,4 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::C { @@ -65,26 +72,49 @@ Contents: tto::M1::C { }, } -task 8 'programmable'. lines 78-81: +task 8, lines 78-81: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +// As long as you don't load the object the type will not be checked. mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 9 'programmable'. lines 82-86: +task 9, lines 82-86: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_none(Result(0)); +// Try to pass the wrong-type move vec to the function mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 10 'programmable'. lines 87-92: +task 10, lines 87-92: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_none_a(Result(0)); +// If you try to receive an object at the wrong type, it will fail +// E_RECEIVING_TYPE_MISMATCH Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 11 'programmable'. lines 93-97: +task 11, lines 93-97: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_all(Input(0), Result(0)); +// Try to spoof a receiving object Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(1) } } -task 12 'programmable'. lines 98-100: +task 12, lines 98-100: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: tto::M1::make_recv_spoof_b(); +//> 1: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4), Result(0)]); Error: Transaction Effects Status: Invalid command argument at 4. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 4, kind: TypeMismatch }, source: None, command: Some(1) } } -task 13 'programmable'. lines 102-105: +task 13, lines 102-105: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: tto::M1::make_recv_spoof_b(); +//> 1: tto::M1::spoof_bytes(Result(0)); +//> 2: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4), Result(1)]); Error: Transaction Effects Status: Invalid command argument at 4. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 4, kind: TypeMismatch }, source: None, command: Some(2) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_immut_then_reuse.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_immut_then_reuse.exp index 1a5445a995ffe..1f729bcd7385a 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_immut_then_reuse.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_immut_then_reuse.exp @@ -1,16 +1,19 @@ processed 6 tasks -task 1 'publish'. lines 6-32: +task 1, lines 6-32: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7174400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-34: +task 2, line 34: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 36-36: +task 3, line 36: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 38-40: +task 4, lines 38-40: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,6 +36,9 @@ Contents: tto::M1::B { }, } -task 5 'programmable'. lines 41-43: +task 5, lines 41-43: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::pass_through(Input(1)); +//> tto::M1::receiver(Input(0), Input(1)); mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_mut_then_reuse.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_mut_then_reuse.exp index 1a5445a995ffe..1f729bcd7385a 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_mut_then_reuse.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/pass_receiver_mut_then_reuse.exp @@ -1,16 +1,19 @@ processed 6 tasks -task 1 'publish'. lines 6-32: +task 1, lines 6-32: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7174400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-34: +task 2, line 34: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 36-36: +task 3, line 36: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 38-40: +task 4, lines 38-40: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,6 +36,9 @@ Contents: tto::M1::B { }, } -task 5 'programmable'. lines 41-43: +task 5, lines 41-43: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::pass_through(Input(1)); +//> tto::M1::receiver(Input(0), Input(1)); mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/pt_receive_type_fixing.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/pt_receive_type_fixing.exp index ad65e5001c92a..787a8b9771880 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/pt_receive_type_fixing.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/pt_receive_type_fixing.exp @@ -1,16 +1,19 @@ processed 13 tasks -task 1 'publish'. lines 6-50: +task 1, lines 6-50: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 8937600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 52-52: +task 2, line 52: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 54-54: +task 3, line 54: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 56-59: +task 4, lines 56-59: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,34 +36,63 @@ Contents: tto::M1::B { }, } -task 5 'programmable'. lines 60-62: +task 5, lines 60-62: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: tto::M1::pass_through(Input(1)); +//> tto::M1::receiver(Input(0), Result(0)); mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'programmable'. lines 64-66: +task 6, lines 64-66: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: tto::M1::pass_through_a(Input(1)); +//> tto::M1::receiver(Input(0), Result(0)); Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(1) } } -task 7 'programmable'. lines 68-70: +task 7, lines 68-70: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: tto::M1::pass_through_mut_ref_a(Input(1)); +//> tto::M1::receiver(Input(0), Input(1)); Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(1) } } -task 8 'programmable'. lines 72-76: +task 8, lines 72-76: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: tto::M1::pass_through_ref_a(Input(1)); +//> tto::M1::receiver(Input(0), Input(1)); +// make vec, then unpack it and make sure the type is fixed Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(1) } } -task 9 'programmable'. lines 77-79: +task 9, lines 77-79: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: MakeMoveVec>([Input(1)]); +//> 1: tto::M1::unpacker_b(Result(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } -task 10 'programmable'. lines 81-86: +task 10, lines 81-86: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: MakeMoveVec>([Input(1)]); +//> 1: tto::M1::unpacker_a(Result(0)); +//> 2: tto::M1::receiver(Input(0), Result(1)); +// This is fine since we are going A -> A in the unpack. But we should fail the call. Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(2) } } -task 11 'programmable'. lines 87-92: +task 11, lines 87-92: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: MakeMoveVec>([Input(1)]); +//> 1: tto::M1::unpacker_generic(Result(0)); +//> 2: tto::M1::receiver(Input(0), Result(1)); +// This should fail since we're going A -> B in the unpack. Error: Transaction Effects Status: Invalid command argument at 1. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: TypeMismatch }, source: None, command: Some(2) } } -task 12 'programmable'. lines 93-95: +task 12, lines 93-95: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: MakeMoveVec>([Input(1)]); +//> 1: tto::M1::unpacker_generic(Result(0)); Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_add_dof_and_mutate.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_add_dof_and_mutate.exp index 3bf47300ba096..3bc38cd74bc2e 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_add_dof_and_mutate.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_add_dof_and_mutate.exp @@ -3,17 +3,20 @@ processed 11 tasks init: A: object(0,0) -task 1 'publish'. lines 6-36: +task 1, lines 6-36: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7835600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 38-38: +task 2, line 38: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3541600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 40-40: +task 3, line 40: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -25,7 +28,8 @@ Contents: tto::M1::A { value: 0u64, } -task 4 'view-object'. lines 42-42: +task 4, line 42: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::A { @@ -37,12 +41,14 @@ Contents: tto::M1::A { value: 0u64, } -task 5 'run'. lines 44-44: +task 5, line 44: +//# run tto::M1::receive --args object(2,0) receiving(2,1) created: object(5,0), object(5,1), object(5,2) mutated: object(0,1), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 9728000, storage_rebate: 3506184, non_refundable_storage_fee: 35416 -task 6 'view-object'. lines 46-46: +task 6, line 46: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -54,7 +60,8 @@ Contents: tto::M1::A { value: 0u64, } -task 7 'view-object'. lines 48-48: +task 7, line 48: +//# view-object 2,1 Owner: Object ID: ( fake(5,0) ) Version: 4 Contents: tto::M1::A { @@ -66,7 +73,8 @@ Contents: tto::M1::A { value: 100u64, } -task 8 'view-object'. lines 50-50: +task 8, line 50: +//# view-object 5,0 Owner: Object ID: ( fake(2,0) ) Version: 4 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -83,7 +91,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 9 'view-object'. lines 52-52: +task 9, line 52: +//# view-object 5,1 Owner: Object ID: ( fake(2,1) ) Version: 4 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -100,7 +109,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 10 'view-object'. lines 54-54: +task 10, line 54: +//# view-object 5,2 Owner: Object ID: ( fake(5,1) ) Version: 4 Contents: tto::M1::A { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_abort.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_abort.exp index cddaf0b318706..f96bc792edc7d 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_abort.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_abort.exp @@ -1,16 +1,19 @@ processed 8 tasks -task 1 'publish'. lines 6-30: +task 1, lines 6-30: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6688000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 32-32: +task 2, line 32: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 34-34: +task 3, line 34: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 36-38: +task 4, lines 36-38: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,11 +36,13 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 39-39: +task 5, line 39: +//# run tto::M1::receiver --args object(2,0) receiving(2,1) Error: Transaction Effects Status: Move Runtime Abort. Location: tto::M1::receiver (function index 1) at offset 6, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: tto, name: Identifier("M1") }, function: 1, instruction: 6, function_name: Some("receiver") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("tto::M1::receiver at offset 6"), exec_state: None, location: Module(ModuleId { address: tto, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 6)] }), command: Some(0) } } -task 6 'view-object'. lines 41-41: +task 6, line 41: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -47,7 +53,8 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 43-43: +task 7, line 43: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_deleted.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_deleted.exp index fc49b48586994..b75ff89b26162 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_deleted.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_deleted.exp @@ -1,16 +1,19 @@ processed 9 tasks -task 1 'publish'. lines 6-30: +task 1, lines 6-30: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6726000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 32-32: +task 2, line 32: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 34-34: +task 3, line 34: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 36-38: +task 4, lines 36-38: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,12 +36,14 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 39-39: +task 5, line 39: +//# run tto::M1::deleter --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0) deleted: object(2,1) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'view-object'. lines 41-41: +task 6, line 41: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -48,9 +54,11 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 43-45: +task 7, lines 43-45: +//# view-object 2,1 No object at id 2,1 -task 8 'run'. lines 46-46: +task 8, line 46: +//# run tto::M1::deleter --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3), source: Some(VMError { major_status: ABORTED, sub_status: Some(3), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_send_back.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_send_back.exp index c38a775ec028d..59daa19598d8c 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_send_back.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_send_back.exp @@ -1,16 +1,19 @@ processed 9 tasks -task 1 'publish'. lines 6-31: +task 1, lines 6-31: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6756400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-33: +task 2, line 33: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 35-35: +task 3, line 35: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 37-39: +task 4, lines 37-39: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,11 +36,13 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 40-40: +task 5, line 40: +//# run tto::M1::send_back --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'view-object'. lines 42-42: +task 6, line 42: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -47,7 +53,8 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 44-46: +task 7, lines 44-46: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 4 Contents: tto::M1::B { @@ -58,6 +65,7 @@ Contents: tto::M1::B { }, } -task 8 'run'. lines 47-47: +task 8, line 47: +//# run tto::M1::send_back --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3), source: Some(VMError { major_status: ABORTED, sub_status: Some(3), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_wrap.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_wrap.exp index d5e0265891ca2..586b87b0e6162 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_wrap.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_and_wrap.exp @@ -1,16 +1,19 @@ processed 9 tasks -task 1 'publish'. lines 6-39: +task 1, lines 6-39: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7569600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 41-41: +task 2, line 41: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 43-43: +task 3, line 43: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 45-47: +task 4, lines 45-47: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,13 +36,15 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 48-48: +task 5, line 48: +//# run tto::M1::wrapper --args object(2,0) receiving(2,1) created: object(5,0) mutated: object(0,0), object(2,0) wrapped: object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3708800, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'view-object'. lines 50-50: +task 6, line 50: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -49,9 +55,11 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 52-54: +task 7, lines 52-54: +//# view-object 2,1 No object at id 2,1 -task 8 'run'. lines 55-55: +task 8, line 55: +//# run tto::M1::wrapper --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3), source: Some(VMError { major_status: ABORTED, sub_status: Some(3), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_ref.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_ref.exp index 8b291179f8a80..cdcd47277d0e3 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_ref.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_ref.exp @@ -1,16 +1,19 @@ processed 18 tasks -task 1 'publish'. lines 6-39: +task 1, lines 6-39: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 9872400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 41-41: +task 2, line 41: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 43-43: +task 3, line 43: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 45-45: +task 4, line 45: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,54 +36,76 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 47-47: +task 5, line 47: +//# run tto::M1::call_mut_ref --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 6 'run'. lines 49-49: +task 6, line 49: +//# run tto::M1::call_immut_ref --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 7 'run'. lines 51-51: +task 7, line 51: +//# run tto::M1::call_mut_ref_ret --args object(2,0) receiving(2,1) Error: Transaction Effects Status: Invalid public Move function signature. Unsupported return type for return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidPublicFunctionReturnType { idx: 0 }, source: None, command: Some(0) } } -task 8 'run'. lines 53-53: +task 8, line 53: +//# run tto::M1::call_mut_ref_immut_ret --args object(2,0) receiving(2,1) Error: Transaction Effects Status: Invalid public Move function signature. Unsupported return type for return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidPublicFunctionReturnType { idx: 0 }, source: None, command: Some(0) } } -task 9 'programmable'. lines 55-56: +task 9, lines 55-56: +//# programmable --inputs receiving(2,1) +//> tto::M1::immut_immut_ref(Input(0), Input(0)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'programmable'. lines 58-59: +task 10, lines 58-59: +//# programmable --inputs receiving(2,1) +//> tto::M1::immut_mut_ref(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 11 'programmable'. lines 61-62: +task 11, lines 61-62: +//# programmable --inputs receiving(2,1) +//> tto::M1::mut_immut_ref(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 12 'programmable'. lines 64-65: +task 12, lines 64-65: +//# programmable --inputs receiving(2,1) +//> tto::M1::mut_mut_ref(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 13 'programmable'. lines 67-68: +task 13, lines 67-68: +//# programmable --inputs receiving(2,1) +//> tto::M1::take_mut_ref(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 14 'programmable'. lines 70-71: +task 14, lines 70-71: +//# programmable --inputs receiving(2,1) +//> tto::M1::take_immut_ref(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 15 'programmable'. lines 73-74: +task 15, lines 73-74: +//# programmable --inputs receiving(2,1) +//> tto::M1::immut_ref_take(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 16 'programmable'. lines 76-77: +task 16, lines 76-77: +//# programmable --inputs receiving(2,1) +//> tto::M1::mut_ref_take(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } -task 17 'programmable'. lines 79-80: +task 17, lines 79-80: +//# programmable --inputs receiving(2,1) +//> tto::M1::double_take(Input(0), Input(0)) Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_value_flow_through.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_value_flow_through.exp index cbf0a6e02ee7b..01404457212ef 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_value_flow_through.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_by_value_flow_through.exp @@ -1,16 +1,19 @@ processed 7 tasks -task 1 'publish'. lines 6-28: +task 1, lines 6-28: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6437200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 30-30: +task 2, line 30: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 32-32: +task 3, line 32: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 34-36: +task 4, lines 34-36: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,10 +36,12 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 37-39: +task 5, lines 37-39: +//# run tto::M1::flow --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 6 'run'. lines 40-40: +task 6, line 40: +//# run tto::M1::drop --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_dof_and_mutate.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_dof_and_mutate.exp index 31ae4b4efe1ec..8f633f1090925 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_dof_and_mutate.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_dof_and_mutate.exp @@ -3,17 +3,20 @@ processed 12 tasks init: A: object(0,0) -task 1 'publish'. lines 6-34: +task 1, lines 6-34: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7828000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 36-36: +task 2, line 36: +//# run tto::M1::start --sender A created: object(2,0), object(2,1), object(2,2), object(2,3) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7273200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 38-38: +task 3, line 38: +//# view-object 2,0 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -30,7 +33,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 4 'view-object'. lines 40-40: +task 4, line 40: +//# view-object 2,1 Owner: Account Address ( A ) Version: 2 Contents: tto::M1::A { @@ -42,7 +46,8 @@ Contents: tto::M1::A { value: 0u64, } -task 5 'view-object'. lines 42-42: +task 5, line 42: +//# view-object 2,2 Owner: Account Address ( fake(2,1) ) Version: 2 Contents: tto::M1::A { @@ -54,7 +59,8 @@ Contents: tto::M1::A { value: 0u64, } -task 6 'view-object'. lines 44-44: +task 6, line 44: +//# view-object 2,3 Owner: Object ID: ( fake(2,0) ) Version: 2 Contents: tto::M1::A { @@ -66,12 +72,14 @@ Contents: tto::M1::A { value: 0u64, } -task 7 'run'. lines 46-46: +task 7, line 46: +//# run tto::M1::receive --args object(2,1) receiving(2,2) --sender A created: object(7,0) mutated: object(0,0), object(2,1), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 5996400, storage_rebate: 3506184, non_refundable_storage_fee: 35416 -task 8 'view-object'. lines 48-48: +task 8, line 48: +//# view-object 2,0 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -88,7 +96,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 9 'view-object'. lines 50-50: +task 9, line 50: +//# view-object 2,1 Owner: Account Address ( A ) Version: 3 Contents: tto::M1::A { @@ -100,7 +109,8 @@ Contents: tto::M1::A { value: 0u64, } -task 10 'view-object'. lines 52-52: +task 10, line 52: +//# view-object 2,2 Owner: Object ID: ( fake(7,0) ) Version: 3 Contents: tto::M1::A { @@ -112,7 +122,8 @@ Contents: tto::M1::A { value: 100u64, } -task 11 'view-object'. lines 54-54: +task 11, line 54: +//# view-object 2,3 Owner: Object ID: ( fake(2,0) ) Version: 2 Contents: tto::M1::A { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_duo_struct.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_duo_struct.exp index 54483f0a757fd..056a3600c992d 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_duo_struct.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_duo_struct.exp @@ -1,16 +1,19 @@ processed 9 tasks -task 1 'publish'. lines 6-44: +task 1, lines 6-44: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 8071200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 46-46: +task 2, line 46: +//# run tto::M1::start created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4636000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 48-48: +task 3, line 48: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 50-50: +task 4, line 50: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,7 +36,8 @@ Contents: tto::M1::B { }, } -task 5 'view-object'. lines 52-54: +task 5, lines 52-54: +//# view-object 2,2 Owner: Account Address ( fake(2,1) ) Version: 3 Contents: tto::M1::B { @@ -43,13 +48,24 @@ Contents: tto::M1::B { }, } -task 6 'programmable'. lines 55-58: +task 6, lines 55-58: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) +//> 0: tto::M1::make_duo(Input(1), Input(2)) +// receive the objects and return them. Error since we need to do something with the returned objects mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 7 'programmable'. lines 59-63: +task 7, lines 59-63: +//# programmable --inputs object(2,0) receiving(2,2) receiving(2,2) +//> 0: tto::M1::make_duo(Input(1), Input(2)); +//> 1: tto::M1::receive_duo(Input(0), Result(0)); +// receive the objects and return them. Then Transfer them with TransferObjects Error: Error checking transaction input objects: DuplicateObjectRefInput -task 8 'programmable'. lines 64-67: +task 8, lines 64-67: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) @tto +//> 0: tto::M1::make_duo(Input(1), Input(2)); +//> 1: tto::M1::receive_duo(Input(0), Result(0)); +//> 2: TransferObjects([NestedResult(1, 0), NestedResult(1, 1)], Input(3)); mutated: object(0,0), object(2,0), object(2,1), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 4636000, storage_rebate: 4589640, non_refundable_storage_fee: 46360 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_param_ty.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_param_ty.exp index 6de3ebc36c5e5..9fbd9fc58681d 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_param_ty.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_param_ty.exp @@ -1,16 +1,19 @@ processed 15 tasks -task 1 'publish'. lines 6-41: +task 1, lines 6-41: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 8519600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 43-43: +task 2, line 43: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 45-45: +task 3, line 45: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 47-47: +task 4, line 47: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,41 +36,51 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 49-49: +task 5, line 49: +//# run tto::M1::receiver --args receiving(2,1) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 6 'run'. lines 51-51: +task 6, line 51: +//# run tto::M1::receiver2 --args receiving(2,1) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 7 'run'. lines 53-53: +task 7, line 53: +//# run tto::M1::receiver3 --args receiving(2,1) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 8 'run'. lines 55-55: +task 8, line 55: +//# run tto::M1::receiver4 --args receiving(2,1) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 9 'run'. lines 57-57: +task 9, line 57: +//# run tto::M1::receiver5 --args receiving(2,1) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 10 'run'. lines 59-59: +task 10, line 59: +//# run tto::M1::receiver6 --args object(2,1) Error: Error checking transaction input objects: IncorrectUserSignature { error: "Object object(2,1) is owned by account address object(2,0), but given owner/signer address is 0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" } -task 11 'run'. lines 61-61: +task 11, line 61: +//# run tto::M1::receiver6 --args object(2,0) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 12 'run'. lines 63-63: +task 12, line 63: +//# run tto::M1::receiver6 --args receiving(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 13 'run'. lines 65-65: +task 13, line 65: +//# run tto::M1::receiver6 --args 0 Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be instantiated from raw bytes Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidUsageOfPureArg }, source: Some("Non-primitive argument at index 0. If it is an object, it must be populated by an object"), command: Some(0) } } -task 14 'run'. lines 67-67: +task 14, line 67: +//# run tto::M1::receiver6 --args vector[0,0,0,0,0,0,0,0,0,0] Error: Transaction Effects Status: Invalid command argument at 0. The argument cannot be instantiated from raw bytes Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidUsageOfPureArg }, source: Some("Non-primitive argument at index 0. If it is an object, it must be populated by an object"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_type.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_type.exp index 4623a8daaf475..8ed5c294bdbe3 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_type.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_invalid_type.exp @@ -1,16 +1,19 @@ processed 6 tasks -task 1 'publish'. lines 6-30: +task 1, lines 6-30: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6923600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 32-32: +task 2, line 32: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 34-34: +task 3, line 34: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 36-38: +task 4, lines 36-38: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,6 +36,7 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 39-39: +task 5, line 39: +//# run tto::M1::receiver --args object(2,0) receiving(2,1) Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 2 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_many_move_vec.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_many_move_vec.exp index d3293a7fc69ff..d73bab23ec6ca 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_many_move_vec.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_many_move_vec.exp @@ -1,16 +1,19 @@ processed 22 tasks -task 1 'publish'. lines 6-77: +task 1, lines 6-77: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 11286000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 79-79: +task 2, line 79: +//# run tto::M1::start created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 81-81: +task 3, line 81: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 83-83: +task 4, line 83: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,7 +36,8 @@ Contents: tto::M1::B { }, } -task 5 'view-object'. lines 85-85: +task 5, line 85: +//# view-object 2,2 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -43,7 +48,8 @@ Contents: tto::M1::B { }, } -task 6 'view-object'. lines 87-87: +task 6, line 87: +//# view-object 2,3 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -54,7 +60,8 @@ Contents: tto::M1::B { }, } -task 7 'view-object'. lines 89-91: +task 7, lines 89-91: +//# view-object 2,4 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -65,43 +72,83 @@ Contents: tto::M1::B { }, } -task 8 'programmable'. lines 92-95: +task 8, lines 92-95: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +// Make the Move vec and pass, but never receive mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 9 'programmable'. lines 96-100: +task 9, lines 96-100: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_none(Input(0), Result(0)); +// Make the Move vec of receiving arguments and then receive all but the last. Only the ince we receive should be mutated mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 10 'programmable'. lines 101-105: +task 10, lines 101-105: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_all_but_last(Input(0), Result(0)); +// Make the Move vec of receiving arguments, pass to a function by immref, then later use the vec to receive all of them mutated: object(0,0), object(2,0), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 5852000, storage_rebate: 5793480, non_refundable_storage_fee: 58520 -task 11 'programmable'. lines 106-111: +task 11, lines 106-111: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_none_by_immref(Input(0), Result(0)); +//> 2: tto::M1::receive_all_send_back(Input(0), Result(0)); +// Make the Move vec of receiving arguments, pass to a function by mutref, then later use the vec to receive all of them mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 6997320, non_refundable_storage_fee: 70680 -task 12 'programmable'. lines 112-117: +task 12, lines 112-117: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_none_by_mutref(Input(0), Result(0)); +//> 2: tto::M1::receive_all_send_back(Input(0), Result(0)); +// Make the Move vec of receiving arguments, pass to a function by mutref and receive some mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 6997320, non_refundable_storage_fee: 70680 -task 13 'programmable'. lines 118-123: +task 13, lines 118-123: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_all_but_last_by_mut_ref(Input(0), Result(0)); +//> 2: tto::M1::receive_all_by_mut_ref(Input(0), Result(0)); +// Make the Move vec of receiving arguments, pass to a function by mutref, receive some, then pass by mutref again to receive the rest mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 6997320, non_refundable_storage_fee: 70680 -task 14 'programmable'. lines 124-129: +task 14, lines 124-129: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_all_but_last_by_mut_ref(Input(0), Result(0)); +//> 2: tto::M1::receive_all_by_mut_ref(Input(0), Result(0)); +// Make the Move vec of receiving arguments, pass to a function by mutref, receive some, then pass by value to receive the rest mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 6997320, non_refundable_storage_fee: 70680 -task 15 'programmable'. lines 130-135: +task 15, lines 130-135: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_all_but_last_by_mut_ref(Input(0), Result(0)); +//> 2: tto::M1::receive_all_send_back(Input(0), Result(0)); +// Make the Move vec of receiving arguments and then receive all of them mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 6997320, non_refundable_storage_fee: 70680 -task 16 'programmable'. lines 136-138: +task 16, lines 136-138: +//# programmable --inputs object(2,0) receiving(2,1) receiving(2,2) receiving(2,3) receiving(2,4) +//> 0: MakeMoveVec>([Input(1), Input(2), Input(3), Input(4)]); +//> 1: tto::M1::receive_all(Input(0), Result(0)); mutated: object(0,0), object(2,0), object(2,1), object(2,2), object(2,3), object(2,4) gas summary: computation_cost: 1000000, storage_cost: 7068000, storage_rebate: 6997320, non_refundable_storage_fee: 70680 -task 17 'view-object'. lines 140-140: +task 17, line 140: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 12 Contents: tto::M1::A { @@ -112,7 +159,8 @@ Contents: tto::M1::A { }, } -task 18 'view-object'. lines 142-142: +task 18, line 142: +//# view-object 2,1 Owner: Account Address ( _ ) Version: 12 Contents: tto::M1::B { @@ -123,7 +171,8 @@ Contents: tto::M1::B { }, } -task 19 'view-object'. lines 144-144: +task 19, line 144: +//# view-object 2,2 Owner: Account Address ( _ ) Version: 12 Contents: tto::M1::B { @@ -134,7 +183,8 @@ Contents: tto::M1::B { }, } -task 20 'view-object'. lines 146-146: +task 20, line 146: +//# view-object 2,3 Owner: Account Address ( _ ) Version: 12 Contents: tto::M1::B { @@ -145,7 +195,8 @@ Contents: tto::M1::B { }, } -task 21 'view-object'. lines 148-148: +task 21, line 148: +//# view-object 2,4 Owner: Account Address ( _ ) Version: 12 Contents: tto::M1::B { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_multiple_times_in_row.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_multiple_times_in_row.exp index 52c79f1f56518..ebf31c2bc7ff4 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_multiple_times_in_row.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_multiple_times_in_row.exp @@ -3,22 +3,26 @@ processed 13 tasks init: A: object(0,0) -task 1 'publish'. lines 6-36: +task 1, lines 6-36: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7007200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 38-38: +task 2, line 38: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 40-40: +task 3, line 40: +//# run tto::M1::middle --sender A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 4 'view-object'. lines 42-42: +task 4, line 42: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -29,7 +33,8 @@ Contents: tto::M1::A { }, } -task 5 'view-object'. lines 44-46: +task 5, lines 44-46: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -40,11 +45,13 @@ Contents: tto::M1::B { }, } -task 6 'run'. lines 47-47: +task 6, line 47: +//# run tto::M1::send_back --args object(2,0) receiving(2,1) mutated: object(0,1), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 7 'view-object'. lines 49-49: +task 7, line 49: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -55,7 +62,8 @@ Contents: tto::M1::A { }, } -task 8 'view-object'. lines 51-53: +task 8, lines 51-53: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 4 Contents: tto::M1::B { @@ -66,18 +74,22 @@ Contents: tto::M1::B { }, } -task 9 'run'. lines 54-56: +task 9, lines 54-56: +//# run tto::M1::send_back --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3), source: Some(VMError { major_status: ABORTED, sub_status: Some(3), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } -task 10 'run'. lines 57-59: +task 10, lines 57-59: +//# run tto::M1::send_back --args object(2,0) receiving(2,1)@4 mutated: object(0,1), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 11 'run'. lines 60-62: +task 11, lines 60-62: +//# run tto::M1::send_back --summarize --args object(3,0) receiving(2,1)@6 --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3), source: Some(VMError { major_status: ABORTED, sub_status: Some(3), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } -task 12 'run'. lines 63-63: +task 12, line 63: +//# run tto::M1::send_back --args object(2,0) receiving(2,1)@6 mutated: object(0,1), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_id.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_id.exp index a0df4b73d64e0..bb45b90872e15 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_id.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_id.exp @@ -1,16 +1,19 @@ processed 10 tasks -task 1 'publish'. lines 6-29: +task 1, lines 6-29: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6650000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 33-33: +task 3, line 33: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 35-35: +task 4, line 35: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,19 +36,25 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 37-37: +task 5, line 37: +//# run tto::M1::receiver --args receiving(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'programmable'. lines 39-40: +task 6, lines 39-40: +//# programmable --inputs receiving(2,1) +//> sui::transfer::receiving_object_id(Input(0)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'programmable'. lines 42-43: +task 7, lines 42-43: +//# programmable --inputs receiving(2,1) +//> tto::M1::receiver(Input(0)) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'view-object'. lines 45-45: +task 8, line 45: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -55,7 +65,8 @@ Contents: tto::M1::A { }, } -task 9 'view-object'. lines 47-47: +task 9, line 47: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_owner.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_owner.exp index 4cac97aebe9c8..21440e16e1345 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_owner.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_object_owner.exp @@ -3,17 +3,20 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 6-28: +task 1, lines 6-28: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6634800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 30-30: +task 2, line 30: +//# run tto::M1::start --sender A created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5996400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 32-32: +task 3, line 32: +//# view-object 2,0 Owner: Object ID: ( fake(2,2) ) Version: 2 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -30,7 +33,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 4 'view-object'. lines 34-34: +task 4, line 34: +//# view-object 2,1 Owner: Object ID: ( fake(2,0) ) Version: 2 Contents: tto::M1::A { @@ -42,7 +46,8 @@ Contents: tto::M1::A { value: 0u64, } -task 5 'view-object'. lines 36-38: +task 5, lines 36-38: +//# view-object 2,2 Owner: Account Address ( A ) Version: 2 Contents: tto::M1::A { @@ -54,8 +59,10 @@ Contents: tto::M1::A { value: 0u64, } -task 6 'run'. lines 39-41: +task 6, lines 39-41: +//# run tto::M1::receive --args object(2,2) receiving(2,1) --sender A Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,1), parent_id: object(2,0) } -task 7 'run'. lines 42-42: +task 7, line 42: +//# run tto::M1::receive --args object(2,2) receiving(2,0) --sender A Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,0), parent_id: object(2,2) } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_dont_touch.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_dont_touch.exp index bc67a6bdf8d7e..608c8fc0b3ac0 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_dont_touch.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_dont_touch.exp @@ -1,16 +1,19 @@ processed 8 tasks -task 1 'publish'. lines 6-29: +task 1, lines 6-29: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6604400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 33-33: +task 3, line 33: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 35-37: +task 4, lines 35-37: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,11 +36,14 @@ Contents: tto::M1::B { }, } -task 5 'programmable'. lines 38-39: +task 5, lines 38-39: +//# programmable --inputs object(2,0) receiving(2,1) +//> 0: tto::M1::receiver(Input(0), Input(1)) Error: Transaction Effects Status: Unused result without the drop ability. Command result 0, return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: UnusedValueWithoutDrop { result_idx: 0, secondary_idx: 0 }, source: None, command: None } } -task 6 'view-object'. lines 41-41: +task 6, line 41: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -47,7 +54,8 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 43-43: +task 7, line 43: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_then_transfer.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_then_transfer.exp index b366f3c05f38c..0b0a0e2b90abf 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_then_transfer.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_return_object_then_transfer.exp @@ -1,16 +1,19 @@ processed 8 tasks -task 1 'publish'. lines 6-29: +task 1, lines 6-29: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6604400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 33-33: +task 3, line 33: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 35-37: +task 4, lines 35-37: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,11 +36,15 @@ Contents: tto::M1::B { }, } -task 5 'programmable'. lines 38-40: +task 5, lines 38-40: +//# programmable --inputs object(2,0) receiving(2,1) @tto +//> 0: tto::M1::receiver(Input(0), Input(1)); +//> TransferObjects([Result(0)], Input(2)) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'view-object'. lines 42-42: +task 6, line 42: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::A { @@ -47,7 +55,8 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 44-44: +task 7, line 44: +//# view-object 2,1 Owner: Account Address ( tto ) Version: 4 Contents: tto::M1::B { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_ticket_coin_operations.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_ticket_coin_operations.exp index 56b0ab9332335..f41904e80793b 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/receive_ticket_coin_operations.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/receive_ticket_coin_operations.exp @@ -1,16 +1,19 @@ processed 11 tasks -task 1 'publish'. lines 6-23: +task 1, lines 6-23: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 25-25: +task 2, line 25: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 27-27: +task 3, line 27: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 29-31: +task 4, lines 29-31: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,23 +36,32 @@ Contents: tto::M1::B { }, } -task 5 'programmable'. lines 32-33: +task 5, lines 32-33: +//# programmable --inputs receiving(2,1) @tto +//> TransferObjects([Input(0)], Input(2)) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 6 'programmable'. lines 35-36: +task 6, lines 35-36: +//# programmable --inputs receiving(2,1) 10 +//> SplitCoins(Input(0), [Input(1)]) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 7 'programmable'. lines 38-39: +task 7, lines 38-39: +//# programmable --inputs object(2,0) receiving(2,1) +//> MergeCoins(Input(0), [Input(1)]) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: Some("Expected a coin but got an non coin object"), command: Some(0) } } -task 8 'programmable'. lines 41-42: +task 8, lines 41-42: +//# programmable --inputs object(2,0) receiving(2,1) +//> MergeCoins(Input(1), [Input(0)]) Error: Transaction Effects Status: Invalid command argument at 0. The type of the value does not match the expected type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: TypeMismatch }, source: None, command: Some(0) } } -task 9 'view-object'. lines 44-44: +task 9, line 44: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 7 Contents: tto::M1::A { @@ -59,7 +72,8 @@ Contents: tto::M1::A { }, } -task 10 'view-object'. lines 46-46: +task 10, line 46: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/basic_receive.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/basic_receive.exp index 2a1ecda7cdb0f..5d56c6f6257e1 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/basic_receive.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/basic_receive.exp @@ -1,16 +1,19 @@ processed 9 tasks -task 1 'publish'. lines 6-30: +task 1, lines 6-30: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6969200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 32-32: +task 2, line 32: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 34-34: +task 3, line 34: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 36-36: +task 4, line 36: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,11 +36,13 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 38-38: +task 5, line 38: +//# run tto::M1::receiver --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'view-object'. lines 40-40: +task 6, line 40: +//# view-object 2,0 Owner: Shared( 3 ) Version: 4 Contents: tto::M1::A { @@ -47,7 +53,8 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 42-42: +task 7, line 42: +//# view-object 2,1 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::B { @@ -58,6 +65,7 @@ Contents: tto::M1::B { }, } -task 8 'run'. lines 44-44: +task 8, line 44: +//# run tto::M1::receiver --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Debug of error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3) at command Some(0) diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/drop_receiving.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/drop_receiving.exp index bdafe3164f522..b37f04c5d00dc 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/drop_receiving.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/drop_receiving.exp @@ -1,23 +1,34 @@ processed 6 tasks -task 1 'publish'. lines 6-33: +task 1, lines 6-33: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7182000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 35-35: +task 2, line 35: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 37-40: +task 3, lines 37-40: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::send_back(Input(0), Input(1)) +// Include the receiving argument, but don't use it at the PTB level mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 4 'programmable'. lines 41-45: +task 4, lines 41-45: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::nop(Input(0)) +// Include the receiving argument, but don't use it at the Move level. The +// receiving object should not be mutated by this. mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 -task 5 'programmable'. lines 46-47: +task 5, lines 46-47: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::nop_with_receiver(Input(0), Input(1)) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 2181960, non_refundable_storage_fee: 22040 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_dof_and_mutate.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_dof_and_mutate.exp index bcbf7f73d3182..22e33c96bb349 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_dof_and_mutate.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_dof_and_mutate.exp @@ -3,17 +3,20 @@ processed 12 tasks init: A: object(0,0) -task 1 'publish'. lines 6-34: +task 1, lines 6-34: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7881200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 36-36: +task 2, line 36: +//# run tto::M1::start created: object(2,0), object(2,1), object(2,2), object(2,3) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7273200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 38-38: +task 3, line 38: +//# view-object 2,0 Owner: Object ID: ( fake(2,3) ) Version: 3 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -30,7 +33,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 4 'view-object'. lines 40-40: +task 4, line 40: +//# view-object 2,1 Owner: Shared( 3 ) Version: 3 Contents: tto::M1::A { @@ -42,7 +46,8 @@ Contents: tto::M1::A { value: 0u64, } -task 5 'view-object'. lines 42-42: +task 5, line 42: +//# view-object 2,2 Owner: Object ID: ( fake(2,0) ) Version: 3 Contents: tto::M1::A { @@ -54,7 +59,8 @@ Contents: tto::M1::A { value: 0u64, } -task 6 'view-object'. lines 44-44: +task 6, line 44: +//# view-object 2,3 Owner: Account Address ( fake(2,1) ) Version: 3 Contents: tto::M1::A { @@ -66,12 +72,14 @@ Contents: tto::M1::A { value: 0u64, } -task 7 'run'. lines 46-46: +task 7, line 46: +//# run tto::M1::receive --args object(2,1) receiving(2,3) created: object(7,0) mutated: object(0,1), object(2,1), object(2,3) gas summary: computation_cost: 1000000, storage_cost: 5996400, storage_rebate: 3506184, non_refundable_storage_fee: 35416 -task 8 'view-object'. lines 48-48: +task 8, line 48: +//# view-object 2,0 Owner: Object ID: ( fake(2,3) ) Version: 3 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -88,7 +96,8 @@ Contents: sui::dynamic_field::Field, sui }, } -task 9 'view-object'. lines 50-50: +task 9, line 50: +//# view-object 2,1 Owner: Shared( 3 ) Version: 4 Contents: tto::M1::A { @@ -100,7 +109,8 @@ Contents: tto::M1::A { value: 0u64, } -task 10 'view-object'. lines 52-52: +task 10, line 52: +//# view-object 2,2 Owner: Object ID: ( fake(2,0) ) Version: 3 Contents: tto::M1::A { @@ -112,7 +122,8 @@ Contents: tto::M1::A { value: 0u64, } -task 11 'view-object'. lines 54-54: +task 11, line 54: +//# view-object 2,3 Owner: Object ID: ( fake(7,0) ) Version: 4 Contents: tto::M1::A { diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_multiple_times_in_row.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_multiple_times_in_row.exp index fb800fcebf771..168123f8c1d15 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_multiple_times_in_row.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/receive_multiple_times_in_row.exp @@ -3,22 +3,26 @@ processed 13 tasks init: A: object(0,0) -task 1 'publish'. lines 6-37: +task 1, lines 6-37: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7182000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 39-39: +task 2, line 39: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 41-41: +task 3, line 41: +//# run tto::M1::middle --sender A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 4 'view-object'. lines 43-43: +task 4, line 43: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: tto::M1::A { @@ -29,7 +33,8 @@ Contents: tto::M1::A { }, } -task 5 'view-object'. lines 45-47: +task 5, lines 45-47: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -40,11 +45,13 @@ Contents: tto::M1::B { }, } -task 6 'run'. lines 48-48: +task 6, line 48: +//# run tto::M1::send_back --args object(2,0) receiving(2,1) mutated: object(0,1), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 7 'view-object'. lines 50-50: +task 7, line 50: +//# view-object 2,0 Owner: Shared( 3 ) Version: 4 Contents: tto::M1::A { @@ -55,7 +62,8 @@ Contents: tto::M1::A { }, } -task 8 'view-object'. lines 52-54: +task 8, lines 52-54: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 4 Contents: tto::M1::B { @@ -66,18 +74,22 @@ Contents: tto::M1::B { }, } -task 9 'run'. lines 55-57: +task 9, lines 55-57: +//# run tto::M1::send_back --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Debug of error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3) at command Some(0) -task 10 'run'. lines 58-60: +task 10, lines 58-60: +//# run tto::M1::send_back --args object(2,0) receiving(2,1)@4 mutated: object(0,1), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 11 'run'. lines 61-63: +task 11, lines 61-63: +//# run tto::M1::send_back --summarize --args object(3,0) receiving(2,1)@6 --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3), source: Some(VMError { major_status: ABORTED, sub_status: Some(3), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } } -task 12 'run'. lines 64-64: +task 12, line 64: +//# run tto::M1::send_back --args object(2,0) receiving(2,1)@6 mutated: object(0,1), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/transfer_then_share.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/transfer_then_share.exp index afb956e930364..6404b8baec924 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/transfer_then_share.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/shared_parent/transfer_then_share.exp @@ -1,16 +1,19 @@ processed 9 tasks -task 1 'publish'. lines 6-31: +task 1, lines 6-31: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6916000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-33: +task 2, line 33: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 35-35: +task 3, line 35: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 37-37: +task 4, line 37: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,11 +36,13 @@ Contents: tto::M1::B { }, } -task 5 'run'. lines 39-39: +task 5, line 39: +//# run tto::M1::receiver --args object(2,0) receiving(2,1) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200 -task 6 'view-object'. lines 41-41: +task 6, line 41: +//# view-object 2,0 Owner: Shared( 3 ) Version: 4 Contents: tto::M1::A { @@ -47,7 +53,8 @@ Contents: tto::M1::A { }, } -task 7 'view-object'. lines 43-43: +task 7, line 43: +//# view-object 2,1 Owner: Account Address ( _ ) Version: 4 Contents: tto::M1::B { @@ -58,6 +65,7 @@ Contents: tto::M1::B { }, } -task 8 'run'. lines 45-45: +task 8, line 45: +//# run tto::M1::receiver --args object(2,0) receiving(2,1)@3 Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::receive_impl (function index 12) at offset 0, Abort Code: 3 Debug of error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 3) at command Some(0) diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/take_receiver_then_try_to_reuse.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/take_receiver_then_try_to_reuse.exp index b8bbd4ea769e7..8d240aa17519c 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/take_receiver_then_try_to_reuse.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/take_receiver_then_try_to_reuse.exp @@ -1,16 +1,19 @@ processed 6 tasks -task 1 'publish'. lines 6-32: +task 1, lines 6-32: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7182000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-34: +task 2, line 34: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 36-36: +task 3, line 36: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 3 Contents: tto::M1::A { @@ -21,7 +24,8 @@ Contents: tto::M1::A { }, } -task 4 'view-object'. lines 38-40: +task 4, lines 38-40: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 3 Contents: tto::M1::B { @@ -32,6 +36,9 @@ Contents: tto::M1::B { }, } -task 5 'programmable'. lines 41-43: +task 5, lines 41-43: +//# programmable --inputs object(2,0) receiving(2,1) +//> tto::M1::pass_through(Input(1)); +//> tto::M1::receiver(Input(0), Input(1)); Error: Transaction Effects Status: Invalid command argument at 1. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidValueUsage }, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/receive_object/transfer_object_cyclic.exp b/crates/sui-adapter-transactional-tests/tests/receive_object/transfer_object_cyclic.exp index b09e7dc364dce..47fab9ceddcd9 100644 --- a/crates/sui-adapter-transactional-tests/tests/receive_object/transfer_object_cyclic.exp +++ b/crates/sui-adapter-transactional-tests/tests/receive_object/transfer_object_cyclic.exp @@ -1,11 +1,13 @@ processed 3 tasks -task 1 'publish'. lines 6-24: +task 1, lines 6-24: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5852000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 26-26: +task 2, line 26: +//# run tto::M1::start created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/runtime_behavior/error_locations.exp b/crates/sui-adapter-transactional-tests/tests/runtime_behavior/error_locations.exp index fd73f93fc3c11..909f257495aca 100644 --- a/crates/sui-adapter-transactional-tests/tests/runtime_behavior/error_locations.exp +++ b/crates/sui-adapter-transactional-tests/tests/runtime_behavior/error_locations.exp @@ -1,22 +1,27 @@ processed 6 tasks -task 1 'publish'. lines 8-30: +task 1, lines 8-30: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4332000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 32-32: +task 2, line 32: +//# run test::m::abort_ Error: Transaction Effects Status: Move Runtime Abort. Location: test::m::abort_ (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 0, instruction: 1, function_name: Some("abort_") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("test::m::abort_ at offset 1"), exec_state: None, location: Module(ModuleId { address: test, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 3 'run'. lines 34-34: +task 3, line 34: +//# run test::m::loop_ --gas-budget 1000000 Error: Transaction Effects Status: Insufficient Gas. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InsufficientGas, source: Some(VMError { major_status: OUT_OF_GAS, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: test, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 0)] }), command: Some(0) } } -task 4 'run'. lines 36-36: +task 4, line 36: +//# run test::m::math Error: Transaction Effects Status: Move Primitive Runtime Error. Location: test::m::math (function index 2) at offset 2. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 2, instruction: 2, function_name: Some("math") }))), source: Some(VMError { major_status: ARITHMETIC_ERROR, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: test, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(2), 2)] }), command: Some(0) } } -task 5 'run'. lines 38-38: +task 5, line 38: +//# run test::m::vector_ Error: Transaction Effects Status: Move Primitive Runtime Error. Location: test::m::vector_ (function index 3) at offset 4. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: test, name: Identifier("m") }, function: 3, instruction: 4, function_name: Some("vector_") }))), source: Some(VMError { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(1), message: None, exec_state: None, location: Module(ModuleId { address: test, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(3), 4)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_new.exp b/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_new.exp index 7f5007fa2265b..ceda8f83614f3 100644 --- a/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_new.exp +++ b/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_new.exp @@ -1,14 +1,17 @@ processed 4 tasks -task 1 'publish'. lines 8-42: +task 1, lines 8-42: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4491600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 44-44: +task 2, line 44: +//# run test::m::t1 --args true mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 46-46: +task 3, line 46: +//# run test::m::t2 --args true mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_old.exp b/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_old.exp index 6489d97a31ab0..0db90397e9b78 100644 --- a/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_old.exp +++ b/crates/sui-adapter-transactional-tests/tests/runtime_behavior/versioned_check_swap_loc_old.exp @@ -1,14 +1,17 @@ processed 4 tasks -task 1 'publish'. lines 8-42: +task 1, lines 8-42: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4491600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 44-44: +task 2, line 44: +//# run test::m::t1 --args true Error: Transaction Effects Status: MOVE VM INVARIANT VIOLATION. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMInvariantViolation, source: Some(VMError { major_status: UNKNOWN_INVARIANT_VIOLATION_ERROR, sub_status: None, message: Some("moving container with dangling references"), exec_state: None, location: Module(ModuleId { address: test, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 13)] }), command: Some(0) } } -task 3 'run'. lines 46-46: +task 3, line 46: +//# run test::m::t2 --args true Error: Transaction Effects Status: MOVE VM INVARIANT VIOLATION. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMInvariantViolation, source: Some(VMError { major_status: UNKNOWN_INVARIANT_VIOLATION_ERROR, sub_status: None, message: Some("moving container with dangling references"), exec_state: None, location: Module(ModuleId { address: test, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 12)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/shared/add_dynamic_field.exp b/crates/sui-adapter-transactional-tests/tests/shared/add_dynamic_field.exp index 1802854ce1930..cca218ef7b671 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/add_dynamic_field.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/add_dynamic_field.exp @@ -3,17 +3,20 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 9-32: +task 1, lines 9-32: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6627200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-34: +task 2, line 34: +//# run a::m::create --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 36-36: +task 3, line 36: +//# view-object 2,0 Owner: Shared( 2 ) Version: 2 Contents: a::m::Obj { @@ -24,17 +27,20 @@ Contents: a::m::Obj { }, } -task 4 'run'. lines 38-38: +task 4, line 38: +//# run a::m::add_dynamic_field --sender A --args object(2,0) created: object(4,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 3678400, storage_rebate: 2189484, non_refundable_storage_fee: 22116 -task 5 'run'. lines 40-40: +task 5, line 40: +//# run a::m::create --sender A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'view-object'. lines 42-42: +task 6, line 42: +//# view-object 5,0 Owner: Shared( 4 ) Version: 4 Contents: a::m::Obj { @@ -45,6 +51,7 @@ Contents: a::m::Obj { }, } -task 7 'run'. lines 44-44: +task 7, line 44: +//# run a::m::add_and_remove_dynamic_field --sender A --args object(5,0) mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 2189484, non_refundable_storage_fee: 22116 diff --git a/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_field.exp b/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_field.exp index c881c1d1b707c..6e6514ce8956e 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_field.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_field.exp @@ -3,17 +3,20 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 9-39: +task 1, lines 9-39: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7531600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 41-41: +task 2, line 41: +//# run a::m::create_shared --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 43-43: +task 3, line 43: +//# view-object 2,0 Owner: Shared( 2 ) Version: 2 Contents: a::m::Inner { @@ -24,16 +27,19 @@ Contents: a::m::Inner { }, } -task 4 'run'. lines 45-45: +task 4, line 45: +//# run a::m::add_dynamic_field --sender A --args object(2,0) Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 5 'run'. lines 47-47: +task 5, line 47: +//# run a::m::create_shared --sender A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'view-object'. lines 49-49: +task 6, line 49: +//# view-object 5,0 Owner: Shared( 4 ) Version: 4 Contents: a::m::Inner { @@ -44,7 +50,8 @@ Contents: a::m::Inner { }, } -task 7 'run'. lines 51-51: +task 7, line 51: +//# run a::m::add_and_remove_dynamic_field --sender A --args object(5,0) created: object(7,0) mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 2204532, non_refundable_storage_fee: 22268 diff --git a/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_object_field.exp b/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_object_field.exp index 747082ae6c86b..82cbb04fb190b 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_object_field.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/become_dynamic_object_field.exp @@ -3,17 +3,20 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 9-39: +task 1, lines 9-39: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7691200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 41-41: +task 2, line 41: +//# run a::m::create_shared --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 43-43: +task 3, line 43: +//# view-object 2,0 Owner: Shared( 2 ) Version: 2 Contents: a::m::Inner { @@ -24,16 +27,19 @@ Contents: a::m::Inner { }, } -task 4 'run'. lines 45-45: +task 4, line 45: +//# run a::m::add_dynamic_object_field --sender A --args object(2,0) Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 5 'run'. lines 47-47: +task 5, line 47: +//# run a::m::create_shared --sender A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'view-object'. lines 49-49: +task 6, line 49: +//# view-object 5,0 Owner: Shared( 4 ) Version: 4 Contents: a::m::Inner { @@ -44,7 +50,8 @@ Contents: a::m::Inner { }, } -task 7 'run'. lines 51-51: +task 7, line 51: +//# run a::m::add_and_remove_dynamic_object_field --sender A --args object(5,0) created: object(7,0) mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 2204532, non_refundable_storage_fee: 22268 diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion.exp index 73383d6a019c7..e4521883eea6d 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion.exp @@ -1,21 +1,25 @@ processed 9 tasks -task 1 'publish'. lines 9-26: +task 1, lines 9-26: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5342800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'publish'. lines 28-36: +task 2, lines 28-36: +//# publish --dependencies t2 created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4453600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 38-38: +task 3, line 38: +//# run t2::o2::create created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 40-42: +task 4, lines 40-42: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: t2::o2::Obj2 { @@ -26,17 +30,20 @@ Contents: t2::o2::Obj2 { }, } -task 5 'run'. lines 43-43: +task 5, line 43: +//# run t1::o1::consume_o2 --args object(3,0) mutated: object(0,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 6 'run'. lines 45-45: +task 6, line 45: +//# run t2::o2::create created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 47-49: +task 7, lines 47-49: +//# view-object 6,0 Owner: Shared( 6 ) Version: 6 Contents: t2::o2::Obj2 { @@ -47,7 +54,8 @@ Contents: t2::o2::Obj2 { }, } -task 8 'run'. lines 50-50: +task 8, line 50: +//# run t2::o2::consume_o2 --args object(6,0) mutated: object(0,0) deleted: object(6,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2204532, non_refundable_storage_fee: 22268 diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec.exp index cd745ca160e0a..f367fce98e74c 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec.exp @@ -1,21 +1,25 @@ processed 10 tasks -task 1 'publish'. lines 6-45: +task 1, lines 6-45: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6900800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 47-47: +task 2, line 47: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 49-49: +task 3, line 49: +//# run t2::o2::create created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 51-51: +task 4, line 51: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -26,7 +30,8 @@ Contents: t2::o2::Obj2 { }, } -task 5 'view-object'. lines 53-55: +task 5, lines 53-55: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: t2::o2::Obj2 { @@ -37,17 +42,22 @@ Contents: t2::o2::Obj2 { }, } -task 6 'programmable'. lines 56-58: +task 6, lines 56-58: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::delete(Result(0)); mutated: object(0,0), object(2,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 3430944, non_refundable_storage_fee: 34656 -task 7 'run'. lines 60-60: +task 7, line 60: +//# run t2::o2::mint_shared_coin created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'view-object'. lines 62-64: +task 8, lines 62-64: +//# view-object 7,0 Owner: Shared( 6 ) Version: 6 Contents: sui::coin::Coin { @@ -61,7 +71,13 @@ Contents: sui::coin::Coin { }, } -task 9 'programmable'. lines 65-70: +task 9, lines 65-70: +//# programmable --inputs 0 object(7,0) @0x0 +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_coin(Result(0)); +//> 2: SplitCoins(Result(1), [Input(0)]); +//> 3: TransferObjects([Result(2)], Input(2)); +//> 4: t2::o2::share_coin(Result(1)); created: object(9,0) mutated: object(0,0), object(7,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec_fails.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec_fails.exp index 20e3b71f987ed..2e85f1154cdb2 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec_fails.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_make_move_vec_fails.exp @@ -1,21 +1,25 @@ processed 22 tasks -task 1 'publish'. lines 6-97: +task 1, lines 6-97: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10944000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 99-99: +task 2, line 99: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 101-101: +task 3, line 101: +//# run t2::o2::create created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 103-103: +task 4, line 103: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -26,7 +30,8 @@ Contents: t2::o2::Obj2 { }, } -task 5 'view-object'. lines 105-107: +task 5, lines 105-107: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: t2::o2::Obj2 { @@ -37,48 +42,90 @@ Contents: t2::o2::Obj2 { }, } -task 6 'programmable'. lines 108-112: +task 6, lines 108-112: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::freezee(Result(0)); +// Make MoveVec and then try to add as dof Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 7 'programmable'. lines 113-117: +task 7, lines 113-117: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::dof_(Input(0), Result(0)); +// Make MoveVec and then try to add as df Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 8 'programmable'. lines 118-122: +task 8, lines 118-122: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::df_(Input(0), Result(0)); +// Make MoveVec and then try to transfer it Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 9 'programmable'. lines 123-127: +task 9, lines 123-127: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::transfer_(Result(0)); +// Make MoveVec pop and return it, then try to freeze Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 10 'programmable'. lines 128-133: +task 10, lines 128-133: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_it(Result(0)); +//> 2: t2::o2::freezer(Result(1)); +// Make MoveVec pop and return it, then try to add as dof Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 11 'programmable'. lines 134-139: +task 11, lines 134-139: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_it(Result(0)); +//> 2: t2::o2::dofer(Input(0), Result(1)); +// Make MoveVec pop and return it, then try to add as df Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 12 'programmable'. lines 140-145: +task 12, lines 140-145: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_it(Result(0)); +//> 2: t2::o2::dfer(Input(0), Result(1)); +// Make MoveVec pop and return it, then try to transfer it Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 13 'programmable'. lines 146-151: +task 13, lines 146-151: +//# programmable --inputs object(2,0) object(3,0) +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_it(Result(0)); +//> 2: t2::o2::transferer(Result(1)); +// Make MoveVec pop and return it, then try to transfer it with PT transfer Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 14 'programmable'. lines 152-155: +task 14, lines 152-155: +//# programmable --inputs object(3,0) @0x0 +//> 0: MakeMoveVec([Input(0)]); +//> 1: t2::o2::pop_it(Result(0)); +//> 2: TransferObjects([Result(1)], Input(1)); Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 15 'run'. lines 157-157: +task 15, line 157: +//# run t2::o2::mint_shared_coin created: object(15,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'view-object'. lines 159-162: +task 16, lines 159-162: +//# view-object 15,0 Owner: Shared( 14 ) Version: 14 Contents: sui::coin::Coin { @@ -92,22 +139,57 @@ Contents: sui::coin::Coin { }, } -task 17 'programmable'. lines 163-169: +task 17, lines 163-169: +//# programmable --inputs 0 object(15,0) @0x0 +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_coin(Result(0)); +//> 2: SplitCoins(Result(1), [Input(0)]); +//> 3: TransferObjects([Result(2)], Input(2)); +// Try to call public_share_object directly -- this should fail Error: Transaction Effects Status: Unused result without the drop ability. Command result 1, return value 0 Debug of error: UnusedValueWithoutDrop { result_idx: 1, secondary_idx: 0 } at command None -task 18 'programmable'. lines 170-178: +task 18, lines 170-178: +//# programmable --inputs 0 object(15,0) @0x0 +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_coin(Result(0)); +//> 2: SplitCoins(Result(1), [Input(0)]); +//> 3: TransferObjects([Result(2)], Input(2)); +//> 4: sui::transfer::public_share_object(Input(1)); +// Try to reshare the shared object -- this should fail since the input was +// used for the `MakeMoveVec` call Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Debug of error: VMVerificationOrDeserializationError at command Some(4) -task 19 'programmable'. lines 179-187: +task 19, lines 179-187: +//# programmable --inputs 0 object(15,0) @0x0 +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_coin(Result(0)); +//> 2: SplitCoins(Result(1), [Input(0)]); +//> 3: TransferObjects([Result(2)], Input(2)); +//> 4: t2::o2::share_coin(Input(1)); +// Try to transfer the shared object -- this should fail since the input was +// used for the `MakeMoveVec` call Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage } at command Some(4) -task 20 'programmable'. lines 188-195: +task 20, lines 188-195: +//# programmable --inputs 0 object(15,0) @0x0 +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_coin(Result(0)); +//> 2: SplitCoins(Result(1), [Input(0)]); +//> 3: TransferObjects([Result(2)], Input(2)); +//> 4: TransferObjects([Input(1)], Input(2)); +// Try to transfer the shared object Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage } at command Some(4) -task 21 'programmable'. lines 196-201: +task 21, lines 196-201: +//# programmable --inputs 0 object(15,0) @0x0 +//> 0: MakeMoveVec([Input(1)]); +//> 1: t2::o2::pop_coin(Result(0)); +//> 2: SplitCoins(Result(1), [Input(0)]); +//> 3: TransferObjects([Result(2)], Input(2)); +//> 4: TransferObjects([Result(1)], Input(2)); Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge.exp index b0ccd6ebaf879..ca204d373f22c 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge.exp @@ -3,22 +3,26 @@ processed 21 tasks init: A: object(0,0) -task 1 'publish'. lines 13-60: +task 1, lines 13-60: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9264400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 62-62: +task 2, line 62: +//# run t2::o2::mint_shared_coin created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 64-64: +task 3, line 64: +//# run t2::o2::mint_owned_coin created: object(3,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 66-66: +task 4, line 66: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: sui::coin::Coin { @@ -32,7 +36,8 @@ Contents: sui::coin::Coin { }, } -task 5 'view-object'. lines 68-71: +task 5, lines 68-71: +//# view-object 3,0 Owner: Account Address ( A ) Version: 4 Contents: sui::coin::Coin { @@ -46,27 +51,35 @@ Contents: sui::coin::Coin { }, } -task 6 'programmable'. lines 72-76: +task 6, lines 72-76: +//# programmable --sender A --inputs object(2,0) object(3,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::transferer(Input(1)); +// **Merge owned into shared** mutated: object(0,0), object(3,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 7 'run'. lines 78-78: +task 7, line 78: +//# run t2::o2::mint_owned_coin created: object(7,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'run'. lines 80-80: +task 8, line 80: +//# run t2::o2::mint_shared_coin created: object(8,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'run'. lines 82-82: +task 9, line 82: +//# run t2::o2::mint_shared_obj created: object(9,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'view-object'. lines 84-84: +task 10, line 84: +//# view-object 7,0 Owner: Account Address ( A ) Version: 5 Contents: sui::coin::Coin { @@ -80,7 +93,8 @@ Contents: sui::coin::Coin { }, } -task 11 'view-object'. lines 86-86: +task 11, line 86: +//# view-object 8,0 Owner: Shared( 6 ) Version: 6 Contents: sui::coin::Coin { @@ -94,7 +108,8 @@ Contents: sui::coin::Coin { }, } -task 12 'view-object'. lines 88-90: +task 12, lines 88-90: +//# view-object 9,0 Owner: Shared( 7 ) Version: 7 Contents: t2::o2::Obj2 { @@ -105,27 +120,35 @@ Contents: t2::o2::Obj2 { }, } -task 13 'programmable'. lines 91-95: +task 13, lines 91-95: +//# programmable --sender A --inputs object(7,0) object(8,0) object(9,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::deleter(Input(1)); +// **Merge shared into shared** mutated: object(0,0), object(9,0) deleted: object(7,0), object(8,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 4160772, non_refundable_storage_fee: 42028 -task 14 'run'. lines 97-97: +task 14, line 97: +//# run t2::o2::mint_shared_coin created: object(14,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'run'. lines 99-99: +task 15, line 99: +//# run t2::o2::mint_shared_coin created: object(15,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'run'. lines 101-101: +task 16, line 101: +//# run t2::o2::mint_shared_obj created: object(16,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 17 'view-object'. lines 103-103: +task 17, line 103: +//# view-object 14,0 Owner: Shared( 8 ) Version: 8 Contents: sui::coin::Coin { @@ -139,7 +162,8 @@ Contents: sui::coin::Coin { }, } -task 18 'view-object'. lines 105-105: +task 18, line 105: +//# view-object 15,0 Owner: Shared( 9 ) Version: 9 Contents: sui::coin::Coin { @@ -153,7 +177,8 @@ Contents: sui::coin::Coin { }, } -task 19 'view-object'. lines 107-109: +task 19, lines 107-109: +//# view-object 16,0 Owner: Shared( 10 ) Version: 10 Contents: t2::o2::Obj2 { @@ -164,7 +189,10 @@ Contents: t2::o2::Obj2 { }, } -task 20 'programmable'. lines 110-112: +task 20, lines 110-112: +//# programmable --sender A --inputs object(14,0) object(15,0) object(16,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::deleter(Input(1)); mutated: object(0,0), object(16,0) deleted: object(14,0), object(15,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 4160772, non_refundable_storage_fee: 42028 diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge_fails.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge_fails.exp index 8811c1b216eaf..5a4577427bc67 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge_fails.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_merge_fails.exp @@ -3,27 +3,32 @@ processed 24 tasks init: A: object(0,0) -task 1 'publish'. lines 13-62: +task 1, lines 13-62: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9264400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 64-64: +task 2, line 64: +//# run t2::o2::mint_owned_coin created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 66-66: +task 3, line 66: +//# run t2::o2::mint_shared_coin created: object(3,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 68-68: +task 4, line 68: +//# run t2::o2::mint_shared_obj created: object(4,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'view-object'. lines 70-70: +task 5, line 70: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: sui::coin::Coin { @@ -37,7 +42,8 @@ Contents: sui::coin::Coin { }, } -task 6 'view-object'. lines 72-72: +task 6, line 72: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: sui::coin::Coin { @@ -51,7 +57,8 @@ Contents: sui::coin::Coin { }, } -task 7 'view-object'. lines 74-76: +task 7, lines 74-76: +//# view-object 4,0 Owner: Shared( 5 ) Version: 5 Contents: t2::o2::Obj2 { @@ -62,42 +69,66 @@ Contents: t2::o2::Obj2 { }, } -task 8 'programmable'. lines 77-81: +task 8, lines 77-81: +//# programmable --sender A --inputs object(2,0) object(3,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::freezer(Input(1)); +// Merge and then try to add as dof Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 9 'programmable'. lines 82-86: +task 9, lines 82-86: +//# programmable --sender A --inputs object(2,0) object(3,0) object(4,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::dofer(Input(2), Input(1)); +// Merge and then try to add as df Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 10 'programmable'. lines 87-91: +task 10, lines 87-91: +//# programmable --sender A --inputs object(2,0) object(3,0) object(4,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::dfer(Input(2), Input(1)); +// Merge and then try to transfer it Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 11 'programmable'. lines 92-96: +task 11, lines 92-96: +//# programmable --sender A --inputs object(2,0) object(3,0) object(4,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::transferer(Input(1)); +// Merge and then try to transfer it with PTB transfer Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 12 'programmable'. lines 97-101: +task 12, lines 97-101: +//# programmable --sender A --inputs object(2,0) object(3,0) object(4,0) @A +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: TransferObjects([Input(1)], Input(3)); +// **Merge shared into shared** Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 13 'run'. lines 103-103: +task 13, line 103: +//# run t2::o2::mint_shared_coin created: object(13,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 14 'run'. lines 105-105: +task 14, line 105: +//# run t2::o2::mint_shared_coin created: object(14,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'run'. lines 107-107: +task 15, line 107: +//# run t2::o2::mint_shared_obj created: object(15,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'view-object'. lines 109-109: +task 16, line 109: +//# view-object 13,0 Owner: Shared( 6 ) Version: 6 Contents: sui::coin::Coin { @@ -111,7 +142,8 @@ Contents: sui::coin::Coin { }, } -task 17 'view-object'. lines 111-111: +task 17, line 111: +//# view-object 14,0 Owner: Shared( 7 ) Version: 7 Contents: sui::coin::Coin { @@ -125,7 +157,8 @@ Contents: sui::coin::Coin { }, } -task 18 'view-object'. lines 113-115: +task 18, lines 113-115: +//# view-object 15,0 Owner: Shared( 8 ) Version: 8 Contents: t2::o2::Obj2 { @@ -136,22 +169,41 @@ Contents: t2::o2::Obj2 { }, } -task 19 'programmable'. lines 116-120: +task 19, lines 116-120: +//# programmable --sender A --inputs object(13,0) object(14,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::freezer(Input(1)); +// Merge and then try to add as dof Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 20 'programmable'. lines 121-125: +task 20, lines 121-125: +//# programmable --sender A --inputs object(13,0) object(14,0) object(15,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::dofer(Input(2), Input(1)); +// Merge and then try to add as df Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 21 'programmable'. lines 126-130: +task 21, lines 126-130: +//# programmable --sender A --inputs object(13,0) object(14,0) object(15,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::dfer(Input(2), Input(1)); +// Merge and then try to transfer it Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 22 'programmable'. lines 131-135: +task 22, lines 131-135: +//# programmable --sender A --inputs object(13,0) object(14,0) object(15,0) +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: t2::o2::transferer(Input(1)); +// Merge and then try to transfer it with PTB transfer Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 23 'programmable'. lines 136-138: +task 23, lines 136-138: +//# programmable --sender A --inputs object(13,0) object(14,0) object(15,0) @A +//> 0: MergeCoins(Input(1), [Input(0)]); +//> 1: TransferObjects([Input(1)], Input(3)); Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call.exp index b52f0588b5243..6d931814e6b43 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call.exp @@ -1,21 +1,25 @@ processed 11 tasks -task 1 'publish'. lines 6-35: +task 1, lines 6-35: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6384000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 37-37: +task 2, line 37: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 39-39: +task 3, line 39: +//# run t2::o2::create created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 41-41: +task 4, line 41: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -26,7 +30,8 @@ Contents: t2::o2::Obj2 { }, } -task 5 'view-object'. lines 43-45: +task 5, lines 43-45: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: t2::o2::Obj2 { @@ -37,17 +42,22 @@ Contents: t2::o2::Obj2 { }, } -task 6 'programmable'. lines 46-48: +task 6, lines 46-48: +//# programmable --inputs object(2,0) object(3,0) +//> 0: t2::o2::id(Input(1)); +//> 1: t2::o2::deleter(Result(0)); mutated: object(0,0), object(2,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 3430944, non_refundable_storage_fee: 34656 -task 7 'run'. lines 50-50: +task 7, line 50: +//# run t2::o2::mint_shared_coin created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'view-object'. lines 52-54: +task 8, lines 52-54: +//# view-object 7,0 Owner: Shared( 6 ) Version: 6 Contents: sui::coin::Coin { @@ -61,12 +71,23 @@ Contents: sui::coin::Coin { }, } -task 9 'programmable'. lines 55-61: +task 9, lines 55-61: +//# programmable --inputs 0 object(7,0) @0x0 +//> 0: t2::o2::id>(Input(1)); +//> 1: SplitCoins(Result(0), [Input(0)]); +//> 2: TransferObjects([Result(1)], Input(2)); +//> 3: t2::o2::share_coin(Result(0)); +// Try to call public_share_object directly -- this should work because the coin has `store`. created: object(9,0) mutated: object(0,0), object(7,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 10 'programmable'. lines 62-66: +task 10, lines 62-66: +//# programmable --inputs 0 object(7,0) @0x0 +//> 0: t2::o2::id>(Input(1)); +//> 1: SplitCoins(Result(0), [Input(0)]); +//> 2: TransferObjects([Result(1)], Input(2)); +//> 3: sui::transfer::public_share_object>(Result(0)); created: object(10,0) mutated: object(0,0), object(7,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call_fails.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call_fails.exp index d2b865310e3fd..5a1a1d2055abb 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call_fails.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_deletion_via_move_call_fails.exp @@ -1,21 +1,25 @@ processed 16 tasks -task 1 'publish'. lines 6-57: +task 1, lines 6-57: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 8869200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 59-59: +task 2, line 59: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 61-61: +task 3, line 61: +//# run t2::o2::create created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 63-63: +task 4, line 63: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -26,7 +30,8 @@ Contents: t2::o2::Obj2 { }, } -task 5 'view-object'. lines 65-67: +task 5, lines 65-67: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: t2::o2::Obj2 { @@ -37,28 +42,45 @@ Contents: t2::o2::Obj2 { }, } -task 6 'programmable'. lines 68-72: +task 6, lines 68-72: +//# programmable --inputs object(2,0) object(3,0) +//> 0: t2::o2::id(Input(1)); +//> 1: t2::o2::freezer(Result(0)); +// pass through a move function and then try to add as dof Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 7 'programmable'. lines 73-77: +task 7, lines 73-77: +//# programmable --inputs object(2,0) object(3,0) +//> 0: t2::o2::id(Input(1)); +//> 1: t2::o2::dofer(Input(0), Result(0)); +// pass through a move function and then try to add as df Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 8 'programmable'. lines 78-82: +task 8, lines 78-82: +//# programmable --inputs object(2,0) object(3,0) +//> 0: t2::o2::id(Input(1)); +//> 1: t2::o2::dfer(Input(0), Result(0)); +// pass through a move function and then try to transfer it Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 9 'programmable'. lines 83-85: +task 9, lines 83-85: +//# programmable --inputs object(2,0) object(3,0) +//> 0: t2::o2::id(Input(1)); +//> 1: t2::o2::transferer(Result(0)); Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 10 'run'. lines 87-87: +task 10, line 87: +//# run t2::o2::mint_shared_coin created: object(10,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'view-object'. lines 89-91: +task 11, lines 89-91: +//# view-object 10,0 Owner: Shared( 9 ) Version: 9 Contents: sui::coin::Coin { @@ -72,18 +94,41 @@ Contents: sui::coin::Coin { }, } -task 12 'programmable'. lines 92-98: +task 12, lines 92-98: +//# programmable --inputs 0 object(10,0) @0x0 +//> 0: t2::o2::id>(Input(1)); +//> 1: SplitCoins(Result(0), [Input(0)]); +//> 2: TransferObjects([Result(1)], Input(2)); +//> 3: sui::transfer::public_share_object>(Input(1)); +// Try to double-use the input using a user-defined function Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage } at command Some(3) -task 13 'programmable'. lines 99-105: +task 13, lines 99-105: +//# programmable --inputs 0 object(10,0) @0x0 +//> 0: t2::o2::id>(Input(1)); +//> 1: SplitCoins(Result(0), [Input(0)]); +//> 2: TransferObjects([Result(1)], Input(2)); +//> 3: t2::o2::share_coin(Input(1)); +// Try to transfer the shared object and double-use the input Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage } at command Some(3) -task 14 'programmable'. lines 106-112: +task 14, lines 106-112: +//# programmable --inputs 0 object(10,0) @0x0 +//> 0: t2::o2::id>(Input(1)); +//> 1: SplitCoins(Result(0), [Input(0)]); +//> 2: TransferObjects([Result(1)], Input(2)); +//> 3: TransferObjects([Input(1)], Input(2)); +// Try to transfer the shared object Error: Transaction Effects Status: Invalid command argument at 0. Invalid usage of value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidValueUsage } at command Some(3) -task 15 'programmable'. lines 113-117: +task 15, lines 113-117: +//# programmable --inputs 0 object(10,0) @0x0 +//> 0: t2::o2::id>(Input(1)); +//> 1: SplitCoins(Result(0), [Input(0)]); +//> 2: TransferObjects([Result(1)], Input(2)); +//> 3: TransferObjects([Result(0)], Input(2)); Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_v20.exp b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_v20.exp index 7b02857c93230..9349ffc442e2d 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_v20.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/by_value_shared_object_v20.exp @@ -1,21 +1,25 @@ processed 7 tasks -task 1 'publish'. lines 8-24: +task 1, lines 8-24: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5342800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'publish'. lines 26-34: +task 2, lines 26-34: +//# publish --dependencies t2 created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4453600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 37-37: +task 3, line 37: +//# run t2::o2::create created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 39-39: +task 4, line 39: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: t2::o2::Obj2 { @@ -26,10 +30,12 @@ Contents: t2::o2::Obj2 { }, } -task 5 'run'. lines 41-41: +task 5, line 41: +//# run t1::o1::consume_o2 --args object(3,0) Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue } at command Some(0) -task 6 'run'. lines 43-43: +task 6, line 43: +//# run t2::o2::consume_o2 --args object(3,0) Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue } at command Some(0) diff --git a/crates/sui-adapter-transactional-tests/tests/shared/freeze.exp b/crates/sui-adapter-transactional-tests/tests/shared/freeze.exp index faf0515ade4c6..cbc9d29666289 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/freeze.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/freeze.exp @@ -1,16 +1,19 @@ processed 5 tasks -task 1 'publish'. lines 8-25: +task 1, lines 8-25: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5396000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 29-29: +task 3, line 29: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -21,6 +24,7 @@ Contents: t2::o2::Obj2 { }, } -task 4 'run'. lines 31-31: +task 4, line 31: +//# run t2::o2::freeze_o2 --args object(2,0) Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/shared/re_share.exp b/crates/sui-adapter-transactional-tests/tests/shared/re_share.exp index 26daeda5503ab..d3ff4d7a6cb96 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/re_share.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/re_share.exp @@ -1,16 +1,19 @@ processed 12 tasks -task 1 'publish'. lines 8-29: +task 1, lines 8-29: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5882400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 33-33: +task 3, line 33: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -21,11 +24,13 @@ Contents: t2::o2::Obj2 { }, } -task 4 'run'. lines 35-35: +task 4, line 35: +//# run t2::o2::mut_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 5 'view-object'. lines 37-37: +task 5, line 37: +//# view-object 2,0 Owner: Shared( 3 ) Version: 4 Contents: t2::o2::Obj2 { @@ -36,11 +41,13 @@ Contents: t2::o2::Obj2 { }, } -task 6 'run'. lines 39-39: +task 6, line 39: +//# run t2::o2::re_share_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 7 'view-object'. lines 41-41: +task 7, line 41: +//# view-object 2,0 Owner: Shared( 3 ) Version: 5 Contents: t2::o2::Obj2 { @@ -51,11 +58,13 @@ Contents: t2::o2::Obj2 { }, } -task 8 'run'. lines 43-43: +task 8, line 43: +//# run t2::o2::re_share_non_public_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 9 'view-object'. lines 45-45: +task 9, line 45: +//# view-object 2,0 Owner: Shared( 3 ) Version: 6 Contents: t2::o2::Obj2 { @@ -66,11 +75,13 @@ Contents: t2::o2::Obj2 { }, } -task 10 'run'. lines 47-47: +task 10, line 47: +//# run t2::o2::mut_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 11 'view-object'. lines 49-49: +task 11, line 49: +//# view-object 2,0 Owner: Shared( 3 ) Version: 7 Contents: t2::o2::Obj2 { diff --git a/crates/sui-adapter-transactional-tests/tests/shared/re_share_v45.exp b/crates/sui-adapter-transactional-tests/tests/shared/re_share_v45.exp index 25f51ec8c0e3d..aee021cdba9be 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/re_share_v45.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/re_share_v45.exp @@ -1,16 +1,19 @@ processed 12 tasks -task 1 'publish'. lines 8-29: +task 1, lines 8-29: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5882400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 31-31: +task 2, line 31: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 33-33: +task 3, line 33: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -21,11 +24,13 @@ Contents: t2::o2::Obj2 { }, } -task 4 'run'. lines 35-35: +task 4, line 35: +//# run t2::o2::mut_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 5 'view-object'. lines 37-37: +task 5, line 37: +//# view-object 2,0 Owner: Shared( 3 ) Version: 4 Contents: t2::o2::Obj2 { @@ -36,11 +41,13 @@ Contents: t2::o2::Obj2 { }, } -task 6 'run'. lines 39-39: +task 6, line 39: +//# run t2::o2::re_share_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 7 'view-object'. lines 41-41: +task 7, line 41: +//# view-object 2,0 Owner: Shared( 0 ) Version: 5 Contents: t2::o2::Obj2 { @@ -51,11 +58,13 @@ Contents: t2::o2::Obj2 { }, } -task 8 'run'. lines 43-43: +task 8, line 43: +//# run t2::o2::re_share_non_public_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 9 'view-object'. lines 45-45: +task 9, line 45: +//# view-object 2,0 Owner: Shared( 0 ) Version: 6 Contents: t2::o2::Obj2 { @@ -66,11 +75,13 @@ Contents: t2::o2::Obj2 { }, } -task 10 'run'. lines 47-47: +task 10, line 47: +//# run t2::o2::mut_o2 --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 2204532, non_refundable_storage_fee: 22268 -task 11 'view-object'. lines 49-49: +task 11, line 49: +//# view-object 2,0 Owner: Shared( 0 ) Version: 7 Contents: t2::o2::Obj2 { diff --git a/crates/sui-adapter-transactional-tests/tests/shared/transfer.exp b/crates/sui-adapter-transactional-tests/tests/shared/transfer.exp index 03ef764962d2e..e6847526553fb 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/transfer.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/transfer.exp @@ -1,16 +1,19 @@ processed 5 tasks -task 1 'publish'. lines 9-24: +task 1, lines 9-24: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5654400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 26-26: +task 2, line 26: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 28-28: +task 3, line 28: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -21,6 +24,7 @@ Contents: t2::o2::Obj2 { }, } -task 4 'run'. lines 30-30: +task 4, line 30: +//# run t2::o2::transfer_to_single_owner --args object(2,0) Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/shared/upgrade.exp b/crates/sui-adapter-transactional-tests/tests/shared/upgrade.exp index b7ad2a16cd3d5..0881aa089290f 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/upgrade.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/upgrade.exp @@ -3,17 +3,20 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 8-36: +task 1, lines 8-36: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7440400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 38-38: +task 2, line 38: +//# run t::m::create --sender A created: object(2,0), object(2,1), object(2,2), object(2,3) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7835600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 40-40: +task 3, line 40: +//# view-object 2,2 Owner: Account Address ( A ) Version: 2 Contents: t::m::Obj { @@ -24,14 +27,17 @@ Contents: t::m::Obj { }, } -task 4 'run'. lines 42-42: +task 4, line 42: +//# run t::m::share --args object(2,2) --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::share_object_impl (function index 10) at offset 0, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 10, instruction: 0, function_name: Some("share_object_impl") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(10), 0)] }), command: Some(0) } } -task 5 'run'. lines 44-44: +task 5, line 44: +//# run t::m::share_wrapped --args object(2,2) --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::share_object_impl (function index 10) at offset 0, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 10, instruction: 0, function_name: Some("share_object_impl") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(10), 0)] }), command: Some(0) } } -task 6 'run'. lines 46-46: +task 6, line 46: +//# run t::m::share_child --args object(2,2) --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::transfer::share_object_impl (function index 10) at offset 0, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("transfer") }, function: 10, instruction: 0, function_name: Some("share_object_impl") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(10), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/shared/wrap.exp b/crates/sui-adapter-transactional-tests/tests/shared/wrap.exp index c00d9946c23a2..6de5dd29e245f 100644 --- a/crates/sui-adapter-transactional-tests/tests/shared/wrap.exp +++ b/crates/sui-adapter-transactional-tests/tests/shared/wrap.exp @@ -1,16 +1,19 @@ processed 5 tasks -task 1 'publish'. lines 8-27: +task 1, lines 8-27: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 30-30: +task 2, line 30: +//# run t2::o2::create created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 32-32: +task 3, line 32: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: t2::o2::Obj2 { @@ -21,6 +24,7 @@ Contents: t2::o2::Obj2 { }, } -task 4 'run'. lines 34-34: +task 4, line 34: +//# run t2::o2::wrap_o2 --args object(2,0) Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/deleted_id_limits_tests.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/deleted_id_limits_tests.exp index 14c71aafb77f3..c44ab03b9cfbc 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/deleted_id_limits_tests.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/deleted_id_limits_tests.exp @@ -1,26 +1,32 @@ processed 7 tasks -task 1 'publish'. lines 8-32: +task 1, lines 8-32: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5259200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-35: +task 2, lines 33-35: +//# run Test::M1::delete_n_ids --args 1 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 36-38: +task 3, lines 36-38: +//# run Test::M1::delete_n_ids --args 256 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 39-41: +task 4, lines 39-41: +//# run Test::M1::delete_n_ids --args 2048 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 5000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 42-44: +task 5, lines 42-44: +//# run Test::M1::delete_n_ids --args 2049 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } -task 6 'run'. lines 45-45: +task 6, line 45: +//# run Test::M1::delete_n_ids --args 4096 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp index 8cfd8264693b7..4b2c0d8cf17e2 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp @@ -1,42 +1,51 @@ processed 10 tasks -task 1 'publish'. lines 8-55: +task 1, lines 8-55: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7311200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 56-58: +task 2, lines 56-58: +//# run Test::M1::emit_n_small_events --args 1 --gas-budget 100000000000000 --summarize events: 1 mutated: 1 gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 59-61: +task 3, lines 59-61: +//# run Test::M1::emit_n_small_events --args 1024 --gas-budget 100000000000000 --summarize events: 50 mutated: 1 gas summary: computation_cost: 3000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 62-64: +task 4, lines 62-64: +//# run Test::M1::emit_n_small_events --args 1025 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::event::emit (function index 0) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("event") }, function: 0, instruction: 0, function_name: Some("emit") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(0), message: Some("Emitting more than 1024 events is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("event") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 0)] }), command: Some(0) } } -task 5 'run'. lines 65-67: +task 5, lines 65-67: +//# run Test::M1::emit_n_small_events --args 2093 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::event::emit (function index 0) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("event") }, function: 0, instruction: 0, function_name: Some("emit") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(0), message: Some("Emitting more than 1024 events is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("event") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 0)] }), command: Some(0) } } -task 6 'run'. lines 68-70: +task 6, lines 68-70: +//# run Test::M1::emit_event_with_size --args 200000 --gas-budget 100000000000000 --summarize events: 1 mutated: 1 gas summary: computation_cost: 1393000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 71-73: +task 7, lines 71-73: +//# run Test::M1::emit_event_with_size --args 256000 --gas-budget 100000000000000 --summarize events: 1 mutated: 1 gas summary: computation_cost: 1814000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'run'. lines 74-76: +task 8, lines 74-76: +//# run Test::M1::emit_event_with_size --args 256001 --gas-budget 100000000000000 --summarize Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::event::emit (function index 0) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("event") }, function: 0, instruction: 0, function_name: Some("emit") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(1), message: Some("Emitting event of size 256001 bytes. Limit is 256000 bytes."), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("event") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 0)] }), command: Some(0) } } -task 9 'run'. lines 77-77: +task 9, line 77: +//# run Test::M1::emit_event_with_size --args 259000 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::event::emit (function index 0) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("event") }, function: 0, instruction: 0, function_name: Some("emit") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(1), message: Some("Emitting event of size 259000 bytes. Limit is 256000 bytes."), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("event") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests_out_of_gas.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests_out_of_gas.exp index 780bdae769ffc..5f0e3286e59a1 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests_out_of_gas.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests_out_of_gas.exp @@ -1,22 +1,27 @@ processed 6 tasks -task 1 'publish'. lines 8-66: +task 1, lines 8-66: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7919200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 67-69: +task 2, lines 67-69: +//# run Test::M1::emit_n_small_events --args 1025 --gas-budget 1000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::event::emit (function index 0) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("event") }, function: 0, instruction: 0, function_name: Some("emit") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(0), message: Some("Emitting more than 1024 events is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("event") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 0)] }), command: Some(0) } } -task 3 'run'. lines 70-72: +task 3, lines 70-72: +//# run Test::M1::emit_n_small_events --args 2093 --gas-budget 1000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::event::emit (function index 0) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("event") }, function: 0, instruction: 0, function_name: Some("emit") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(0), message: Some("Emitting more than 1024 events is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("event") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 0)] }), command: Some(0) } } -task 4 'run'. lines 73-75: +task 4, lines 73-75: +//# run Test::M1::emit_event_with_size --args 259000 --gas-budget 1000000000 Error: Transaction Effects Status: Insufficient Gas. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InsufficientGas, source: Some(VMError { major_status: OUT_OF_GAS, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: Test, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 27)] }), command: Some(0) } } -task 5 'run'. lines 76-76: +task 5, line 76: +//# run Test::M1::emit_n_events_with_size --args 3 256000 --gas-budget 1000000000 --summarize Error: Transaction Effects Status: Insufficient Gas. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InsufficientGas, source: Some(VMError { major_status: OUT_OF_GAS, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: Test, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 33)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/identitifer_len_limits.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/identitifer_len_limits.exp index e06f947bc9bae..fd41251844efe 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/identitifer_len_limits.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/identitifer_len_limits.exp @@ -1,14 +1,17 @@ processed 4 tasks -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: IDENTIFIER_TOO_LONG, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("M1_1234567891234567890123456789012345678912345678901234567890123456789123456789012345678908901234567891234567890123456789078912345678901234567890") }), indices: [(Identifier, 0)], offsets: [] }), command: Some(0) } } -task 2 'publish'. lines 17-23: +task 2, lines 17-23: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: IDENTIFIER_TOO_LONG, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("M1_12345678912345678901234567890") }), indices: [(Identifier, 1)], offsets: [] }), command: Some(0) } } -task 3 'publish'. lines 26-47: +task 3, lines 26-47: +//# publish created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6095200, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp index 20ded1ec45f38..dfa9be123b60f 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp @@ -3,21 +3,25 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 8-78: +task 1, lines 8-78: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9933200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 79-81: +task 2, lines 79-81: +//# run Test::M1::transfer_object_with_size --args 256001 --sender A --gas-budget 10000000000000 Error: Transaction Effects Status: Move object with size 256001 is larger than the maximum object size 256000 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveObjectTooBig { object_size: 256001, max_object_size: 256000 }, source: None, command: None } } -task 3 'run'. lines 82-84: +task 3, lines 82-84: +//# run Test::M1::transfer_object_with_size --args 255999 --sender A --gas-budget 100000000000000 created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1863000000, storage_cost: 1947553200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 85-85: +task 4, line 85: +//# run Test::M1::transfer_object_with_size --args 256000 --sender A --gas-budget 100000000000000 created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1863000000, storage_cost: 1947560800, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/new_id_limits_tests.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/new_id_limits_tests.exp index 165119846ad1e..6f8176bfb11c5 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/new_id_limits_tests.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/new_id_limits_tests.exp @@ -1,26 +1,32 @@ processed 7 tasks -task 1 'publish'. lines 8-33: +task 1, lines 8-33: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5259200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 34-36: +task 2, lines 34-36: +//# run Test::M1::create_n_ids --args 1 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 37-39: +task 3, lines 37-39: +//# run Test::M1::create_n_ids --args 256 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 40-42: +task 4, lines 40-42: +//# run Test::M1::create_n_ids --args 2048 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 5000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 43-45: +task 5, lines 43-45: +//# run Test::M1::create_n_ids --args 2049 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } -task 6 'run'. lines 46-46: +task 6, line 46: +//# run Test::M1::create_n_ids --args 4096 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/object_runtime_limits.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/object_runtime_limits.exp index 7f1c4e66b04d3..73f3f26cc7d00 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/object_runtime_limits.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/object_runtime_limits.exp @@ -3,25 +3,30 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 7-26: +task 1, lines 7-26: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5821600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 28-28: +task 2, line 28: +//# run a::m::add_n_items --sender A --args 100 --gas-budget 1000000000000 --summarize created: 200 mutated: 1 gas summary: computation_cost: 1000000, storage_cost: 270028000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 30-30: +task 3, line 30: +//# run a::m::add_n_items --sender A --args 1000 --gas-budget 1000000000000 --summarize created: 2000 mutated: 1 gas summary: computation_cost: 7000000, storage_cost: 2691388000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 32-32: +task 4, line 32: +//# run a::m::add_n_items --sender A --args 1025 --gas-budget 1000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::dynamic_field::has_child_object (function index 14) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 14, instruction: 0, function_name: Some("has_child_object") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(5), message: Some("Object runtime cached objects limit (1000 entries) reached"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(14), 0)] }), command: Some(0) } } -task 5 'run'. lines 34-34: +task 5, line 34: +//# run a::m::add_n_items --sender A --args 1025 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::dynamic_field::has_child_object (function index 14) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 14, instruction: 0, function_name: Some("has_child_object") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(5), message: Some("Object runtime cached objects limit (1000 entries) reached"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(14), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/transfered_id_limits_tests.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/transfered_id_limits_tests.exp index 6caea53cd0e88..54d1535c8359b 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/transfered_id_limits_tests.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/transfered_id_limits_tests.exp @@ -1,37 +1,45 @@ processed 9 tasks -task 1 'publish'. lines 8-32: +task 1, lines 8-32: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5578400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 33-35: +task 2, lines 33-35: +//# run Test::M1::transfer_n_ids --args 1 --gas-budget 100000000000000 --summarize created: 1 mutated: 1 gas summary: computation_cost: 1000000, storage_cost: 2219200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 36-38: +task 3, lines 36-38: +//# run Test::M1::transfer_n_ids --args 256 --gas-budget 100000000000000 --summarize created: 256 mutated: 1 gas summary: computation_cost: 1000000, storage_cost: 316175200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 39-41: +task 4, lines 39-41: +//# run Test::M1::transfer_n_ids --args 2048 --gas-budget 100000000000000 --summarize created: 2048 mutated: 1 gas summary: computation_cost: 4000000, storage_cost: 2522485600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 42-44: +task 5, lines 42-44: +//# run Test::M1::transfer_n_ids --args 2049 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } -task 6 'run'. lines 45-47: +task 6, lines 45-47: +//# run Test::M1::transfer_n_ids --args 4096 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } -task 7 'run'. lines 48-50: +task 7, lines 48-50: +//# run Test::M1::transfer_n_ids --args 2049 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } -task 8 'run'. lines 51-51: +task 8, line 51: +//# run Test::M1::transfer_n_ids --args 4096 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: sui::tx_context::derive_id (function index 6) at offset 0. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: sui, name: Identifier("tx_context") }, function: 6, instruction: 0, function_name: Some("derive_id") }))), source: Some(VMError { major_status: MEMORY_LIMIT_EXCEEDED, sub_status: Some(2), message: Some("Creating more than 2048 IDs is not allowed"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("tx_context") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 0)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/vector_len_limits.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/vector_len_limits.exp index 358300b44a3e8..0977c9faa9933 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/vector_len_limits.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/vector_len_limits.exp @@ -1,22 +1,27 @@ processed 6 tasks -task 1 'publish'. lines 8-31: +task 1, lines 8-31: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4316800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 32-34: +task 2, lines 32-34: +//# run Test::M1::push_n_items --args 1 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 35-37: +task 3, lines 35-37: +//# run Test::M1::push_n_items --args 256 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 38-40: +task 4, lines 38-40: +//# run Test::M1::push_n_items --args 262144 --gas-budget 100000000000000 mutated: object(0,0) gas summary: computation_cost: 4088000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 41-41: +task 5, line 41: +//# run Test::M1::push_n_items --args 262145 --gas-budget 100000000000000 Error: Transaction Effects Status: Move Primitive Runtime Error. Location: Test::M1::push_n_items (function index 0) at offset 11. Arithmetic error, stack overflow, max value depth, etc. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MovePrimitiveRuntimeError(MoveLocationOpt(Some(MoveLocation { module: ModuleId { address: Test, name: Identifier("M1") }, function: 0, instruction: 11, function_name: Some("push_n_items") }))), source: Some(VMError { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(4), message: Some("vector size limit is 262144"), exec_state: None, location: Module(ModuleId { address: Test, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 11)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/sui/coin_in_vec.exp b/crates/sui-adapter-transactional-tests/tests/sui/coin_in_vec.exp index 2b89163844c2e..cba9defeb225c 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/coin_in_vec.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/coin_in_vec.exp @@ -3,22 +3,28 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 6-28: +task 1, lines 6-28: +//# publish --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7926800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 30-32: +task 2, lines 30-32: +//# programmable --sender A --inputs 10 @A +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 34-34: +task 3, line 34: +//# run test::coin_in_vec::deposit --args object(1,0) object(2,0) --sender A mutated: object(0,0), object(1,0) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2629600, storage_rebate: 3280464, non_refundable_storage_fee: 33136 -task 4 'run'. lines 36-36: +task 4, line 36: +//# run test::coin_in_vec::withdraw --args object(1,0) --sender A mutated: object(0,0), object(1,0) unwrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 3313600, storage_rebate: 2603304, non_refundable_storage_fee: 26296 diff --git a/crates/sui-adapter-transactional-tests/tests/sui/coin_transfer.exp b/crates/sui-adapter-transactional-tests/tests/sui/coin_transfer.exp index f904aca94f0ad..6c0d5bdce848b 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/coin_transfer.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/coin_transfer.exp @@ -3,12 +3,16 @@ processed 8 tasks init: A: object(0,0), B: object(0,1), C: object(0,2) -task 1 'programmable'. lines 8-10: +task 1, lines 8-10: +//# programmable --sender B --inputs 10 @B +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 12-12: +task 2, line 12: +//# view-object 1,0 Owner: Account Address ( B ) Version: 2 Contents: sui::coin::Coin { @@ -22,12 +26,14 @@ Contents: sui::coin::Coin { }, } -task 3 'run'. lines 14-14: +task 3, line 14: +//# run sui::pay::split_and_transfer --type-args sui::sui::SUI --args object(1,0) 10 @A --sender B created: object(3,0) mutated: object(0,1), object(1,0) gas summary: computation_cost: 1000000, storage_cost: 2964000, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 4 'view-object'. lines 16-16: +task 4, line 16: +//# view-object 1,0 Owner: Account Address ( B ) Version: 3 Contents: sui::coin::Coin { @@ -41,7 +47,8 @@ Contents: sui::coin::Coin { }, } -task 5 'view-object'. lines 18-18: +task 5, line 18: +//# view-object 3,0 Owner: Account Address ( A ) Version: 3 Contents: sui::coin::Coin { @@ -55,10 +62,12 @@ Contents: sui::coin::Coin { }, } -task 6 'run'. lines 20-20: +task 6, line 20: +//# run sui::pay::split_and_transfer --type-args sui::sui::SUI --args object(1,0) 0 @C --sender A Error: Error checking transaction input objects: IncorrectUserSignature { error: "Object object(1,0) is owned by account address @B, but given owner/signer address is @A" } -task 7 'view-object'. lines 22-22: +task 7, line 22: +//# view-object 1,0 Owner: Account Address ( B ) Version: 3 Contents: sui::coin::Coin { diff --git a/crates/sui-adapter-transactional-tests/tests/sui/freeze.exp b/crates/sui-adapter-transactional-tests/tests/sui/freeze.exp index 3bd80a812a6bc..15340daaf375d 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/freeze.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/freeze.exp @@ -3,24 +3,29 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 8-67: +task 1, lines 8-67: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9317600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 69-69: +task 2, line 69: +//# run test::object_basics::create --args 10 @A --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 71-71: +task 3, line 71: +//# run test::object_basics::freeze_object --args object(2,0) --sender A mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 2362536, non_refundable_storage_fee: 23864 -task 4 'run'. lines 73-73: +task 4, line 73: +//# run test::object_basics::transfer_ --args object(2,0) @A --sender A Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue }, source: None, command: Some(0) } } -task 5 'run'. lines 75-75: +task 5, line 75: +//# run test::object_basics::set_value --args object(2,0) 1 --sender A Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by mutable reference, &mut. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByMutRef }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/sui/freeze_v20.exp b/crates/sui-adapter-transactional-tests/tests/sui/freeze_v20.exp index 3bd80a812a6bc..15340daaf375d 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/freeze_v20.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/freeze_v20.exp @@ -3,24 +3,29 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 8-67: +task 1, lines 8-67: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9317600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 69-69: +task 2, line 69: +//# run test::object_basics::create --args 10 @A --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 71-71: +task 3, line 71: +//# run test::object_basics::freeze_object --args object(2,0) --sender A mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 2362536, non_refundable_storage_fee: 23864 -task 4 'run'. lines 73-73: +task 4, line 73: +//# run test::object_basics::transfer_ --args object(2,0) @A --sender A Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue }, source: None, command: Some(0) } } -task 5 'run'. lines 75-75: +task 5, line 75: +//# run test::object_basics::set_value --args object(2,0) 1 --sender A Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by mutable reference, &mut. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByMutRef }, source: None, command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/sui/move_call_args_type_mismatch.exp b/crates/sui-adapter-transactional-tests/tests/sui/move_call_args_type_mismatch.exp index d560a84c657ff..eb88d85fa48e6 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/move_call_args_type_mismatch.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/move_call_args_type_mismatch.exp @@ -1,14 +1,17 @@ processed 4 tasks -task 1 'publish'. lines 6-13: +task 1, lines 6-13: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 14-16: +task 2, lines 14-16: +//# run Test::M::create --args 10 Error: Transaction Effects Status: Arity mismatch for Move function. The number of arguments does not match the number of parameters Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: ArityMismatch, source: Some("Expected 2 arguments calling function 'create', but found 1"), command: Some(0) } } -task 3 'run'. lines 17-17: +task 3, line 17: +//# run Test::M::create --args 10 10 Error: Transaction Effects Status: Invalid command argument at 1. The argument cannot be deserialized into a value of the specified type Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 1, kind: InvalidBCSBytes }, source: Some("Function expects address but provided argument's value does not match"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/sui/move_call_incorrect_function.exp b/crates/sui-adapter-transactional-tests/tests/sui/move_call_incorrect_function.exp index 052049cc8f495..e0924c22c1fa0 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/move_call_incorrect_function.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/move_call_incorrect_function.exp @@ -1,13 +1,16 @@ processed 4 tasks -task 1 'publish'. lines 8-15: +task 1, lines 8-15: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 16-18: +task 2, lines 16-18: +//# run 0x242::M::create Error: Error checking transaction input objects: DependentPackageNotFound { package_id: 0x0000000000000000000000000000000000000000000000000000000000000242 } -task 3 'run'. lines 19-19: +task 3, line 19: +//# run Test::M::foo Error: Transaction Effects Status: Function Not Found. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: FunctionNotFound, source: Some("Could not resolve function 'foo' in module Test::M"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/sui/object_basics.exp b/crates/sui-adapter-transactional-tests/tests/sui/object_basics.exp index 5585546f29408..f6e6ccb6186ad 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/object_basics.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/object_basics.exp @@ -3,17 +3,20 @@ processed 9 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-67: +task 1, lines 8-67: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 9317600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 69-69: +task 2, line 69: +//# run test::object_basics::create --sender A --args 10 @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 71-71: +task 3, line 71: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::object_basics::Object { @@ -25,11 +28,13 @@ Contents: test::object_basics::Object { value: 10u64, } -task 4 'run'. lines 73-73: +task 4, line 73: +//# run test::object_basics::transfer_ --sender A --args object(2,0) @B mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 2362536, non_refundable_storage_fee: 23864 -task 5 'view-object'. lines 75-75: +task 5, line 75: +//# view-object 2,0 Owner: Account Address ( B ) Version: 3 Contents: test::object_basics::Object { @@ -41,17 +46,20 @@ Contents: test::object_basics::Object { value: 10u64, } -task 6 'run'. lines 77-77: +task 6, line 77: +//# run test::object_basics::create --sender B --args 20 @B created: object(6,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 7 'run'. lines 79-79: +task 7, line 79: +//# run test::object_basics::update --sender B --args object(2,0) object(6,0) events: Event { package_id: test, transaction_module: Identifier("object_basics"), sender: B, type_: StructTag { address: test, module: Identifier("object_basics"), name: Identifier("NewValueEvent"), type_params: [] }, contents: [20, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,1), object(2,0), object(6,0) gas summary: computation_cost: 1000000, storage_cost: 3784800, storage_rebate: 3746952, non_refundable_storage_fee: 37848 -task 8 'run'. lines 81-81: +task 8, line 81: +//# run test::object_basics::delete --sender B --args object(2,0) mutated: object(0,1) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2362536, non_refundable_storage_fee: 23864 diff --git a/crates/sui-adapter-transactional-tests/tests/sui/publish_module_non_zero_address.exp b/crates/sui-adapter-transactional-tests/tests/sui/publish_module_non_zero_address.exp index 40a5fda3f3e7d..edd7240b952ca 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/publish_module_non_zero_address.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/publish_module_non_zero_address.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 8-10: +task 1, lines 8-10: +//# publish Error: Transaction Effects Status: Publish Error, Non-zero Address. The modules in the package must have their self-addresses set to zero. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PublishErrorNonZeroAddress, source: Some("Publishing module M with non-zero address is not allowed"), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/sui/unwrap.exp b/crates/sui-adapter-transactional-tests/tests/sui/unwrap.exp index b7a5a13e7c44c..649762d7bbc1d 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/unwrap.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/unwrap.exp @@ -3,17 +3,20 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 9-68: +task 1, lines 9-68: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 9150400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 70-70: +task 2, line 70: +//# run test::object_basics::create --args 10 @A created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 72-72: +task 3, line 72: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::object_basics::Object { @@ -25,19 +28,22 @@ Contents: test::object_basics::Object { value: 10u64, } -task 4 'run'. lines 74-74: +task 4, line 74: +//# run test::object_basics::wrap --args object(2,0) --sender A created: object(4,0) mutated: object(0,0) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2637200, storage_rebate: 1384416, non_refundable_storage_fee: 13984 -task 5 'run'. lines 76-76: +task 5, line 76: +//# run test::object_basics::unwrap --args object(4,0) --sender A mutated: object(0,0) unwrapped: object(2,0) deleted: object(4,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 2610828, non_refundable_storage_fee: 26372 -task 6 'view-object'. lines 78-78: +task 6, line 78: +//# view-object 2,0 Owner: Account Address ( A ) Version: 5 Contents: test::object_basics::Object { diff --git a/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_delete.exp b/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_delete.exp index 3e6c24806b715..5df7829a86906 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_delete.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_delete.exp @@ -3,34 +3,40 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 14-61: +task 1, lines 14-61: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7516400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 63-63: +task 2, line 63: +//# run test::object_basics::create --args 10 created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 65-65: +task 3, line 65: +//# run test::object_basics::wrap --args object(2,0) created: object(3,0) mutated: object(0,1) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2637200, storage_rebate: 2362536, non_refundable_storage_fee: 23864 -task 4 'run'. lines 67-67: +task 4, line 67: +//# run test::object_basics::unwrap_and_delete --args object(3,0) mutated: object(0,1) deleted: object(3,0) unwrapped_then_deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2610828, non_refundable_storage_fee: 26372 -task 5 'run'. lines 69-69: +task 5, line 69: +//# run test::object_basics::create_and_wrap --args 10 created: object(5,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2637200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 71-71: +task 6, line 71: +//# run test::object_basics::unwrap_and_delete --args object(5,0) mutated: object(0,1) deleted: object(5,0) unwrapped_then_deleted: object(_) diff --git a/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_freeze.exp b/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_freeze.exp index fd653bd2e6a55..fab645d62b9f0 100644 --- a/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_freeze.exp +++ b/crates/sui-adapter-transactional-tests/tests/sui/unwrap_then_freeze.exp @@ -3,17 +3,20 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 9-38: +task 1, lines 9-38: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6946400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 40-40: +task 2, line 40: +//# run test::object_basics::create --args 10 @A created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 42-42: +task 3, line 42: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::object_basics::Object { @@ -25,19 +28,22 @@ Contents: test::object_basics::Object { value: 10u64, } -task 4 'run'. lines 44-44: +task 4, line 44: +//# run test::object_basics::wrap --args object(2,0) --sender A created: object(4,0) mutated: object(0,0) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2637200, storage_rebate: 1384416, non_refundable_storage_fee: 13984 -task 5 'run'. lines 46-46: +task 5, line 46: +//# run test::object_basics::unwrap_and_freeze --args object(4,0) --sender A mutated: object(0,0) unwrapped: object(2,0) deleted: object(4,0) gas summary: computation_cost: 1000000, storage_cost: 2386400, storage_rebate: 2610828, non_refundable_storage_fee: 26372 -task 6 'view-object'. lines 48-48: +task 6, line 48: +//# view-object 2,0 Owner: Immutable Version: 5 Contents: test::object_basics::Object { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store.exp index 4c18c546273c2..989af238130ab 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store.exp @@ -3,17 +3,20 @@ processed 10 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-25: +task 1, lines 8-25: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5783600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run test::m::mint_s --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 29-29: +task 3, line 29: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -24,11 +27,13 @@ Contents: test::m::S { }, } -task 4 'transfer-object'. lines 31-31: +task 4, line 31: +//# transfer-object 2,0 --sender A --recipient B Error: Transaction Effects Status: Invalid Transfer Object, object does not have public transfer. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidTransferObject, source: None, command: Some(0) } } -task 5 'view-object'. lines 33-36: +task 5, lines 33-36: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: test::m::S { @@ -39,12 +44,14 @@ Contents: test::m::S { }, } -task 6 'run'. lines 38-38: +task 6, line 38: +//# run test::m::mint_cup --type-args test::m::S --sender A created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2500400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 40-40: +task 7, line 40: +//# view-object 6,0 Owner: Account Address ( A ) Version: 4 Contents: test::m::Cup { @@ -55,11 +62,13 @@ Contents: test::m::Cup { }, } -task 8 'transfer-object'. lines 42-42: +task 8, line 42: +//# transfer-object 6,0 --sender A --recipient B Error: Transaction Effects Status: Invalid Transfer Object, object does not have public transfer. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: InvalidTransferObject, source: None, command: Some(0) } } -task 9 'view-object'. lines 44-44: +task 9, line 44: +//# view-object 6,0 Owner: Account Address ( A ) Version: 5 Contents: test::m::Cup { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive.exp index b14dc3ecb89c4..7cd5bf8112bc7 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive.exp @@ -3,17 +3,20 @@ processed 20 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-77: +task 1, lines 9-77: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 9659600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 79-79: +task 2, line 79: +//# run test::m::mint_s --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3442800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 81-81: +task 3, line 81: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::m::Parent { @@ -24,7 +27,8 @@ Contents: test::m::Parent { }, } -task 4 'view-object'. lines 83-83: +task 4, line 83: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 2 Contents: test::m::S { @@ -35,17 +39,22 @@ Contents: test::m::S { }, } -task 5 'programmable'. lines 85-87: +task 5, lines 85-87: +//# programmable --sender A --inputs object(2,0) receiving(2,1) +//> 0: test::m::receive_s(Input(0), Input(1)); +//> 1: test::m::destroy_s(Result(0)); mutated: object(0,0), object(2,0) deleted: object(2,1) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 3408372, non_refundable_storage_fee: 34428 -task 6 'run'. lines 89-89: +task 6, line 89: +//# run test::m::mint_cup --sender A --type-args u64 created: object(6,0), object(6,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 91-91: +task 7, line 91: +//# view-object 6,0 Owner: Account Address ( fake(6,1) ) Version: 4 Contents: test::m::Cup { @@ -56,7 +65,8 @@ Contents: test::m::Cup { }, } -task 8 'view-object'. lines 93-93: +task 8, line 93: +//# view-object 6,1 Owner: Account Address ( A ) Version: 4 Contents: test::m::Parent { @@ -67,17 +77,23 @@ Contents: test::m::Parent { }, } -task 9 'programmable'. lines 95-99: +task 9, lines 95-99: +//# programmable --sender A --inputs object(6,1) receiving(6,0) +//> 0: test::m::receive_cup(Input(0), Input(1)); +//> 1: test::m::destroy_cup(Result(0)); +// Try to directly call `public_receive` and `receive` on an object without public transfer. mutated: object(0,0), object(6,1) deleted: object(6,0) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 3430944, non_refundable_storage_fee: 34656 -task 10 'run'. lines 101-101: +task 10, line 101: +//# run test::m::mint_s --sender A created: object(10,0), object(10,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3442800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'view-object'. lines 103-103: +task 11, line 103: +//# view-object 10,0 Owner: Account Address ( A ) Version: 6 Contents: test::m::Parent { @@ -88,7 +104,8 @@ Contents: test::m::Parent { }, } -task 12 'view-object'. lines 105-105: +task 12, line 105: +//# view-object 10,1 Owner: Account Address ( fake(10,0) ) Version: 6 Contents: test::m::S { @@ -99,20 +116,31 @@ Contents: test::m::S { }, } -task 13 'programmable'. lines 107-109: +task 13, lines 107-109: +//# programmable --sender A --inputs object(10,0) receiving(10,1) +//> 0: test::m::parent_uid(Input(0)); +//> 1: sui::transfer::public_receive(Result(0), Input(1)); Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("transfer") }), indices: [], offsets: [] }), command: Some(1) } } -task 14 'programmable'. lines 111-117: +task 14, lines 111-117: +//# programmable --sender A --inputs object(10,0) receiving(10,1) +//> 0: test::m::parent_uid(Input(0)); +//> 1: sui::transfer::receive(Result(0), Input(1)); +// Now publish one with store. We should: +// 1. Not be able to call `receive` to receive it. +// 2. Be able to call `public_receive` to receive it. Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::receive. Use the public variant instead, sui::transfer::public_receive"), command: Some(1) } } -task 15 'run'. lines 119-119: +task 15, line 119: +//# run test::m::mint_store --sender A created: object(15,0), object(15,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3473200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'view-object'. lines 121-121: +task 16, line 121: +//# view-object 15,0 Owner: Account Address ( A ) Version: 9 Contents: test::m::Parent { @@ -123,7 +151,8 @@ Contents: test::m::Parent { }, } -task 17 'view-object'. lines 123-123: +task 17, line 123: +//# view-object 15,1 Owner: Account Address ( fake(15,0) ) Version: 9 Contents: test::m::Store { @@ -134,11 +163,20 @@ Contents: test::m::Store { }, } -task 18 'programmable'. lines 125-129: +task 18, lines 125-129: +//# programmable --sender A --inputs object(15,0) receiving(15,1) +//> 0: test::m::parent_uid(Input(0)); +//> 1: sui::transfer::receive(Result(0), Input(1)); +// Can receive it via a direct `public_receive` call since `Store` has the `store` ability. Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::receive. Use the public variant instead, sui::transfer::public_receive"), command: Some(1) } } -task 19 'programmable'. lines 130-134: +task 19, lines 130-134: +//# programmable --sender A --inputs object(15,0) receiving(15,1) +//> 0: test::m::parent_uid(Input(0)); +//> 1: sui::transfer::public_receive(Result(0), Input(1)); +//> 2: test::m::destroy_store(Result(1)); +//> 3: sui::object::delete(Result(0)); mutated: object(0,0) deleted: object(15,0), object(15,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 3438468, non_refundable_storage_fee: 34732 diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive_version30.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive_version30.exp index 2c1836fc57d9d..1f39e169dd9a0 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive_version30.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/does_not_have_store_receive_version30.exp @@ -3,17 +3,20 @@ processed 18 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 9-77: +task 1, lines 9-77: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 9659600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 79-79: +task 2, line 79: +//# run test::m::mint_s --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3442800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 81-81: +task 3, line 81: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::m::Parent { @@ -24,7 +27,8 @@ Contents: test::m::Parent { }, } -task 4 'view-object'. lines 83-83: +task 4, line 83: +//# view-object 2,1 Owner: Account Address ( fake(2,0) ) Version: 2 Contents: test::m::S { @@ -35,17 +39,22 @@ Contents: test::m::S { }, } -task 5 'programmable'. lines 85-87: +task 5, lines 85-87: +//# programmable --sender A --inputs object(2,0) receiving(2,1) +//> 0: test::m::receive_s(Input(0), Input(1)); +//> 1: test::m::destroy_s(Result(0)); mutated: object(0,0), object(2,0) deleted: object(2,1) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 3408372, non_refundable_storage_fee: 34428 -task 6 'run'. lines 89-89: +task 6, line 89: +//# run test::m::mint_cup --sender A --type-args u64 created: object(6,0), object(6,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 91-91: +task 7, line 91: +//# view-object 6,0 Owner: Account Address ( fake(6,1) ) Version: 4 Contents: test::m::Cup { @@ -56,7 +65,8 @@ Contents: test::m::Cup { }, } -task 8 'view-object'. lines 93-93: +task 8, line 93: +//# view-object 6,1 Owner: Account Address ( A ) Version: 4 Contents: test::m::Parent { @@ -67,17 +77,23 @@ Contents: test::m::Parent { }, } -task 9 'programmable'. lines 95-99: +task 9, lines 95-99: +//# programmable --sender A --inputs object(6,1) receiving(6,0) +//> 0: test::m::receive_cup(Input(0), Input(1)); +//> 1: test::m::destroy_cup(Result(0)); +// Try to directly call`receive` on an object without public transfer this should work up to PV 30. mutated: object(0,0), object(6,1) deleted: object(6,0) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 3430944, non_refundable_storage_fee: 34656 -task 10 'run'. lines 101-101: +task 10, line 101: +//# run test::m::mint_s --sender A created: object(10,0), object(10,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3442800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'view-object'. lines 103-103: +task 11, line 103: +//# view-object 10,0 Owner: Account Address ( A ) Version: 6 Contents: test::m::Parent { @@ -88,7 +104,8 @@ Contents: test::m::Parent { }, } -task 12 'view-object'. lines 105-105: +task 12, line 105: +//# view-object 10,1 Owner: Account Address ( fake(10,0) ) Version: 6 Contents: test::m::S { @@ -99,17 +116,25 @@ Contents: test::m::S { }, } -task 13 'programmable'. lines 107-113: +task 13, lines 107-113: +//# programmable --sender A --inputs object(10,0) receiving(10,1) +//> 0: test::m::parent_uid(Input(0)); +//> 1: sui::transfer::receive(Result(0), Input(1)); +//> 2: test::m::destroy_s(Result(1)); +//> 3: sui::object::delete(Result(0)); +// Now publish one with store. We should still be able to call `receive` to receive it. mutated: object(0,0) deleted: object(10,0), object(10,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 3408372, non_refundable_storage_fee: 34428 -task 14 'run'. lines 115-115: +task 14, line 115: +//# run test::m::mint_store --sender A created: object(14,0), object(14,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3473200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'view-object'. lines 117-117: +task 15, line 117: +//# view-object 14,0 Owner: Account Address ( A ) Version: 8 Contents: test::m::Parent { @@ -120,7 +145,8 @@ Contents: test::m::Parent { }, } -task 16 'view-object'. lines 119-119: +task 16, line 119: +//# view-object 14,1 Owner: Account Address ( fake(14,0) ) Version: 8 Contents: test::m::Store { @@ -131,7 +157,12 @@ Contents: test::m::Store { }, } -task 17 'programmable'. lines 121-125: +task 17, lines 121-125: +//# programmable --sender A --inputs object(14,0) receiving(14,1) +//> 0: test::m::parent_uid(Input(0)); +//> 1: sui::transfer::receive(Result(0), Input(1)); +//> 2: test::m::destroy_store(Result(1)); +//> 3: sui::object::delete(Result(0)); mutated: object(0,0) deleted: object(14,0), object(14,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 3438468, non_refundable_storage_fee: 34732 diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/has_store.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/has_store.exp index 3ff874d0208fe..ac93eda488233 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/has_store.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/has_store.exp @@ -3,17 +3,20 @@ processed 10 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-25: +task 1, lines 8-25: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5905200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run test::m::mint_s --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 29-29: +task 3, line 29: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: test::m::S { @@ -24,11 +27,13 @@ Contents: test::m::S { }, } -task 4 'transfer-object'. lines 31-31: +task 4, line 31: +//# transfer-object 2,0 --sender A --recipient B mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 5 'view-object'. lines 33-36: +task 5, lines 33-36: +//# view-object 2,0 Owner: Account Address ( B ) Version: 3 Contents: test::m::S { @@ -39,12 +44,14 @@ Contents: test::m::S { }, } -task 6 'run'. lines 38-38: +task 6, line 38: +//# run test::m::mint_cup --type-args test::m::S --sender A created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2500400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 40-40: +task 7, line 40: +//# view-object 6,0 Owner: Account Address ( A ) Version: 4 Contents: test::m::Cup { @@ -55,11 +62,13 @@ Contents: test::m::Cup { }, } -task 8 'transfer-object'. lines 42-42: +task 8, line 42: +//# transfer-object 6,0 --sender A --recipient B mutated: object(0,0), object(6,0) gas summary: computation_cost: 1000000, storage_cost: 2500400, storage_rebate: 2475396, non_refundable_storage_fee: 25004 -task 9 'view-object'. lines 44-44: +task 9, line 44: +//# view-object 6,0 Owner: Account Address ( B ) Version: 5 Contents: test::m::Cup { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable.exp index a4ef5095291a4..e1a3371145004 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable.exp @@ -3,17 +3,20 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-19: +task 1, lines 8-19: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5365600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 21-21: +task 2, line 21: +//# run test::m::mint_s --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 23-23: +task 3, line 23: +//# view-object 2,0 Owner: Immutable Version: 2 Contents: test::m::S { @@ -24,11 +27,13 @@ Contents: test::m::S { }, } -task 4 'transfer-object'. lines 25-25: +task 4, line 25: +//# transfer-object 2,0 --sender A --recipient B Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue }, source: None, command: Some(0) } } -task 5 'view-object'. lines 27-27: +task 5, line 27: +//# view-object 2,0 Owner: Immutable Version: 2 Contents: test::m::S { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable_v20.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable_v20.exp index 04d7b53d8ccbd..797f9105fd2f9 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable_v20.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/immutable_v20.exp @@ -3,17 +3,20 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-18: +task 1, lines 8-18: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5365600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 20-20: +task 2, line 20: +//# run test::m::mint_s --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 22-22: +task 3, line 22: +//# view-object 2,0 Owner: Immutable Version: 2 Contents: test::m::S { @@ -24,11 +27,13 @@ Contents: test::m::S { }, } -task 4 'transfer-object'. lines 24-24: +task 4, line 24: +//# transfer-object 2,0 --sender A --recipient B Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue }, source: None, command: Some(0) } } -task 5 'view-object'. lines 26-26: +task 5, line 26: +//# view-object 2,0 Owner: Immutable Version: 2 Contents: test::m::S { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/package.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/package.exp index 36ab467fe97e4..cb6c59fd67505 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/package.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/package.exp @@ -3,16 +3,20 @@ processed 5 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-10: +task 1, lines 8-10: +//# publish --sender A created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3176800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 13-13: +task 2, line 13: +//# view-object 1,0 1,0::m -task 3 'transfer-object'. lines 15-15: +task 3, line 15: +//# transfer-object 1,0 --sender A --recipient B Error: Error checking transaction input objects: MovePackageAsObject { object_id: object(1,0) } -task 4 'view-object'. lines 17-17: +task 4, line 17: +//# view-object 1,0 1,0::m diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/quasi_shared.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/quasi_shared.exp index 54dcdcf0b56cc..4626021d4dcb9 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/quasi_shared.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/quasi_shared.exp @@ -3,22 +3,26 @@ processed 7 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-23: +task 1, lines 8-23: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6148400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 25-25: +task 2, line 25: +//# run test::m::mint_s created: object(2,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 27-27: +task 3, line 27: +//# run test::m::mint_child --args object(2,0) created: object(3,0), object(3,1) mutated: object(0,2), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5890000, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 4 'view-object'. lines 29-29: +task 4, line 29: +//# view-object 3,0 Owner: Object ID: ( fake(2,0) ) Version: 4 Contents: sui::dynamic_field::Field, sui::object::ID> { @@ -35,10 +39,12 @@ Contents: sui::dynamic_field::Field, sui }, } -task 5 'transfer-object'. lines 31-31: +task 5, line 31: +//# transfer-object 3,0 --sender A --recipient B Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(3,0), parent_id: object(2,0) } -task 6 'view-object'. lines 33-33: +task 6, line 33: +//# view-object 3,0 Owner: Object ID: ( fake(2,0) ) Version: 4 Contents: sui::dynamic_field::Field, sui::object::ID> { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/shared.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/shared.exp index 92764ae9b6e9a..3ef6653047a5f 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/shared.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/shared.exp @@ -3,22 +3,26 @@ processed 10 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-25: +task 1, lines 8-25: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5525200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run test::m::mint_s created: object(2,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 29-29: +task 3, line 29: +//# run test::m::mint_s2 created: object(3,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 31-31: +task 4, line 31: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: test::m::S { @@ -29,7 +33,8 @@ Contents: test::m::S { }, } -task 5 'view-object'. lines 33-33: +task 5, line 33: +//# view-object 3,0 Owner: Shared( 4 ) Version: 4 Contents: test::m::S2 { @@ -40,15 +45,18 @@ Contents: test::m::S2 { }, } -task 6 'transfer-object'. lines 35-35: +task 6, line 35: +//# transfer-object 2,0 --sender A --recipient B Error: Transaction Effects Status: Invalid Transfer Object, object does not have public transfer. Debug of error: InvalidTransferObject at command Some(0) -task 7 'transfer-object'. lines 37-37: +task 7, line 37: +//# transfer-object 3,0 --sender A --recipient B Error: Transaction Effects Status: The shared object operation is not allowed. Debug of error: SharedObjectOperationNotAllowed at command None -task 8 'view-object'. lines 39-39: +task 8, line 39: +//# view-object 2,0 Owner: Shared( 3 ) Version: 4 Contents: test::m::S { @@ -59,7 +67,8 @@ Contents: test::m::S { }, } -task 9 'view-object'. lines 41-41: +task 9, line 41: +//# view-object 3,0 Owner: Shared( 4 ) Version: 5 Contents: test::m::S2 { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/shared_v20.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/shared_v20.exp index f9ade9dc97ed0..fa5fa82775ef5 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/shared_v20.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/shared_v20.exp @@ -3,17 +3,20 @@ processed 6 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 8-18: +task 1, lines 8-18: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 4902000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 20-20: +task 2, line 20: +//# run test::m::mint_s created: object(2,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'view-object'. lines 22-22: +task 3, line 22: +//# view-object 2,0 Owner: Shared( 3 ) Version: 3 Contents: test::m::S { @@ -24,11 +27,13 @@ Contents: test::m::S { }, } -task 4 'transfer-object'. lines 24-24: +task 4, line 24: +//# transfer-object 2,0 --sender A --recipient B Error: Transaction Effects Status: Invalid command argument at 0. Immutable objects cannot be passed by-value. Debug of error: CommandArgumentError { arg_idx: 0, kind: InvalidObjectByValue } at command Some(0) -task 5 'view-object'. lines 26-26: +task 5, line 26: +//# view-object 2,0 Owner: Shared( 3 ) Version: 4 Contents: test::m::S { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/transfer_coin.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/transfer_coin.exp index 51d924b6ecfa7..6d4d45576f067 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/transfer_coin.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/transfer_coin.exp @@ -3,11 +3,14 @@ processed 5 tasks init: A: object(0,0), B: object(0,1), C: object(0,2) -task 1 'programmable'. lines 8-9: +task 1, lines 8-9: +//# programmable --sender C --inputs @A +//> TransferObjects([Gas], Input(0)) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'view-object'. lines 11-11: +task 2, line 11: +//# view-object 0,2 Owner: Account Address ( A ) Version: 2 Contents: sui::coin::Coin { @@ -21,11 +24,13 @@ Contents: sui::coin::Coin { }, } -task 3 'transfer-object'. lines 13-13: +task 3, line 13: +//# transfer-object 0,2 --sender A --recipient B mutated: object(0,0), object(0,2) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 15-15: +task 4, line 15: +//# view-object 0,2 Owner: Account Address ( B ) Version: 3 Contents: sui::coin::Coin { diff --git a/crates/sui-adapter-transactional-tests/tests/transfer_object/wrap_unwrap.exp b/crates/sui-adapter-transactional-tests/tests/transfer_object/wrap_unwrap.exp index dd919ca38f437..5c3a2baea3a8e 100644 --- a/crates/sui-adapter-transactional-tests/tests/transfer_object/wrap_unwrap.exp +++ b/crates/sui-adapter-transactional-tests/tests/transfer_object/wrap_unwrap.exp @@ -3,17 +3,20 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 8-39: +task 1, lines 8-39: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6224400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 41-41: +task 2, line 41: +//# run a::m::mint --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 43-43: +task 3, line 43: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: a::m::S { @@ -24,13 +27,15 @@ Contents: a::m::S { }, } -task 4 'run'. lines 45-45: +task 4, line 45: +//# run a::m::wrap --sender A --args object(2,0) created: object(4,0) mutated: object(0,0) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2439600, storage_rebate: 2174436, non_refundable_storage_fee: 21964 -task 5 'view-object'. lines 47-47: +task 5, line 47: +//# view-object 4,0 Owner: Account Address ( A ) Version: 3 Contents: a::m::T { @@ -48,13 +53,15 @@ Contents: a::m::T { }, } -task 6 'run'. lines 49-49: +task 6, line 49: +//# run a::m::unwrap --sender A --args object(4,0) mutated: object(0,0) unwrapped: object(2,0) deleted: object(4,0) gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 2415204, non_refundable_storage_fee: 24396 -task 7 'view-object'. lines 51-51: +task 7, line 51: +//# view-object 2,0 Owner: Account Address ( A ) Version: 4 Contents: a::m::S { diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution.exp index 3191dbfee311b..37132b249b69c 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution.exp @@ -3,29 +3,35 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 14-19: +task 2, lines 14-19: +//# upgrade --package Test1 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 21-26: +task 3, lines 21-26: +//# upgrade --package Test2 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'run'. lines 28-30: +task 4, lines 28-30: +//# run Test1::M1::f1 Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 5 'run'. lines 31-33: +task 5, lines 31-33: +//# run Test2::M1::f1 Error: Transaction Effects Status: Move Runtime Abort. Location: Test2::M1::f1 (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test2, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 6 'run'. lines 34-34: +task 6, line 34: +//# run Test3::M1::f1 Error: Transaction Effects Status: Move Runtime Abort. Location: Test3::M1::f1 (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test3, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution_v46.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution_v46.exp index 022603b7e7b1e..3d1fcbce712c2 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution_v46.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/abort_code_resolution_v46.exp @@ -3,29 +3,35 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 14-19: +task 2, lines 14-19: +//# upgrade --package Test1 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 21-26: +task 3, lines 21-26: +//# upgrade --package Test2 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5084400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'run'. lines 28-30: +task 4, lines 28-30: +//# run Test1::M1::f1 Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 5 'run'. lines 31-33: +task 5, lines 31-33: +//# run Test2::M1::f1 Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 6 'run'. lines 34-34: +task 6, line 34: +//# run Test3::M1::f1 Error: Transaction Effects Status: Move Runtime Abort. Location: Test1::M1::f1 (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: Test1, name: Identifier("M1") }, function: 0, instruction: 1, function_name: Some("f1") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("Test1::M1::f1 at offset 1"), exec_state: None, location: Module(ModuleId { address: Test1, name: Identifier("M1") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade.exp index d4a270c16c699..f6b1bb0e27e47 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade.exp @@ -3,47 +3,58 @@ processed 12 tasks init: A: object(0,0) -task 1 'publish'. lines 6-10: +task 1, lines 6-10: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5388400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 12-18: +task 2, lines 12-18: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 20-23: +task 3, lines 20-23: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 25-28: +task 4, lines 25-28: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 30-33: +task 5, lines 30-33: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 35-38: +task 6, lines 35-38: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 7 'upgrade'. lines 40-43: +task 7, lines 40-43: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 8 'upgrade'. lines 45-48: +task 8, lines 45-48: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("First field of struct Foo must be 'id', dummy_field found"), command: Some(1) } } -task 9 'upgrade'. lines 50-56: +task 9, lines 50-56: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 10 'upgrade'. lines 58-61: +task 10, lines 58-61: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 11 'upgrade'. lines 63-66: +task 11, lines 63-66: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_enum.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_enum.exp index 071545c3d1cf4..6ba80ad0d5383 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_enum.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_enum.exp @@ -3,39 +3,48 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5320000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 13-19: +task 2, lines 13-19: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 21-26: +task 3, lines 21-26: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 28-33: +task 4, lines 28-33: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 35-40: +task 5, lines 35-40: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 42-47: +task 6, lines 42-47: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 7 'upgrade'. lines 49-54: +task 7, lines 49-54: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 8 'upgrade'. lines 56-61: +task 8, lines 56-61: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 9 'upgrade'. lines 63-68: +task 9, lines 63-68: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics.exp index 0dc3495f7018d..b1b9bde010399 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics.exp @@ -3,23 +3,28 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5403600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-14: +task 2, lines 11-14: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 16-19: +task 3, lines 16-19: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 21-24: +task 4, lines 21-24: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 26-29: +task 5, lines 26-29: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics_enum.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics_enum.exp index 5af3a64973ffd..8f19d7f2b541d 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics_enum.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/add_ability_during_upgrade_generics_enum.exp @@ -3,23 +3,28 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5335200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-14: +task 2, lines 11-14: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 16-19: +task 3, lines 16-19: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 21-24: +task 4, lines 21-24: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 26-29: +task 5, lines 26-29: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/add_key_during_upgrade.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/add_key_during_upgrade.exp index 35ae2da09d868..19a5fff96e6e2 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/add_key_during_upgrade.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/add_key_during_upgrade.exp @@ -3,11 +3,13 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 6-14: +task 1, lines 6-14: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6102800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 16-24: +task 2, lines 16-24: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/add_new_type_with_key.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/add_new_type_with_key.exp index 3bb1d2661dddc..a1f5d4c634ed0 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/add_new_type_with_key.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/add_new_type_with_key.exp @@ -3,12 +3,14 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5700000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 13-21: +task 2, lines 13-21: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6102800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/basic.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/basic.exp index e06ce45327543..5a4e5510424d0 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/basic.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/basic.exp @@ -3,11 +3,13 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 6-10: +task 1, lines 6-10: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5646800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 12-15: +task 2, lines 12-15: +//# upgrade --package Test --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/constants.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/constants.exp index ae49decdd131a..1b5950dd78ce7 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/constants.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/constants.exp @@ -3,45 +3,54 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 6-16: +task 1, lines 6-16: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 18-28: +task 2, lines 18-28: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A --policy compatible created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 30-42: +task 3, lines 30-42: +//# upgrade --package V1 --upgrade-capability 1,1 --sender A --policy additive created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'upgrade'. lines 44-54: +task 4, lines 44-54: +//# upgrade --package V2 --upgrade-capability 1,1 --sender A --policy additive Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 56-68: +task 5, lines 56-68: +//# upgrade --package V2 --upgrade-capability 1,1 --sender A --policy dep_only Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 69-87: +task 6, lines 69-87: +//# upgrade --package V2 --upgrade-capability 1,1 --sender A --policy additive created: object(6,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6368800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 7 'upgrade'. lines 88-103: +task 7, lines 88-103: +//# upgrade --package V3 --upgrade-capability 1,1 --sender A --policy additive created: object(7,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6292800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 8 'upgrade'. lines 104-118: +task 8, lines 104-118: +//# upgrade --package V4 --upgrade-capability 1,1 --sender A --policy dep_only created: object(8,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6209200, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 9 'upgrade'. lines 119-132: +task 9, lines 119-132: +//# upgrade --package V5 --upgrade-capability 1,1 --sender A --policy dep_only created: object(9,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6292800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/dep_override.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/dep_override.exp index a972d638fd294..a0ae5ed103369 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/dep_override.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/dep_override.exp @@ -3,52 +3,62 @@ processed 21 tasks init: A: object(0,0) -task 1 'publish'. lines 10-18: +task 1, lines 10-18: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6809600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 20-28: +task 2, lines 20-28: +//# upgrade --package Test_DepDepV1 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6809600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 30-41: +task 3, lines 30-41: +//# upgrade --package Test_DepDepV2 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6809600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'publish'. lines 44-49: +task 4, lines 44-49: +//# publish --upgradeable --dependencies Test_DepDepV1 --sender A created: object(4,0), object(4,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6551200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'upgrade'. lines 51-59: +task 5, lines 51-59: +//# upgrade --package Test_DepV1 --upgrade-capability 4,1 --dependencies Test_DepDepV2 --sender A created: object(5,0) mutated: object(0,0), object(4,1) gas summary: computation_cost: 1000000, storage_cost: 6551200, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'publish'. lines 62-69: +task 6, lines 62-69: +//# publish --upgradeable --dependencies Test_DepV1 Test_DepDepV1 --sender A created: object(6,0), object(6,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7030000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'upgrade'. lines 71-78: +task 7, lines 71-78: +//# upgrade --package Test_V1 --upgrade-capability 6,1 --dependencies Test_DepV2 Test_DepDepV2 --sender A created: object(7,0) mutated: object(0,0), object(6,1) gas summary: computation_cost: 1000000, storage_cost: 7030000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 8 'upgrade'. lines 80-85: +task 8, lines 80-85: +//# upgrade --package Test_V2 --upgrade-capability 6,1 --dependencies Test_DepV1 Test_DepDepV3 --sender A created: object(8,0) mutated: object(0,0), object(6,1) gas summary: computation_cost: 1000000, storage_cost: 7030000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 9 'run'. lines 87-87: +task 9, line 87: +//# run Test_V1::M1::baz created: object(9,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 10 'view-object'. lines 89-89: +task 10, line 89: +//# view-object 9,0 Owner: Shared( 2 ) Version: 2 Contents: Test_DepDepV1::DepDepM1::Obj { @@ -60,12 +70,14 @@ Contents: Test_DepDepV1::DepDepM1::Obj { v: 42u64, } -task 11 'run'. lines 91-91: +task 11, line 91: +//# run Test_V2::M1::baz created: object(11,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 12 'view-object'. lines 93-93: +task 12, line 93: +//# view-object 11,0 Owner: Shared( 3 ) Version: 3 Contents: Test_DepDepV1::DepDepM1::Obj { @@ -77,12 +89,14 @@ Contents: Test_DepDepV1::DepDepM1::Obj { v: 7u64, } -task 13 'run'. lines 95-95: +task 13, line 95: +//# run Test_V3::M1::baz created: object(13,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 14 'view-object'. lines 97-100: +task 14, lines 97-100: +//# view-object 13,0 Owner: Shared( 4 ) Version: 4 Contents: Test_DepDepV1::DepDepM1::Obj { @@ -94,12 +108,16 @@ Contents: Test_DepDepV1::DepDepM1::Obj { v: 0u64, } -task 15 'programmable'. lines 101-103: +task 15, lines 101-103: +//# programmable --sender A +//> 0: Test_V2::M1::baz(); +//> 1: Test_V3::M1::baz(); created: object(15,0), object(15,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'view-object'. lines 105-105: +task 16, line 105: +//# view-object 15,0 Owner: Shared( 10 ) Version: 10 Contents: Test_DepDepV1::DepDepM1::Obj { @@ -111,7 +129,8 @@ Contents: Test_DepDepV1::DepDepM1::Obj { v: 7u64, } -task 17 'view-object'. lines 107-112: +task 17, lines 107-112: +//# view-object 15,1 Owner: Shared( 10 ) Version: 10 Contents: Test_DepDepV1::DepDepM1::Obj { @@ -123,14 +142,17 @@ Contents: Test_DepDepV1::DepDepM1::Obj { v: 0u64, } -task 18 'upgrade'. lines 114-120: +task 18, lines 114-120: +//# upgrade --package Test_V3 --upgrade-capability 6,1 --dependencies Test_DepDepV1 --sender A Error: Transaction Effects Status: Publish/Upgrade Error, Missing dependency. A dependency of a published or upgraded package has not been assigned an on-chain address. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PublishUpgradeMissingDependency, source: None, command: Some(1) } } -task 19 'upgrade'. lines 122-128: +task 19, lines 122-128: +//# upgrade --package Test_V3 --upgrade-capability 6,1 --dependencies Test_DepV2 --sender A Error: Transaction Effects Status: Publish/Upgrade Error, Missing dependency. A dependency of a published or upgraded package has not been assigned an on-chain address. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PublishUpgradeMissingDependency, source: None, command: Some(1) } } -task 20 'upgrade'. lines 130-134: +task 20, lines 130-134: +//# upgrade --package Test_V3 --upgrade-capability 6,1 --dependencies Test_DepV2 Test_DepDepV1 --sender A Error: Transaction Effects Status: Publish/Upgrade Error, Dependency downgrade. Indirect (transitive) dependency of published or upgraded package has been assigned an on-chain version that is less than the version required by one of the package's transitive dependencies. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PublishUpgradeDependencyDowngrade, source: None, command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/enum_struct_swap.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/enum_struct_swap.exp index 64d6f9739bb06..c8feaaf3bfc54 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/enum_struct_swap.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/enum_struct_swap.exp @@ -3,11 +3,13 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 6-16: +task 1, lines 6-16: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 18-26: +task 2, lines 18-26: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/enums.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/enums.exp index a7ded87edb2dc..318434e82b5a4 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/enums.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/enums.exp @@ -3,35 +3,43 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 6-16: +task 1, lines 6-16: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 18-28: +task 2, lines 18-28: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: None, command: Some(1) } } -task 3 'upgrade'. lines 30-40: +task 3, lines 30-40: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 42-45: +task 4, lines 42-45: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: None, command: Some(1) } } -task 5 'upgrade'. lines 47-57: +task 5, lines 47-57: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 59-66: +task 6, lines 59-66: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 7 'upgrade'. lines 68-78: +task 7, lines 68-78: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 8 'upgrade'. lines 80-91: +task 8, lines 80-91: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/friend_fun_changes.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/friend_fun_changes.exp index 024ada4385249..13006a9fddc22 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/friend_fun_changes.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/friend_fun_changes.exp @@ -3,36 +3,43 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 6-20: +task 1, lines 6-20: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7668400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 21-35: +task 2, lines 21-35: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 7683600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 36-60: +task 3, lines 36-60: +//# upgrade --package V1 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 8907200, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'upgrade'. lines 61-83: +task 4, lines 61-83: +//# upgrade --package V2 --upgrade-capability 1,1 --sender A created: object(4,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 9834400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 5 'run'. lines 85-85: +task 5, line 85: +//# run V3::friend_module::call_friend mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 6 'run'. lines 87-87: +task 6, line 87: +//# run V3::friend_module::call_public created: object(6,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2432000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'view-object'. lines 89-89: +task 7, line 89: +//# view-object 6,0 Owner: Account Address ( A ) Version: 3 Contents: V0::base_module::Object { diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/large_module_inclusion_checks.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/large_module_inclusion_checks.exp index d0daf74eb8067..4eb4db4e317d7 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/large_module_inclusion_checks.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/large_module_inclusion_checks.exp @@ -3,39 +3,47 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 6-56: +task 1, lines 6-56: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 11308800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 57-108: +task 2, lines 57-108: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A --policy dep_only Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 109-160: +task 3, lines 109-160: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A --policy additive Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 161-211: +task 4, lines 161-211: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A --policy additive created: object(4,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 11308800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 5 'upgrade'. lines 212-264: +task 5, lines 212-264: +//# upgrade --package V1 --upgrade-capability 1,1 --sender A --policy dep_only Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 265-317: +task 6, lines 265-317: +//# upgrade --package V1 --upgrade-capability 1,1 --sender A --policy additive created: object(6,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 12084000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 7 'upgrade'. lines 318-370: +task 7, lines 318-370: +//# upgrade --package V2 --upgrade-capability 1,1 --sender A --policy dep_only created: object(7,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 12084000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 8 'upgrade'. lines 371-421: +task 8, lines 371-421: +//# upgrade --package V3 --upgrade-capability 1,1 --sender A --policy additive created: object(8,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 12084000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/linkage.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/linkage.exp index 658fbbe803e59..95b7996b05c33 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/linkage.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/linkage.exp @@ -3,22 +3,26 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 6-12: +task 1, lines 6-12: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6216800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 14-24: +task 2, lines 14-24: +//# upgrade --package Test_DepV1 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6520800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'publish'. lines 26-32: +task 3, lines 26-32: +//# publish --upgradeable --dependencies Test_DepV1 --sender A created: object(3,0), object(3,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6201600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'upgrade'. lines 34-41: +task 4, lines 34-41: +//# upgrade --package Test_V1 --upgrade-capability 3,1 --dependencies Test_DepV2 --sender A created: object(4,0) mutated: object(0,0), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 6247200, storage_rebate: 2595780, non_refundable_storage_fee: 26220 diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/modules.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/modules.exp index d2839fcc1a291..b94fbab920a9c 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/modules.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/modules.exp @@ -3,23 +3,28 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 6-27: +task 1, lines 6-27: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 9583600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 28-48: +task 2, lines 28-48: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: None, command: Some(1) } } -task 3 'upgrade'. lines 49-66: +task 3, lines 49-66: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: None, command: Some(1) } } -task 4 'upgrade'. lines 67-85: +task 4, lines 67-85: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some("Existing module b not found in next version of package"), command: Some(1) } } -task 5 'upgrade'. lines 86-102: +task 5, lines 86-102: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some("Existing module a not found in next version of package"), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/multi_version.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/multi_version.exp index 5ae625ea22e1a..359c163c5a23e 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/multi_version.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/multi_version.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5532800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-15: +task 2, lines 11-15: +//# upgrade --package Test_V1 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5646800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 17-20: +task 3, lines 17-20: +//# upgrade --package Test_V2 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/new_types.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/new_types.exp index d582cb79a0f55..6eeb5a74503ac 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/new_types.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/new_types.exp @@ -3,37 +3,44 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 6-18: +task 1, lines 6-18: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7166800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 21-33: +task 2, lines 21-33: +//# upgrade --package Test_DepV1 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 7166800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'publish'. lines 36-47: +task 3, lines 36-47: +//# publish --upgradeable --dependencies Test_DepV1 --sender A created: object(3,0), object(3,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6908400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'upgrade'. lines 49-60: +task 4, lines 49-60: +//# upgrade --package Test_V1 --upgrade-capability 3,1 --dependencies Test_DepV1 --sender A created: object(4,0) mutated: object(0,0), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 6908400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 5 'upgrade'. lines 62-73: +task 5, lines 62-73: +//# upgrade --package Test_V2 --upgrade-capability 3,1 --dependencies Test_DepV2 --sender A created: object(5,0) mutated: object(0,0), object(3,1) gas summary: computation_cost: 1000000, storage_cost: 6908400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'run'. lines 76-76: +task 6, line 76: +//# run Test_DepV1::DepM1::foo created: object(6,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 7 'view-object'. lines 78-80: +task 7, lines 78-80: +//# view-object 6,0 Owner: Shared( 2 ) Version: 2 Contents: Test_DepV1::DepM1::DepObj { @@ -45,11 +52,15 @@ Contents: Test_DepV1::DepM1::DepObj { v: 42u64, } -task 8 'programmable'. lines 81-83: +task 8, lines 81-83: +//# programmable --sender A --inputs object(6,0) +//> 0: Test_DepV1::DepM1::mod_obj(Input(0)); +//> 1: Test_DepV2::DepM1::mod_obj(Input(0)); mutated: object(0,0), object(6,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 2302344, non_refundable_storage_fee: 23256 -task 9 'view-object'. lines 85-88: +task 9, lines 85-88: +//# view-object 6,0 Owner: Shared( 2 ) Version: 7 Contents: Test_DepV1::DepM1::DepObj { @@ -61,11 +72,15 @@ Contents: Test_DepV1::DepM1::DepObj { v: 39u64, } -task 10 'programmable'. lines 89-91: +task 10, lines 89-91: +//# programmable --sender A --inputs object(6,0) +//> 0: Test_V1::M1::mod_dep_obj(Input(0)); +//> 1: Test_V2::M1::mod_dep_obj(Input(0)); mutated: object(0,0), object(6,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 2302344, non_refundable_storage_fee: 23256 -task 11 'view-object'. lines 93-96: +task 11, lines 93-96: +//# view-object 6,0 Owner: Shared( 2 ) Version: 8 Contents: Test_DepV1::DepM1::DepObj { @@ -77,11 +92,15 @@ Contents: Test_DepV1::DepM1::DepObj { v: 37u64, } -task 12 'programmable'. lines 97-99: +task 12, lines 97-99: +//# programmable --sender A --inputs object(6,0) +//> 0: Test_V2::M1::mod_dep_obj(Input(0)); +//> 1: Test_V3::M1::mod_dep_obj(Input(0)); mutated: object(0,0), object(6,0) gas summary: computation_cost: 1000000, storage_cost: 2325600, storage_rebate: 2302344, non_refundable_storage_fee: 23256 -task 13 'view-object'. lines 101-101: +task 13, line 101: +//# view-object 6,0 Owner: Shared( 2 ) Version: 9 Contents: Test_DepV1::DepM1::DepObj { diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/private_fun_changes.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/private_fun_changes.exp index 42ed9c5d36ac9..7d3779a1ba92c 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/private_fun_changes.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/private_fun_changes.exp @@ -3,46 +3,55 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5038800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-14: +task 2, lines 11-14: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5054000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 16-19: +task 3, lines 16-19: +//# upgrade --package V1 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5122400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'upgrade'. lines 21-24: +task 4, lines 21-24: +//# upgrade --package V2 --upgrade-capability 1,1 --sender A created: object(4,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5122400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 5 'upgrade'. lines 26-29: +task 5, lines 26-29: +//# upgrade --package V3 --upgrade-capability 1,1 --sender A created: object(5,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5122400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'upgrade'. lines 31-33: +task 6, lines 31-33: +//# upgrade --package V4 --upgrade-capability 1,1 --sender A created: object(6,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 4856400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 7 'upgrade'. lines 35-38: +task 7, lines 35-38: +//# upgrade --package V5 --upgrade-capability 1,1 --sender A created: object(7,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5122400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 8 'upgrade'. lines 40-43: +task 8, lines 40-43: +//# upgrade --package V6 --upgrade-capability 1,1 --sender A created: object(8,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5122400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 9 'upgrade'. lines 45-48: +task 9, lines 45-48: +//# upgrade --package V7 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/public_fun_changes.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/public_fun_changes.exp index bd3bc6c686f22..3fe4379c86d49 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/public_fun_changes.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/public_fun_changes.exp @@ -3,41 +3,50 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5038800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-14: +task 2, lines 11-14: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 16-19: +task 3, lines 16-19: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 21-24: +task 4, lines 21-24: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 26-29: +task 5, lines 26-29: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 31-34: +task 6, lines 31-34: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A created: object(6,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5038800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 7 'upgrade'. lines 36-39: +task 7, lines 36-39: +//# upgrade --package Test_V1 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 8 'upgrade'. lines 41-44: +task 8, lines 41-44: +//# upgrade --package Test_V1 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 9 'upgrade'. lines 46-49: +task 9, lines 46-49: +//# upgrade --package Test_V1 --upgrade-capability 1,1 --sender A created: object(9,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5038800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/publisher.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/publisher.exp index 3858cf3f14af8..dd5ea6a7c9181 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/publisher.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/publisher.exp @@ -3,20 +3,24 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 6-16: +task 1, lines 6-16: +//# publish --upgradeable --sender A created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 8557600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 18-33: +task 2, lines 18-33: +//# upgrade --package A0 --upgrade-capability 1,2 --sender A created: object(2,0) mutated: object(0,0), object(1,2) gas summary: computation_cost: 1000000, storage_cost: 7691200, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'run'. lines 35-35: +task 3, line 35: +//# run A1::m::test --type-args A0::m::A --args object(1,1) --sender A mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2812000, storage_rebate: 2783880, non_refundable_storage_fee: 28120 -task 4 'run'. lines 37-37: +task 4, line 37: +//# run A1::m::test --type-args A1::m::B --args object(1,1) --sender A mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2812000, storage_rebate: 2783880, non_refundable_storage_fee: 28120 diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_fun_generics.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_fun_generics.exp index 8975b5b657ded..87e8edf32e17f 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_fun_generics.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_fun_generics.exp @@ -3,26 +3,31 @@ processed 6 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5046400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-14: +task 2, lines 11-14: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5046400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 16-19: +task 3, lines 16-19: +//# upgrade --package A1 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5046400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'upgrade'. lines 21-24: +task 4, lines 21-24: +//# upgrade --package A2 --upgrade-capability 1,1 --sender A created: object(4,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5046400, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 5 'upgrade'. lines 26-29: +task 5, lines 26-29: +//# upgrade --package A3 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_generics.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_generics.exp index b221e65f9bc7f..f968d7d361844 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_generics.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_ability_during_upgrade_generics.exp @@ -3,27 +3,33 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5335200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 13-18: +task 2, lines 13-18: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 20-25: +task 3, lines 20-25: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 4 'upgrade'. lines 27-32: +task 4, lines 27-32: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 34-39: +task 5, lines 34-39: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 41-46: +task 6, lines 41-46: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom.exp index 7dd973cbedc56..b255a65c02634 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom.exp @@ -3,15 +3,18 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5403600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-14: +task 2, lines 11-14: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 16-19: +task 3, lines 16-19: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom_enum.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom_enum.exp index 0263ba8ab26ac..a822fbaf4f84f 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom_enum.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/remove_phantom_enum.exp @@ -3,15 +3,18 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5327600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 11-14: +task 2, lines 11-14: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 3 'upgrade'. lines 16-19: +task 3, lines 16-19: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/struct_enum_swap.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/struct_enum_swap.exp index 1a944197ef886..19d11b2d188ed 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/struct_enum_swap.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/struct_enum_swap.exp @@ -3,11 +3,13 @@ processed 3 tasks init: A: object(0,0) -task 1 'publish'. lines 6-14: +task 1, lines 6-14: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5882400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 16-26: +task 2, lines 16-26: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/structs.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/structs.exp index cbd15b302b956..429b0190e321e 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/structs.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/structs.exp @@ -3,27 +3,33 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-14: +task 1, lines 6-14: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5882400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 16-24: +task 2, lines 16-24: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: None, command: Some(1) } } -task 3 'upgrade'. lines 26-29: +task 3, lines 26-29: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: None, command: Some(1) } } -task 4 'upgrade'. lines 31-39: +task 4, lines 31-39: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 5 'upgrade'. lines 41-49: +task 5, lines 41-49: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } -task 6 'upgrade'. lines 51-60: +task 6, lines 51-60: +//# upgrade --package Test_V0 --upgrade-capability 1,1 --sender A Error: Transaction Effects Status: Invalid package upgrade. New package is incompatible with previous version Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: PackageUpgradeError { upgrade_error: IncompatibleUpgrade }, source: Some(PartialVMError { major_status: BACKWARD_INCOMPATIBLE_MODULE_UPDATE, sub_status: None, message: None, exec_state: None, indices: [], offsets: [] }), command: Some(1) } } diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/transitive_linkage.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/transitive_linkage.exp index 696049a49b30e..7e57917f2050a 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/transitive_linkage.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/transitive_linkage.exp @@ -3,32 +3,38 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-12: +task 1, lines 6-12: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6216800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 15-21: +task 2, lines 15-21: +//# upgrade --package Test_DepV1 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6216800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 23-33: +task 3, lines 23-33: +//# upgrade --package Test_DepV2 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6520800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'publish'. lines 36-42: +task 4, lines 36-42: +//# publish --upgradeable --dependencies Test_DepV1 --sender A created: object(4,0), object(4,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6201600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'upgrade'. lines 44-50: +task 5, lines 44-50: +//# upgrade --package Test_V1 --upgrade-capability 4,1 --dependencies Test_DepV2 --sender A created: object(5,0) mutated: object(0,0), object(4,1) gas summary: computation_cost: 1000000, storage_cost: 6201600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'upgrade'. lines 52-59: +task 6, lines 52-59: +//# upgrade --package Test_V2 --upgrade-capability 4,1 --dependencies Test_DepV3 --sender A created: object(6,0) mutated: object(0,0), object(4,1) gas summary: computation_cost: 1000000, storage_cost: 6247200, storage_rebate: 2595780, non_refundable_storage_fee: 26220 diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/type_names.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/type_names.exp index 3198fa30144ce..03f049f4a8df8 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/type_names.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/type_names.exp @@ -3,62 +3,74 @@ processed 20 tasks init: A: object(0,0) -task 1 'publish'. lines 6-16: +task 1, lines 6-16: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6581600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 18-30: +task 2, lines 18-30: +//# upgrade --package A0 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 7280800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'upgrade'. lines 32-62: +task 3, lines 32-62: +//# upgrade --package A1 --upgrade-capability 1,1 --sender A created: object(3,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 9902800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'run'. lines 64-64: +task 4, line 64: +//# run A2::m::canary --type-args A0::m::A --args true --sender A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 66-66: +task 5, line 66: +//# run A2::m::canary --type-args A1::m::B --args true --sender A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 68-68: +task 6, line 68: +//# run A2::m::canary --type-args A0::m::A --args false --sender A created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 70-70: +task 7, line 70: +//# run A2::m::canary --type-args A1::m::B --args false --sender A created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'run'. lines 72-72: +task 8, line 72: +//# run A2::m::canary --type-args A0::m::EA --args true --sender A created: object(8,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'run'. lines 74-74: +task 9, line 74: +//# run A2::m::canary --type-args A1::m::EB --args true --sender A created: object(9,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'run'. lines 76-76: +task 10, line 76: +//# run A2::m::canary --type-args A0::m::EA --args false --sender A created: object(10,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 11 'run'. lines 78-78: +task 11, line 78: +//# run A2::m::canary --type-args A1::m::EB --args false --sender A created: object(11,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2728400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 12 'view-object'. lines 80-80: +task 12, line 80: +//# view-object 4,0 Owner: Account Address ( A ) Version: 5 Contents: A0::m::Canary { @@ -135,7 +147,8 @@ Contents: A0::m::Canary { ], } -task 13 'view-object'. lines 82-82: +task 13, line 82: +//# view-object 5,0 Owner: Account Address ( A ) Version: 6 Contents: A0::m::Canary { @@ -212,7 +225,8 @@ Contents: A0::m::Canary { ], } -task 14 'view-object'. lines 84-84: +task 14, line 84: +//# view-object 6,0 Owner: Account Address ( A ) Version: 7 Contents: A0::m::Canary { @@ -289,7 +303,8 @@ Contents: A0::m::Canary { ], } -task 15 'view-object'. lines 86-86: +task 15, line 86: +//# view-object 7,0 Owner: Account Address ( A ) Version: 8 Contents: A0::m::Canary { @@ -366,7 +381,8 @@ Contents: A0::m::Canary { ], } -task 16 'view-object'. lines 88-88: +task 16, line 88: +//# view-object 8,0 Owner: Account Address ( A ) Version: 9 Contents: A0::m::Canary { @@ -443,7 +459,8 @@ Contents: A0::m::Canary { ], } -task 17 'view-object'. lines 90-90: +task 17, line 90: +//# view-object 9,0 Owner: Account Address ( A ) Version: 10 Contents: A0::m::Canary { @@ -520,7 +537,8 @@ Contents: A0::m::Canary { ], } -task 18 'view-object'. lines 92-92: +task 18, line 92: +//# view-object 10,0 Owner: Account Address ( A ) Version: 11 Contents: A0::m::Canary { @@ -597,7 +615,8 @@ Contents: A0::m::Canary { ], } -task 19 'view-object'. lines 94-94: +task 19, line 94: +//# view-object 11,0 Owner: Account Address ( A ) Version: 12 Contents: A0::m::Canary { diff --git a/crates/sui-adapter-transactional-tests/tests/upgrade/upgrade_ratchet.exp b/crates/sui-adapter-transactional-tests/tests/upgrade/upgrade_ratchet.exp index 4354d89f95f5b..8085097fda15d 100644 --- a/crates/sui-adapter-transactional-tests/tests/upgrade/upgrade_ratchet.exp +++ b/crates/sui-adapter-transactional-tests/tests/upgrade/upgrade_ratchet.exp @@ -3,62 +3,76 @@ processed 15 tasks init: A: object(0,0) -task 1 'publish'. lines 6-12: +task 1, lines 6-12: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5646800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'upgrade'. lines 13-16: +task 2, lines 13-16: +//# upgrade --package V0 --upgrade-capability 1,1 --sender A created: object(2,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5016000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 3 'run'. lines 18-20: +task 3, lines 18-20: +//# run sui::package::only_additive_upgrades --args object(1,1) --sender A mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2622000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 4 'upgrade'. lines 21-26: +task 4, lines 21-26: +//# upgrade --package V1 --upgrade-capability 1,1 --sender A --policy compatible Error: Transaction Effects Status: Move Runtime Abort. Location: sui::package::authorize_upgrade (function index 21) at offset 24, Abort Code: 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("package") }, function: 21, instruction: 24, function_name: Some("authorize_upgrade") }, 1), source: Some(VMError { major_status: ABORTED, sub_status: Some(1), message: Some("sui::package::authorize_upgrade at offset 24"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("package") }), indices: [], offsets: [(FunctionDefinitionIndex(21), 24)] }), command: Some(0) } } -task 5 'upgrade'. lines 27-32: +task 5, lines 27-32: +//# upgrade --package V1 --upgrade-capability 1,1 --sender A --policy additive created: object(5,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5016000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'upgrade'. lines 33-36: +task 6, lines 33-36: +//# upgrade --package V2 --upgrade-capability 1,1 --sender A --policy dep_only created: object(6,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5016000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 7 'run'. lines 38-40: +task 7, lines 38-40: +//# run sui::package::only_dep_upgrades --args object(1,1) --sender A mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2622000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 8 'upgrade'. lines 41-46: +task 8, lines 41-46: +//# upgrade --package V3 --upgrade-capability 1,1 --sender A --policy compatible Error: Transaction Effects Status: Move Runtime Abort. Location: sui::package::authorize_upgrade (function index 21) at offset 24, Abort Code: 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("package") }, function: 21, instruction: 24, function_name: Some("authorize_upgrade") }, 1), source: Some(VMError { major_status: ABORTED, sub_status: Some(1), message: Some("sui::package::authorize_upgrade at offset 24"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("package") }), indices: [], offsets: [(FunctionDefinitionIndex(21), 24)] }), command: Some(0) } } -task 9 'upgrade'. lines 47-52: +task 9, lines 47-52: +//# upgrade --package V3 --upgrade-capability 1,1 --sender A --policy additive Error: Transaction Effects Status: Move Runtime Abort. Location: sui::package::authorize_upgrade (function index 21) at offset 24, Abort Code: 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("package") }, function: 21, instruction: 24, function_name: Some("authorize_upgrade") }, 1), source: Some(VMError { major_status: ABORTED, sub_status: Some(1), message: Some("sui::package::authorize_upgrade at offset 24"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("package") }), indices: [], offsets: [(FunctionDefinitionIndex(21), 24)] }), command: Some(0) } } -task 10 'upgrade'. lines 53-58: +task 10, lines 53-58: +//# upgrade --package V3 --upgrade-capability 1,1 --sender A --policy dep_only created: object(10,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5016000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 11 'run'. lines 59-61: +task 11, lines 59-61: +//# run sui::package::only_additive_upgrades --args object(1,1) --sender A Error: Transaction Effects Status: Move Runtime Abort. Location: sui::package::restrict (function index 23) at offset 10, Abort Code: 1 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("package") }, function: 23, instruction: 10, function_name: Some("restrict") }, 1), source: Some(VMError { major_status: ABORTED, sub_status: Some(1), message: Some("sui::package::restrict at offset 10"), exec_state: None, location: Module(ModuleId { address: sui, name: Identifier("package") }), indices: [], offsets: [(FunctionDefinitionIndex(23), 10)] }), command: Some(0) } } -task 12 'run'. lines 62-62: +task 12, line 62: +//# run sui::package::make_immutable --args object(1,1) --sender A mutated: object(0,0) deleted: object(1,1) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 13 'view-object'. lines 64-66: +task 13, lines 64-66: +//# view-object 1,1 No object at id 1,1 -task 14 'upgrade'. lines 67-70: +task 14, lines 67-70: +//# upgrade --package V4 --upgrade-capability 1,1 --sender A --policy dep_only Error: INVALID TEST. Could not load object argument object(1,1) diff --git a/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp b/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp index c55b0fa1e784f..f5e7f1369bf4e 100644 --- a/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp +++ b/crates/sui-graphql-e2e-tests/tests/available_range/available_range.exp @@ -1,6 +1,7 @@ processed 5 tasks -task 1 'run-graphql'. lines 6-28: +task 1, lines 6-28: +//# run-graphql Response: { "data": { "availableRange": { @@ -24,13 +25,16 @@ Response: { } } -task 2 'create-checkpoint'. lines 30-30: +task 2, line 30: +//# create-checkpoint Checkpoint created: 1 -task 3 'create-checkpoint'. lines 33-33: +task 3, line 33: +//# create-checkpoint Checkpoint created: 2 -task 4 'run-graphql'. lines 36-58: +task 4, lines 36-58: +//# run-graphql Response: { "data": { "availableRange": { diff --git a/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.exp b/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.exp index df3dd4440f982..d9ce0e338c863 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/checkpoint_connection_pagination.exp @@ -1,9 +1,11 @@ processed 18 tasks -task 1 'create-checkpoint'. lines 31-31: +task 1, line 31: +//# create-checkpoint 12 Checkpoint created: 12 -task 2 'run-graphql'. lines 33-45: +task 2, lines 33-45: +//# run-graphql --cursors {"c":12,"s":6} Response: { "data": { "checkpoints": { @@ -41,7 +43,8 @@ Response: { } } -task 3 'run-graphql'. lines 47-59: +task 3, lines 47-59: +//# run-graphql --cursors {"c":12,"s":6} {"c":12,"s":8} Response: { "data": { "checkpoints": { @@ -61,7 +64,8 @@ Response: { } } -task 4 'run-graphql'. lines 61-73: +task 4, lines 61-73: +//# run-graphql --cursors {"c":12,"s":6} Response: { "data": { "checkpoints": { @@ -99,7 +103,8 @@ Response: { } } -task 5 'run-graphql'. lines 75-87: +task 5, lines 75-87: +//# run-graphql --cursors {"c":12,"s":3} {"c":12,"s":6} Response: { "data": { "checkpoints": { @@ -125,7 +130,8 @@ Response: { } } -task 6 'run-graphql'. lines 89-101: +task 6, lines 89-101: +//# run-graphql --cursors {"c":12,"s":3} Response: { "data": { "checkpoints": { @@ -157,7 +163,8 @@ Response: { } } -task 7 'run-graphql'. lines 103-115: +task 7, lines 103-115: +//# run-graphql --cursors {"c":12,"s":6} Response: { "data": { "checkpoints": { @@ -195,7 +202,8 @@ Response: { } } -task 8 'run-graphql'. lines 117-129: +task 8, lines 117-129: +//# run-graphql --cursors {"c":12,"s":4} Response: { "data": { "checkpoints": { @@ -233,7 +241,8 @@ Response: { } } -task 9 'run-graphql'. lines 131-143: +task 9, lines 131-143: +//# run-graphql --cursors {"c":12,"s":4} Response: { "data": { "checkpoints": { @@ -295,7 +304,8 @@ Response: { } } -task 10 'run-graphql'. lines 145-157: +task 10, lines 145-157: +//# run-graphql --cursors {"c":12,"s":6} Response: { "data": { "checkpoints": { @@ -333,7 +343,8 @@ Response: { } } -task 11 'run-graphql'. lines 159-171: +task 11, lines 159-171: +//# run-graphql --cursors {"c":12,"s":3} {"c":12,"s":6} Response: { "data": { "checkpoints": { @@ -359,7 +370,8 @@ Response: { } } -task 12 'run-graphql'. lines 173-185: +task 12, lines 173-185: +//# run-graphql --cursors {"c":12,"s":9} Response: { "data": { "checkpoints": { @@ -391,7 +403,8 @@ Response: { } } -task 13 'run-graphql'. lines 187-199: +task 13, lines 187-199: +//# run-graphql Response: { "data": { "checkpoints": { @@ -483,7 +496,8 @@ Response: { } } -task 14 'run-graphql'. lines 201-213: +task 14, lines 201-213: +//# run-graphql Response: { "data": { "checkpoints": { @@ -521,7 +535,8 @@ Response: { } } -task 15 'run-graphql'. lines 215-227: +task 15, lines 215-227: +//# run-graphql Response: { "data": { "checkpoints": { @@ -559,7 +574,8 @@ Response: { } } -task 16 'run-graphql'. lines 229-241: +task 16, lines 229-241: +//# run-graphql Response: { "data": null, "errors": [ @@ -581,7 +597,8 @@ Response: { ] } -task 17 'run-graphql'. lines 243-256: +task 17, lines 243-256: +//# run-graphql --cursors {"c":10,"s":3} {"c":12,"s":6} Response: { "data": null, "errors": [ diff --git a/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp b/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp index 8a8a3702e5491..d7fd81e48c98b 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/coin_metadata.exp @@ -3,15 +3,18 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-17: +task 1, lines 6-17: +//# publish --sender A created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10617200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 19-19: +task 2, line 19: +//# create-checkpoint Checkpoint created: 1 -task 3 'run-graphql'. lines 21-32: +task 3, lines 21-32: +//# run-graphql Response: { "data": { "coinMetadata": { @@ -26,16 +29,21 @@ Response: { } } -task 4 'programmable'. lines 35-37: +task 4, lines 35-37: +//# programmable --sender A --inputs object(1,2) 100 @A +//> 0: sui::coin::mint(Input(0), Input(1)); +//> TransferObjects([Result(0)], Input(2)) created: object(4,0) mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 2663496, non_refundable_storage_fee: 26904 -task 5 'create-checkpoint'. lines 39-39: +task 5, line 39: +//# create-checkpoint Checkpoint created: 2 -task 6 'run-graphql'. lines 41-52: +task 6, lines 41-52: +//# run-graphql Response: { "data": { "coinMetadata": { diff --git a/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp b/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp index 4ce724a86d1b4..cb95142a98918 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/dynamic_fields.exp @@ -3,30 +3,36 @@ processed 13 tasks init: A: object(0,0) -task 1 'publish'. lines 13-52: +task 1, lines 13-52: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8329600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 54-54: +task 2, line 54: +//# run Test::m::create_obj --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2234400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 56-56: +task 3, line 56: +//# run Test::m::add_df --sender A --args object(2,0) created: object(3,0), object(3,1), object(3,2) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 6536000, storage_rebate: 2212056, non_refundable_storage_fee: 22344 -task 4 'run'. lines 58-58: +task 4, line 58: +//# run Test::m::add_dof --sender A --args object(2,0) created: object(4,0), object(4,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 2212056, non_refundable_storage_fee: 22344 -task 5 'create-checkpoint'. lines 60-60: +task 5, line 60: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 62-85: +task 6, lines 62-85: +//# run-graphql Response: { "data": { "object": { @@ -94,16 +100,19 @@ Response: { } } -task 7 'run'. lines 87-87: +task 7, line 87: +//# run Test::m::wrap --sender A --args object(2,0) created: object(7,0) mutated: object(0,0) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2485200, storage_rebate: 2212056, non_refundable_storage_fee: 22344 -task 8 'create-checkpoint'. lines 89-89: +task 8, line 89: +//# create-checkpoint Checkpoint created: 2 -task 9 'run-graphql'. lines 91-114: +task 9, lines 91-114: +//# run-graphql Response: { "data": { "object": { @@ -171,7 +180,8 @@ Response: { } } -task 10 'run-graphql'. lines 116-141: +task 10, lines 116-141: +//# run-graphql Response: { "data": { "owner": { @@ -251,7 +261,8 @@ Response: { } } -task 11 'run-graphql'. lines 143-163: +task 11, lines 143-163: +//# run-graphql Response: { "data": { "owner": { @@ -277,7 +288,8 @@ Response: { } } -task 12 'run-graphql'. lines 165-176: +task 12, lines 165-176: +//# run-graphql Response: { "data": { "owner": { diff --git a/crates/sui-graphql-e2e-tests/tests/call/owned_objects.exp b/crates/sui-graphql-e2e-tests/tests/call/owned_objects.exp index 5a1c5e7b3df55..941664716c8ed 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/owned_objects.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/owned_objects.exp @@ -1,11 +1,13 @@ processed 11 tasks -task 1 'publish'. lines 22-41: +task 1, lines 22-41: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5570800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run-graphql'. lines 43-61: +task 2, lines 43-61: +//# run-graphql Response: { "data": { "address": { @@ -16,12 +18,14 @@ Response: { } } -task 3 'run'. lines 63-63: +task 3, line 63: +//# run Test::M1::create --args 0 @A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 65-65: +task 4, line 65: +//# view-object 3,0 Owner: Account Address ( A ) Version: 3 Contents: Test::M1::Object { @@ -33,10 +37,12 @@ Contents: Test::M1::Object { value: 0u64, } -task 5 'create-checkpoint'. lines 67-67: +task 5, line 67: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 69-87: +task 6, lines 69-87: +//# run-graphql Response: { "data": { "address": { @@ -58,7 +64,8 @@ Response: { } } -task 7 'run-graphql'. lines 89-107: +task 7, lines 89-107: +//# run-graphql Response: { "data": { "address": { @@ -80,7 +87,8 @@ Response: { } } -task 8 'run-graphql'. lines 109-127: +task 8, lines 109-127: +//# run-graphql Response: { "data": { "address": { @@ -91,7 +99,8 @@ Response: { } } -task 9 'run-graphql'. lines 129-147: +task 9, lines 129-147: +//# run-graphql Response: { "data": { "owner": { @@ -113,7 +122,8 @@ Response: { } } -task 10 'run-graphql'. lines 149-167: +task 10, lines 149-167: +//# run-graphql Response: { "data": { "object": null diff --git a/crates/sui-graphql-e2e-tests/tests/call/simple.exp b/crates/sui-graphql-e2e-tests/tests/call/simple.exp index 6e500c9aa663f..9ac1393da7ca2 100644 --- a/crates/sui-graphql-e2e-tests/tests/call/simple.exp +++ b/crates/sui-graphql-e2e-tests/tests/call/simple.exp @@ -3,22 +3,26 @@ processed 26 tasks init: validator_0: object(0,0) -task 1 'publish'. lines 6-25: +task 1, lines 6-25: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5570800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run Test::M1::create --args 0 @A --gas-price 1000 created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 29-29: +task 3, line 29: +//# run Test::M1::create --args 0 @validator_0 created: object(3,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'view-object'. lines 31-31: +task 4, line 31: +//# view-object 0,0 Owner: Account Address ( validator_0 ) Version: 1 Contents: sui::coin::Coin { @@ -32,7 +36,8 @@ Contents: sui::coin::Coin { }, } -task 5 'view-object'. lines 33-33: +task 5, line 33: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: Test::M1::Object { @@ -44,7 +49,8 @@ Contents: Test::M1::Object { value: 0u64, } -task 6 'view-object'. lines 35-35: +task 6, line 35: +//# view-object 3,0 Owner: Account Address ( validator_0 ) Version: 4 Contents: Test::M1::Object { @@ -56,21 +62,26 @@ Contents: Test::M1::Object { value: 0u64, } -task 7 'create-checkpoint'. lines 37-37: +task 7, line 37: +//# create-checkpoint 4 Checkpoint created: 4 -task 8 'view-checkpoint'. lines 39-39: +task 8, line 39: +//# view-checkpoint CheckpointSummary { epoch: 0, seq: 4, content_digest: D3oWLCcqoa1D15gxzvMaDemNNY8YYVspAkYkcmtQKWRt, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 3000000, storage_cost: 10176400, storage_rebate: 1956240, non_refundable_storage_fee: 19760 }} -task 9 'advance-epoch'. lines 41-41: +task 9, line 41: +//# advance-epoch 6 Epoch advanced: 5 -task 10 'view-checkpoint'. lines 43-43: +task 10, line 43: +//# view-checkpoint CheckpointSummary { epoch: 5, seq: 10, content_digest: BDEsevJNRZ9x9xxb3eCdVtrHpu1EQP6gz2fTCGjcswdL, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 0, storage_cost: 0, storage_rebate: 0, non_refundable_storage_fee: 0 }} -task 11 'run-graphql'. lines 45-50: +task 11, lines 45-50: +//# run-graphql Response: { "data": { "checkpoint": { @@ -79,14 +90,17 @@ Response: { } } -task 12 'create-checkpoint'. lines 52-52: +task 12, line 52: +//# create-checkpoint Checkpoint created: 11 -task 13 'view-checkpoint'. lines 54-54: +task 13, line 54: +//# view-checkpoint CheckpointSummary { epoch: 6, seq: 11, content_digest: D3oWLCcqoa1D15gxzvMaDemNNY8YYVspAkYkcmtQKWRt, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 0, storage_cost: 0, storage_rebate: 0, non_refundable_storage_fee: 0 }} -task 14 'run-graphql'. lines 56-61: +task 14, lines 56-61: +//# run-graphql Response: { "data": { "checkpoint": { @@ -95,7 +109,8 @@ Response: { } } -task 15 'run-graphql'. lines 63-68: +task 15, lines 63-68: +//# run-graphql --show-usage --show-headers --show-service-version Headers: { "content-type": "application/json", "content-length": "157", @@ -124,14 +139,17 @@ Response: { } } -task 16 'view-checkpoint'. lines 70-70: +task 16, line 70: +//# view-checkpoint CheckpointSummary { epoch: 6, seq: 11, content_digest: D3oWLCcqoa1D15gxzvMaDemNNY8YYVspAkYkcmtQKWRt, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 0, storage_cost: 0, storage_rebate: 0, non_refundable_storage_fee: 0 }} -task 17 'advance-epoch'. lines 72-75: +task 17, lines 72-75: +//# advance-epoch Epoch advanced: 6 -task 18 'run-graphql'. lines 77-92: +task 18, lines 77-92: +//# run-graphql Response: { "data": { "address": { @@ -152,7 +170,8 @@ Response: { } } -task 19 'run-graphql'. lines 94-149: +task 19, lines 94-149: +//# run-graphql Response: { "data": { "address": { @@ -247,7 +266,8 @@ Response: { } } -task 20 'run-graphql'. lines 151-167: +task 20, lines 151-167: +//# run-graphql Response: { "data": { "epoch": { @@ -269,7 +289,8 @@ Response: { } } -task 21 'run-graphql'. lines 169-175: +task 21, lines 169-175: +//# run-graphql Response: { "data": { "epoch": { @@ -278,22 +299,26 @@ Response: { } } -task 22 'run'. lines 177-177: +task 22, line 177: +//# run Test::M1::create --args 0 @A --gas-price 999 created: object(22,0) mutated: object(0,1) gas summary: computation_cost: 999000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 23 'run'. lines 179-179: +task 23, line 179: +//# run Test::M1::create --args 0 @A --gas-price 1000 created: object(23,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 24 'run'. lines 181-181: +task 24, line 181: +//# run Test::M1::create --args 0 @A --gas-price 235 created: object(24,0) mutated: object(0,1) gas summary: computation_cost: 235000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 25 'run-graphql'. lines 183-188: +task 25, lines 183-188: +//# run-graphql Response: { "data": { "serviceConfig": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp b/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp index 4dfca4529cdf7..0420427fbe84c 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/balances.exp @@ -3,49 +3,63 @@ processed 34 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 19-46: +task 1, lines 19-46: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 15663600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 48-48: +task 2, line 48: +//# create-checkpoint Checkpoint created: 1 -task 3 'programmable'. lines 50-52: +task 3, lines 50-52: +//# programmable --sender A --inputs object(1,5) 100 object(1,1) +//> 0: sui::coin::mint(Input(0), Input(1)); +//> MergeCoins(Input(2), [Result(0)]); mutated: object(0,0), object(1,1), object(1,5) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 3972672, non_refundable_storage_fee: 40128 -task 4 'create-checkpoint'. lines 54-54: +task 4, line 54: +//# create-checkpoint Checkpoint created: 2 -task 5 'transfer-object'. lines 56-56: +task 5, line 56: +//# transfer-object 1,2 --sender A --recipient B mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 -task 6 'create-checkpoint'. lines 58-58: +task 6, line 58: +//# create-checkpoint Checkpoint created: 3 -task 7 'transfer-object'. lines 60-60: +task 7, line 60: +//# transfer-object 1,3 --sender A --recipient B mutated: object(0,0), object(1,3) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 -task 9 'create-checkpoint'. lines 64-64: +task 9, line 64: +//# create-checkpoint Checkpoint created: 4 -task 11 'create-checkpoint'. lines 68-68: +task 11, line 68: +//# create-checkpoint Checkpoint created: 5 -task 13 'create-checkpoint'. lines 72-72: +task 13, line 72: +//# create-checkpoint Checkpoint created: 6 -task 15 'create-checkpoint'. lines 76-76: +task 15, line 76: +//# create-checkpoint Checkpoint created: 7 -task 16 'run-graphql'. lines 78-99: +task 16, lines 78-99: +//# run-graphql --cursors {"c":2,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -80,7 +94,8 @@ Response: { } } -task 17 'run-graphql'. lines 101-122: +task 17, lines 101-122: +//# run-graphql --cursors {"c":3,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -115,7 +130,8 @@ Response: { } } -task 18 'run-graphql'. lines 124-145: +task 18, lines 124-145: +//# run-graphql --cursors {"c":4,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -150,13 +166,16 @@ Response: { } } -task 19 'force-object-snapshot-catchup'. lines 147-147: +task 19, line 147: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 3 Objects snapshot updated to [0 to 3) -task 20 'create-checkpoint'. lines 149-149: +task 20, line 149: +//# create-checkpoint Checkpoint created: 8 -task 21 'run-graphql'. lines 151-172: +task 21, lines 151-172: +//# run-graphql --cursors {"c":2,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -191,7 +210,8 @@ Response: { } } -task 22 'run-graphql'. lines 174-195: +task 22, lines 174-195: +//# run-graphql --cursors {"c":3,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -226,7 +246,8 @@ Response: { } } -task 23 'run-graphql'. lines 197-218: +task 23, lines 197-218: +//# run-graphql --cursors {"c":4,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -261,13 +282,16 @@ Response: { } } -task 24 'force-object-snapshot-catchup'. lines 220-220: +task 24, line 220: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 4 Objects snapshot updated to [0 to 4) -task 25 'create-checkpoint'. lines 222-222: +task 25, line 222: +//# create-checkpoint Checkpoint created: 9 -task 26 'run-graphql'. lines 224-245: +task 26, lines 224-245: +//# run-graphql --cursors {"c":2,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -301,7 +325,8 @@ Response: { ] } -task 27 'run-graphql'. lines 247-268: +task 27, lines 247-268: +//# run-graphql --cursors {"c":3,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -336,7 +361,8 @@ Response: { } } -task 28 'run-graphql'. lines 270-291: +task 28, lines 270-291: +//# run-graphql --cursors {"c":4,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -371,13 +397,16 @@ Response: { } } -task 29 'force-object-snapshot-catchup'. lines 294-294: +task 29, line 294: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 6 Objects snapshot updated to [0 to 6) -task 30 'create-checkpoint'. lines 296-296: +task 30, line 296: +//# create-checkpoint Checkpoint created: 10 -task 31 'run-graphql'. lines 298-319: +task 31, lines 298-319: +//# run-graphql --cursors {"c":2,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -411,7 +440,8 @@ Response: { ] } -task 32 'run-graphql'. lines 321-342: +task 32, lines 321-342: +//# run-graphql --cursors {"c":3,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { @@ -445,7 +475,8 @@ Response: { ] } -task 33 'run-graphql'. lines 344-365: +task 33, lines 344-365: +//# run-graphql --cursors {"c":4,"t":1,"tc":1} Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp b/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp index d16fa51988c57..a02e97976ee4a 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp @@ -3,66 +3,80 @@ processed 16 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 13-26: +task 1, lines 13-26: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5175600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 28-28: +task 2, line 28: +//# run Test::M1::create --args 0 @A --sender A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 30-30: +task 3, line 30: +//# run Test::M1::create --args 0 @A --sender A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 32-32: +task 4, line 32: +//# run Test::M1::create --args 0 @A --sender A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 34-34: +task 5, line 34: +//# run Test::M1::create --args 0 @A --sender A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'create-checkpoint'. lines 36-36: +task 6, line 36: +//# create-checkpoint Checkpoint created: 1 -task 7 'run'. lines 38-38: +task 7, line 38: +//# run Test::M1::create --args 0 @A --sender A created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'run'. lines 40-40: +task 8, line 40: +//# run Test::M1::create --args 0 @A --sender A created: object(8,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'run'. lines 42-42: +task 9, line 42: +//# run Test::M1::create --args 0 @A --sender A created: object(9,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'create-checkpoint'. lines 44-44: +task 10, line 44: +//# create-checkpoint Checkpoint created: 2 -task 11 'run'. lines 46-46: +task 11, line 46: +//# run Test::M1::create --args 0 @A --sender A created: object(11,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 12 'run'. lines 48-48: +task 12, line 48: +//# run Test::M1::create --args 0 @A --sender A created: object(12,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 13 'create-checkpoint'. lines 50-50: +task 13, line 50: +//# create-checkpoint Checkpoint created: 3 -task 14 'run-graphql'. lines 52-76: +task 14, lines 52-76: +//# run-graphql Response: { "data": { "checkpoints": { @@ -234,7 +248,8 @@ Response: { } } -task 15 'run-graphql'. lines 78-95: +task 15, lines 78-95: +//# run-graphql Response: { "data": { "checkpoints": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp b/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp index 776aa9ef21110..93d37879a2a4e 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/coins.exp @@ -3,24 +3,31 @@ processed 21 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 12-39: +task 1, lines 12-39: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 15663600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 41-41: +task 2, line 41: +//# create-checkpoint Checkpoint created: 1 -task 3 'programmable'. lines 43-45: +task 3, lines 43-45: +//# programmable --sender A --inputs object(1,5) 100000 object(1,1) +//> 0: sui::coin::mint(Input(0), Input(1)); +//> MergeCoins(Input(2), [Result(0)]); mutated: object(0,0), object(1,1), object(1,5) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 4012800, storage_rebate: 3972672, non_refundable_storage_fee: 40128 -task 4 'create-checkpoint'. lines 47-47: +task 4, line 47: +//# create-checkpoint Checkpoint created: 2 -task 5 'run-graphql'. lines 49-90: +task 5, lines 49-90: +//# run-graphql Response: { "data": { "queryCoinsAtLatest": { @@ -258,7 +265,8 @@ Response: { } } -task 6 'run-graphql'. lines 92-133: +task 6, lines 92-133: +//# run-graphql --cursors @{obj_1_3,1} Response: { "data": { "queryCoinsAtChkpt1": { @@ -422,20 +430,24 @@ Response: { } } -task 7 'transfer-object'. lines 135-135: +task 7, line 135: +//# transfer-object 1,2 --sender A --recipient B mutated: object(0,0), object(1,2) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 -task 8 'transfer-object'. lines 137-137: +task 8, line 137: +//# transfer-object 1,3 --sender A --recipient B mutated: object(0,0), object(1,3) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 2310400, storage_rebate: 2287296, non_refundable_storage_fee: 23104 -task 9 'create-checkpoint'. lines 139-139: +task 9, line 139: +//# create-checkpoint Checkpoint created: 3 -task 10 'run-graphql'. lines 141-194: +task 10, lines 141-194: +//# run-graphql Response: { "data": { "queryCoins": { @@ -627,16 +639,20 @@ Response: { } } -task 12 'create-checkpoint'. lines 198-198: +task 12, line 198: +//# create-checkpoint Checkpoint created: 4 -task 14 'create-checkpoint'. lines 202-202: +task 14, line 202: +//# create-checkpoint Checkpoint created: 5 -task 16 'create-checkpoint'. lines 206-206: +task 16, line 206: +//# create-checkpoint Checkpoint created: 6 -task 17 'run-graphql'. lines 208-249: +task 17, lines 208-249: +//# run-graphql --cursors @{obj_1_3,1} Response: { "data": { "queryCoinsAtChkpt1BeforeSnapshotCatchup": { @@ -800,13 +816,16 @@ Response: { } } -task 18 'force-object-snapshot-catchup'. lines 251-251: +task 18, line 251: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 4 Objects snapshot updated to [0 to 4) -task 19 'create-checkpoint'. lines 253-253: +task 19, line 253: +//# create-checkpoint Checkpoint created: 7 -task 20 'run-graphql'. lines 255-284: +task 20, lines 255-284: +//# run-graphql --cursors @{obj_1_3,1} Response: { "data": null, "errors": [ diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp index b49d3833680b4..096429dcc4757 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp @@ -3,17 +3,20 @@ processed 13 tasks init: A: object(0,0) -task 1 'publish'. lines 14-55: +task 1, lines 14-55: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8474000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 57-57: +task 2, line 57: +//# run Test::M1::parent --sender A --args @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 59-59: +task 3, line 59: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: Test::M1::Parent { @@ -25,12 +28,14 @@ Contents: Test::M1::Parent { count: 0u64, } -task 4 'run'. lines 61-61: +task 4, line 61: +//# run Test::M1::add_df --sender A --args object(2,0) created: object(4,0), object(4,1), object(4,2) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 8664000, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 5 'view-object'. lines 63-63: +task 5, line 63: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: Test::M1::Parent { @@ -42,12 +47,14 @@ Contents: Test::M1::Parent { count: 0u64, } -task 6 'run'. lines 65-65: +task 6, line 65: +//# run Test::M1::add_more_df --sender A --args object(2,0) created: object(6,0), object(6,1), object(6,2) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 8664000, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 7 'view-object'. lines 67-67: +task 7, line 67: +//# view-object 2,0 Owner: Account Address ( A ) Version: 4 Contents: Test::M1::Parent { @@ -59,19 +66,23 @@ Contents: Test::M1::Parent { count: 0u64, } -task 8 'run'. lines 69-69: +task 8, line 69: +//# run Test::M1::remove_df --sender A --args object(2,0) mutated: object(0,0), object(2,0) deleted: object(4,0), object(4,1), object(4,2) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 8577360, non_refundable_storage_fee: 86640 -task 9 'run'. lines 71-71: +task 9, line 71: +//# run Test::M1::mutate_parent --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 10 'create-checkpoint'. lines 73-73: +task 10, line 73: +//# create-checkpoint Checkpoint created: 1 -task 11 'run-graphql'. lines 75-138: +task 11, lines 75-138: +//# run-graphql Response: { "data": { "latest": { @@ -264,7 +275,8 @@ Response: { } } -task 12 'run-graphql'. lines 140-178: +task 12, lines 140-178: +//# run-graphql Response: { "data": { "latest_owner": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp index b6210cde55e02..f31230c2b72ac 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp @@ -3,29 +3,37 @@ processed 13 tasks init: A: object(0,0) -task 1 'publish'. lines 14-58: +task 1, lines 14-58: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7949600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 60-62: +task 2, lines 60-62: +//# programmable --sender A --inputs @A +//> 0: Test::M1::child(Input(0)); +//> 1: Test::M1::parent(Input(0)); created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 64-64: +task 3, line 64: +//# run Test::M1::add_child --sender A --args object(2,1) object(2,0) 42 created: object(3,0) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 4 'run'. lines 66-66: +task 4, line 66: +//# run Test::M1::mutate_parent --sender A --args object(2,1) mutated: object(0,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 5 'create-checkpoint'. lines 68-68: +task 5, line 68: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 70-127: +task 6, lines 70-127: +//# run-graphql Response: { "data": { "latest": { @@ -123,15 +131,18 @@ Response: { } } -task 7 'run'. lines 129-129: +task 7, line 129: +//# run Test::M1::delete_child --sender A --args object(2,1) 42 mutated: object(0,0), object(2,1) deleted: object(2,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 6004152, non_refundable_storage_fee: 60648 -task 8 'create-checkpoint'. lines 131-131: +task 8, line 131: +//# create-checkpoint Checkpoint created: 2 -task 9 'run-graphql'. lines 133-184: +task 9, lines 133-184: +//# run-graphql Response: { "data": { "latest": { @@ -167,14 +178,17 @@ Response: { } } -task 10 'run'. lines 186-186: +task 10, line 186: +//# run Test::M1::mutate_parent --sender A --args object(2,1) mutated: object(0,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 11 'create-checkpoint'. lines 188-188: +task 11, line 188: +//# create-checkpoint Checkpoint created: 3 -task 12 'run-graphql'. lines 190-253: +task 12, lines 190-253: +//# run-graphql Response: { "data": { "latest": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp index b4bf34c302834..512f602e83bfe 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp @@ -3,25 +3,32 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 19-58: +task 1, lines 19-58: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7600000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 60-62: +task 2, lines 60-62: +//# programmable --sender A --inputs @A +//> 0: Test::M1::child(Input(0)); +//> 1: Test::M1::parent(Input(0)); created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 64-64: +task 3, line 64: +//# run Test::M1::add_child --sender A --args object(2,1) object(2,0) 42 created: object(3,0) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 4 'create-checkpoint'. lines 66-66: +task 4, line 66: +//# create-checkpoint Checkpoint created: 1 -task 5 'run-graphql'. lines 68-130: +task 5, lines 68-130: +//# run-graphql Response: { "data": { "latest": { @@ -141,15 +148,18 @@ Response: { } } -task 6 'run'. lines 132-132: +task 6, line 132: +//# run Test::M1::reclaim_and_transfer_child --sender A --args object(2,1) 42 @A mutated: object(0,0), object(2,0), object(2,1) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 6004152, non_refundable_storage_fee: 60648 -task 7 'create-checkpoint'. lines 134-134: +task 7, line 134: +//# create-checkpoint Checkpoint created: 2 -task 8 'run-graphql'. lines 136-186: +task 8, lines 136-186: +//# run-graphql Response: { "data": { "latest": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp index 5761c7338afa0..010d862209187 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp @@ -3,45 +3,57 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 18-57: +task 1, lines 18-57: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7600000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 59-62: +task 2, lines 59-62: +//# programmable --sender A --inputs @A +//> 0: Test::M1::child(Input(0)); +//> 1: Test::M1::parent(Input(0)); +//> 2: Test::M1::parent(Input(0)); created: object(2,0), object(2,1), object(2,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4924800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 64-64: +task 3, line 64: +//# run Test::M1::add_child --sender A --args object(2,1) object(2,0) 42 created: object(3,0) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 4 'run'. lines 66-66: +task 4, line 66: +//# run Test::M1::reclaim_and_transfer_child --sender A --args object(2,1) 42 @A mutated: object(0,0), object(2,0), object(2,1) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 6004152, non_refundable_storage_fee: 60648 -task 5 'run'. lines 68-68: +task 5, line 68: +//# run Test::M1::add_child --sender A --args object(2,2) object(2,0) 42 created: object(5,0) mutated: object(0,0), object(2,0), object(2,2) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 6 'run'. lines 70-70: +task 6, line 70: +//# run Test::M1::reclaim_and_transfer_child --sender A --args object(2,2) 42 @A mutated: object(0,0), object(2,0), object(2,2) deleted: object(5,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 6004152, non_refundable_storage_fee: 60648 -task 7 'run'. lines 72-72: +task 7, line 72: +//# run Test::M1::add_child --sender A --args object(2,1) object(2,0) 42 created: object(3,0) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 8 'create-checkpoint'. lines 74-74: +task 8, line 74: +//# create-checkpoint Checkpoint created: 1 -task 9 'run-graphql'. lines 76-156: +task 9, lines 76-156: +//# run-graphql Response: { "data": { "latest": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp index 4278c2f57e771..afbfbb96ca3a1 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp @@ -3,17 +3,22 @@ processed 35 tasks init: A: object(0,0) -task 1 'publish'. lines 12-82: +task 1, lines 12-82: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 11012400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 84-86: +task 2, lines 84-86: +//# programmable --sender A --inputs @A 42 +//> 0: Test::M1::parent(Input(0)); +//> 1: Test::M1::child(Input(0)); created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3549200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 88-88: +task 3, line 88: +//# view-object 2,1 Owner: Account Address ( A ) Version: 2 Contents: Test::M1::Parent { @@ -24,7 +29,8 @@ Contents: Test::M1::Parent { }, } -task 4 'view-object'. lines 90-90: +task 4, line 90: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: Test::M1::Child { @@ -36,12 +42,16 @@ Contents: Test::M1::Child { count: 0u64, } -task 5 'programmable'. lines 92-94: +task 5, lines 92-94: +//# programmable --sender A --inputs object(2,1) object(2,0) 420 +//> Test::M1::add_child(Input(0), Input(1), Input(2)); +//> Test::M1::mutate_child_via_parent(Input(0), Input(2)); created: object(5,0) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6004000, storage_rebate: 3513708, non_refundable_storage_fee: 35492 -task 6 'view-object'. lines 96-96: +task 6, line 96: +//# view-object 2,1 Owner: Account Address ( A ) Version: 3 Contents: Test::M1::Parent { @@ -52,7 +62,8 @@ Contents: Test::M1::Parent { }, } -task 7 'view-object'. lines 98-98: +task 7, line 98: +//# view-object 2,0 Owner: Object ID: ( fake(5,0) ) Version: 3 Contents: Test::M1::Child { @@ -64,10 +75,12 @@ Contents: Test::M1::Child { count: 1u64, } -task 8 'create-checkpoint'. lines 100-100: +task 8, line 100: +//# create-checkpoint Checkpoint created: 1 -task 9 'run-graphql'. lines 102-164: +task 9, lines 102-164: +//# run-graphql Response: { "data": { "parent_version_2_no_dof": { @@ -115,12 +128,16 @@ Response: { } } -task 10 'programmable'. lines 166-168: +task 10, lines 166-168: +//# programmable --sender A --inputs object(2,1) 420 +//> Test::M1::mutate_child_via_parent(Input(0), Input(1)); +//> Test::M1::add_df(Input(0)); created: object(10,0), object(10,1), object(10,2) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 9910400, storage_rebate: 3513708, non_refundable_storage_fee: 35492 -task 11 'view-object'. lines 170-170: +task 11, line 170: +//# view-object 2,1 Owner: Account Address ( A ) Version: 4 Contents: Test::M1::Parent { @@ -131,7 +148,8 @@ Contents: Test::M1::Parent { }, } -task 12 'view-object'. lines 172-172: +task 12, line 172: +//# view-object 2,0 Owner: Object ID: ( fake(5,0) ) Version: 4 Contents: Test::M1::Child { @@ -143,10 +161,12 @@ Contents: Test::M1::Child { count: 2u64, } -task 13 'create-checkpoint'. lines 174-174: +task 13, line 174: +//# create-checkpoint Checkpoint created: 2 -task 14 'run-graphql'. lines 176-236: +task 14, lines 176-236: +//# run-graphql --cursors @{obj_5_0,1} @{obj_5_0,2} Response: { "data": { "parent_version_4_show_dof_and_dfs": { @@ -293,7 +313,8 @@ Response: { } } -task 15 'run-graphql'. lines 238-275: +task 15, lines 238-275: +//# run-graphql Response: { "data": { "parent_version_3": { @@ -347,12 +368,15 @@ Response: { } } -task 16 'programmable'. lines 278-279: +task 16, lines 278-279: +//# programmable --sender A --inputs object(2,1) +//> Test::M1::add_more_df(Input(0)); created: object(16,0), object(16,1), object(16,2) mutated: object(0,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 8603200, storage_rebate: 2219580, non_refundable_storage_fee: 22420 -task 17 'view-object'. lines 281-281: +task 17, line 281: +//# view-object 2,1 Owner: Account Address ( A ) Version: 5 Contents: Test::M1::Parent { @@ -363,7 +387,8 @@ Contents: Test::M1::Parent { }, } -task 18 'view-object'. lines 283-283: +task 18, line 283: +//# view-object 2,0 Owner: Object ID: ( fake(5,0) ) Version: 4 Contents: Test::M1::Child { @@ -375,10 +400,12 @@ Contents: Test::M1::Child { count: 2u64, } -task 19 'create-checkpoint'. lines 285-285: +task 19, line 285: +//# create-checkpoint Checkpoint created: 3 -task 20 'run-graphql'. lines 287-337: +task 20, lines 287-337: +//# run-graphql --cursors @{obj_5_0,2} @{obj_5_0,3} Response: { "data": { "parent_version_4_has_4_children": { @@ -670,12 +697,15 @@ Response: { } } -task 21 'programmable'. lines 339-340: +task 21, lines 339-340: +//# programmable --sender A --inputs object(2,1) 420 +//> Test::M1::remove_df(Input(0)); mutated: object(0,0), object(2,1) deleted: object(10,0), object(10,1), object(10,2) gas summary: computation_cost: 1000000, storage_cost: 2242000, storage_rebate: 8517168, non_refundable_storage_fee: 86032 -task 22 'view-object'. lines 342-342: +task 22, line 342: +//# view-object 2,1 Owner: Account Address ( A ) Version: 6 Contents: Test::M1::Parent { @@ -686,7 +716,8 @@ Contents: Test::M1::Parent { }, } -task 23 'view-object'. lines 344-344: +task 23, line 344: +//# view-object 2,0 Owner: Object ID: ( fake(5,0) ) Version: 4 Contents: Test::M1::Child { @@ -698,10 +729,12 @@ Contents: Test::M1::Child { count: 2u64, } -task 24 'create-checkpoint'. lines 346-346: +task 24, line 346: +//# create-checkpoint Checkpoint created: 4 -task 25 'run-graphql'. lines 348-398: +task 25, lines 348-398: +//# run-graphql --cursors @{obj_5_0,2} @{obj_5_0,4} Response: { "data": { "parent_version_4_has_df1_2_3": { @@ -923,7 +956,8 @@ Response: { } } -task 26 'run-graphql'. lines 400-431: +task 26, lines 400-431: +//# run-graphql Response: { "data": { "parent_version_4": { @@ -945,19 +979,24 @@ Response: { } } -task 28 'create-checkpoint'. lines 435-435: +task 28, line 435: +//# create-checkpoint Checkpoint created: 5 -task 30 'create-checkpoint'. lines 439-439: +task 30, line 439: +//# create-checkpoint Checkpoint created: 6 -task 31 'force-object-snapshot-catchup'. lines 441-441: +task 31, line 441: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 5 Objects snapshot updated to [0 to 5) -task 32 'create-checkpoint'. lines 443-443: +task 32, line 443: +//# create-checkpoint Checkpoint created: 7 -task 33 'run-graphql'. lines 445-495: +task 33, lines 445-495: +//# run-graphql --cursors @{obj_5_0,2} @{obj_5_0,4} Response: { "data": { "parent_version_4_outside_consistent_range": { @@ -1122,7 +1161,8 @@ Response: { ] } -task 34 'run-graphql'. lines 497-528: +task 34, lines 497-528: +//# run-graphql Response: { "data": { "parent_version_4": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp index aef62d9a8bf46..9b299a409ae9e 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp @@ -3,45 +3,54 @@ processed 17 tasks init: A: object(0,0) -task 1 'publish'. lines 20-68: +task 1, lines 20-68: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8770400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 70-70: +task 2, line 70: +//# run Test::M1::parent --sender A --args @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 72-72: +task 3, line 72: +//# run Test::M1::child --sender A --args @A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2295200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 74-74: +task 4, line 74: +//# run Test::M1::child --sender A --args @A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2295200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 76-76: +task 5, line 76: +//# run Test::M1::add_child --sender A --args object(2,0) object(3,0) 42 created: object(5,0) mutated: object(0,0), object(2,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 6 'run'. lines 78-78: +task 6, line 78: +//# run Test::M1::add_nested_child --sender A --args object(2,0) 42 object(4,0) 420 created: object(6,0) mutated: object(0,0), object(2,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 7 'run'. lines 80-80: +task 7, line 80: +//# run Test::M1::reclaim_and_freeze_child --sender A --args object(2,0) 42 mutated: object(0,0), object(2,0), object(3,0) deleted: object(5,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 6004152, non_refundable_storage_fee: 60648 -task 8 'create-checkpoint'. lines 82-82: +task 8, line 82: +//# create-checkpoint Checkpoint created: 1 -task 9 'run-graphql'. lines 84-114: +task 9, lines 84-114: +//# run-graphql Response: { "data": { "object": { @@ -68,7 +77,8 @@ Response: { } } -task 10 'run-graphql'. lines 116-146: +task 10, lines 116-146: +//# run-graphql Response: { "data": { "object": { @@ -108,7 +118,8 @@ Response: { } } -task 11 'run-graphql'. lines 148-178: +task 11, lines 148-178: +//# run-graphql Response: { "data": { "object": { @@ -119,14 +130,16 @@ Response: { } } -task 12 'run-graphql'. lines 180-210: +task 12, lines 180-210: +//# run-graphql Response: { "data": { "object": null } } -task 13 'run-graphql'. lines 212-239: +task 13, lines 212-239: +//# run-graphql Response: { "data": { "object": { @@ -142,14 +155,16 @@ Response: { } } -task 14 'run-graphql'. lines 241-258: +task 14, lines 241-258: +//# run-graphql Response: { "data": { "object": null } } -task 15 'run-graphql'. lines 260-287: +task 15, lines 260-287: +//# run-graphql Response: { "data": { "object": { @@ -176,7 +191,8 @@ Response: { } } -task 16 'run-graphql'. lines 289-316: +task 16, lines 289-316: +//# run-graphql Response: { "data": { "object": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp index 0a343b5ec74e3..eba8ea1f3697a 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp @@ -3,17 +3,20 @@ processed 17 tasks init: A: object(0,0) -task 1 'publish'. lines 14-45: +task 1, lines 14-45: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7828000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 47-47: +task 2, line 47: +//# run Test::M1::parent --sender A --args @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'view-object'. lines 49-49: +task 3, line 49: +//# view-object 2,0 Owner: Account Address ( A ) Version: 2 Contents: Test::M1::Parent { @@ -25,12 +28,14 @@ Contents: Test::M1::Parent { count: 0u64, } -task 4 'run'. lines 51-51: +task 4, line 51: +//# run Test::M1::add_df --sender A --args object(2,0) created: object(4,0), object(4,1), object(4,2) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 8664000, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 5 'view-object'. lines 53-53: +task 5, line 53: +//# view-object 2,0 Owner: Account Address ( A ) Version: 3 Contents: Test::M1::Parent { @@ -42,11 +47,13 @@ Contents: Test::M1::Parent { count: 0u64, } -task 6 'run'. lines 55-55: +task 6, line 55: +//# run Test::M1::mutate_parent --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 7 'view-object'. lines 57-57: +task 7, line 57: +//# view-object 2,0 Owner: Account Address ( A ) Version: 4 Contents: Test::M1::Parent { @@ -58,10 +65,12 @@ Contents: Test::M1::Parent { count: 42u64, } -task 8 'create-checkpoint'. lines 59-59: +task 8, line 59: +//# create-checkpoint Checkpoint created: 1 -task 9 'run-graphql'. lines 61-109: +task 9, lines 61-109: +//# run-graphql Response: { "data": { "latest": { @@ -130,7 +139,8 @@ Response: { } } -task 10 'view-object'. lines 111-111: +task 10, line 111: +//# view-object 2,0 Owner: Account Address ( A ) Version: 4 Contents: Test::M1::Parent { @@ -142,11 +152,13 @@ Contents: Test::M1::Parent { count: 42u64, } -task 11 'run'. lines 113-113: +task 11, line 113: +//# run Test::M1::mutate_df1 --sender A --args object(2,0) mutated: object(0,0), object(2,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 4484000, storage_rebate: 4378968, non_refundable_storage_fee: 44232 -task 12 'view-object'. lines 115-115: +task 12, line 115: +//# view-object 2,0 Owner: Account Address ( A ) Version: 5 Contents: Test::M1::Parent { @@ -158,11 +170,13 @@ Contents: Test::M1::Parent { count: 42u64, } -task 13 'run'. lines 117-117: +task 13, line 117: +//# run Test::M1::mutate_parent --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 14 'view-object'. lines 119-119: +task 14, line 119: +//# view-object 2,0 Owner: Account Address ( A ) Version: 6 Contents: Test::M1::Parent { @@ -174,10 +188,12 @@ Contents: Test::M1::Parent { count: 84u64, } -task 15 'create-checkpoint'. lines 121-121: +task 15, line 121: +//# create-checkpoint Checkpoint created: 2 -task 16 'run-graphql'. lines 123-171: +task 16, lines 123-171: +//# run-graphql Response: { "data": { "latest": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp index 0c061bcc5bd11..2acec4d99870e 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp @@ -3,29 +3,37 @@ processed 14 tasks init: A: object(0,0) -task 1 'publish'. lines 15-62: +task 1, lines 15-62: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8390400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 64-66: +task 2, lines 64-66: +//# programmable --sender A --inputs @A +//> 0: Test::M1::child(Input(0)); +//> 1: Test::M1::parent(Input(0)); created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 68-68: +task 3, line 68: +//# run Test::M1::add_child --sender A --args object(2,1) object(2,0) 42 created: object(3,0) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 4 'run'. lines 70-70: +task 4, line 70: +//# run Test::M1::mutate_parent --sender A --args object(2,1) mutated: object(0,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 5 'create-checkpoint'. lines 72-72: +task 5, line 72: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 74-131: +task 6, lines 74-131: +//# run-graphql Response: { "data": { "latest": { @@ -123,15 +131,18 @@ Response: { } } -task 7 'run'. lines 133-133: +task 7, line 133: +//# run Test::M1::reclaim_and_transfer_child --sender A --args object(2,1) 42 @A mutated: object(0,0), object(2,0), object(2,1) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 6004152, non_refundable_storage_fee: 60648 -task 8 'create-checkpoint'. lines 135-135: +task 8, line 135: +//# create-checkpoint Checkpoint created: 2 -task 9 'run-graphql'. lines 137-188: +task 9, lines 137-188: +//# run-graphql Response: { "data": { "latest": { @@ -167,19 +178,23 @@ Response: { } } -task 10 'run'. lines 190-190: +task 10, line 190: +//# run Test::M1::mutate_child --sender A --args object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2295200, storage_rebate: 2272248, non_refundable_storage_fee: 22952 -task 11 'run'. lines 192-192: +task 11, line 192: +//# run Test::M1::add_child --sender A --args object(2,1) object(2,0) 42 created: object(3,0) mutated: object(0,0), object(2,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 12 'create-checkpoint'. lines 194-194: +task 12, line 194: +//# create-checkpoint Checkpoint created: 3 -task 13 'run-graphql'. lines 196-259: +task 13, lines 196-259: +//# run-graphql Response: { "data": { "latest": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp index 08ed54af8a328..54a0230eff3e7 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp @@ -3,48 +3,58 @@ processed 17 tasks init: A: object(0,0) -task 1 'publish'. lines 24-75: +task 1, lines 24-75: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 8960400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 77-77: +task 2, line 77: +//# run Test::M1::parent --sender A --args @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 79-79: +task 3, line 79: +//# run Test::M1::child --sender A --args @A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2295200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 81-81: +task 4, line 81: +//# run Test::M1::child --sender A --args @A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2295200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 83-83: +task 5, line 83: +//# run Test::M1::add_child --sender A --args object(2,0) object(3,0) 42 created: object(5,0) mutated: object(0,0), object(2,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 6 'run'. lines 85-85: +task 6, line 85: +//# run Test::M1::add_nested_child --sender A --args object(2,0) 42 object(4,0) 420 created: object(6,0) mutated: object(0,0), object(2,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 6064800, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 7 'run'. lines 87-87: +task 7, line 87: +//# run Test::M1::mutate_child_on_parent --sender A --args object(2,0) 42 mutated: object(0,0), object(2,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 8 'run'. lines 89-89: +task 8, line 89: +//# run Test::M1::mutate_nested_child_on_parent --sender A --args object(2,0) 42 420 mutated: object(0,0), object(2,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 3610000, storage_rebate: 3573900, non_refundable_storage_fee: 36100 -task 9 'create-checkpoint'. lines 91-91: +task 9, line 91: +//# create-checkpoint Checkpoint created: 1 -task 10 'run-graphql'. lines 93-123: +task 10, lines 93-123: +//# run-graphql Response: { "data": { "object": { @@ -71,7 +81,8 @@ Response: { } } -task 11 'run-graphql'. lines 125-155: +task 11, lines 125-155: +//# run-graphql Response: { "data": { "object": { @@ -111,7 +122,8 @@ Response: { } } -task 12 'run-graphql'. lines 157-187: +task 12, lines 157-187: +//# run-graphql Response: { "data": { "object": { @@ -151,7 +163,8 @@ Response: { } } -task 13 'run-graphql'. lines 189-219: +task 13, lines 189-219: +//# run-graphql Response: { "data": { "object": { @@ -191,7 +204,8 @@ Response: { } } -task 14 'run-graphql'. lines 221-238: +task 14, lines 221-238: +//# run-graphql Response: { "data": { "object": { @@ -202,14 +216,16 @@ Response: { } } -task 15 'run-graphql'. lines 240-257: +task 15, lines 240-257: +//# run-graphql Response: { "data": { "object": null } } -task 16 'run-graphql'. lines 259-276: +task 16, lines 259-276: +//# run-graphql Response: { "data": { "object": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.exp b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.exp index 5db1f2f90e73c..b92ffe6535b0a 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/checkpoints.exp @@ -3,16 +3,20 @@ processed 16 tasks init: A: object(0,0), B: object(0,1) -task 1 'create-checkpoint'. lines 13-13: +task 1, line 13: +//# create-checkpoint Checkpoint created: 1 -task 2 'create-checkpoint'. lines 15-15: +task 2, line 15: +//# create-checkpoint Checkpoint created: 2 -task 3 'advance-epoch'. lines 17-17: +task 3, line 17: +//# advance-epoch Epoch advanced: 0 -task 4 'run-graphql'. lines 19-34: +task 4, lines 19-34: +//# run-graphql Response: { "data": { "checkpoint": { @@ -40,25 +44,32 @@ Response: { } } -task 5 'create-checkpoint'. lines 36-36: +task 5, line 36: +//# create-checkpoint Checkpoint created: 4 -task 6 'create-checkpoint'. lines 38-38: +task 6, line 38: +//# create-checkpoint Checkpoint created: 5 -task 7 'create-checkpoint'. lines 40-40: +task 7, line 40: +//# create-checkpoint Checkpoint created: 6 -task 8 'advance-epoch'. lines 42-42: +task 8, line 42: +//# advance-epoch Epoch advanced: 1 -task 9 'create-checkpoint'. lines 44-44: +task 9, line 44: +//# create-checkpoint Checkpoint created: 8 -task 10 'create-checkpoint'. lines 46-46: +task 10, line 46: +//# create-checkpoint Checkpoint created: 9 -task 11 'run-graphql'. lines 48-87: +task 11, lines 48-87: +//# run-graphql Response: { "data": { "checkpoint": { @@ -148,10 +159,12 @@ Response: { } } -task 12 'create-checkpoint'. lines 89-89: +task 12, line 89: +//# create-checkpoint Checkpoint created: 10 -task 13 'run-graphql'. lines 91-122: +task 13, lines 91-122: +//# run-graphql --cursors {"s":3,"c":4} {"s":7,"c":8} {"s":9,"c":10} Response: { "data": { "checkpoint": { @@ -202,7 +215,8 @@ Response: { } } -task 14 'run-graphql'. lines 124-155: +task 14, lines 124-155: +//# run-graphql --cursors {"s":0,"c":3} {"s":4,"c":7} {"s":8,"c":9} Response: { "data": { "checkpoint": { @@ -253,7 +267,8 @@ Response: { } } -task 15 'run-graphql'. lines 157-188: +task 15, lines 157-188: +//# run-graphql --cursors {"s":1,"c":2} {"s":5,"c":6} {"s":9,"c":9} Response: { "data": { "checkpoint": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp index 58a47cd86d052..721c1e0dafaf0 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp @@ -3,26 +3,32 @@ processed 26 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 22-35: +task 1, lines 22-35: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5175600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 37-37: +task 2, line 37: +//# create-checkpoint Checkpoint created: 1 -task 3 'run'. lines 39-39: +task 3, line 39: +//# run Test::M1::create --args 0 @A --sender A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 4 'create-checkpoint'. lines 41-41: +task 4, line 41: +//# create-checkpoint Checkpoint created: 2 -task 5 'advance-epoch'. lines 43-43: +task 5, line 43: +//# advance-epoch Epoch advanced: 0 -task 6 'run-graphql'. lines 45-61: +task 6, lines 45-61: +//# run-graphql Response: { "data": { "checkpoint": { @@ -62,64 +68,80 @@ Response: { } } -task 7 'run'. lines 63-63: +task 7, line 63: +//# run Test::M1::create --args 0 @A --sender A created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'create-checkpoint'. lines 65-65: +task 8, line 65: +//# create-checkpoint Checkpoint created: 4 -task 9 'run'. lines 67-67: +task 9, line 67: +//# run Test::M1::create --args 0 @A --sender A created: object(9,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'create-checkpoint'. lines 69-69: +task 10, line 69: +//# create-checkpoint Checkpoint created: 5 -task 11 'run'. lines 71-71: +task 11, line 71: +//# run Test::M1::create --args 0 @A --sender A created: object(11,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 12 'create-checkpoint'. lines 73-73: +task 12, line 73: +//# create-checkpoint Checkpoint created: 6 -task 13 'advance-epoch'. lines 75-75: +task 13, line 75: +//# advance-epoch Epoch advanced: 1 -task 14 'run'. lines 77-77: +task 14, line 77: +//# run Test::M1::create --args 0 @A --sender A created: object(14,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'create-checkpoint'. lines 79-79: +task 15, line 79: +//# create-checkpoint Checkpoint created: 8 -task 16 'run'. lines 81-81: +task 16, line 81: +//# run Test::M1::create --args 0 @A --sender A created: object(16,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 17 'create-checkpoint'. lines 83-83: +task 17, line 83: +//# create-checkpoint Checkpoint created: 9 -task 18 'run'. lines 85-85: +task 18, line 85: +//# run Test::M1::create --args 0 @A --sender A created: object(18,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 19 'create-checkpoint'. lines 87-87: +task 19, line 87: +//# create-checkpoint Checkpoint created: 10 -task 20 'advance-epoch'. lines 89-89: +task 20, line 89: +//# advance-epoch Epoch advanced: 2 -task 21 'advance-epoch'. lines 91-91: +task 21, line 91: +//# advance-epoch Epoch advanced: 3 -task 22 'run-graphql'. lines 93-157: +task 22, lines 93-157: +//# run-graphql --cursors {"t":3,"tc":3,"c":4} {"t":7,"tc":7,"c":8} {"t":11,"tc":11,"c":12} Response: { "data": { "checkpoint": { @@ -359,7 +381,8 @@ Response: { } } -task 23 'run-graphql'. lines 159-199: +task 23, lines 159-199: +//# run-graphql --cursors {"t":0,"tc":0,"c":7} {"t":4,"tc":4,"c":11} {"t":8,"tc":8,"c":12} Response: { "data": { "checkpoint": { @@ -443,7 +466,8 @@ Response: { } } -task 24 'run-graphql'. lines 201-241: +task 24, lines 201-241: +//# run-graphql --cursors {"t":1,"tc":1,"c":2} {"t":5,"tc":5,"c":6} {"t":9,"tc":9,"c":10} Response: { "data": { "checkpoint": { @@ -491,7 +515,8 @@ Response: { } } -task 25 'run-graphql'. lines 243-282: +task 25, lines 243-282: +//# run-graphql --cursors {"t":5,"tc":5,"c":6} Response: { "data": { "checkpoint": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp b/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp index 86fa7bf15e70b..5c5af6023700e 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/object_at_version.exp @@ -3,20 +3,24 @@ processed 20 tasks init: A: object(0,0) -task 1 'publish'. lines 19-56: +task 1, lines 19-56: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7014800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 58-58: +task 2, line 58: +//# run Test::M1::create --args 0 @A created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'create-checkpoint'. lines 60-60: +task 3, line 60: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 62-75: +task 4, lines 62-75: +//# run-graphql Response: { "data": { "object": { @@ -34,14 +38,17 @@ Response: { } } -task 5 'run'. lines 77-77: +task 5, line 77: +//# run Test::M1::update --sender A --args object(2,0) 1 mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 1301652, non_refundable_storage_fee: 13148 -task 6 'create-checkpoint'. lines 79-79: +task 6, line 79: +//# create-checkpoint Checkpoint created: 2 -task 7 'run-graphql'. lines 81-107: +task 7, lines 81-107: +//# run-graphql Response: { "data": { "latest_version": { @@ -71,16 +78,19 @@ Response: { } } -task 8 'run'. lines 109-109: +task 8, line 109: +//# run Test::M1::wrap --sender A --args object(2,0) created: object(8,0) mutated: object(0,0) wrapped: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2553600, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 9 'create-checkpoint'. lines 111-111: +task 9, line 111: +//# create-checkpoint Checkpoint created: 3 -task 10 'run-graphql'. lines 113-139: +task 10, lines 113-139: +//# run-graphql Response: { "data": { "latest_wrapped": { @@ -103,16 +113,19 @@ Response: { } } -task 11 'run'. lines 141-141: +task 11, line 141: +//# run Test::M1::unwrap --sender A --args object(8,0) mutated: object(0,0) unwrapped: object(2,0) deleted: object(8,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2528064, non_refundable_storage_fee: 25536 -task 12 'create-checkpoint'. lines 143-143: +task 12, line 143: +//# create-checkpoint Checkpoint created: 4 -task 13 'run-graphql'. lines 145-183: +task 13, lines 145-183: +//# run-graphql Response: { "data": { "latest_unwrapped": { @@ -147,15 +160,18 @@ Response: { } } -task 14 'run'. lines 185-185: +task 14, line 185: +//# run Test::M1::delete --sender A --args object(2,0) mutated: object(0,0) deleted: object(2,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 15 'create-checkpoint'. lines 187-187: +task 15, line 187: +//# create-checkpoint Checkpoint created: 5 -task 16 'run-graphql'. lines 189-215: +task 16, lines 189-215: +//# run-graphql Response: { "data": { "latest_deleted": { @@ -171,13 +187,16 @@ Response: { } } -task 17 'force-object-snapshot-catchup'. lines 217-217: +task 17, line 217: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 5 Objects snapshot updated to [0 to 5) -task 18 'create-checkpoint'. lines 219-219: +task 18, line 219: +//# create-checkpoint Checkpoint created: 6 -task 19 'run-graphql'. lines 221-260: +task 19, lines 221-260: +//# run-graphql Response: { "data": { "object_within_available_range": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp index 26492d64de0e2..b79c01ea4f6d8 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination.exp @@ -3,25 +3,30 @@ processed 24 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 15-28: +task 1, lines 15-28: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5175600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 30-30: +task 2, line 30: +//# run Test::M1::create --args 0 @A created: object(2,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 32-32: +task 3, line 32: +//# run Test::M1::create --args 1 @A created: object(3,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'create-checkpoint'. lines 34-34: +task 4, line 34: +//# create-checkpoint Checkpoint created: 1 -task 5 'run-graphql'. lines 36-64: +task 5, lines 36-64: +//# run-graphql --cursors @{obj_2_0} @{obj_3_0} Response: { "data": { "one_of_these_will_yield_an_object": { @@ -50,20 +55,24 @@ Response: { } } -task 6 'run'. lines 66-66: +task 6, line 66: +//# run Test::M1::create --args 2 @A created: object(6,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 68-68: +task 7, line 68: +//# run Test::M1::create --args 3 @A created: object(7,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'create-checkpoint'. lines 70-70: +task 8, line 70: +//# create-checkpoint Checkpoint created: 2 -task 9 'run-graphql'. lines 72-100: +task 9, lines 72-100: +//# run-graphql --cursors @{obj_2_0,1} @{obj_3_0,1} Response: { "data": { "paginating_on_checkpoint_1": { @@ -92,7 +101,8 @@ Response: { } } -task 10 'run-graphql'. lines 102-117: +task 10, lines 102-117: +//# run-graphql Response: { "data": { "four_objects": { @@ -152,7 +162,8 @@ Response: { } } -task 11 'run-graphql'. lines 119-144: +task 11, lines 119-144: +//# run-graphql Response: { "data": { "objects_at_version": { @@ -212,14 +223,18 @@ Response: { } } -task 12 'programmable'. lines 146-147: +task 12, lines 146-147: +//# programmable --sender A --inputs object(2,0) object(3,0) object(6,0) object(7,0) @B +//> TransferObjects([Input(0), Input(1), Input(2), Input(3)], Input(4)) mutated: object(0,0), object(2,0), object(3,0), object(6,0), object(7,0) gas summary: computation_cost: 1000000, storage_cost: 6247200, storage_rebate: 5206608, non_refundable_storage_fee: 52592 -task 13 'create-checkpoint'. lines 149-149: +task 13, line 149: +//# create-checkpoint Checkpoint created: 3 -task 14 'run-graphql'. lines 151-213: +task 14, lines 151-213: +//# run-graphql --cursors @{obj_6_0,2} Response: { "data": { "after_obj_6_0_at_checkpoint_2": { @@ -486,19 +501,24 @@ Response: { } } -task 16 'create-checkpoint'. lines 217-217: +task 16, line 217: +//# create-checkpoint Checkpoint created: 4 -task 18 'create-checkpoint'. lines 221-221: +task 18, line 221: +//# create-checkpoint Checkpoint created: 5 -task 19 'force-object-snapshot-catchup'. lines 223-223: +task 19, line 223: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 4 Objects snapshot updated to [0 to 4) -task 20 'create-checkpoint'. lines 225-225: +task 20, line 225: +//# create-checkpoint Checkpoint created: 6 -task 21 'run-graphql'. lines 227-242: +task 21, lines 227-242: +//# run-graphql --cursors @{obj_6_0,2} Response: { "data": null, "errors": [ @@ -520,7 +540,8 @@ Response: { ] } -task 22 'run-graphql'. lines 244-260: +task 22, lines 244-260: +//# run-graphql Response: { "data": { "owned_by_address_b_latest": { @@ -580,7 +601,8 @@ Response: { } } -task 23 'run-graphql'. lines 262-288: +task 23, lines 262-288: +//# run-graphql Response: { "data": { "objects_at_version": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp index eb78279ac0352..526cf915ec05d 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp @@ -3,29 +3,35 @@ processed 15 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 10-27: +task 1, lines 10-27: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5456800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 29-29: +task 2, line 29: +//# run Test::M1::create --args 0 @A created: object(2,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 31-31: +task 3, line 31: +//# run Test::M1::create --args 1 @A created: object(3,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 33-33: +task 4, line 33: +//# run Test::M1::update --sender A --args 100 object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 1301652, non_refundable_storage_fee: 13148 -task 5 'create-checkpoint'. lines 35-35: +task 5, line 35: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 37-65: +task 6, lines 37-65: +//# run-graphql --cursors @{obj_3_0} Response: { "data": { "after_obj_3_0": { @@ -54,14 +60,17 @@ Response: { } } -task 7 'run'. lines 67-67: +task 7, line 67: +//# run Test::M1::update --sender A --args 200 object(2,0) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 8 'create-checkpoint'. lines 69-69: +task 8, line 69: +//# create-checkpoint Checkpoint created: 2 -task 9 'run-graphql'. lines 71-100: +task 9, lines 71-100: +//# run-graphql --cursors @{obj_3_0,1} Response: { "data": { "after_obj_3_0_chkpt_1": { @@ -90,7 +99,8 @@ Response: { } } -task 10 'run-graphql'. lines 102-177: +task 10, lines 102-177: +//# run-graphql --cursors @{obj_3_0,2} Response: { "data": { "address": { @@ -181,14 +191,17 @@ Response: { } } -task 11 'run'. lines 179-179: +task 11, line 179: +//# run Test::M1::update --sender A --args 300 object(3,0) mutated: object(0,0), object(3,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 12 'create-checkpoint'. lines 181-181: +task 12, line 181: +//# create-checkpoint Checkpoint created: 3 -task 13 'run-graphql'. lines 183-246: +task 13, lines 183-246: +//# run-graphql --cursors @{obj_3_0,2} Response: { "data": { "after_obj_3_0_chkpt_2": { @@ -249,7 +262,8 @@ Response: { } } -task 14 'run-graphql'. lines 248-323: +task 14, lines 248-323: +//# run-graphql --cursors @{obj_3_0,3} Response: { "data": { "address": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp b/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp index dc0cc60eadd7e..41d03f006b926 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/performance/many_objects.exp @@ -3,20 +3,24 @@ processed 13 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 12-35: +task 1, lines 12-35: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 6118000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 37-37: +task 2, line 37: +//# run Test::M1::create_many --sender A --args @A created: object(2,0), object(2,1), object(2,2), object(2,3), object(2,4), object(2,5), object(2,6), object(2,7), object(2,8), object(2,9), object(2,10), object(2,11), object(2,12), object(2,13), object(2,14), object(2,15), object(2,16), object(2,17), object(2,18), object(2,19), object(2,20), object(2,21), object(2,22), object(2,23), object(2,24), object(2,25), object(2,26), object(2,27), object(2,28), object(2,29), object(2,30), object(2,31), object(2,32), object(2,33), object(2,34), object(2,35), object(2,36), object(2,37), object(2,38), object(2,39), object(2,40), object(2,41), object(2,42), object(2,43), object(2,44), object(2,45), object(2,46), object(2,47), object(2,48), object(2,49), object(2,50), object(2,51), object(2,52), object(2,53), object(2,54), object(2,55), object(2,56), object(2,57), object(2,58), object(2,59), object(2,60), object(2,61), object(2,62), object(2,63), object(2,64), object(2,65), object(2,66), object(2,67), object(2,68), object(2,69), object(2,70), object(2,71), object(2,72), object(2,73), object(2,74), object(2,75), object(2,76), object(2,77), object(2,78), object(2,79), object(2,80), object(2,81), object(2,82), object(2,83), object(2,84), object(2,85), object(2,86), object(2,87), object(2,88), object(2,89), object(2,90), object(2,91), object(2,92), object(2,93), object(2,94), object(2,95), object(2,96), object(2,97), object(2,98), object(2,99), object(2,100), object(2,101), object(2,102), object(2,103), object(2,104), object(2,105), object(2,106), object(2,107), object(2,108), object(2,109), object(2,110), object(2,111), object(2,112), object(2,113), object(2,114), object(2,115), object(2,116), object(2,117), object(2,118), object(2,119), object(2,120), object(2,121), object(2,122), object(2,123), object(2,124), object(2,125), object(2,126), object(2,127), object(2,128), object(2,129), object(2,130), object(2,131), object(2,132), object(2,133), object(2,134), object(2,135), object(2,136), object(2,137), object(2,138), object(2,139), object(2,140), object(2,141), object(2,142), object(2,143), object(2,144), object(2,145), object(2,146), object(2,147), object(2,148), object(2,149), object(2,150), object(2,151), object(2,152), object(2,153), object(2,154), object(2,155), object(2,156), object(2,157), object(2,158), object(2,159), object(2,160), object(2,161), object(2,162), object(2,163), object(2,164), object(2,165), object(2,166), object(2,167), object(2,168), object(2,169), object(2,170), object(2,171), object(2,172), object(2,173), object(2,174), object(2,175), object(2,176), object(2,177), object(2,178), object(2,179), object(2,180), object(2,181), object(2,182), object(2,183), object(2,184), object(2,185), object(2,186), object(2,187), object(2,188), object(2,189), object(2,190), object(2,191), object(2,192), object(2,193), object(2,194), object(2,195), object(2,196), object(2,197), object(2,198), object(2,199), object(2,200), object(2,201), object(2,202), object(2,203), object(2,204), object(2,205), object(2,206), object(2,207), object(2,208), object(2,209), object(2,210), object(2,211), object(2,212), object(2,213), object(2,214), object(2,215), object(2,216), object(2,217), object(2,218), object(2,219), object(2,220), object(2,221), object(2,222), object(2,223), object(2,224), object(2,225), object(2,226), object(2,227), object(2,228), object(2,229), object(2,230), object(2,231), object(2,232), object(2,233), object(2,234), object(2,235), object(2,236), object(2,237), object(2,238), object(2,239), object(2,240), object(2,241), object(2,242), object(2,243), object(2,244), object(2,245), object(2,246), object(2,247), object(2,248), object(2,249), object(2,250), object(2,251), object(2,252), object(2,253), object(2,254), object(2,255), object(2,256), object(2,257), object(2,258), object(2,259), object(2,260), object(2,261), object(2,262), object(2,263), object(2,264), object(2,265), object(2,266), object(2,267), object(2,268), object(2,269), object(2,270), object(2,271), object(2,272), object(2,273), object(2,274), object(2,275), object(2,276), object(2,277), object(2,278), object(2,279), object(2,280), object(2,281), object(2,282), object(2,283), object(2,284), object(2,285), object(2,286), object(2,287), object(2,288), object(2,289), object(2,290), object(2,291), object(2,292), object(2,293), object(2,294), object(2,295), object(2,296), object(2,297), object(2,298), object(2,299), object(2,300), object(2,301), object(2,302), object(2,303), object(2,304), object(2,305), object(2,306), object(2,307), object(2,308), object(2,309), object(2,310), object(2,311), object(2,312), object(2,313), object(2,314), object(2,315), object(2,316), object(2,317), object(2,318), object(2,319), object(2,320), object(2,321), object(2,322), object(2,323), object(2,324), object(2,325), object(2,326), object(2,327), object(2,328), object(2,329), object(2,330), object(2,331), object(2,332), object(2,333), object(2,334), object(2,335), object(2,336), object(2,337), object(2,338), object(2,339), object(2,340), object(2,341), object(2,342), object(2,343), object(2,344), object(2,345), object(2,346), object(2,347), object(2,348), object(2,349), object(2,350), object(2,351), object(2,352), object(2,353), object(2,354), object(2,355), object(2,356), object(2,357), object(2,358), object(2,359), object(2,360), object(2,361), object(2,362), object(2,363), object(2,364), object(2,365), object(2,366), object(2,367), object(2,368), object(2,369), object(2,370), object(2,371), object(2,372), object(2,373), object(2,374), object(2,375), object(2,376), object(2,377), object(2,378), object(2,379), object(2,380), object(2,381), object(2,382), object(2,383), object(2,384), object(2,385), object(2,386), object(2,387), object(2,388), object(2,389), object(2,390), object(2,391), object(2,392), object(2,393), object(2,394), object(2,395), object(2,396), object(2,397), object(2,398), object(2,399), object(2,400), object(2,401), object(2,402), object(2,403), object(2,404), object(2,405), object(2,406), object(2,407), object(2,408), object(2,409), object(2,410), object(2,411), object(2,412), object(2,413), object(2,414), object(2,415), object(2,416), object(2,417), object(2,418), object(2,419), object(2,420), object(2,421), object(2,422), object(2,423), object(2,424), object(2,425), object(2,426), object(2,427), object(2,428), object(2,429), object(2,430), object(2,431), object(2,432), object(2,433), object(2,434), object(2,435), object(2,436), object(2,437), object(2,438), object(2,439), object(2,440), object(2,441), object(2,442), object(2,443), object(2,444), object(2,445), object(2,446), object(2,447), object(2,448), object(2,449), object(2,450), object(2,451), object(2,452), object(2,453), object(2,454), object(2,455), object(2,456), object(2,457), object(2,458), object(2,459), object(2,460), object(2,461), object(2,462), object(2,463), object(2,464), object(2,465), object(2,466), object(2,467), object(2,468), object(2,469), object(2,470), object(2,471), object(2,472), object(2,473), object(2,474), object(2,475), object(2,476), object(2,477), object(2,478), object(2,479), object(2,480), object(2,481), object(2,482), object(2,483), object(2,484), object(2,485), object(2,486), object(2,487), object(2,488), object(2,489), object(2,490), object(2,491), object(2,492), object(2,493), object(2,494), object(2,495), object(2,496), object(2,497), object(2,498), object(2,499) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 658388000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 39-39: +task 3, line 39: +//# create-checkpoint 2 Checkpoint created: 2 -task 4 'run-graphql'. lines 41-82: +task 4, lines 41-82: +//# run-graphql Response: { "data": { "last_2": { @@ -134,19 +138,23 @@ Response: { } } -task 5 'transfer-object'. lines 84-84: +task 5, line 84: +//# transfer-object 2,499 --sender A --recipient B mutated: object(0,0), object(2,499) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 6 'transfer-object'. lines 86-86: +task 6, line 86: +//# transfer-object 2,498 --sender A --recipient B mutated: object(0,0), object(2,498) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 7 'transfer-object'. lines 88-88: +task 7, line 88: +//# transfer-object 2,497 --sender A --recipient B mutated: object(0,0), object(2,497) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 8 'view-object'. lines 90-90: +task 8, line 90: +//# view-object 2,498 Owner: Account Address ( B ) Version: 4 Contents: Test::M1::Object { @@ -158,7 +166,8 @@ Contents: Test::M1::Object { value: 6u64, } -task 9 'view-object'. lines 92-92: +task 9, line 92: +//# view-object 2,497 Owner: Account Address ( B ) Version: 5 Contents: Test::M1::Object { @@ -170,10 +179,12 @@ Contents: Test::M1::Object { value: 275u64, } -task 10 'create-checkpoint'. lines 94-94: +task 10, line 94: +//# create-checkpoint Checkpoint created: 3 -task 11 'run-graphql'. lines 96-138: +task 11, lines 96-138: +//# run-graphql Response: { "data": { "last_3": { @@ -263,7 +274,8 @@ Response: { } } -task 12 'run-graphql'. lines 140-244: +task 12, lines 140-244: +//# run-graphql Response: { "data": { "a": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp b/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp index 42449ff1ad3c1..be20c25842a7f 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/staked_sui.exp @@ -3,7 +3,8 @@ processed 15 tasks init: C: object(0,0) -task 1 'run-graphql'. lines 6-18: +task 1, lines 6-18: +//# run-graphql Response: { "data": { "address": { @@ -14,43 +15,56 @@ Response: { } } -task 2 'programmable'. lines 20-22: +task 2, lines 20-22: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 24-24: +task 3, line 24: +//# run 0x3::sui_system::request_add_stake --args object(0x5) object(2,0) @validator_0 --sender C events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(3,0), object(3,1) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(_), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 15078400, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 4 'create-checkpoint'. lines 26-26: +task 4, line 26: +//# create-checkpoint Checkpoint created: 1 -task 5 'advance-epoch'. lines 28-28: +task 5, line 28: +//# advance-epoch Epoch advanced: 0 -task 6 'programmable'. lines 30-32: +task 6, lines 30-32: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 34-34: +task 7, line 34: +//# run 0x3::sui_system::request_add_stake --args object(0x5) object(6,0) @validator_0 --sender C events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(7,0) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0), object(3,0) deleted: object(6,0) gas summary: computation_cost: 1000000, storage_cost: 15078400, storage_rebate: 14626656, non_refundable_storage_fee: 147744 -task 8 'create-checkpoint'. lines 36-36: +task 8, line 36: +//# create-checkpoint Checkpoint created: 3 -task 9 'advance-epoch'. lines 38-38: +task 9, line 38: +//# advance-epoch Epoch advanced: 1 -task 10 'view-object'. lines 40-40: +task 10, line 40: +//# view-object 3,1 Owner: Account Address ( C ) Version: 3 Contents: sui_system::staking_pool::StakedSui { @@ -68,7 +82,8 @@ Contents: sui_system::staking_pool::StakedSui { }, } -task 11 'view-object'. lines 42-42: +task 11, line 42: +//# view-object 7,0 Owner: Account Address ( C ) Version: 5 Contents: sui_system::staking_pool::StakedSui { @@ -86,7 +101,8 @@ Contents: sui_system::staking_pool::StakedSui { }, } -task 12 'run-graphql'. lines 44-56: +task 12, lines 44-56: +//# run-graphql Response: { "data": { "address": { @@ -110,7 +126,8 @@ Response: { } } -task 13 'run-graphql'. lines 58-102: +task 13, lines 58-102: +//# run-graphql --cursors @{obj_3_1,1} @{obj_7_0,1} Response: { "data": { "no_coins_after_obj_3_1_chkpt_1": { @@ -136,7 +153,8 @@ Response: { } } -task 14 'run-graphql'. lines 104-147: +task 14, lines 104-147: +//# run-graphql --cursors @{obj_3_1,3} @{obj_7_0,3} Response: { "data": { "coins_after_obj_3_1_chkpt_3": { diff --git a/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp b/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp index 7b1eedded760d..211357e662262 100644 --- a/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp +++ b/crates/sui-graphql-e2e-tests/tests/consistency/tx_address_objects.exp @@ -3,39 +3,56 @@ processed 17 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 17-34: +task 1, lines 17-34: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 5479600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 36-37: +task 2, lines 36-37: +//# programmable --sender A --inputs 0 1 @A +//> 0: Test::M1::create(Input(0), Input(2)); created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 39-39: +task 3, line 39: +//# create-checkpoint Checkpoint created: 1 -task 4 'programmable'. lines 41-44: +task 4, lines 41-44: +//# programmable --sender A --inputs object(2,0) 100 2 3 @A +//> Test::M1::set_value(Input(0), Input(1)); +//> Test::M1::create(Input(2), Input(4)); +//> Test::M1::create(Input(3), Input(4)); created: object(4,0), object(4,1) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 4932400, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 5 'create-checkpoint'. lines 46-46: +task 5, line 46: +//# create-checkpoint Checkpoint created: 2 -task 6 'programmable'. lines 48-52: +task 6, lines 48-52: +//# programmable --sender A --inputs object(2,0) 200 4 5 6 @A +//> Test::M1::set_value(Input(0), Input(1)); +//> Test::M1::create(Input(2), Input(5)); +//> Test::M1::create(Input(3), Input(5)); +//> Test::M1::create(Input(4), Input(5)); created: object(6,0), object(6,1), object(6,2) mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 6247200, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 7 'create-checkpoint'. lines 54-54: +task 7, line 54: +//# create-checkpoint Checkpoint created: 3 -task 9 'create-checkpoint'. lines 58-58: +task 9, line 58: +//# create-checkpoint Checkpoint created: 4 -task 10 'run-graphql'. lines 60-134: +task 10, lines 60-134: +//# run-graphql Response: { "data": { "address_at_latest_checkpoint_4": { @@ -360,7 +377,8 @@ Response: { } } -task 11 'run-graphql'. lines 136-180: +task 11, lines 136-180: +//# run-graphql Response: { "data": { "all_transactions": { @@ -871,13 +889,16 @@ Response: { } } -task 12 'force-object-snapshot-catchup'. lines 182-182: +task 12, line 182: +//# force-object-snapshot-catchup --start-cp 0 --end-cp 3 Objects snapshot updated to [0 to 3) -task 13 'create-checkpoint'. lines 184-184: +task 13, line 184: +//# create-checkpoint Checkpoint created: 5 -task 14 'run-graphql'. lines 186-260: +task 14, lines 186-260: +//# run-graphql Response: { "data": { "address_at_latest_checkpoint_4": { @@ -1202,10 +1223,12 @@ Response: { } } -task 15 'create-checkpoint'. lines 262-262: +task 15, line 262: +//# create-checkpoint Checkpoint created: 6 -task 16 'run-graphql'. lines 264-299: +task 16, lines 264-299: +//# run-graphql Response: { "data": { "all_transactions": { diff --git a/crates/sui-graphql-e2e-tests/tests/datetime/datetime.exp b/crates/sui-graphql-e2e-tests/tests/datetime/datetime.exp index 05cfd0f9a7256..4b514880d10de 100644 --- a/crates/sui-graphql-e2e-tests/tests/datetime/datetime.exp +++ b/crates/sui-graphql-e2e-tests/tests/datetime/datetime.exp @@ -1,39 +1,51 @@ processed 23 tasks -task 1 'create-checkpoint'. lines 6-8: +task 1, lines 6-8: +//# create-checkpoint Checkpoint created: 1 -task 3 'create-checkpoint'. lines 11-13: +task 3, lines 11-13: +//# create-checkpoint Checkpoint created: 2 -task 5 'create-checkpoint'. lines 16-18: +task 5, lines 16-18: +//# create-checkpoint Checkpoint created: 3 -task 7 'create-checkpoint'. lines 21-23: +task 7, lines 21-23: +//# create-checkpoint Checkpoint created: 4 -task 9 'create-checkpoint'. lines 26-28: +task 9, lines 26-28: +//# create-checkpoint Checkpoint created: 5 -task 11 'create-checkpoint'. lines 31-33: +task 11, lines 31-33: +//# create-checkpoint Checkpoint created: 6 -task 13 'create-checkpoint'. lines 36-38: +task 13, lines 36-38: +//# create-checkpoint Checkpoint created: 7 -task 15 'advance-epoch'. lines 41-41: +task 15, line 41: +//# advance-epoch Epoch advanced: 0 -task 16 'create-checkpoint'. lines 43-45: +task 16, lines 43-45: +//# create-checkpoint Checkpoint created: 9 -task 19 'create-checkpoint'. lines 51-51: +task 19, line 51: +//# create-checkpoint Checkpoint created: 10 -task 20 'advance-epoch'. lines 53-53: +task 20, line 53: +//# advance-epoch Epoch advanced: 1 -task 21 'run-graphql'. lines 55-66: +task 21, lines 55-66: +//# run-graphql Response: { "data": { "checkpoints": { @@ -113,7 +125,8 @@ Response: { } } -task 22 'run-graphql'. lines 68-86: +task 22, lines 68-86: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp b/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp index db30674dec2b3..9c17377b19919 100644 --- a/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp +++ b/crates/sui-graphql-e2e-tests/tests/epoch/epoch.exp @@ -3,42 +3,57 @@ processed 11 tasks init: C: object(0,0) -task 1 'create-checkpoint'. lines 8-8: +task 1, line 8: +//# create-checkpoint Checkpoint created: 1 -task 2 'advance-epoch'. lines 10-10: +task 2, line 10: +//# advance-epoch Epoch advanced: 0 -task 3 'programmable'. lines 12-14: +task 3, lines 12-14: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 4 'run'. lines 16-18: +task 4, lines 16-18: +//# run 0x3::sui_system::request_add_stake --args object(0x5) object(3,0) @validator_0 --sender C events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 15078400, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 5 'create-checkpoint'. lines 19-19: +task 5, line 19: +//# create-checkpoint Checkpoint created: 3 -task 6 'advance-epoch'. lines 21-23: +task 6, lines 21-23: +//# advance-epoch Epoch advanced: 1 -task 7 'programmable'. lines 24-28: +task 7, lines 24-28: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) +// TODO: Short term hack to get around indexer epoch issue created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'create-checkpoint'. lines 29-29: +task 8, line 29: +//# create-checkpoint Checkpoint created: 5 -task 9 'advance-epoch'. lines 31-32: +task 9, lines 31-32: +//# advance-epoch Epoch advanced: 2 -task 10 'run-graphql'. lines 33-62: +task 10, lines 33-62: +//# run-graphql Response: { "data": { "epoch": { diff --git a/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp b/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp index c67b8b5cdfdb5..25c9da026cd9c 100644 --- a/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp +++ b/crates/sui-graphql-e2e-tests/tests/epoch/system_state.exp @@ -3,72 +3,96 @@ processed 23 tasks init: C: object(0,0), validator_0: object(0,1) -task 1 'create-checkpoint'. lines 10-10: +task 1, line 10: +//# create-checkpoint Checkpoint created: 1 -task 2 'advance-epoch'. lines 12-12: +task 2, line 12: +//# advance-epoch Epoch advanced: 0 -task 3 'programmable'. lines 14-16: +task 3, lines 14-16: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 4 'run'. lines 18-18: +task 4, line 18: +//# run 0x3::sui_system::request_add_stake --args object(0x5) object(3,0) @validator_0 --sender C events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [248, 78, 186, 99, 231, 9, 139, 242, 111, 186, 194, 226, 178, 139, 36, 108, 107, 38, 243, 45, 234, 239, 71, 218, 67, 179, 228, 139, 121, 123, 170, 161, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 15078400, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 5 'create-checkpoint'. lines 20-20: +task 5, line 20: +//# create-checkpoint Checkpoint created: 3 -task 6 'advance-epoch'. lines 22-22: +task 6, line 22: +//# advance-epoch Epoch advanced: 1 -task 7 'create-checkpoint'. lines 24-24: +task 7, line 24: +//# create-checkpoint Checkpoint created: 5 -task 8 'advance-epoch'. lines 26-26: +task 8, line 26: +//# advance-epoch Epoch advanced: 2 -task 9 'programmable'. lines 28-30: +task 9, lines 28-30: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(9,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 10 'create-checkpoint'. lines 32-32: +task 10, line 32: +//# create-checkpoint Checkpoint created: 7 -task 11 'advance-epoch'. lines 34-34: +task 11, line 34: +//# advance-epoch Epoch advanced: 3 -task 12 'run'. lines 36-36: +task 12, line 36: +//# run 0x3::sui_system::request_withdraw_stake --args object(0x5) object(4,0) --sender C events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("UnstakingRequestEvent"), type_params: [] }, contents: [248, 78, 186, 99, 231, 9, 139, 242, 111, 186, 194, 226, 178, 139, 36, 108, 107, 38, 243, 45, 234, 239, 71, 218, 67, 179, 228, 139, 121, 123, 170, 161, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } created: object(12,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(4,0) gas summary: computation_cost: 1000000, storage_cost: 14774400, storage_rebate: 14927616, non_refundable_storage_fee: 150784 -task 13 'create-checkpoint'. lines 38-38: +task 13, line 38: +//# create-checkpoint Checkpoint created: 9 -task 14 'advance-epoch'. lines 40-40: +task 14, line 40: +//# advance-epoch Epoch advanced: 4 -task 15 'programmable'. lines 42-44: +task 15, lines 42-44: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(15,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'create-checkpoint'. lines 46-46: +task 16, line 46: +//# create-checkpoint Checkpoint created: 11 -task 17 'advance-epoch'. lines 48-48: +task 17, line 48: +//# advance-epoch Epoch advanced: 5 -task 18 'run-graphql'. lines 50-60: +task 18, lines 50-60: +//# run-graphql Response: { "data": { "epoch": { @@ -82,7 +106,8 @@ Response: { } } -task 19 'run-graphql'. lines 62-72: +task 19, lines 62-72: +//# run-graphql Response: { "data": { "epoch": { @@ -96,7 +121,8 @@ Response: { } } -task 20 'run-graphql'. lines 74-84: +task 20, lines 74-84: +//# run-graphql Response: { "data": { "epoch": { @@ -110,7 +136,8 @@ Response: { } } -task 21 'run-graphql'. lines 86-96: +task 21, lines 86-96: +//# run-graphql Response: { "data": { "epoch": { @@ -124,7 +151,8 @@ Response: { } } -task 22 'run-graphql'. lines 98-108: +task 22, lines 98-108: +//# run-graphql Response: { "data": { "epoch": { diff --git a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp index cb88eba807b89..8c4d3de6e4054 100644 --- a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp +++ b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors.exp @@ -3,59 +3,73 @@ processed 29 tasks init: A: object(0,0) -task 1 'publish'. lines 6-81: +task 1, lines 6-81: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 9743200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 83-83: +task 2, line 83: +//# run P0::m::callU8 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU8 (function index 0) at offset 1, Abort Code: 9223372161408827393 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 0, instruction: 1, function_name: Some("callU8") }, 9223372161408827393), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372161408827393), message: Some("P0::m::callU8 at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 3 'run'. lines 85-85: +task 3, line 85: +//# run P0::m::callU16 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU16 (function index 1) at offset 1, Abort Code: 9223372174293860355 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 1, instruction: 1, function_name: Some("callU16") }, 9223372174293860355), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372174293860355), message: Some("P0::m::callU16 at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 1)] }), command: Some(0) } } -task 4 'run'. lines 87-87: +task 4, line 87: +//# run P0::m::callU32 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU32 (function index 2) at offset 1, Abort Code: 9223372187178893317 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 2, instruction: 1, function_name: Some("callU32") }, 9223372187178893317), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372187178893317), message: Some("P0::m::callU32 at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(2), 1)] }), command: Some(0) } } -task 5 'run'. lines 89-89: +task 5, line 89: +//# run P0::m::callU64 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU64 (function index 3) at offset 1, Abort Code: 9223372200063926279 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 3, instruction: 1, function_name: Some("callU64") }, 9223372200063926279), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372200063926279), message: Some("P0::m::callU64 at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(3), 1)] }), command: Some(0) } } -task 6 'run'. lines 91-91: +task 6, line 91: +//# run P0::m::callU128 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU128 (function index 4) at offset 1, Abort Code: 9223372212948959241 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 4, instruction: 1, function_name: Some("callU128") }, 9223372212948959241), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372212948959241), message: Some("P0::m::callU128 at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(4), 1)] }), command: Some(0) } } -task 7 'run'. lines 93-93: +task 7, line 93: +//# run P0::m::callU256 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU256 (function index 5) at offset 1, Abort Code: 9223372225833992203 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 5, instruction: 1, function_name: Some("callU256") }, 9223372225833992203), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372225833992203), message: Some("P0::m::callU256 at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(5), 1)] }), command: Some(0) } } -task 8 'run'. lines 95-95: +task 8, line 95: +//# run P0::m::callAddress Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callAddress (function index 6) at offset 1, Abort Code: 9223372238719156239 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 6, instruction: 1, function_name: Some("callAddress") }, 9223372238719156239), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372238719156239), message: Some("P0::m::callAddress at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 1)] }), command: Some(0) } } -task 9 'run'. lines 97-97: +task 9, line 97: +//# run P0::m::callString Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callString (function index 7) at offset 1, Abort Code: 9223372251604189201 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 7, instruction: 1, function_name: Some("callString") }, 9223372251604189201), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372251604189201), message: Some("P0::m::callString at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(7), 1)] }), command: Some(0) } } -task 10 'run'. lines 99-99: +task 10, line 99: +//# run P0::m::callU64vec Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU64vec (function index 8) at offset 1, Abort Code: 9223372264489222163 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 8, instruction: 1, function_name: Some("callU64vec") }, 9223372264489222163), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372264489222163), message: Some("P0::m::callU64vec at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(8), 1)] }), command: Some(0) } } -task 11 'run'. lines 101-101: +task 11, line 101: +//# run P0::m::normalAbort Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::normalAbort (function index 9) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 9, instruction: 1, function_name: Some("normalAbort") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("P0::m::normalAbort at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(9), 1)] }), command: Some(0) } } -task 12 'run'. lines 103-103: +task 12, line 103: +//# run P0::m::assertLineNo Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::assertLineNo (function index 10) at offset 1, Abort Code: 9223372294552813567 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 10, instruction: 1, function_name: Some("assertLineNo") }, 9223372294552813567), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372294552813567), message: Some("P0::m::assertLineNo at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(10), 1)] }), command: Some(0) } } -task 13 'create-checkpoint'. lines 105-105: +task 13, line 105: +//# create-checkpoint Checkpoint created: 1 -task 14 'run-graphql'. lines 107-117: +task 14, lines 107-117: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -131,59 +145,73 @@ Response: { } } -task 15 'upgrade'. lines 119-197: +task 15, lines 119-197: +//# upgrade --package P0 --upgrade-capability 1,1 --sender A created: object(15,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 9849600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 16 'run'. lines 199-199: +task 16, line 199: +//# run P0::m::callU8 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU8 (function index 0) at offset 1, Abort Code: 9223372659625033729 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 0, instruction: 1, function_name: Some("callU8") }, 9223372659625033729), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372659625033729), message: Some("fake(1,0)::m::callU8 at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 17 'run'. lines 201-201: +task 17, line 201: +//# run P0::m::callU16 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU16 (function index 1) at offset 1, Abort Code: 9223372672510066691 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 1, instruction: 1, function_name: Some("callU16") }, 9223372672510066691), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372672510066691), message: Some("fake(1,0)::m::callU16 at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 1)] }), command: Some(0) } } -task 18 'run'. lines 203-203: +task 18, line 203: +//# run P0::m::callU32 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU32 (function index 2) at offset 1, Abort Code: 9223372685395099653 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 2, instruction: 1, function_name: Some("callU32") }, 9223372685395099653), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372685395099653), message: Some("fake(1,0)::m::callU32 at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(2), 1)] }), command: Some(0) } } -task 19 'run'. lines 205-205: +task 19, line 205: +//# run P0::m::callU64 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU64 (function index 3) at offset 1, Abort Code: 9223372698280132615 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 3, instruction: 1, function_name: Some("callU64") }, 9223372698280132615), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372698280132615), message: Some("fake(1,0)::m::callU64 at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(3), 1)] }), command: Some(0) } } -task 20 'run'. lines 207-207: +task 20, line 207: +//# run P0::m::callU128 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU128 (function index 4) at offset 1, Abort Code: 9223372711165165577 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 4, instruction: 1, function_name: Some("callU128") }, 9223372711165165577), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372711165165577), message: Some("fake(1,0)::m::callU128 at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(4), 1)] }), command: Some(0) } } -task 21 'run'. lines 209-209: +task 21, line 209: +//# run P0::m::callU256 Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU256 (function index 5) at offset 1, Abort Code: 9223372724050198539 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 5, instruction: 1, function_name: Some("callU256") }, 9223372724050198539), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372724050198539), message: Some("fake(1,0)::m::callU256 at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(5), 1)] }), command: Some(0) } } -task 22 'run'. lines 211-211: +task 22, line 211: +//# run P0::m::callAddress Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callAddress (function index 6) at offset 1, Abort Code: 9223372736935362575 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 6, instruction: 1, function_name: Some("callAddress") }, 9223372736935362575), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372736935362575), message: Some("fake(1,0)::m::callAddress at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(6), 1)] }), command: Some(0) } } -task 23 'run'. lines 213-213: +task 23, line 213: +//# run P0::m::callString Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callString (function index 7) at offset 1, Abort Code: 9223372749820395537 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 7, instruction: 1, function_name: Some("callString") }, 9223372749820395537), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372749820395537), message: Some("fake(1,0)::m::callString at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(7), 1)] }), command: Some(0) } } -task 24 'run'. lines 215-215: +task 24, line 215: +//# run P0::m::callU64vec Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::callU64vec (function index 8) at offset 1, Abort Code: 9223372762705428499 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 8, instruction: 1, function_name: Some("callU64vec") }, 9223372762705428499), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372762705428499), message: Some("fake(1,0)::m::callU64vec at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(8), 1)] }), command: Some(0) } } -task 25 'run'. lines 217-217: +task 25, line 217: +//# run P0::m::normalAbort Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::normalAbort (function index 9) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 9, instruction: 1, function_name: Some("normalAbort") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("fake(1,0)::m::normalAbort at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(9), 1)] }), command: Some(0) } } -task 26 'run'. lines 219-219: +task 26, line 219: +//# run P0::m::assertLineNo Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::assertLineNo (function index 10) at offset 1, Abort Code: 9223372792769019903 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 10, instruction: 1, function_name: Some("assertLineNo") }, 9223372792769019903), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372792769019903), message: Some("fake(1,0)::m::assertLineNo at offset 1"), exec_state: None, location: Module(ModuleId { address: fake(1,0), name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(10), 1)] }), command: Some(0) } } -task 27 'create-checkpoint'. lines 221-221: +task 27, line 221: +//# create-checkpoint Checkpoint created: 2 -task 28 'run-graphql'. lines 223-233: +task 28, lines 223-233: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp index 690f53706ea03..1dbc3c2db31a7 100644 --- a/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp +++ b/crates/sui-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp @@ -3,27 +3,33 @@ processed 7 tasks init: A: object(0,0) -task 1 'publish'. lines 6-34: +task 1, lines 6-34: +//# publish --sender A created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4187600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 36-36: +task 2, line 36: +//# run P0::m::t_a Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::t_a (function index 0) at offset 1, Abort Code: 9223372127049089023 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 0, instruction: 1, function_name: Some("t_a") }, 9223372127049089023), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372127049089023), message: Some("P0::m::t_a at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } -task 3 'run'. lines 38-38: +task 3, line 38: +//# run P0::m::t_calls_a Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::t_calls_a (function index 1) at offset 1, Abort Code: 9223372139933990911 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 1, instruction: 1, function_name: Some("t_calls_a") }, 9223372139933990911), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372139933990911), message: Some("P0::m::t_calls_a at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 1)] }), command: Some(0) } } -task 4 'run'. lines 40-40: +task 4, line 40: +//# run P0::m::t_const_assert Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::t_const_assert (function index 2) at offset 1, Abort Code: 9223372075509481473 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 2, instruction: 1, function_name: Some("t_const_assert") }, 9223372075509481473), source: Some(VMError { major_status: ABORTED, sub_status: Some(9223372075509481473), message: Some("P0::m::t_const_assert at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(2), 1)] }), command: Some(0) } } -task 5 'create-checkpoint'. lines 42-42: +task 5, line 42: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 44-54: +task 6, lines 44-54: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp index 6b43bc83d265a..eb00b535469f7 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/event_connection.exp @@ -3,45 +3,54 @@ processed 17 tasks init: A: object(0,0), B: object(0,1) -task 1 'publish'. lines 14-81: +task 1, lines 14-81: +//# publish created: object(1,0) mutated: object(0,2) gas summary: computation_cost: 1000000, storage_cost: 11263200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 83-83: +task 2, line 83: +//# run Test::M1::create --sender A --args 0 @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 85-85: +task 3, line 85: +//# run Test::M1::emit_a --sender A --args object(2,0) 0 events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 4 'run'. lines 87-87: +task 4, line 87: +//# run Test::M1::emit_b --sender A --args object(2,0) 1 events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventB"), type_params: [Struct(StructTag { address: Test, module: Identifier("M1"), name: Identifier("Object"), type_params: [] })] }, contents: [1, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 5 'run'. lines 89-89: +task 5, line 89: +//# run Test::M2::create --sender A --args 2 @A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 91-91: +task 6, line 91: +//# run Test::M2::emit_a --sender A --args object(5,0) 2 events: Event { package_id: Test, transaction_module: Identifier("M2"), sender: A, type_: StructTag { address: Test, module: Identifier("M2"), name: Identifier("EventA"), type_params: [] }, contents: [2, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 7 'run'. lines 93-93: +task 7, line 93: +//# run Test::M2::emit_b --sender A --args object(5,0) 3 events: Event { package_id: Test, transaction_module: Identifier("M2"), sender: A, type_: StructTag { address: Test, module: Identifier("M2"), name: Identifier("EventB"), type_params: [Struct(StructTag { address: Test, module: Identifier("M2"), name: Identifier("Object"), type_params: [] })] }, contents: [3, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 8 'create-checkpoint'. lines 95-95: +task 8, line 95: +//# create-checkpoint Checkpoint created: 1 -task 9 'run-graphql'. lines 97-117: +task 9, lines 97-117: +//# run-graphql Response: { "data": { "events": { @@ -123,7 +132,8 @@ Response: { } } -task 10 'run-graphql'. lines 119-139: +task 10, lines 119-139: +//# run-graphql Response: { "data": { "events": { @@ -205,7 +215,8 @@ Response: { } } -task 11 'run-graphql'. lines 141-161: +task 11, lines 141-161: +//# run-graphql Response: { "data": { "events": { @@ -251,7 +262,8 @@ Response: { } } -task 12 'run-graphql'. lines 163-183: +task 12, lines 163-183: +//# run-graphql Response: { "data": { "events": { @@ -279,7 +291,8 @@ Response: { } } -task 13 'run-graphql'. lines 185-205: +task 13, lines 185-205: +//# run-graphql Response: { "data": { "events": { @@ -307,7 +320,8 @@ Response: { } } -task 14 'run-graphql'. lines 207-227: +task 14, lines 207-227: +//# run-graphql Response: { "data": null, "errors": [ @@ -326,7 +340,8 @@ Response: { ] } -task 15 'run-graphql'. lines 229-249: +task 15, lines 229-249: +//# run-graphql Response: { "data": null, "errors": [ @@ -345,7 +360,8 @@ Response: { ] } -task 16 'run-graphql'. lines 251-271: +task 16, lines 251-271: +//# run-graphql Response: { "data": null, "errors": [ diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp index e44c59f4c28b2..97c97d609d009 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp @@ -3,20 +3,24 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 10-37: +task 1, lines 10-37: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6095200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 39-39: +task 2, line 39: +//# run Test::M3::yeet --sender A --args 2 events: Event { package_id: Test, transaction_module: Identifier("M3"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [2, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 41-41: +task 3, line 41: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 43-60: +task 4, lines 43-60: +//# run-graphql Response: { "data": { "events": { @@ -41,7 +45,8 @@ Response: { } } -task 5 'run-graphql'. lines 62-79: +task 5, lines 62-79: +//# run-graphql Response: { "data": { "events": { @@ -66,7 +71,8 @@ Response: { } } -task 6 'run-graphql'. lines 81-98: +task 6, lines 81-98: +//# run-graphql Response: { "data": { "events": { @@ -75,7 +81,8 @@ Response: { } } -task 7 'run-graphql'. lines 100-117: +task 7, lines 100-117: +//# run-graphql Response: { "data": { "events": { @@ -84,7 +91,8 @@ Response: { } } -task 8 'run-graphql'. lines 119-136: +task 8, lines 119-136: +//# run-graphql Response: { "data": { "events": { diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp index 9a8c6e243b753..6eabbcf2d106c 100644 --- a/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/pagination.exp @@ -3,25 +3,30 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 6-22: +task 1, lines 6-22: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 4818400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 24-24: +task 2, line 24: +//# run Test::M1::emit_1 --sender A --args 0 events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 26-26: +task 3, line 26: +//# run Test::M1::emit_2 --sender A --args 1 events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [1, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [2, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'create-checkpoint'. lines 28-28: +task 4, line 28: +//# create-checkpoint Checkpoint created: 1 -task 5 'run-graphql'. lines 30-54: +task 5, lines 30-54: +//# run-graphql Response: { "data": { "events": { @@ -89,7 +94,8 @@ Response: { } } -task 6 'run-graphql'. lines 56-80: +task 6, lines 56-80: +//# run-graphql --cursors {"tx":2,"e":0,"c":1} Response: { "data": { "events": { @@ -139,7 +145,8 @@ Response: { } } -task 7 'run-graphql'. lines 82-106: +task 7, lines 82-106: +//# run-graphql --cursors {"tx":3,"e":1,"c":1} Response: { "data": { "events": { @@ -189,7 +196,8 @@ Response: { } } -task 8 'run-graphql'. lines 108-132: +task 8, lines 108-132: +//# run-graphql Response: { "data": { "events": { diff --git a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp index 2e9dcb11238d8..193b57fbedc34 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/directives.exp +++ b/crates/sui-graphql-e2e-tests/tests/limits/directives.exp @@ -3,7 +3,8 @@ processed 8 tasks init: A: object(0,0) -task 1 'run-graphql'. lines 6-10: +task 1, lines 6-10: +//# run-graphql Response: { "data": null, "errors": [ @@ -22,7 +23,8 @@ Response: { ] } -task 2 'run-graphql'. lines 12-42: +task 2, lines 12-42: +//# run-graphql Response: { "data": null, "errors": [ @@ -41,7 +43,8 @@ Response: { ] } -task 3 'run-graphql'. lines 44-50: +task 3, lines 44-50: +//# run-graphql Response: { "data": null, "errors": [ @@ -60,26 +63,30 @@ Response: { ] } -task 4 'run-graphql'. lines 52-56: +task 4, lines 52-56: +//# run-graphql Response: { "data": {} } -task 5 'run-graphql'. lines 58-62: +task 5, lines 58-62: +//# run-graphql Response: { "data": { "chainIdentifier": "3989ac57" } } -task 6 'run-graphql'. lines 64-68: +task 6, lines 64-68: +//# run-graphql Response: { "data": { "chainIdentifier": "3989ac57" } } -task 7 'run-graphql'. lines 70-74: +task 7, lines 70-74: +//# run-graphql Response: { "data": {} } diff --git a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp index 3305ac5a56ce1..711d4185eaedf 100644 --- a/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp +++ b/crates/sui-graphql-e2e-tests/tests/limits/output_node_estimation.exp @@ -1,6 +1,7 @@ processed 16 tasks -task 1 'run-graphql'. lines 6-14: +task 1, lines 6-14: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -21,7 +22,8 @@ Response: { } } -task 2 'run-graphql'. lines 16-26: +task 2, lines 16-26: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -46,7 +48,8 @@ Response: { } } -task 3 'run-graphql'. lines 28-42: +task 3, lines 28-42: +//# run-graphql --show-usage Response: { "data": { "checkpoints": { @@ -77,7 +80,8 @@ Response: { } } -task 4 'run-graphql'. lines 44-65: +task 4, lines 44-65: +//# run-graphql --show-usage Response: { "data": { "checkpoints": { @@ -117,7 +121,8 @@ Response: { } } -task 5 'run-graphql'. lines 67-88: +task 5, lines 67-88: +//# run-graphql --show-usage Response: { "data": { "checkpoints": { @@ -151,7 +156,8 @@ Response: { } } -task 6 'run-graphql'. lines 90-100: +task 6, lines 90-100: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -176,7 +182,8 @@ Response: { } } -task 7 'run-graphql'. lines 102-112: +task 7, lines 102-112: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -201,7 +208,8 @@ Response: { } } -task 8 'run-graphql'. lines 114-142: +task 8, lines 114-142: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -228,7 +236,8 @@ Response: { } } -task 9 'run-graphql'. lines 144-171: +task 9, lines 144-171: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -253,7 +262,8 @@ Response: { } } -task 10 'run-graphql'. lines 173-222: +task 10, lines 173-222: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -283,7 +293,8 @@ Response: { } } -task 11 'run-graphql'. lines 224-249: +task 11, lines 224-249: +//# run-graphql --show-usage Response: { "data": { "transactionBlocks": { @@ -309,7 +320,8 @@ Response: { } } -task 12 'run-graphql'. lines 251-272: +task 12, lines 251-272: +//# run-graphql --show-usage Response: { "data": { "fragmentSpread": { @@ -339,7 +351,8 @@ Response: { } } -task 13 'run-graphql'. lines 274-286: +task 13, lines 274-286: +//# run-graphql --show-usage Response: { "data": null, "extensions": { @@ -371,7 +384,8 @@ Response: { ] } -task 14 'run-graphql'. lines 288-298: +task 14, lines 288-298: +//# run-graphql --show-usage Response: { "data": null, "extensions": { @@ -397,7 +411,8 @@ Response: { ] } -task 15 'run-graphql'. lines 300-310: +task 15, lines 300-310: +//# run-graphql --show-usage Response: { "data": null, "errors": [ diff --git a/crates/sui-graphql-e2e-tests/tests/objects/coin.exp b/crates/sui-graphql-e2e-tests/tests/objects/coin.exp index 2a109c9e03a3f..ea75e8e6c640a 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/coin.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/coin.exp @@ -3,16 +3,19 @@ processed 4 tasks init: A: object(0,0) -task 1 'publish'. lines 6-33: +task 1, lines 6-33: +//# publish --sender A created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4), object(1,5) mutated: object(0,0) unchanged_shared: 0x0000000000000000000000000000000000000000000000000000000000000403 gas summary: computation_cost: 1000000, storage_cost: 15663600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 35-35: +task 2, line 35: +//# create-checkpoint Checkpoint created: 1 -task 3 'run-graphql'. lines 37-85: +task 3, lines 37-85: +//# run-graphql Response: { "data": { "suiCoins": { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/data.exp b/crates/sui-graphql-e2e-tests/tests/objects/data.exp index 3e8fd63d041d4..8b5edd585e1c8 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/data.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/data.exp @@ -3,20 +3,26 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 6-39: +task 1, lines 6-39: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 7622800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 41-43: +task 2, lines 41-43: +//# programmable --inputs @A +//> 0: P0::m::foo(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2910800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'create-checkpoint'. lines 45-45: +task 3, line 45: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 47-68: +task 4, lines 47-68: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/display.exp b/crates/sui-graphql-e2e-tests/tests/objects/display.exp index c39d89fc62a7b..d52cacb4bd66e 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/display.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/display.exp @@ -3,37 +3,45 @@ processed 17 tasks init: A: object(0,0) -task 1 'publish'. lines 6-130: +task 1, lines 6-130: +//# publish --sender A events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("DisplayCreated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103] } created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 21470000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 132-132: +task 2, line 132: +//# create-checkpoint Checkpoint created: 1 -task 3 'view-checkpoint'. lines 134-134: +task 3, line 134: +//# view-checkpoint CheckpointSummary { epoch: 0, seq: 1, content_digest: 38F9Kd5S9DxwyU8sCegbmKqkYPZrjZBZicUNhhhbPsKu, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 1000000, storage_cost: 21470000, storage_rebate: 0, non_refundable_storage_fee: 0 }} -task 4 'run'. lines 136-136: +task 4, line 136: +//# run Test::boars::create_bear --sender A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3556800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 138-138: +task 5, line 138: +//# run Test::boars::update_display_faulty --sender A --args object(1,1) events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103, 1, 0, 3, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2941200, storage_rebate: 2625876, non_refundable_storage_fee: 26524 -task 6 'create-checkpoint'. lines 140-140: +task 6, line 140: +//# create-checkpoint Checkpoint created: 2 -task 7 'view-checkpoint'. lines 142-142: +task 7, line 142: +//# view-checkpoint CheckpointSummary { epoch: 0, seq: 2, content_digest: 2UUsxLrzkkoM2BZmzxtmF2JyJrQVjUz7a3WbkQbMSkUN, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 3000000, storage_cost: 27968000, storage_rebate: 3603996, non_refundable_storage_fee: 36404 }} -task 8 'run-graphql'. lines 144-157: +task 8, lines 144-157: +//# run-graphql Response: { "data": { "address": { @@ -64,19 +72,23 @@ Response: { } } -task 9 'run'. lines 159-159: +task 9, line 159: +//# run Test::boars::single_add --sender A --args object(1,1) events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103, 2, 0, 4, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 3032400, storage_rebate: 2911788, non_refundable_storage_fee: 29412 -task 10 'create-checkpoint'. lines 161-161: +task 10, line 161: +//# create-checkpoint Checkpoint created: 3 -task 11 'view-checkpoint'. lines 163-163: +task 11, line 163: +//# view-checkpoint CheckpointSummary { epoch: 0, seq: 3, content_digest: 6GU2oy7ZTAeGuvjYLJ7tERdTW5BuynyhRoTr34W2o6tw, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 4000000, storage_cost: 31000400, storage_rebate: 6515784, non_refundable_storage_fee: 65816 }} -task 12 'run-graphql'. lines 165-178: +task 12, lines 165-178: +//# run-graphql Response: { "data": { "address": { @@ -112,19 +124,23 @@ Response: { } } -task 13 'run'. lines 180-180: +task 13, line 180: +//# run Test::boars::multi_add --sender A --args object(1,1) events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: sui, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [50, 4, 50, 221, 146, 116, 124, 168, 170, 179, 99, 227, 72, 95, 129, 228, 10, 223, 66, 108, 254, 161, 49, 27, 162, 255, 7, 195, 168, 245, 89, 103, 3, 0, 15, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125, 5, 98, 111, 111, 108, 115, 7, 123, 98, 111, 111, 108, 115, 125, 5, 98, 117, 121, 101, 114, 7, 123, 98, 117, 121, 101, 114, 125, 4, 110, 97, 109, 101, 6, 123, 110, 97, 109, 101, 125, 7, 99, 114, 101, 97, 116, 111, 114, 9, 123, 99, 114, 101, 97, 116, 111, 114, 125, 5, 112, 114, 105, 99, 101, 7, 123, 112, 114, 105, 99, 101, 125, 11, 112, 114, 111, 106, 101, 99, 116, 95, 117, 114, 108, 58, 85, 110, 105, 113, 117, 101, 32, 66, 111, 97, 114, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 66, 111, 97, 114, 115, 32, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 32, 119, 105, 116, 104, 32, 123, 110, 97, 109, 101, 125, 32, 97, 110, 100, 32, 123, 105, 100, 125, 8, 98, 97, 115, 101, 95, 117, 114, 108, 32, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 123, 105, 109, 103, 95, 117, 114, 108, 125, 11, 110, 111, 95, 116, 101, 109, 112, 108, 97, 116, 101, 23, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 3, 97, 103, 101, 21, 123, 109, 101, 116, 97, 100, 97, 116, 97, 46, 110, 101, 115, 116, 101, 100, 46, 97, 103, 101, 125, 8, 102, 117, 108, 108, 95, 117, 114, 108, 10, 123, 102, 117, 108, 108, 95, 117, 114, 108, 125, 13, 101, 115, 99, 97, 112, 101, 95, 115, 121, 110, 116, 97, 120, 8, 92, 123, 110, 97, 109, 101, 92, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5236400, storage_rebate: 3002076, non_refundable_storage_fee: 30324 -task 14 'create-checkpoint'. lines 182-182: +task 14, line 182: +//# create-checkpoint Checkpoint created: 4 -task 15 'view-checkpoint'. lines 184-184: +task 15, line 184: +//# view-checkpoint CheckpointSummary { epoch: 0, seq: 4, content_digest: XAuLWwCkKRGkkGtQopDS64y6VLVMRxRZTKUrSmJWJPS, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 5000000, storage_cost: 36236800, storage_rebate: 9517860, non_refundable_storage_fee: 96140 }} -task 16 'run-graphql'. lines 186-199: +task 16, lines 186-199: +//# run-graphql Response: { "data": { "address": { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp b/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp index f4c9e4615047c..9e66568e37a18 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/enum_data.exp @@ -3,20 +3,26 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 6-54: +task 1, lines 6-54: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 10510800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 56-58: +task 2, lines 56-58: +//# programmable --inputs @A +//> 0: P0::m::foo(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3032400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 60-60: +task 3, line 60: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 62-83: +task 4, lines 62-83: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp b/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp index 13e936b1defe6..34aaec4632dd9 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/filter_by_type.exp @@ -3,31 +3,40 @@ processed 17 tasks init: C: object(0,0) -task 1 'create-checkpoint'. lines 7-7: +task 1, line 7: +//# create-checkpoint Checkpoint created: 1 -task 2 'advance-epoch'. lines 9-9: +task 2, line 9: +//# advance-epoch Epoch advanced: 0 -task 3 'programmable'. lines 11-13: +task 3, lines 11-13: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 4 'run'. lines 15-17: +task 4, lines 15-17: +//# run 0x3::sui_system::request_add_stake --args object(0x5) object(3,0) @validator_0 --sender C events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 15078400, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 5 'create-checkpoint'. lines 18-18: +task 5, line 18: +//# create-checkpoint Checkpoint created: 3 -task 6 'advance-epoch'. lines 20-20: +task 6, line 20: +//# advance-epoch Epoch advanced: 1 -task 7 'run-graphql'. lines 22-37: +task 7, lines 22-37: +//# run-graphql Response: { "data": { "objects": { @@ -70,7 +79,8 @@ Response: { } } -task 8 'run-graphql'. lines 39-54: +task 8, lines 39-54: +//# run-graphql Response: { "data": { "objects": { @@ -267,7 +277,8 @@ Response: { } } -task 9 'run-graphql'. lines 56-71: +task 9, lines 56-71: +//# run-graphql Response: { "data": { "objects": { @@ -321,7 +332,8 @@ Response: { } } -task 10 'run-graphql'. lines 73-88: +task 10, lines 73-88: +//# run-graphql Response: { "data": { "objects": { @@ -364,7 +376,8 @@ Response: { } } -task 11 'run-graphql'. lines 90-106: +task 11, lines 90-106: +//# run-graphql Response: { "data": { "objects": { @@ -407,7 +420,8 @@ Response: { } } -task 12 'run-graphql'. lines 108-124: +task 12, lines 108-124: +//# run-graphql Response: { "data": null, "errors": [ @@ -426,7 +440,8 @@ Response: { ] } -task 13 'run-graphql'. lines 126-142: +task 13, lines 126-142: +//# run-graphql Response: { "data": null, "errors": [ @@ -445,7 +460,8 @@ Response: { ] } -task 14 'run-graphql'. lines 144-160: +task 14, lines 144-160: +//# run-graphql Response: { "data": null, "errors": [ @@ -464,7 +480,8 @@ Response: { ] } -task 15 'run-graphql'. lines 162-178: +task 15, lines 162-178: +//# run-graphql Response: { "data": null, "errors": [ @@ -483,7 +500,8 @@ Response: { ] } -task 16 'run-graphql'. lines 180-196: +task 16, lines 180-196: +//# run-graphql Response: { "data": null, "errors": [ diff --git a/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp b/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp index 2e2e42dd4dff5..cadf5035c7d77 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/pagination.exp @@ -1,39 +1,47 @@ processed 14 tasks -task 1 'publish'. lines 6-19: +task 1, lines 6-19: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5175600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 21-21: +task 2, line 21: +//# run Test::M1::create --args 0 @A created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 23-23: +task 3, line 23: +//# run Test::M1::create --args 1 @A created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 25-25: +task 4, line 25: +//# run Test::M1::create --args 2 @A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 27-27: +task 5, line 27: +//# run Test::M1::create --args 3 @A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 29-29: +task 6, line 29: +//# run Test::M1::create --args 4 @A created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'create-checkpoint'. lines 31-31: +task 7, line 31: +//# create-checkpoint Checkpoint created: 1 -task 8 'run-graphql'. lines 33-43: +task 8, lines 33-43: +//# run-graphql Response: { "data": { "address": { @@ -60,7 +68,8 @@ Response: { } } -task 9 'run-graphql'. lines 45-55: +task 9, lines 45-55: +//# run-graphql Response: { "data": { "address": { @@ -78,7 +87,8 @@ Response: { } } -task 10 'run-graphql'. lines 57-69: +task 10, lines 57-69: +//# run-graphql --cursors @{obj_5_0} Response: { "data": { "address": { @@ -89,7 +99,8 @@ Response: { } } -task 11 'run-graphql'. lines 71-81: +task 11, lines 71-81: +//# run-graphql --cursors @{obj_4_0} Response: { "data": { "address": { @@ -107,7 +118,8 @@ Response: { } } -task 12 'run-graphql'. lines 83-93: +task 12, lines 83-93: +//# run-graphql --cursors @{obj_3_0} Response: { "data": { "address": { @@ -122,7 +134,8 @@ Response: { } } -task 13 'run-graphql'. lines 95-104: +task 13, lines 95-104: +//# run-graphql Response: { "data": { "address": { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp b/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp index dcd828d169cb8..bca368f1493ea 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/public_transfer.exp @@ -3,20 +3,27 @@ processed 5 tasks init: A: object(0,0) -task 1 'publish'. lines 6-26: +task 1, lines 6-26: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5570800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 28-31: +task 2, lines 28-31: +//# programmable --inputs @A +//> 0: P0::m::foo(); +//> 1: P0::m::bar(); +//> TransferObjects([Result(0)], Input(0)) created: object(2,0), object(2,1) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 3435200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'create-checkpoint'. lines 33-33: +task 3, line 33: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 35-53: +task 4, lines 35-53: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/received.exp b/crates/sui-graphql-e2e-tests/tests/objects/received.exp index f85c9445db89a..3f54bf8824646 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/received.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/received.exp @@ -1,6 +1,7 @@ processed 5 tasks -task 1 'run-graphql'. lines 6-15: +task 1, lines 6-15: +//# run-graphql Response: { "data": { "object": { @@ -11,15 +12,18 @@ Response: { } } -task 2 'publish'. lines 17-27: +task 2, lines 17-27: +//# publish created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6353600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 29-29: +task 3, line 29: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 31-40: +task 4, lines 31-40: +//# run-graphql Response: { "data": { "object": { diff --git a/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp b/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp index a6ddedc93f234..7136da14bd89d 100644 --- a/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp +++ b/crates/sui-graphql-e2e-tests/tests/objects/staked_sui.exp @@ -3,7 +3,8 @@ processed 7 tasks init: C: object(0,0) -task 1 'run-graphql'. lines 6-31: +task 1, lines 6-31: +//# run-graphql Response: { "data": { "objects": { @@ -28,25 +29,32 @@ Response: { } } -task 2 'programmable'. lines 33-35: +task 2, lines 33-35: +//# programmable --sender C --inputs 10000000000 @C +//> SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 37-37: +task 3, line 37: +//# run 0x3::sui_system::request_add_stake --args object(0x5) object(2,0) @validator_0 --sender C events: Event { package_id: sui_system, transaction_module: Identifier("sui_system"), sender: C, type_: StructTag { address: sui_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [135, 141, 242, 35, 38, 24, 124, 195, 86, 219, 178, 127, 110, 40, 201, 151, 112, 169, 166, 183, 93, 180, 71, 210, 141, 37, 35, 151, 110, 94, 69, 29, 218, 131, 22, 109, 1, 175, 215, 221, 207, 138, 245, 248, 68, 244, 90, 170, 83, 244, 133, 72, 229, 17, 124, 35, 245, 162, 151, 140, 253, 66, 34, 68, 252, 204, 154, 66, 27, 187, 19, 193, 166, 106, 26, 169, 143, 10, 215, 80, 41, 237, 233, 72, 87, 119, 156, 105, 21, 180, 79, 148, 6, 139, 146, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(3,0), object(3,1) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(_), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 15078400, storage_rebate: 1956240, non_refundable_storage_fee: 19760 -task 4 'create-checkpoint'. lines 39-39: +task 4, line 39: +//# create-checkpoint Checkpoint created: 1 -task 5 'advance-epoch'. lines 41-41: +task 5, line 41: +//# advance-epoch Epoch advanced: 0 -task 6 'run-graphql'. lines 43-69: +task 6, lines 43-69: +//# run-graphql Response: { "data": { "objects": { diff --git a/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp b/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp index 6d52a8d3b70f4..998a4f884648b 100644 --- a/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp +++ b/crates/sui-graphql-e2e-tests/tests/owner/downcasts.exp @@ -3,15 +3,20 @@ processed 4 tasks init: A: object(0,0) -task 1 'programmable'. lines 7-9: +task 1, lines 7-9: +//# programmable --sender A --inputs 1000 @A +//> 0: SplitCoins(Gas, [Input(0)]); +//> TransferObjects([Result(0)], Input(1)) created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 11-11: +task 2, line 11: +//# create-checkpoint Checkpoint created: 1 -task 3 'run-graphql'. lines 13-22: +task 3, lines 13-22: +//# run-graphql Response: { "data": { "sender": { diff --git a/crates/sui-graphql-e2e-tests/tests/owner/root_version.exp b/crates/sui-graphql-e2e-tests/tests/owner/root_version.exp index 14790da6f9e58..5faf07cd94355 100644 --- a/crates/sui-graphql-e2e-tests/tests/owner/root_version.exp +++ b/crates/sui-graphql-e2e-tests/tests/owner/root_version.exp @@ -3,38 +3,45 @@ processed 17 tasks init: A: object(0,0) -task 1 'publish'. lines 6-86: +task 1, lines 6-86: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 10586800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 88-89: +task 2, lines 88-89: +//# run P0::M::new_o created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2264800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 91-92: +task 3, lines 91-92: +//# run P0::M::new_w created: object(3,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2257200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 94-95: +task 4, lines 94-95: +//# run P0::M::new_dof created: object(4,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 97-98: +task 5, lines 97-98: +//# run P0::M::new_dof created: object(5,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 101-104: +task 6, lines 101-104: +//# run P0::M::connect --args object(2,0) object(3,0) object(4,0) object(5,0) created: object(6,0), object(6,1) mutated: object(0,1), object(2,0), object(4,0), object(5,0) wrapped: object(3,0) gas summary: computation_cost: 1000000, storage_cost: 9940800, storage_rebate: 6041772, non_refundable_storage_fee: 61028 -task 7 'view-object'. lines 106-108: +task 7, lines 106-108: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 7 Contents: P0::M::O { @@ -58,23 +65,28 @@ Contents: P0::M::O { }, } -task 8 'run'. lines 110-111: +task 8, lines 110-111: +//# run P0::M::touch_root --args object(2,0) mutated: object(0,1), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2568800, storage_rebate: 2543112, non_refundable_storage_fee: 25688 -task 9 'run'. lines 113-114: +task 9, lines 113-114: +//# run P0::M::touch_wrapped --args object(2,0) mutated: object(0,1), object(2,0) gas summary: computation_cost: 1000000, storage_cost: 2568800, storage_rebate: 2543112, non_refundable_storage_fee: 25688 -task 10 'run'. lines 116-117: +task 10, lines 116-117: +//# run P0::M::touch_inner --args object(2,0) mutated: object(0,1), object(2,0), object(4,0) gas summary: computation_cost: 1000000, storage_cost: 3853200, storage_rebate: 3814668, non_refundable_storage_fee: 38532 -task 11 'run'. lines 119-120: +task 11, lines 119-120: +//# run P0::M::touch_outer --args object(2,0) mutated: object(0,1), object(2,0), object(5,0) gas summary: computation_cost: 1000000, storage_cost: 3853200, storage_rebate: 3814668, non_refundable_storage_fee: 38532 -task 12 'view-object'. lines 122-122: +task 12, line 122: +//# view-object 2,0 Owner: Account Address ( _ ) Version: 11 Contents: P0::M::O { @@ -98,10 +110,12 @@ Contents: P0::M::O { }, } -task 13 'create-checkpoint'. lines 124-124: +task 13, line 124: +//# create-checkpoint Checkpoint created: 1 -task 14 'run-graphql'. lines 126-141: +task 14, lines 126-141: +//# run-graphql Response: { "data": { "latest": { @@ -175,7 +189,8 @@ Response: { } } -task 15 'run-graphql'. lines 143-171: +task 15, lines 143-171: +//# run-graphql Response: { "data": { "unversioned": { @@ -246,7 +261,8 @@ Response: { } } -task 16 'run-graphql'. lines 173-194: +task 16, lines 173-194: +//# run-graphql Response: { "data": { "unversioned": { diff --git a/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp b/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp index fe8ac6a65abf2..e1e0df1f40885 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/datatypes.exp @@ -3,7 +3,8 @@ processed 9 tasks init: A: object(0,0) -task 1 'run-graphql'. lines 6-54: +task 1, lines 6-54: +//# run-graphql Response: { "data": { "object": { @@ -135,18 +136,22 @@ Response: { } } -task 2 'publish'. lines 56-66: +task 2, lines 56-66: +//# publish --upgradeable --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5981200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 68-68: +task 3, line 68: +//# create-checkpoint Checkpoint created: 1 -task 4 'view-object'. lines 70-70: +task 4, line 70: +//# view-object 2,0 2,0::m -task 5 'run-graphql'. lines 72-96: +task 5, lines 72-96: +//# run-graphql Response: { "data": { "object": { @@ -180,7 +185,8 @@ Response: { } } -task 6 'run-graphql'. lines 98-143: +task 6, lines 98-143: +//# run-graphql Response: { "data": { "object": { @@ -284,7 +290,8 @@ Response: { } } -task 7 'run-graphql'. lines 145-174: +task 7, lines 145-174: +//# run-graphql Response: { "data": { "object": { @@ -348,7 +355,8 @@ Response: { } } -task 8 'run-graphql'. lines 176-206: +task 8, lines 176-206: +//# run-graphql Response: { "data": { "object": { diff --git a/crates/sui-graphql-e2e-tests/tests/packages/enums.exp b/crates/sui-graphql-e2e-tests/tests/packages/enums.exp index cbb2d101ad3d3..74b919f9a81e7 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/enums.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/enums.exp @@ -3,15 +3,18 @@ processed 8 tasks init: A: object(0,0) -task 1 'publish'. lines 6-17: +task 1, lines 6-17: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5783600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 19-19: +task 2, line 19: +//# create-checkpoint Checkpoint created: 1 -task 3 'run-graphql'. lines 21-66: +task 3, lines 21-66: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -100,15 +103,18 @@ Response: { } } -task 4 'upgrade'. lines 68-81: +task 4, lines 68-81: +//# upgrade --package P0 --upgrade-capability 1,1 --sender A created: object(4,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 5 'create-checkpoint'. lines 83-83: +task 5, line 83: +//# create-checkpoint Checkpoint created: 2 -task 6 'run-graphql'. lines 85-148: +task 6, lines 85-148: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -281,7 +287,8 @@ Response: { } } -task 7 'run-graphql'. lines 150-185: +task 7, lines 150-185: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/packages/friends.exp b/crates/sui-graphql-e2e-tests/tests/packages/friends.exp index 66c53217b5c51..22f2e5db69726 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/friends.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/friends.exp @@ -3,15 +3,18 @@ processed 9 tasks init: A: object(0,0) -task 1 'publish'. lines 6-14: +task 1, lines 6-14: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 7379600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 16-16: +task 2, line 16: +//# create-checkpoint Checkpoint created: 1 -task 3 'run-graphql'. lines 18-76: +task 3, lines 18-76: +//# run-graphql --cursors {"i":0,"c":1} {"i":2,"c":1} Response: { "data": { "transactionBlocks": { @@ -113,7 +116,8 @@ Response: { } } -task 4 'run-graphql'. lines 79-108: +task 4, lines 79-108: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -175,7 +179,8 @@ Response: { ] } -task 5 'run-graphql'. lines 110-172: +task 5, lines 110-172: +//# run-graphql --cursors {"i":0,"c":1} {"i":2,"c":1} Response: { "data": { "transactionBlocks": { @@ -279,15 +284,18 @@ Response: { } } -task 6 'upgrade'. lines 174-183: +task 6, lines 174-183: +//# upgrade --package P0 --upgrade-capability 1,1 --sender A created: object(6,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 8139600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 7 'create-checkpoint'. lines 185-185: +task 7, line 185: +//# create-checkpoint Checkpoint created: 2 -task 8 'run-graphql'. lines 187-220: +task 8, lines 187-220: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/packages/functions.exp b/crates/sui-graphql-e2e-tests/tests/packages/functions.exp index 169fa18dbeda4..ae31c692e9a32 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/functions.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/functions.exp @@ -3,7 +3,8 @@ processed 10 tasks init: A: object(0,0) -task 1 'run-graphql'. lines 6-38: +task 1, lines 6-38: +//# run-graphql Response: { "data": { "object": { @@ -72,15 +73,18 @@ Response: { } } -task 2 'publish'. lines 40-44: +task 2, lines 40-44: +//# publish --upgradeable --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5183200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 46-46: +task 3, line 46: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 48-86: +task 4, lines 48-86: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -149,15 +153,18 @@ Response: { } } -task 5 'upgrade'. lines 88-93: +task 5, lines 88-93: +//# upgrade --package P0 --upgrade-capability 2,1 --sender A created: object(5,0) mutated: object(0,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 5418800, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'create-checkpoint'. lines 95-95: +task 6, line 95: +//# create-checkpoint Checkpoint created: 2 -task 7 'run-graphql'. lines 97-136: +task 7, lines 97-136: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -243,7 +250,8 @@ Response: { } } -task 8 'run-graphql'. lines 138-173: +task 8, lines 138-173: +//# run-graphql --cursors {"n":"consensus_commit_prologue","c":2} {"n":"timestamp_ms","c":2} Response: { "data": { "object": { @@ -390,7 +398,8 @@ Response: { } } -task 9 'run-graphql'. lines 175-246: +task 9, lines 175-246: +//# run-graphql --cursors {"n":"consensus_commit_prologue","c":2} {"n":"timestamp_ms","c":2} Response: { "data": { "object": { diff --git a/crates/sui-graphql-e2e-tests/tests/packages/modules.exp b/crates/sui-graphql-e2e-tests/tests/packages/modules.exp index 382ecd96ac6a9..a759003a12968 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/modules.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/modules.exp @@ -1,14 +1,17 @@ processed 6 tasks -task 1 'publish'. lines 6-31: +task 1, lines 6-31: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6004000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 33-33: +task 2, line 33: +//# create-checkpoint Checkpoint created: 1 -task 3 'run-graphql'. lines 35-65: +task 3, lines 35-65: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -48,7 +51,8 @@ Response: { } } -task 4 'run-graphql'. lines 67-104: +task 4, lines 67-104: +//# run-graphql --cursors {"n":"m","c":1} {"n":"o","c":1} Response: { "data": { "transactionBlocks": { @@ -145,7 +149,8 @@ Response: { } } -task 5 'run-graphql'. lines 106-146: +task 5, lines 106-146: +//# run-graphql --cursors {"n":"m","c":1} {"n":"o","c":1} Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/packages/structs.exp b/crates/sui-graphql-e2e-tests/tests/packages/structs.exp index 6a4c029955cb9..b7c3d820c8bc2 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/structs.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/structs.exp @@ -3,7 +3,8 @@ processed 11 tasks init: A: object(0,0) -task 1 'run-graphql'. lines 6-50: +task 1, lines 6-50: +//# run-graphql Response: { "data": { "object": { @@ -131,15 +132,18 @@ Response: { } } -task 2 'publish'. lines 52-56: +task 2, lines 52-56: +//# publish --upgradeable --sender A created: object(2,0), object(2,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5213600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'create-checkpoint'. lines 58-58: +task 3, line 58: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 60-102: +task 4, lines 60-102: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -198,15 +202,18 @@ Response: { } } -task 5 'upgrade'. lines 104-110: +task 5, lines 104-110: +//# upgrade --package P0 --upgrade-capability 2,1 --sender A created: object(5,0) mutated: object(0,0), object(2,1) gas summary: computation_cost: 1000000, storage_cost: 6049600, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 6 'create-checkpoint'. lines 112-112: +task 6, line 112: +//# create-checkpoint Checkpoint created: 2 -task 7 'run-graphql'. lines 114-171: +task 7, lines 114-171: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -339,7 +346,8 @@ Response: { } } -task 8 'run-graphql'. lines 173-208: +task 8, lines 173-208: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -387,7 +395,8 @@ Response: { } } -task 9 'run-graphql'. lines 211-251: +task 9, lines 211-251: +//# run-graphql --cursors {"n":"Coin","c":2} {"n":"TreasuryCap","c":2} Response: { "data": { "object": { @@ -603,7 +612,8 @@ Response: { } } -task 10 'run-graphql'. lines 253-300: +task 10, lines 253-300: +//# run-graphql --cursors {"n":"Coin","c":2} {"n":"TreasuryCap","c":2} Response: { "data": { "object": { diff --git a/crates/sui-graphql-e2e-tests/tests/packages/types.exp b/crates/sui-graphql-e2e-tests/tests/packages/types.exp index 67b889c9be97a..078ee9b351126 100644 --- a/crates/sui-graphql-e2e-tests/tests/packages/types.exp +++ b/crates/sui-graphql-e2e-tests/tests/packages/types.exp @@ -1,6 +1,7 @@ processed 12 tasks -task 1 'run-graphql'. lines 6-15: +task 1, lines 6-15: +//# run-graphql Response: { "data": { "type": { @@ -106,7 +107,8 @@ Response: { } } -task 2 'run-graphql'. lines 17-26: +task 2, lines 17-26: +//# run-graphql Response: { "data": { "type": { @@ -117,7 +119,8 @@ Response: { } } -task 3 'run-graphql'. lines 28-37: +task 3, lines 28-37: +//# run-graphql Response: { "data": { "type": { @@ -132,7 +135,8 @@ Response: { } } -task 4 'run-graphql'. lines 39-48: +task 4, lines 39-48: +//# run-graphql Response: { "data": null, "errors": [ @@ -154,7 +158,8 @@ Response: { ] } -task 5 'run-graphql'. lines 50-60: +task 5, lines 50-60: +//# run-graphql Response: { "data": { "type": { @@ -171,7 +176,8 @@ Response: { } } -task 6 'run-graphql'. lines 62-77: +task 6, lines 62-77: +//# run-graphql Response: { "data": null, "errors": [ @@ -194,7 +200,8 @@ Response: { ] } -task 7 'run-graphql'. lines 79-102: +task 7, lines 79-102: +//# run-graphql Response: { "data": { "token": { @@ -228,7 +235,8 @@ Response: { } } -task 8 'run-graphql'. lines 104-121: +task 8, lines 104-121: +//# run-graphql Response: { "data": null, "errors": [ @@ -251,15 +259,18 @@ Response: { ] } -task 9 'publish'. lines 123-140: +task 9, lines 123-140: +//# publish created: object(9,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4461200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 10 'create-checkpoint'. lines 142-142: +task 10, line 142: +//# create-checkpoint Checkpoint created: 1 -task 11 'run-graphql'. lines 144-152: +task 11, lines 144-152: +//# run-graphql Response: { "data": null, "errors": [ diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp index bd37960e1f599..eed1699cbb327 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp @@ -3,22 +3,34 @@ processed 8 tasks init: C: object(0,0), O: object(0,1), P: object(0,2), Q: object(0,3), R: object(0,4), S: object(0,5) -task 1 'programmable'. lines 6-8: +task 1, lines 6-8: +//# programmable --sender C --inputs @C 1000 2000 3000 4000 5000 +//> SplitCoins(Gas, [Input(1), Input(2), Input(3), Input(4), Input(5)]); +//> TransferObjects([NestedResult(0,0), NestedResult(0,1), NestedResult(0,2), NestedResult(0,3), NestedResult(0,4)], Input(0)); created: object(1,0), object(1,1), object(1,2), object(1,3), object(1,4) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 10-15: +task 2, lines 10-15: +//# programmable --sender C --inputs object(1,0) object(1,1) object(1,2) object(1,3) object(1,4) @O @P @Q @R @S +//> TransferObjects([Input(0)], Input(5)); +//> TransferObjects([Input(1)], Input(6)); +//> TransferObjects([Input(2)], Input(7)); +//> TransferObjects([Input(3)], Input(8)); +//> TransferObjects([Input(4)], Input(9)); mutated: object(0,0), object(1,0), object(1,1), object(1,2), object(1,3), object(1,4) gas summary: computation_cost: 1000000, storage_cost: 5928000, storage_rebate: 5868720, non_refundable_storage_fee: 59280 -task 3 'create-checkpoint'. lines 17-17: +task 3, line 17: +//# create-checkpoint Checkpoint created: 1 -task 4 'advance-epoch'. lines 19-19: +task 4, line 19: +//# advance-epoch Epoch advanced: 0 -task 5 'run-graphql'. lines 21-45: +task 5, lines 21-45: +//# run-graphql Response: { "data": { "address": { @@ -80,7 +92,8 @@ Response: { } } -task 6 'run-graphql'. lines 47-71: +task 6, lines 47-71: +//# run-graphql --cursors {"i":2,"c":1} Response: { "data": { "address": { @@ -118,7 +131,8 @@ Response: { } } -task 7 'run-graphql'. lines 73-97: +task 7, lines 73-97: +//# run-graphql --cursors {"i":3,"c":1} Response: { "data": { "address": { diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp index 67cf6d574545b..d0f145c52957c 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp @@ -3,49 +3,63 @@ processed 12 tasks init: A: object(0,0) -task 1 'publish'. lines 6-33: +task 1, lines 6-33: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 6194000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 35-35: +task 2, line 35: +//# run Test::M1::create --args 2 @A created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'run'. lines 37-37: +task 3, line 37: +//# run Test::M1::create --args 3 @A created: object(3,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 39-39: +task 4, line 39: +//# run Test::M1::create --args 4 @A created: object(4,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 41-41: +task 5, line 41: +//# run Test::M1::create --args 5 @A created: object(5,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 43-43: +task 6, line 43: +//# run Test::M1::create --args 6 @A created: object(6,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'programmable'. lines 45-49: +task 7, lines 45-49: +//# programmable --sender A --inputs object(2,0) object(3,0) object(4,0) object(5,0) object(6,0) @A +//> 0: Test::M1::sum(Input(0), Input(1)); +//> 1: Test::M1::sum(Input(2), Input(3)); +//> 2: Test::M1::sum(Input(0), Input(4)); +//> 3: Test::M1::create(Result(2), Input(5)); created: object(7,0) mutated: object(0,0), object(2,0), object(3,0), object(4,0), object(5,0), object(6,0) gas summary: computation_cost: 1000000, storage_cost: 8876800, storage_rebate: 6508260, non_refundable_storage_fee: 65740 -task 8 'run'. lines 51-51: +task 8, line 51: +//# run Test::M1::increment --sender A --args object(7,0) 100 mutated: object(0,0), object(7,0) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 2279772, non_refundable_storage_fee: 23028 -task 9 'create-checkpoint'. lines 53-53: +task 9, line 53: +//# create-checkpoint Checkpoint created: 1 -task 10 'run-graphql'. lines 56-93: +task 10, lines 56-93: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -117,7 +131,8 @@ Response: { } } -task 11 'run-graphql'. lines 95-132: +task 11, lines 95-132: +//# run-graphql --cursors {"i":0,"c":1} Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.exp b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.exp index e9bb1fff6aa8b..a50b27ee922c0 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.exp +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/events.exp @@ -3,30 +3,36 @@ processed 10 tasks init: A: object(0,0) -task 1 'publish'. lines 6-28: +task 1, lines 6-28: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5251600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 30-30: +task 2, line 30: +//# run Test::M1::emit_1 --sender A --args 1 events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [1, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'run'. lines 32-32: +task 3, line 32: +//# run Test::M1::emit_2 --sender A --args 10 events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [10, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [11, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'run'. lines 34-34: +task 4, line 34: +//# run Test::M1::emit_3 --sender A --args 100 events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [100, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [101, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [102, 0, 0, 0, 0, 0, 0, 0] } mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'create-checkpoint'. lines 36-36: +task 5, line 36: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 38-57: +task 6, lines 38-57: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -126,7 +132,8 @@ Response: { } } -task 7 'run-graphql'. lines 59-70: +task 7, lines 59-70: +//# run-graphql Response: { "data": { "events": { @@ -190,7 +197,8 @@ Response: { } } -task 8 'run-graphql'. lines 72-91: +task 8, lines 72-91: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -219,7 +227,8 @@ Response: { } } -task 9 'run-graphql'. lines 93-112: +task 9, lines 93-112: +//# run-graphql --cursors {"i":0,"c":1} Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.exp b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.exp index 1b9999aaf3ab4..6be8ab6d548ba 100644 --- a/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.exp +++ b/crates/sui-graphql-e2e-tests/tests/transaction_block_effects/object_changes.exp @@ -3,20 +3,24 @@ processed 6 tasks init: validator_0: object(0,0) -task 1 'publish'. lines 6-25: +task 1, lines 6-25: +//# publish created: object(1,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 5570800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run Test::M1::create --args 0 @A --gas-price 1000 created: object(2,0) mutated: object(0,1) gas summary: computation_cost: 1000000, storage_cost: 2302800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'create-checkpoint'. lines 29-29: +task 3, line 29: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 31-50: +task 4, lines 31-50: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -100,7 +104,8 @@ Response: { } } -task 5 'run-graphql'. lines 52-71: +task 5, lines 52-71: +//# run-graphql --cursors {"i":10,"c":1} Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp b/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp index 6dced09578f47..4a2e27aca6efc 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/errors.exp @@ -1,18 +1,23 @@ processed 8 tasks -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3663200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 13-14: +task 2, lines 13-14: +//# programmable +//> P0::m::boom() Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::boom (function index 1) at offset 1, Abort Code: 42 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 1, instruction: 1, function_name: Some("boom") }, 42), source: Some(VMError { major_status: ABORTED, sub_status: Some(42), message: Some("P0::m::boom at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 1)] }), command: Some(0) } } -task 3 'create-checkpoint'. lines 16-16: +task 3, line 16: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 18-30: +task 4, lines 18-30: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -28,14 +33,20 @@ Response: { } } -task 5 'programmable'. lines 32-35: +task 5, lines 32-35: +//# programmable +//> 0: P0::m::tick(); +//> 1: P0::m::tick(); +//> P0::m::boom() Error: Transaction Effects Status: Move Runtime Abort. Location: P0::m::boom (function index 1) at offset 1, Abort Code: 42 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: P0, name: Identifier("m") }, function: 1, instruction: 1, function_name: Some("boom") }, 42), source: Some(VMError { major_status: ABORTED, sub_status: Some(42), message: Some("P0::m::boom at offset 1"), exec_state: None, location: Module(ModuleId { address: P0, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(1), 1)] }), command: Some(2) } } -task 6 'create-checkpoint'. lines 37-37: +task 6, line 37: +//# create-checkpoint Checkpoint created: 2 -task 7 'run-graphql'. lines 39-52: +task 7, lines 39-52: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp b/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp index 448059f04b6aa..d1a45fd72cb9b 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/programmable.exp @@ -3,15 +3,18 @@ processed 21 tasks init: A: object(0,0) -task 1 'publish'. lines 6-16: +task 1, lines 6-16: +//# publish --upgradeable --sender A created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6315600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'create-checkpoint'. lines 18-18: +task 2, line 18: +//# create-checkpoint Checkpoint created: 1 -task 3 'run-graphql'. lines 20-199: +task 3, lines 20-199: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -170,15 +173,18 @@ Response: { } } -task 4 'upgrade'. lines 201-216: +task 4, lines 201-216: +//# upgrade --package P0 --upgrade-capability 1,1 --sender A created: object(4,0) mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 6589200, storage_rebate: 2595780, non_refundable_storage_fee: 26220 -task 5 'create-checkpoint'. lines 218-218: +task 5, line 218: +//# create-checkpoint Checkpoint created: 2 -task 6 'run-graphql'. lines 220-399: +task 6, lines 220-399: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -441,20 +447,36 @@ Response: { } } -task 7 'programmable'. lines 401-404: +task 7, lines 401-404: +//# programmable --sender A --inputs 41u64 @A +//> 0: MakeMoveVec([Input(0)]); +//> 1: P0::m::new(Result(0)); +//> sui::transfer::public_transfer(Result(1), Input(1)) created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 2280000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'programmable'. lines 406-415: +task 8, lines 406-415: +//# programmable --sender A --inputs 42u64 43u64 1000 @A +//> 0: MakeMoveVec([Input(0), Input(1)]); +//> 1: MakeMoveVec([]); +//> 2: SplitCoins(Gas, [Input(2), Input(2)]); +//> 3: P0::m::new(Result(0)); +//> 4: TransferObjects([Result(3)], Input(3)); +//> 5: P0::m::new(Result(1)); +//> 6: P0::m::burn(Result(5)); +//> 7: MergeCoins(NestedResult(2,0), [NestedResult(2,1)]); +//> TransferObjects([NestedResult(2,0)], Input(3)) created: object(8,0), object(8,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3328800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 9 'create-checkpoint'. lines 417-417: +task 9, line 417: +//# create-checkpoint Checkpoint created: 3 -task 10 'run-graphql'. lines 419-607: +task 10, lines 419-607: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -842,14 +864,18 @@ Response: { } } -task 11 'programmable'. lines 609-610: +task 11, lines 609-610: +//# programmable --sender A --inputs 1000 +//> SplitCoins(Gas, [Input(0)]) Error: Transaction Effects Status: Unused result without the drop ability. Command result 0, return value 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: UnusedValueWithoutDrop { result_idx: 0, secondary_idx: 0 }, source: None, command: None } } -task 12 'create-checkpoint'. lines 612-612: +task 12, line 612: +//# create-checkpoint Checkpoint created: 4 -task 13 'run-graphql'. lines 614-793: +task 13, lines 614-793: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -975,7 +1001,8 @@ Response: { } } -task 14 'run-graphql'. lines 795-805: +task 14, lines 795-805: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -1033,7 +1060,8 @@ Response: { } } -task 15 'run-graphql'. lines 807-817: +task 15, lines 807-817: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -1051,7 +1079,8 @@ Response: { } } -task 16 'run-graphql'. lines 819-829: +task 16, lines 819-829: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -1101,7 +1130,8 @@ Response: { } } -task 17 'run-graphql'. lines 831-838: +task 17, lines 831-838: +//# run-graphql Response: { "data": { "address": { @@ -1112,7 +1142,8 @@ Response: { } } -task 18 'run-graphql'. lines 840-845: +task 18, lines 840-845: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -1128,7 +1159,8 @@ Response: { } } -task 19 'run-graphql'. lines 847-852: +task 19, lines 847-852: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -1144,7 +1176,8 @@ Response: { } } -task 20 'run-graphql'. lines 854-864: +task 20, lines 854-864: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/random.exp b/crates/sui-graphql-e2e-tests/tests/transactions/random.exp index 5dd2f349140e0..5d5853d899295 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/random.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/random.exp @@ -1,12 +1,15 @@ processed 7 tasks -task 1 'create-checkpoint'. lines 6-6: +task 1, line 6: +//# create-checkpoint Checkpoint created: 1 -task 2 'advance-epoch'. lines 8-8: +task 2, line 8: +//# advance-epoch --create-random-state Epoch advanced: 0 -task 3 'run-graphql'. lines 10-46: +task 3, lines 10-46: +//# run-graphql Response: { "data": { "epoch": { @@ -63,10 +66,12 @@ Response: { } } -task 5 'create-checkpoint'. lines 52-52: +task 5, line 52: +//# create-checkpoint Checkpoint created: 3 -task 6 'run-graphql'. lines 54-69: +task 6, lines 54-69: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp b/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp index d0bf06f0906e4..1d29dcca4c7ce 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/shared.exp @@ -1,27 +1,37 @@ processed 7 tasks -task 1 'publish'. lines 6-22: +task 1, lines 6-22: +//# publish created: object(1,0), object(1,1) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 6862800, storage_rebate: 0, non_refundable_storage_fee: 0 -task 2 'programmable'. lines 24-25: +task 2, lines 24-25: +//# programmable --inputs immshared(1,0) +//> 0: P0::m::get(Input(0)) mutated: object(0,0) unchanged_shared: object(1,0) gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'programmable'. lines 27-28: +task 3, lines 27-28: +//# programmable --inputs object(1,0) +//> 0: P0::m::inc(Input(0)) mutated: object(0,0), object(1,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 4 'programmable'. lines 30-32: +task 4, lines 30-32: +//# programmable --inputs object(1,0) +//> 0: P0::m::get(Input(0)); +//> P0::m::inc(Input(0)) mutated: object(0,0), object(1,0) gas summary: computation_cost: 1000000, storage_cost: 2272400, storage_rebate: 2249676, non_refundable_storage_fee: 22724 -task 5 'create-checkpoint'. lines 34-34: +task 5, line 34: +//# create-checkpoint Checkpoint created: 1 -task 6 'run-graphql'. lines 36-84: +task 6, lines 36-84: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/transactions/system.exp b/crates/sui-graphql-e2e-tests/tests/transactions/system.exp index b1b30792c3090..ed999ab7f9b54 100644 --- a/crates/sui-graphql-e2e-tests/tests/transactions/system.exp +++ b/crates/sui-graphql-e2e-tests/tests/transactions/system.exp @@ -1,6 +1,7 @@ processed 8 tasks -task 1 'run-graphql'. lines 8-102: +task 1, lines 8-102: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -1464,10 +1465,12 @@ Response: { } } -task 3 'create-checkpoint'. lines 106-106: +task 3, line 106: +//# create-checkpoint Checkpoint created: 1 -task 4 'run-graphql'. lines 108-183: +task 4, lines 108-183: +//# run-graphql Response: { "data": { "transactionBlocks": { @@ -1551,10 +1554,12 @@ Response: { } } -task 6 'advance-epoch'. lines 187-187: +task 6, line 187: +//# advance-epoch Epoch advanced: 0 -task 7 'run-graphql'. lines 189-276: +task 7, lines 189-276: +//# run-graphql Response: { "data": { "transactionBlocks": { diff --git a/crates/sui-graphql-e2e-tests/tests/validator/validator.exp b/crates/sui-graphql-e2e-tests/tests/validator/validator.exp index 21df97737b9a0..69659c8f7afee 100644 --- a/crates/sui-graphql-e2e-tests/tests/validator/validator.exp +++ b/crates/sui-graphql-e2e-tests/tests/validator/validator.exp @@ -3,44 +3,54 @@ processed 29 tasks init: A: object(0,0) -task 1 'advance-epoch'. lines 8-8: +task 1, line 8: +//# advance-epoch Epoch advanced: 0 -task 2 'create-checkpoint'. lines 10-10: +task 2, line 10: +//# create-checkpoint Checkpoint created: 2 -task 3 'publish'. lines 12-37: +task 3, lines 12-37: +//# publish --sender A --gas-budget 9999999999 created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5920400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 4 'run'. lines 39-39: +task 4, line 39: +//# run P0::m::new --sender A created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 5 'run'. lines 41-41: +task 5, line 41: +//# run P0::m::new --sender A created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 6 'run'. lines 43-43: +task 6, line 43: +//# run P0::m::new --sender A created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 7 'run'. lines 45-45: +task 7, line 45: +//# run P0::m::new --sender A created: object(7,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'create-checkpoint'. lines 47-47: +task 8, line 47: +//# create-checkpoint Checkpoint created: 3 -task 9 'advance-epoch'. lines 49-49: +task 9, line 49: +//# advance-epoch Epoch advanced: 1 -task 10 'run-graphql'. lines 51-63: +task 10, lines 51-63: +//# run-graphql Response: { "data": { "epoch": { @@ -58,88 +68,106 @@ Response: { } } -task 11 'run'. lines 65-65: +task 11, line 65: +//# run P0::m::new --sender A created: object(11,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 12 'run'. lines 67-67: +task 12, line 67: +//# run P0::m::new --sender A created: object(12,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 13 'run'. lines 69-69: +task 13, line 69: +//# run P0::m::new --sender A created: object(13,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 14 'run'. lines 71-71: +task 14, line 71: +//# run P0::m::new --sender A created: object(14,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 15 'run'. lines 73-73: +task 15, line 73: +//# run P0::m::new --sender A created: object(15,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 16 'run'. lines 75-75: +task 16, line 75: +//# run P0::m::new --sender A created: object(16,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 17 'run'. lines 77-77: +task 17, line 77: +//# run P0::m::new --sender A created: object(17,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 18 'run'. lines 79-79: +task 18, line 79: +//# run P0::m::new --sender A created: object(18,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 19 'run'. lines 81-81: +task 19, line 81: +//# run P0::m::new --sender A created: object(19,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 20 'run'. lines 83-83: +task 20, line 83: +//# run P0::m::new --sender A created: object(20,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 21 'run'. lines 85-85: +task 21, line 85: +//# run P0::m::new --sender A created: object(21,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 22 'run'. lines 87-87: +task 22, line 87: +//# run P0::m::new --sender A created: object(22,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 23 'run'. lines 89-89: +task 23, line 89: +//# run P0::m::new --sender A created: object(23,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 24 'run'. lines 91-91: +task 24, line 91: +//# run P0::m::new --sender A created: object(24,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 25 'run'. lines 93-93: +task 25, line 93: +//# run P0::m::new --sender A created: object(25,0) mutated: object(0,0) gas summary: computation_cost: 1441000000, storage_cost: 1932269600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 26 'create-checkpoint'. lines 95-95: +task 26, line 95: +//# create-checkpoint Checkpoint created: 5 -task 27 'advance-epoch'. lines 97-99: +task 27, lines 97-99: +//# advance-epoch Epoch advanced: 2 -task 28 'run-graphql'. lines 101-118: +task 28, lines 101-118: +//# run-graphql Response: { "data": { "epoch": { diff --git a/crates/sui-transactional-test-runner/src/test_adapter.rs b/crates/sui-transactional-test-runner/src/test_adapter.rs index aeb1fdc3886cf..cce915fa4d87c 100644 --- a/crates/sui-transactional-test-runner/src/test_adapter.rs +++ b/crates/sui-transactional-test-runner/src/test_adapter.rs @@ -31,6 +31,7 @@ use move_core_types::{ }; use move_symbol_pool::Symbol; use move_transactional_test_runner::framework::MaybeNamedCompiledModule; +use move_transactional_test_runner::tasks::TaskCommand; use move_transactional_test_runner::{ framework::{compile_any, store_modules, CompiledState, MoveTestAdapter}, tasks::{InitCommand, RunCommand, SyntaxChoice, TaskInput}, @@ -178,6 +179,34 @@ impl<'a> MoveTestAdapter<'a> for SuiTestAdapter { type ExtraValueArgs = SuiExtraValueArgs; type Subcommand = SuiSubcommand; + fn render_command_input( + &self, + task: &TaskInput< + TaskCommand< + Self::ExtraInitArgs, + Self::ExtraPublishArgs, + Self::ExtraValueArgs, + Self::ExtraRunArgs, + Self::Subcommand, + >, + >, + ) -> Option { + match &task.command { + TaskCommand::Subcommand(SuiSubcommand::ProgrammableTransaction(..)) => { + let data_str = std::fs::read_to_string(task.data.as_ref()?) + .ok()? + .trim() + .to_string(); + Some(format!("{}\n{}", task.task_text, data_str)) + } + TaskCommand::Init(_, _) + | TaskCommand::PrintBytecode(_) + | TaskCommand::Publish(_, _) + | TaskCommand::Run(_, _) + | TaskCommand::Subcommand(..) => None, + } + } + fn compiled_state(&mut self) -> &mut CompiledState { &mut self.compiled_state } @@ -513,15 +542,17 @@ impl<'a> MoveTestAdapter<'a> for SuiTestAdapter { command_lines_stop, stop_line, data, + task_text, } = task; macro_rules! get_obj { ($fake_id:ident, $version:expr) => {{ let id = match self.fake_to_real_object_id($fake_id) { None => bail!( - "task {}, lines {}-{}. Unbound fake id {}", + "task {}, lines {}-{}\n{}\n. Unbound fake id {}", number, start_line, command_lines_stop, + task_text, $fake_id ), Some(res) => res, diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/clock_mut.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/clock_mut.exp index 062fd7f66d6d7..e904c88df7f2b 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/clock_mut.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/clock_mut.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-14: +task 0, lines 6-14: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Clock must be passed by immutable reference. got: &mut sui::clock::Clock"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/clock_ref.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/clock_ref.exp index d0962e6a0e3e4..77f20608191ba 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/clock_ref.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/clock_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-14: +task 0, lines 6-14: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3952000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/clock_val.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/clock_val.exp index ea2be198f7c9f..f4be10beeda0f 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/clock_val.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/clock_val.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-14: +task 0, lines 6-14: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Clock must be passed by immutable reference. got: sui::clock::Clock"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_and_generic_object_params.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_and_generic_object_params.exp index 975726cb182c3..6f5b07a6093fd 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_and_generic_object_params.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_and_generic_object_params.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-16: +task 0, lines 4-16: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4598000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_mut_ref_vector.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_mut_ref_vector.exp index 4383f758f9bd3..8ebb0826942ea 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_mut_ref_vector.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_mut_ref_vector.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-15: +task 0, lines 6-15: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &mut vector"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_ref_vector.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_ref_vector.exp index 698692cb7314a..8fcf74765deb9 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_ref_vector.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_obj_ref_vector.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-15: +task 0, lines 6-15: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &vector"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_param_after_primitive.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_param_after_primitive.exp index c1e89654fa99e..02a7c73a86c47 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_param_after_primitive.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_param_after_primitive.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-16: +task 0, lines 4-16: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4560000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_invalid.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_invalid.exp index a21164f585b56..d5f9ff6a6f3d0 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_invalid.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_invalid.exp @@ -1,9 +1,11 @@ processed 2 tasks -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: std::option::Option"), command: Some(0) } } -task 1 'publish'. lines 18-28: +task 1, lines 18-28: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: vector>"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_valid.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_valid.exp index 13dabe34faf29..8241786cc49fa 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_valid.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_valid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4332000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/id.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/id.exp index fc170a79903fe..74f9425080673 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/id.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/id.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-21: +task 0, lines 6-21: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4149600, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/nested_generic_vector_param.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/nested_generic_vector_param.exp index 3909e81372cf0..bffdcc7003259 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/nested_generic_vector_param.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/nested_generic_vector_param.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-13: +task 0, lines 4-13: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3982400, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/nested_key_generic_vector_param.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/nested_key_generic_vector_param.exp index 4e4aa08e3793f..4625303404c74 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/nested_key_generic_vector_param.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/nested_key_generic_vector_param.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-13: +task 0, lines 4-13: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: vector>"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct.exp index 264f0814a1250..1c64cab5d1700 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-17: +task 0, lines 6-17: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: _::m::S"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic.exp index 00b05ad2f8036..04263bb837ac3 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic.exp @@ -1,9 +1,11 @@ processed 2 tasks -task 0 'publish'. lines 6-21: +task 0, lines 6-21: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: _::m::Obj<_::m::NoStore>"), command: Some(0) } } -task 1 'publish'. lines 23-35: +task 1, lines 23-35: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: _::m::Obj"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic_valid.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic_valid.exp index 2068d3e73e6d5..892f33a6fb6f3 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic_valid.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_generic_valid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-18: +task 0, lines 6-18: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4567600, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_vector.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_vector.exp index 686b6db528a39..eabd9f61c36c0 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_vector.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/non_key_struct_vector.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-17: +task 0, lines 6-17: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: vector<_::m::S>"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/obj_mut_ref_vector.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/obj_mut_ref_vector.exp index c855225ab4539..942c6be407d73 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/obj_mut_ref_vector.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/obj_mut_ref_vector.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-18: +task 0, lines 6-18: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &mut vector<_::m::S>"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/obj_ref_vector.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/obj_ref_vector.exp index afe4f2e49ffdb..23387d34971b6 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/obj_ref_vector.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/obj_ref_vector.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-18: +task 0, lines 6-18: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Expected primitive or object type. Got: &vector<_::m::S>"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/ok.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/ok.exp index 1a1874b4f0b99..69306e676de32 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/ok.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/ok.exp @@ -1,11 +1,13 @@ processed 2 tasks -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3929200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 1 'publish'. lines 13-20: +task 1, lines 13-20: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3929200, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/option.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/option.exp index 16906422536e5..3b39519ba4aa6 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/option.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/option.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-23: +task 0, lines 6-23: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4590400, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/optional_txn_context.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/optional_txn_context.exp index bc7053e3106d5..8dc0a247d417f 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/optional_txn_context.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/optional_txn_context.exp @@ -1,11 +1,13 @@ processed 2 tasks -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3769600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 1 'publish'. lines 14-23: +task 1, lines 14-23: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4392800, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/random_mut.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/random_mut.exp index b47cea42e6297..adb5811d67d2c 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/random_mut.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/random_mut.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-14: +task 0, lines 6-14: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Random must be passed by immutable reference. got: &mut sui::random::Random"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/random_ref.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/random_ref.exp index 36ca9b363cd40..59e660137ea84 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/random_ref.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/random_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-14: +task 0, lines 6-14: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3974800, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/random_val.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/random_val.exp index 9f2e8220f9f31..54b6a50c73dbb 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/random_val.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/random_val.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-14: +task 0, lines 6-14: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point parameter type. Random must be passed by immutable reference. got: sui::random::Random"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/return_values.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/return_values.exp index febd73d4f1201..fe965c2befbbf 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/return_values.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/return_values.exp @@ -1,26 +1,31 @@ processed 5 tasks -task 0 'publish'. lines 6-13: +task 0, lines 6-13: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3959600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 1 'publish'. lines 15-22: +task 1, lines 15-22: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3967200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 2 'publish'. lines 24-31: +task 2, lines 24-31: +//# publish created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3967200, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'publish'. lines 33-41: +task 3, lines 33-41: +//# publish created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4506800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 4 'publish'. lines 43-51: +task 4, lines 43-51: +//# publish created: object(5,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4522000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/return_values_invalid.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/return_values_invalid.exp index 3de6284c20a28..780ee9ba39cd7 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/return_values_invalid.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/return_values_invalid.exp @@ -1,25 +1,31 @@ processed 6 tasks -task 0 'publish'. lines 6-13: +task 0, lines 6-13: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point return type. Expected a non reference type."), command: Some(0) } } -task 1 'publish'. lines 15-22: +task 1, lines 15-22: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point return type. Expected a non reference type."), command: Some(0) } } -task 2 'publish'. lines 24-31: +task 2, lines 24-31: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point return type. Expected a non reference type."), command: Some(0) } } -task 3 'publish'. lines 33-41: +task 3, lines 33-41: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point return type. The specified return type does not have the 'drop' ability: _::m::Copyable"), command: Some(0) } } -task 4 'publish'. lines 43-52: +task 4, lines 43-52: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point return type. The specified return type does not have the 'drop' ability: _::m::Obj"), command: Some(0) } } -task 5 'publish'. lines 54-63: +task 5, lines 54-63: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Invalid entry point return type. The specified return type does not have the 'drop' ability: vector<_::m::Obj>"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/single_generic_vector_param.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/single_generic_vector_param.exp index 3dd7fc6ad4a25..baee4a5e34a86 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/single_generic_vector_param.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/single_generic_vector_param.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-13: +task 0, lines 4-13: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3974800, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param.exp index 1b54618031683..ca52662520adb 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-13: +task 0, lines 4-13: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3967200, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_generic_object.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_generic_object.exp index 3847627b4aa60..63c7b8d9db8ed 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_generic_object.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_generic_object.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-16: +task 0, lines 4-16: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4575200, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_key.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_key.exp index 1b54618031683..ca52662520adb 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_key.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/single_type_param_key.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-13: +task 0, lines 4-13: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3967200, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/entry_points/string.exp b/crates/sui-verifier-transactional-tests/tests/entry_points/string.exp index 9aa01517dc77c..1a101b050c11f 100644 --- a/crates/sui-verifier-transactional-tests/tests/entry_points/string.exp +++ b/crates/sui-verifier-transactional-tests/tests/entry_points/string.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-31: +task 0, lines 6-31: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4894400, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only.exp index eded5762cba05..e052cf9169452 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp index 05fda759024fd..5839bc91c36c5 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-13: +task 1, lines 6-13: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field_version_48.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field_version_48.exp index 59c4b2a9bf7b6..aed5a6d8b0567 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field_version_48.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_uid_field_version_48.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-13: +task 1, lines 6-13: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERSION, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_version_48.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_version_48.exp index c9b5c15c8d08a..daf6ae8e8faa1 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_version_48.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_only_version_48.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERSION, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store.exp index eded5762cba05..ce97e9c38d3fe 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp index 05fda759024fd..5839bc91c36c5 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-13: +task 1, lines 6-13: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum X cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field_version_48.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field_version_48.exp index 59c4b2a9bf7b6..aed5a6d8b0567 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field_version_48.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_uid_field_version_48.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-13: +task 1, lines 6-13: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERSION, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_version_48.exp b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_version_48.exp index c9b5c15c8d08a..babbac061e8da 100644 --- a/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_version_48.exp +++ b/crates/sui-verifier-transactional-tests/tests/enums/enum_with_key_store_version_48.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'publish'. lines 6-11: +task 1, lines 6-11: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERSION, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_generic_key_struct_id_field.exp b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_generic_key_struct_id_field.exp index e995a7977e754..49a73c52ad480 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_generic_key_struct_id_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_generic_key_struct_id_field.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-18: +task 0, lines 4-18: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4461200, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_id_field.exp b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_id_field.exp index e13371a2f5c8f..a9e6add9cecc2 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_id_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_id_field.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-18: +task 0, lines 4-18: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4370000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_non_id_field.exp b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_non_id_field.exp index b74ce85176846..861fc6214589a 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_non_id_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_non_id_field.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-19: +task 0, lines 4-19: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4438400, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_non_key_struct_id_field.exp b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_non_key_struct_id_field.exp index e13371a2f5c8f..a9e6add9cecc2 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_non_key_struct_id_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_non_key_struct_id_field.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-18: +task 0, lines 4-18: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4370000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_immutable/write_id_field.exp b/crates/sui-verifier-transactional-tests/tests/id_immutable/write_id_field.exp index b8636461ad435..bc1238fcdbb55 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_immutable/write_id_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_immutable/write_id_field.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-20: +task 0, lines 4-20: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [(FunctionDefinition, 0)], offsets: [(FunctionDefinitionIndex(0), 5)] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/direct_leak_through_call.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/direct_leak_through_call.exp index 28af99b7e2c98..89dd1a52a55de 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/direct_leak_through_call.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/direct_leak_through_call.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-26: +task 0, lines 4-26: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4590400, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/indirect_leak_through_call.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/indirect_leak_through_call.exp index 7b5c3cd0467e4..ed8d85bc90e5c 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/indirect_leak_through_call.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/indirect_leak_through_call.exp @@ -1,10 +1,12 @@ processed 2 tasks -task 0 'publish'. lines 4-26: +task 0, lines 4-26: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("PartialVMError with status UNKNOWN_VERIFICATION_ERROR with sub status 1 and message Invalid object creation in _::m::foo. Object created without a newly created UID. The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object"), command: Some(0) } } -task 1 'publish'. lines 28-50: +task 1, lines 28-50: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4590400, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/infinite_loop.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/infinite_loop.exp index dab5c6acbb6b2..2517c73195371 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/infinite_loop.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/infinite_loop.exp @@ -1,11 +1,13 @@ processed 2 tasks -task 0 'publish'. lines 6-28: +task 0, lines 6-28: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4970400, storage_rebate: 0, non_refundable_storage_fee: 0 -task 1 'publish'. lines 30-59: +task 1, lines 30-59: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5168000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/loop.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/loop.exp index 83210eafe7774..65b147b7770ed 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/loop.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/loop.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-34: +task 0, lines 4-34: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5631600, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/through_call_with_borrow_field.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/through_call_with_borrow_field.exp index 0772f31c75e55..3e081245bdee3 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/through_call_with_borrow_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/through_call_with_borrow_field.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-34: +task 0, lines 4-34: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("PartialVMError with status UNKNOWN_VERIFICATION_ERROR with sub status 1 and message Invalid object creation in _::m::new. Object created without a newly created UID. The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/through_direct_return.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/through_direct_return.exp index c873982603db4..9cbae06ff67f4 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/through_direct_return.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/through_direct_return.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-20: +task 0, lines 4-20: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4294000, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/through_indirect_return.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/through_indirect_return.exp index 8b1e684d35305..2e711a7d0b1ee 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/through_indirect_return.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/through_indirect_return.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-20: +task 0, lines 4-20: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("PartialVMError with status UNKNOWN_VERIFICATION_ERROR with sub status 1 and message Invalid object creation in _::m::foo. Object created without a newly created UID. The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/through_pack.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/through_pack.exp index 1c266848e9acb..73ccd827d7be5 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/through_pack.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/through_pack.exp @@ -1,10 +1,12 @@ processed 2 tasks -task 0 'publish'. lines 4-37: +task 0, lines 4-37: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("PartialVMError with status UNKNOWN_VERIFICATION_ERROR with sub status 1 and message Invalid object creation in _::test::test. Object created without a newly created UID. The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object"), command: Some(0) } } -task 1 'publish'. lines 39-62: +task 1, lines 39-62: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4902000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/through_reference.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/through_reference.exp index b8636461ad435..bc1238fcdbb55 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/through_reference.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/through_reference.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-20: +task 0, lines 4-20: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [(FunctionDefinition, 0)], offsets: [(FunctionDefinitionIndex(0), 5)] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/through_vector.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/through_vector.exp index 51d864e4511af..5f2b481e4e00f 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/through_vector.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/through_vector.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-21: +task 0, lines 4-21: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4362400, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/id_leak/transmute.exp b/crates/sui-verifier-transactional-tests/tests/id_leak/transmute.exp index a3b6af960c48d..34e932a09de36 100644 --- a/crates/sui-verifier-transactional-tests/tests/id_leak/transmute.exp +++ b/crates/sui-verifier-transactional-tests/tests/id_leak/transmute.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-28: +task 0, lines 4-28: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("PartialVMError with status UNKNOWN_VERIFICATION_ERROR with sub status 1 and message Invalid object creation in _::m::transmute. Object created without a newly created UID. The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/cannot_call_init.exp b/crates/sui-verifier-transactional-tests/tests/init/cannot_call_init.exp index 238ab4f2a8d75..689fc06aa1a71 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/cannot_call_init.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/cannot_call_init.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-17: +task 0, lines 4-17: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::init at offset 1. Cannot call a module's 'init' function from another Move function"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/imm_tx_context.exp b/crates/sui-verifier-transactional-tests/tests/init/imm_tx_context.exp index 57f4dd5908a17..ed134276dae6e 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/imm_tx_context.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/imm_tx_context.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-13: +task 0, lines 6-13: +//# publish Error: Transaction Effects Status: Move Runtime Abort. Location: _::m::init (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: _, name: Identifier("m") }, function: 0, instruction: 1, function_name: Some("init") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("_::m::init at offset 1"), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/must_have_txn_context.exp b/crates/sui-verifier-transactional-tests/tests/init/must_have_txn_context.exp index 32aaeb56c0dc7..a699a76409e56 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/must_have_txn_context.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/must_have_txn_context.exp @@ -1,9 +1,11 @@ processed 2 tasks -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected at least one and at most two parameters for _::m::init"), command: Some(0) } } -task 1 'publish'. lines 14-21: +task 1, lines 14-21: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/not_generic.exp b/crates/sui-verifier-transactional-tests/tests/init/not_generic.exp index ac404897e25f6..81e86badf30ae 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/not_generic.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/not_generic.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m. 'init' function cannot have type parameters"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/not_private.exp b/crates/sui-verifier-transactional-tests/tests/init/not_private.exp index ce749355ccdcf..0c48ab8bc6fdb 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/not_private.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/not_private.exp @@ -1,13 +1,16 @@ processed 3 tasks -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m. 'init' function must be private"), command: Some(0) } } -task 1 'publish'. lines 13-20: +task 1, lines 13-20: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m. 'init' function must be private"), command: Some(0) } } -task 2 'publish'. lines 22-29: +task 2, lines 22-29: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m. 'init' function must be private"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/not_txn_context.exp b/crates/sui-verifier-transactional-tests/tests/init/not_txn_context.exp index 1e783b68886e9..7a90a4dbc7ed2 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/not_txn_context.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/not_txn_context.exp @@ -1,13 +1,16 @@ processed 3 tasks -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext, but found u64"), command: Some(0) } } -task 1 'publish'. lines 13-20: +task 1, lines 13-20: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last parameter for _::tx_context::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext, but found _::tx_context::TxContext"), command: Some(0) } } -task 2 'publish'. lines 22-29: +task 2, lines 22-29: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext, but found sui::tx_context::TxContext"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/ok.exp b/crates/sui-verifier-transactional-tests/tests/init/ok.exp index 0b109b9aad8e2..1ac935c595aca 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/ok.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/ok.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Move Runtime Abort. Location: _::m::init (function index 0) at offset 1, Abort Code: 0 Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: _, name: Identifier("m") }, function: 0, instruction: 1, function_name: Some("init") }, 0), source: Some(VMError { major_status: ABORTED, sub_status: Some(0), message: Some("_::m::init at offset 1"), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [], offsets: [(FunctionDefinitionIndex(0), 1)] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/init/return_values.exp b/crates/sui-verifier-transactional-tests/tests/init/return_values.exp index f1633348cd773..9e721bd79ce01 100644 --- a/crates/sui-verifier-transactional-tests/tests/init/return_values.exp +++ b/crates/sui-verifier-transactional-tests/tests/init/return_values.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m, 'init' function cannot have return values"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/bool_field.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/bool_field.exp index 8a642f034a7e7..397d346f90822 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/bool_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/bool_field.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4362400, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_no_drop.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_no_drop.exp index e7562633b991a..9a88315e6f111 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_no_drop.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_no_drop.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-19: +task 0, lines 6-19: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_bool_field.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_bool_field.exp index 3e118c41b2d3a..c1f5d00d16770 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_bool_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_bool_field.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-18: +task 0, lines 6-18: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_no_field.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_no_field.exp index 3e118c41b2d3a..c1f5d00d16770 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_no_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_single_variant_no_field.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-18: +task 0, lines 6-18: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_wrong_name.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_wrong_name.exp index 3e118c41b2d3a..c1f5d00d16770 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_wrong_name.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/enum_wrong_name.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-18: +task 0, lines 6-18: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/instantiate.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/instantiate.exp index 0eb4d2faf77d9..112bed346ada1 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/instantiate.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/instantiate.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-24: +task 0, lines 6-24: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("one-time witness type _::m::M is instantiated in the _::m::pack function and must never be"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_invalid.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_invalid.exp index d1192077c7845..4a9d4090f5601 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_invalid.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_invalid.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_valid.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_valid.exp index e4ffc74896d30..e6f3d8dd5f17a 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_valid.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/many_fields_valid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 6-14: +task 0, lines 6-14: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4005200, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/more_abilities.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/more_abilities.exp index 7dbc7510cd982..1d1e6dc978320 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/more_abilities.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/more_abilities.exp @@ -1,13 +1,16 @@ processed 4 tasks -task 1 'publish'. lines 8-19: +task 1, lines 8-19: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("one-time witness type candidate _::m::M must have a single ability: drop"), command: Some(0) } } -task 2 'publish'. lines 21-32: +task 2, lines 21-32: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("one-time witness type candidate _::m::M must have a single ability: drop"), command: Some(0) } } -task 3 'publish'. lines 34-45: +task 3, lines 34-45: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("one-time witness type candidate _::m::M must have a single ability: drop"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_drop.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_drop.exp index 00064d635eff8..c2d1ae423295a 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_drop.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_drop.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-18: +task 0, lines 6-18: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("one-time witness type candidate _::m::M must have a single ability: drop"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_field.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_field.exp index 26038cca0c189..7ed0b7200e0e8 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_field.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_field.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-17: +task 0, lines 6-17: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: ZERO_SIZED_STRUCT, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [(StructDefinition, 0)], offsets: [] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_init_arg.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_init_arg.exp index 8b6834a6bd30f..0c891d1e2b4a7 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_init_arg.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/no_init_arg.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("init function of a module containing one-time witness type candidate must have _::m::M as the first parameter (a struct which has no fields or a single field of type bool)"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/other_mod_def.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/other_mod_def.exp index a8edae68a81cd..767fb0c285688 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/other_mod_def.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/other_mod_def.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::n::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::n::N) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/type_param.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/type_param.exp index 16763ddbb2a12..631a0ee14b506 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/type_param.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/type_param.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m. 'init' function cannot have type parameters"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type.exp index 80386a4a8bf50..bf294e6d1673b 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type.exp @@ -1,11 +1,13 @@ processed 2 tasks -task 0 'publish'. lines 6-23: +task 0, lines 6-23: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4613200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 1 'publish'. lines 25-43: +task 1, lines 25-43: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4932400, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type_with_init.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type_with_init.exp index d1192077c7845..4a9d4090f5601 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type_with_init.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_field_type_with_init.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_init_type.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_init_type.exp index ee419ce792bd8..b4c8a108501e4 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_init_type.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_init_type.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-17: +task 0, lines 6-17: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("init function of a module containing one-time witness type candidate must have _::m::M as the first parameter (a struct which has no fields or a single field of type bool)"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name.exp index d1192077c7845..4a9d4090f5601 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::m::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::m::M) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name_format.exp b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name_format.exp index 0218df59fe48f..d916e3731b533 100644 --- a/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name_format.exp +++ b/crates/sui-verifier-transactional-tests/tests/one_time_witness/wrong_name_format.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Expected last (and at most second) parameter for _::mod::init to be &mut sui::tx_context::TxContext or &sui::tx_context::TxContext; optional first parameter must be of one-time witness type whose name is the same as the capitalized module name (_::mod::MOD) and which has no fields or a single field of type bool"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer.exp index bb703b587edc5..83fad6b12ecc4 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer.exp @@ -1,17 +1,21 @@ processed 4 tasks -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::transfer' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_transfer'"), command: Some(0) } } -task 1 'publish'. lines 18-28: +task 1, lines 18-28: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::freeze_object' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_freeze_object'"), command: Some(0) } } -task 2 'publish'. lines 30-40: +task 2, lines 30-40: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::share_object' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_share_object'"), command: Some(0) } } -task 3 'publish'. lines 42-54: +task 3, lines 42-54: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::receive' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_explicit.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_explicit.exp index 969ac0ff6853e..23cbbe5a33a1e 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_explicit.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_explicit.exp @@ -1,58 +1,72 @@ processed 16 tasks -task 1 'publish'. lines 8-24: +task 1, lines 8-24: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 5175600, storage_rebate: 0, non_refundable_storage_fee: 0 -task 3 'publish'. lines 30-39: +task 3, lines 30-39: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("Enum StoreEnum cannot have the 'key' ability. Enums cannot have the 'key' ability."), command: Some(0) } } -task 4 'publish'. lines 41-51: +task 4, lines 41-51: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::transfer' on an object of type 'test::m::KeyStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_transfer'"), command: Some(0) } } -task 5 'publish'. lines 53-63: +task 5, lines 53-63: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::freeze_object' on an object of type 'test::m::KeyStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_freeze_object'"), command: Some(0) } } -task 6 'publish'. lines 65-75: +task 6, lines 65-75: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::share_object' on an object of type 'test::m::KeyStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_share_object'"), command: Some(0) } } -task 7 'publish'. lines 77-91: +task 7, lines 77-91: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::receive' on an object of type 'test::m::KeyStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } -task 8 'publish'. lines 93-103: +task 8, lines 93-103: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::transfer' on an object of type 'test::m::KeyStoreStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_transfer'"), command: Some(0) } } -task 9 'publish'. lines 105-115: +task 9, lines 105-115: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::freeze_object' on an object of type 'test::m::KeyStoreStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_freeze_object'"), command: Some(0) } } -task 10 'publish'. lines 117-127: +task 10, lines 117-127: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::share_object' on an object of type 'test::m::KeyStoreStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_share_object'"), command: Some(0) } } -task 11 'publish'. lines 129-143: +task 11, lines 129-143: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::u::f. Invalid call to 'sui::transfer::receive' on an object of type 'test::m::KeyStoreStruct'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } -task 12 'publish'. lines 145-155: +task 12, lines 145-155: +//# publish --dependencies test Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: Some("expected type with abilities [Key, ] got type actual Struct(DatatypeHandleIndex(0)) with incompatible abilities [Store, ] at offset 2 "), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("u") }), indices: [(Signature, 1), (FunctionDefinition, 0)], offsets: [] }), command: Some(0) } } -task 13 'publish'. lines 157-167: +task 13, lines 157-167: +//# publish --dependencies test Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: Some("expected type with abilities [Key, ] got type actual Struct(DatatypeHandleIndex(0)) with incompatible abilities [Store, ] at offset 1 "), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("u") }), indices: [(Signature, 1), (FunctionDefinition, 0)], offsets: [] }), command: Some(0) } } -task 14 'publish'. lines 169-179: +task 14, lines 169-179: +//# publish --dependencies test Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: Some("expected type with abilities [Key, ] got type actual Struct(DatatypeHandleIndex(0)) with incompatible abilities [Store, ] at offset 1 "), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("u") }), indices: [(Signature, 1), (FunctionDefinition, 0)], offsets: [] }), command: Some(0) } } -task 15 'publish'. lines 181-193: +task 15, lines 181-193: +//# publish --dependencies test Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: Some("expected type with abilities [Key, ] got type actual Struct(DatatypeHandleIndex(0)) with incompatible abilities [Store, ]"), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("u") }), indices: [(Signature, 0), (FunctionHandle, 0)], offsets: [] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_generic.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_generic.exp index 9b2776838c1aa..d4f0ae72ca81c 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_generic.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_generic.exp @@ -1,17 +1,21 @@ processed 4 tasks -task 0 'publish'. lines 8-17: +task 0, lines 8-17: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::transfer' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_transfer'"), command: Some(0) } } -task 1 'publish'. lines 19-28: +task 1, lines 19-28: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::freeze_object' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_freeze_object'"), command: Some(0) } } -task 2 'publish'. lines 30-39: +task 2, lines 30-39: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::share_object' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_share_object'"), command: Some(0) } } -task 3 'publish'. lines 41-52: +task 3, lines 41-52: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::receive' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store.exp index bb703b587edc5..83fad6b12ecc4 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store.exp @@ -1,17 +1,21 @@ processed 4 tasks -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::transfer' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_transfer'"), command: Some(0) } } -task 1 'publish'. lines 18-28: +task 1, lines 18-28: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::freeze_object' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_freeze_object'"), command: Some(0) } } -task 2 'publish'. lines 30-40: +task 2, lines 30-40: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::share_object' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_share_object'"), command: Some(0) } } -task 3 'publish'. lines 42-54: +task 3, lines 42-54: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::receive' on an object of type 'sui::coin::Coin'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store_generic.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store_generic.exp index d0c31ec28d7eb..67765130ba69f 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store_generic.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/no_public_transfer_store_generic.exp @@ -1,17 +1,21 @@ processed 5 tasks -task 1 'publish'. lines 10-19: +task 1, lines 10-19: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::transfer' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_transfer'"), command: Some(0) } } -task 2 'publish'. lines 21-30: +task 2, lines 21-30: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::freeze_object' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_freeze_object'"), command: Some(0) } } -task 3 'publish'. lines 32-41: +task 3, lines 32-41: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::share_object' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_share_object'"), command: Some(0) } } -task 4 'publish'. lines 43-54: +task 4, lines 43-54: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::receive' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/private_event_emit.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/private_event_emit.exp index 3c02b6cf8e23e..24d4359f0cb87 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/private_event_emit.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/private_event_emit.exp @@ -1,34 +1,42 @@ processed 10 tasks -task 1 'publish'. lines 8-18: +task 1, lines 8-18: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::event::emit' with an event type 'sui::coin::CurrencyCreated'. The event's type must be defined in the current module"), command: Some(0) } } -task 2 'publish'. lines 20-29: +task 2, lines 20-29: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::event::emit' with an event type 'T0'. The event's type must be defined in the current module"), command: Some(0) } } -task 3 'publish'. lines 31-40: +task 3, lines 31-40: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::event::emit' with an event type 'u64'. The event's type must be defined in the current module"), command: Some(0) } } -task 4 'publish'. lines 42-55: +task 4, lines 42-55: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::event::emit' with an event type 'vector<_::m::X>'. The event's type must be defined in the current module"), command: Some(0) } } -task 5 'publish'. lines 57-70: +task 5, lines 57-70: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::event::emit' with an event type 'vector<_::m::X>'. The event's type must be defined in the current module"), command: Some(0) } } -task 6 'publish'. lines 72-81: +task 6, lines 72-81: +//# publish created: object(6,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3990000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 8 'publish'. lines 85-95: +task 8, lines 85-95: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::t::t. Invalid call to 'sui::event::emit' with an event type 'test::m::X'. The event's type must be defined in the current module"), command: Some(0) } } -task 9 'publish'. lines 97-107: +task 9, lines 97-107: +//# publish --dependencies test Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::t::t. Invalid call to 'sui::event::emit' with an event type 'test::m::Y'. The event's type must be defined in the current module"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store.exp index 63786fe22f748..8c9c6a44181e4 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store.exp @@ -1,21 +1,25 @@ processed 4 tasks -task 0 'publish'. lines 7-17: +task 0, lines 7-17: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4461200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 1 'publish'. lines 19-29: +task 1, lines 19-29: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4187600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 2 'publish'. lines 31-41: +task 2, lines 31-41: +//# publish created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4180000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'publish'. lines 43-55: +task 3, lines 43-55: +//# publish created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4582800, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store_generic.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store_generic.exp index 8b7caaa1f618d..59c9e42a45671 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store_generic.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/public_transfer_with_store_generic.exp @@ -1,21 +1,25 @@ processed 4 tasks -task 0 'publish'. lines 7-22: +task 0, lines 7-22: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4689200, storage_rebate: 0, non_refundable_storage_fee: 0 -task 1 'publish'. lines 24-39: +task 1, lines 24-39: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4377600, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 2 'publish'. lines 41-56: +task 2, lines 41-56: +//# publish created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4370000, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'publish'. lines 58-76: +task 3, lines 58-76: +//# publish created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4826000, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/receive_with_and_without_store.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/receive_with_and_without_store.exp index 8a4d196fbe6c6..ebe3f1f73eb9d 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/receive_with_and_without_store.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/receive_with_and_without_store.exp @@ -1,19 +1,23 @@ processed 4 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::receive_bad. Invalid call to 'sui::transfer::receive' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m1::receive_bad. Invalid call to 'sui::transfer::receive' on an object of type 'T0'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } -task 2 'publish'. lines 27-41: +task 2, lines 27-41: +//# publish created: object(3,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4848800, storage_rebate: 978120, non_refundable_storage_fee: 9880 -task 3 'publish'. lines 43-54: +task 3, lines 43-54: +//# publish created: object(4,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4430800, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key.exp index 94a4e1cf6cd8b..d76565feab718 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key.exp @@ -1,9 +1,11 @@ processed 2 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: Some("expected type with abilities [Key, ] got type actual TypeParameter(0) with incompatible abilities []"), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m2") }), indices: [(Signature, 0), (FunctionHandle, 0)], offsets: [] }), command: Some(0) } } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: Some("expected type with abilities [Key, ] got type actual TypeParameter(0) with incompatible abilities []"), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m2") }), indices: [(Signature, 0), (FunctionHandle, 0)], offsets: [] }), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key_version30.exp b/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key_version30.exp index b4279ca29fd68..010999baf5902 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key_version30.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_generics/receive_without_key_version30.exp @@ -1,10 +1,12 @@ processed 3 tasks -task 1 'publish'. lines 3-18: +task 1, lines 3-18: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, message: Some("expected type with abilities [Key, ] got type actual TypeParameter(0) with incompatible abilities []"), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m2") }), indices: [(Signature, 0), (FunctionHandle, 0)], offsets: [] }), command: Some(0) } } -task 2 'publish'. lines 19-30: +task 2, lines 19-30: +//# publish created: object(2,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 4377600, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-verifier-transactional-tests/tests/private_transfer/transfer_invalid.exp b/crates/sui-verifier-transactional-tests/tests/private_transfer/transfer_invalid.exp index d640a917846f3..a3c09734e36c2 100644 --- a/crates/sui-verifier-transactional-tests/tests/private_transfer/transfer_invalid.exp +++ b/crates/sui-verifier-transactional-tests/tests/private_transfer/transfer_invalid.exp @@ -1,17 +1,21 @@ processed 4 tasks -task 0 'publish'. lines 6-16: +task 0, lines 6-16: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::transfer' on an object of type 'sui::clock::Clock'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_transfer'"), command: Some(0) } } -task 1 'publish'. lines 18-28: +task 1, lines 18-28: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::share_object' on an object of type 'sui::clock::Clock'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_share_object'"), command: Some(0) } } -task 2 'publish'. lines 30-40: +task 2, lines 30-40: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::freeze_object' on an object of type 'sui::clock::Clock'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_freeze_object'"), command: Some(0) } } -task 3 'publish'. lines 42-54: +task 3, lines 42-54: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("_::m::t. Invalid call to 'sui::transfer::receive' on an object of type 'sui::clock::Clock'. The transferred object's type must be defined in the current module. If the object has the 'store' type ability, you can use the non-internal variant instead, i.e. 'sui::transfer::public_receive'"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_first_field_not_id.exp b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_first_field_not_id.exp index 194de04b78268..e0abc71178e2d 100644 --- a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_first_field_not_id.exp +++ b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_first_field_not_id.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-10: +task 0, lines 4-10: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("First field of struct S must be 'id', flag found"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_address.exp b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_address.exp index d51f08b1dd98a..7d693d314e8b5 100644 --- a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_address.exp +++ b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_address.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("First field of struct S must be of type sui::object::UID, _::object::UID type found"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_name.exp b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_name.exp index f4d446e2fc48f..cc6368556b08b 100644 --- a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_name.exp +++ b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_name.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-10: +task 0, lines 4-10: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("First field of struct S must be of type sui::object::UID, sui::object::ID type found"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_type.exp b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_type.exp index 4c74efb0d9e3e..b89b0671b1995 100644 --- a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_type.exp +++ b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_type.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-10: +task 0, lines 4-10: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("First field of struct S must be of type sui::object::UID, Bool type found"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_valid.exp b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_valid.exp index 0d33ff9f06655..8c488bdcc61e1 100644 --- a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_valid.exp +++ b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_valid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 4-10: +task 0, lines 4-10: +//# publish created: object(1,0) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 3967200, storage_rebate: 0, non_refundable_storage_fee: 0 diff --git a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_second_field_id.exp b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_second_field_id.exp index 4770e8e9c6d60..9bc543aebb219 100644 --- a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_second_field_id.exp +++ b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_second_field_id.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Sui Move Bytecode Verification Error. Please run the Sui Move Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: SuiMoveVerificationError, source: Some("First field of struct S must be 'id', flag found"), command: Some(0) } } diff --git a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_with_drop.exp b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_with_drop.exp index ce08d3a54af52..bf84f5fafc640 100644 --- a/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_with_drop.exp +++ b/crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_with_drop.exp @@ -1,5 +1,6 @@ processed 1 task -task 0 'publish'. lines 4-11: +task 0, lines 4-11: +//# publish Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [(StructDefinition, 0)], offsets: [] }), command: Some(0) } } diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/procedure_args.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/procedure_args.exp index af6b9936ea1cd..542076a58ae32 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/procedure_args.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/procedure_args.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 9-19: +task 1, lines 9-19: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CALL_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_enum_has_resource_field.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_enum_has_resource_field.exp index 5e99c309ea853..2362c0bc231ac 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_enum_has_resource_field.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_enum_has_resource_field.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 15-27: +task 1, lines 15-27: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 29-39: +task 2, lines 29-39: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_has_resource_field.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_has_resource_field.exp index 8fc6a9cda1f20..4f1a25214a9cc 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_has_resource_field.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/ability_field_requirements/unrestricted_has_resource_field.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-10: +task 0, lines 1-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/128_params_and_128_locals.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/128_params_and_128_locals.exp index 0d1108cb066f0..c50a8491dd134 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/128_params_and_128_locals.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/128_params_and_128_locals.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-265: +task 0, lines 1-265: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: TOO_MANY_LOCALS, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/1_param_and_255_locals.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/1_param_and_255_locals.exp index f5cf0a7794371..974c19a2d0287 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/1_param_and_255_locals.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/1_param_and_255_locals.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-264: +task 0, lines 1-264: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: TOO_MANY_LOCALS, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_locals.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_locals.exp index cb05a36a19c0a..5f2910e3993b2 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_locals.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_locals.exp @@ -1,4 +1,5 @@ processed 1 task -task 0 'publish'. lines 1-263: +task 0, lines 1-263: +//# publish Error: value (256) cannot exceed (255) diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_params.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_params.exp index b62ab7bb96ffa..34238e3062bac 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_params.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/256_params.exp @@ -1,4 +1,5 @@ processed 1 task -task 0 'publish'. lines 1-264: +task 0, lines 1-264: +//# publish Error: value (256) cannot exceed (255) diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals.exp index 6f873d8ae353d..a4ad787848de6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals_enum.exp index 6f873d8ae353d..a4ad787848de6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_few_type_actuals_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals.exp index 6f873d8ae353d..a4ad787848de6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals_enum.exp index 6f873d8ae353d..a4ad787848de6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_bounds/too_many_type_actuals_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_and_struct_names.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_and_struct_names.exp index 97c3bde180757..1fa7cc24d6207 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_and_struct_names.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_and_struct_names.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_name.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_name.exp index 97c3bde180757..1fa7cc24d6207 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_name.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_enum_name.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name.exp index 5495d3b884ed2..7fd2c9e0b0348 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-7: +task 0, lines 1-7: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name_enum.exp index 5771c52239300..72301b97cedb1 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_field_name_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-7: +task 0, lines 1-7: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_function_name.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_function_name.exp index 86db5c831716b..b32d7ba5c13fb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_function_name.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_function_name.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_struct_name.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_struct_name.exp index cedea2736a311..3dc4c9bafe6e1 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_struct_name.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_struct_name.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_variant_name.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_variant_name.exp index 36c193b22e1e1..de3b40a4b7aa2 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_variant_name.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/duplicate_variant_name.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-10: +task 0, lines 1-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_enums.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_enums.exp index ca5fe731b4693..af54c1afba15d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_enums.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_enums.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::EmptyStruct'. Got VMError: { major_status: MALFORMED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_structs.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_structs.exp index 1f49c06d237a0..30b951562656a 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_structs.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/empty_structs.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::EmptyStruct'. Got VMError: { major_status: ZERO_SIZED_STRUCT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/friend_decl_duplicated.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/friend_decl_duplicated.exp index a0c4d8fa72c5f..6899831845756 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/friend_decl_duplicated.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/check_duplication/friend_decl_duplicated.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'publish'. lines 5-10: +task 1, lines 5-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::B'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_5.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_5.exp index b1cf6779332ef..036b421bbf15f 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_5.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_5.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-18: +task 0, lines 1-18: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INDEX_OUT_OF_BOUNDS, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_6.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_6.exp index dda1334940f6a..decd4de6fd2f4 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_6.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_6.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-21: +task 0, lines 1-21: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INDEX_OUT_OF_BOUNDS, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_8.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_8.exp index 7f94e2896e857..22dbf4313914b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_8.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/if_branch_diverges_8.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-24: +task 0, lines 1-24: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INDEX_OUT_OF_BOUNDS, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough1.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough1.exp index 736704a8208ca..005b5833818b7 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough1.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough1.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-8: +task 0, lines 1-8: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EMPTY_CODE_UNIT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough2.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough2.exp index 949448a2b9867..fb528a3bb0572 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough2.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough2.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-12: +task 0, lines 1-12: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INVALID_FALL_THROUGH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough3.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough3.exp index bafbfc043ec8c..91cdb6b18686d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough3.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/invalid_fallthrough3.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-17: +task 0, lines 1-17: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INVALID_FALL_THROUGH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_drop.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_drop.exp index 14e08fc1da963..14e841cebd9fe 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_drop.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_drop.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 17-5497: +task 1, lines 17-5497: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_reference.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_reference.exp index 28246cbe4f82e..cb5d2600b833e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_reference.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/last_jump_unconditional_reference.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5480: +task 0, lines 1-5480: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: VEC_UPDATE_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch.exp index 85a33c64606fd..b283b9d79616b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-25: +task 0, lines 1-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::PolymorphicEnums'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 13)], } -task 1 'publish'. lines 27-51: +task 1, lines 27-51: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::MonomorphicEnums'. Got VMError: { major_status: MOVELOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch_successor.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch_successor.exp index 38fb31af816e4..b2290616f46c6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch_successor.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/control_flow/variant_switch_successor.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-19: +task 0, lines 1-19: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_friend_function_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_friend_function_invalid.exp index c08c13cd90371..bff0fb2291f4a 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_friend_function_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_friend_function_invalid.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'publish'. lines 9-18: +task 1, lines 9-18: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::N'. Got VMError: { major_status: LOOKUP_FAILED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_private_function.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_private_function.exp index 06fdb10b950cb..31e3a9b5c0666 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_private_function.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/access_private_function.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 9-22: +task 1, lines 9-22: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: LOOKUP_FAILED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/internal_function_invalid_call.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/internal_function_invalid_call.exp index 4d389f1f2915f..3f8dc6431ee0c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/internal_function_invalid_call.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/internal_function_invalid_call.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 41-56: +task 1, lines 41-56: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CALL_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/use_unpublished_module.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/use_unpublished_module.exp index 436ffccd00b82..710d37698dbe3 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/use_unpublished_module.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/dependencies/use_unpublished_module.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-10: +task 0, lines 1-10: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: LINKER_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/enum_match_out_of_bounds.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/enum_match_out_of_bounds.exp index a456a27bea8cb..57020381e68df 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/enum_match_out_of_bounds.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/enum_match_out_of_bounds.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-38: +task 0, lines 1-38: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INVALID_ENUM_SWITCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/module_enum_struct_shared_name.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/module_enum_struct_shared_name.exp index 4ff3c0403265f..11aeee603726e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/module_enum_struct_shared_name.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/module_enum_struct_shared_name.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-5: +task 0, lines 1-5: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: DUPLICATE_ELEMENT, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/mutual_recursive_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/mutual_recursive_enum.exp index 25c763799d4d7..41e5457614633 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/mutual_recursive_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/mutual_recursive_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/recursive_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/recursive_enum.exp index 44d0918b6ab2d..ad9ca92c323cd 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/recursive_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/recursive_enum.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 1 'publish'. lines 10-14: +task 1, lines 10-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M0'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 16-28: +task 2, lines 16-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M1'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 30-36: +task 3, lines 30-36: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 38-45: +task 4, lines 38-45: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 47-56: +task 5, lines 47-56: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/ref_in_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/ref_in_enum.exp index 2f6da114fb575..bd8a6c8019bcf 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/ref_in_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/enum_defs/ref_in_enum.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-4: +task 0, lines 1-4: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M1'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M2'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 11-14: +task 2, lines 11-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M3'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 16-19: +task 3, lines 16-19: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M4'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_different_address.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_different_address.exp index 233693e52c531..811d53f54e5ce 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_different_address.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_different_address.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'publish'. lines 5-9: +task 1, lines 5-9: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000044::N'. Got VMError: { major_status: INVALID_FRIEND_DECL_WITH_MODULES_OUTSIDE_ACCOUNT_ADDRESS, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_self.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_self.exp index 1cf0800e87b10..eb17197aa344d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_self.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/friends/friend_decl_self.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-5: +task 0, lines 1-5: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INVALID_FRIEND_DECL_WITH_SELF, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1.exp index 88822b962886e..8a8f0e085cc48 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'publish'. lines 1-51: +task 0, lines 1-51: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 53-70: +task 1, lines 53-70: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 72-122: +task 2, lines 72-122: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1_enum.exp index 88822b962886e..8a8f0e085cc48 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/complex_1_enum.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'publish'. lines 1-51: +task 0, lines 1-51: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 53-70: +task 1, lines 53-70: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 72-122: +task 2, lines 72-122: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting.exp index 3b9f372dec827..adbec9b3fe0de 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-23: +task 0, lines 1-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting_enum.exp index 3b9f372dec827..adbec9b3fe0de 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_three_args_type_con_shifting_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-23: +task 0, lines 1-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con.exp index 6457e989da40e..78369208ad929 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-17: +task 0, lines 1-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con_enum.exp index 6457e989da40e..78369208ad929 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_two_args_swapping_type_con_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-17: +task 0, lines 1-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con.exp index e68aa0a009bca..6d41922052c42 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-20: +task 0, lines 1-20: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con_enum.exp index e68aa0a009bca..6d41922052c42 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/mutually_recursive_type_con_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-20: +task 0, lines 1-20: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1.exp index 011ac8091e033..78c493676f019 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1_enum.exp index 011ac8091e033..78c493676f019 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_1_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2.exp index e7a1ab8d9a110..b3a74762fbfdb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum.exp index e7a1ab8d9a110..b3a74762fbfdb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum_struct.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum_struct.exp index e7a1ab8d9a110..b3a74762fbfdb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum_struct.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/nested_types_2_enum_struct.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_infinite_type_terminates.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_infinite_type_terminates.exp index f4a66de93b693..c332bce7d7352 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_infinite_type_terminates.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_infinite_type_terminates.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-45: +task 0, lines 1-45: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con.exp index e7a1ab8d9a110..b3a74762fbfdb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con_enum.exp index e7a1ab8d9a110..b3a74762fbfdb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_one_arg_type_con_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con.exp index 2d87672574bf7..dd4ffa564acd7 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con_enum.exp index 2d87672574bf7..dd4ffa564acd7 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/recursive_two_args_swapping_type_con_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops.exp index e68aa0a009bca..6d41922052c42 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-20: +task 0, lines 1-20: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops_enum.exp index e68aa0a009bca..6d41922052c42 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/instantiation_loops/two_loops_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-20: +task 0, lines 1-20: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: LOOP_IN_INSTANTIATION_GRAPH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unreleased_reference.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unreleased_reference.exp index 4491ec25543c4..e1b52f2b09b2e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unreleased_reference.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unreleased_reference.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unused_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unused_resource.exp index 24aa88e99f95f..464459b8ba702 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unused_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/abort_unused_resource.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 10-20: +task 1, lines 10-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: LOOKUP_FAILED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_enum_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_enum_resource.exp index ac7fb92c935c2..f3f34dd739b46 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_enum_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_enum_resource.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 1 'run'. lines 19-32: +task 1, lines 19-32: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::m'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 2 'run'. lines 34-46: +task 2, lines 34-46: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000003::m'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_in_one_if_branch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_in_one_if_branch.exp index 894758b06c89f..2b68123fc15e3 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_in_one_if_branch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_in_one_if_branch.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-23: +task 0, lines 1-23: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_resource.exp index e729363f810b1..7b0ea91193e7c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_resource.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 10-22: +task 1, lines 10-22: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch.exp index c732375776751..26fb69fd09beb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-19: +task 0, lines 1-19: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch_no_else.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch_no_else.exp index 879f45604b1fd..cf9cd6abf810a 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch_no_else.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/assign_wrong_if_branch_no_else.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-15: +task 0, lines 1-15: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/branch_assigns_then_moves.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/branch_assigns_then_moves.exp index 7e91deac1744a..31b64e79124bc 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/branch_assigns_then_moves.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/branch_assigns_then_moves.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-21: +task 0, lines 1-21: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_assigns_if_doesnt.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_assigns_if_doesnt.exp index cc589d4cadf28..619ff502ce14d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_assigns_if_doesnt.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_assigns_if_doesnt.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-20: +task 0, lines 1-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_moves_if_doesnt.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_moves_if_doesnt.exp index 7e91deac1744a..31b64e79124bc 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_moves_if_doesnt.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/else_moves_if_doesnt.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-21: +task 0, lines 1-21: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/enum_non_drop_assignment.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/enum_non_drop_assignment.exp index 4f74b554b982e..320bba4aa29a1 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/enum_non_drop_assignment.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/enum_non_drop_assignment.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-22: +task 0, lines 1-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Enums'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 10)], } -task 1 'publish'. lines 24-47: +task 1, lines 24-47: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Enums'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_else_doesnt.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_else_doesnt.exp index cc589d4cadf28..619ff502ce14d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_else_doesnt.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_else_doesnt.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-20: +task 0, lines 1-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_no_else.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_no_else.exp index ae079aad7a1e9..a7e4b420785d9 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_no_else.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_assigns_no_else.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-16: +task 0, lines 1-16: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_else_doesnt.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_else_doesnt.exp index 7e91deac1744a..31b64e79124bc 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_else_doesnt.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_else_doesnt.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-21: +task 0, lines 1-21: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_no_else.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_no_else.exp index 5d4753bd9002e..c460703850f0d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_no_else.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/if_moves_no_else.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-18: +task 0, lines 1-18: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/join_failure.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/join_failure.exp index 8fb0fb20b2748..6cf3c4da7f2b2 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/join_failure.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/join_failure.exp @@ -1,6 +1,7 @@ processed 5 tasks -task 0 'publish'. lines 1-20: +task 0, lines 1-20: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: MOVELOC_UNAVAILABLE_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 15)], } -task 1 'publish'. lines 22-40: +task 1, lines 22-40: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 15)], } -task 2 'publish'. lines 42-61: +task 2, lines 42-61: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 17)], } -task 3 'publish'. lines 63-82: +task 3, lines 63-82: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 15)], } -task 4 'publish'. lines 84-104: +task 4, lines 84-104: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: BORROWLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/move_before_assign.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/move_before_assign.exp index 628f6042dee73..ba4a581cbba82 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/move_before_assign.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/move_before_assign.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-14: +task 0, lines 1-14: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/use_before_assign.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/use_before_assign.exp index 3dfc9e9dd31e7..7303b6b3480c1 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/use_before_assign.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/use_before_assign.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/vector_ops_non_droppable_resource_not_destroyed.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/vector_ops_non_droppable_resource_not_destroyed.exp index 7a8a07c5bfa15..bc4e41d05152d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/vector_ops_non_droppable_resource_not_destroyed.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/vector_ops_non_droppable_resource_not_destroyed.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-10: +task 0, lines 1-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local.exp index 2fba20f570eed..058f8165e9811 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-23: +task 0, lines 1-23: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local_2.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local_2.exp index ee5528dbf727e..e84ebe52ece66 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local_2.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/locals_safety/while_move_local_2.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-27: +task 0, lines 1-27: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_field_after_local.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_field_after_local.exp index 56a1524b0ac08..6f382c8885bf0 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_field_after_local.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_field_after_local.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-22: +task 0, lines 1-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Tester'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_after_move.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_after_move.exp index ea6e41089a298..ddcec905b1f82 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_after_move.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_after_move.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-17: +task 0, lines 1-17: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_struct_invalidated.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_struct_invalidated.exp index 58495357d80ec..d89142b6632f0 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_struct_invalidated.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/assign_local_struct_invalidated.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 36-63: +task 1, lines 36-63: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_if.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_if.exp index bf8c5677eaf53..4d77d8401aeb3 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_if.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_if.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-18: +task 0, lines 1-18: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_return_mutable_borrow_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_return_mutable_borrow_bad.exp index cefe0fe3aa085..34fb8e15a093b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_return_mutable_borrow_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/borrow_return_mutable_borrow_bad.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-16: +task 0, lines 1-16: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: RET_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_field_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_field_invalid.exp index 58c50b9f5be58..2e0e8c38f0e75 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_field_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_field_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-17: +task 0, lines 1-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: COPYLOC_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_indirect_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_indirect_invalid.exp index a666808ceded3..44cd892decb22 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_indirect_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_indirect_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-20: +task 0, lines 1-20: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: COPYLOC_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_invalid.exp index e10bfcc93730d..81c742edcf308 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/copy_loc_borrowed_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: COPYLOC_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_copy_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_copy_bad.exp index ea6e41089a298..ddcec905b1f82 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_copy_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_copy_bad.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-17: +task 0, lines 1-17: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_eq_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_eq_bad.exp index de038a27cb216..b9be5c7447b00 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_eq_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/deref_eq_bad.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-18: +task 0, lines 1-18: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: READREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/enum_variant_factor.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/enum_variant_factor.exp index 6f29d65d31bf9..51a06846770e0 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/enum_variant_factor.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/enum_variant_factor.exp @@ -1,6 +1,7 @@ processed 7 tasks -task 0 'publish'. lines 1-17: +task 0, lines 1-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 5)], } -task 1 'publish'. lines 19-36: +task 1, lines 19-36: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 2 'publish'. lines 38-54: +task 2, lines 38-54: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 3 'publish'. lines 56-74: +task 3, lines 56-74: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 5)], } -task 5 'publish'. lines 96-118: +task 5, lines 96-118: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::invalid'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 21)], } -task 6 'publish'. lines 120-142: +task 6, lines 120-142: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::invalid'. Got VMError: { major_status: READREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/eq_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/eq_bad.exp index 7c78f043bf404..471df961b3e8b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/eq_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/eq_bad.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: READREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 6)], } -task 1 'publish'. lines 15-27: +task 1, lines 15-27: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester2'. Got VMError: { major_status: READREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 6)], } -task 2 'publish'. lines 29-41: +task 2, lines 29-41: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester3'. Got VMError: { major_status: READREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 6)], } -task 3 'publish'. lines 43-55: +task 3, lines 43-55: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester4'. Got VMError: { major_status: READREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_1.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_1.exp index 782b6965557cd..6cd663ba4f900 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_1.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_1.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-28: +task 0, lines 1-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 15)], } -task 1 'publish'. lines 30-57: +task 1, lines 30-57: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2.exp index 16602f305c647..8a66a53217c1c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-31: +task 0, lines 1-31: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2_enum.exp index 0b814354e6e23..fc90190b6d745 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/factor_invalid_2_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-33: +task 0, lines 1-33: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid.exp index 6f2cc6e5b15d5..dfece1d571412 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-47: +task 0, lines 1-47: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(2), 23)], } -task 1 'publish'. lines 49-95: +task 1, lines 49-95: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester2'. Got VMError: { major_status: FREEZEREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid_enum.exp index 116193e35c4b6..12b95974ce691 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_invalid_enum.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-47: +task 0, lines 1-47: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(2), 5)], } -task 1 'publish'. lines 49-96: +task 1, lines 49-96: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: FREEZEREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid.exp index 61f81292ab7fd..e406114b97aaf 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-29: +task 0, lines 1-29: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid_enum.exp index c0ca90f4ab2c4..51d1aafc60147 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut_trivial_invalid_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-22: +task 0, lines 1-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Tester'. Got VMError: { major_status: FIELD_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack.exp index ae5cc2f4bf16f..16f950f00f658 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack.exp @@ -1,6 +1,7 @@ processed 7 tasks -task 0 'publish'. lines 1-20: +task 0, lines 1-20: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 13)], } -task 1 'publish'. lines 22-47: +task 1, lines 22-47: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 11)], } -task 2 'publish'. lines 49-68: +task 2, lines 49-68: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 10)], } -task 3 'publish'. lines 70-95: +task 3, lines 70-95: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 8)], } -task 4 'publish'. lines 97-114: +task 4, lines 97-114: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 10)], } -task 5 'publish'. lines 116-134: +task 5, lines 116-134: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 10)], } -task 6 'publish'. lines 136-160: +task 6, lines 136-160: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack_loop.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack_loop.exp index 53383d6af92c3..767d1a31fdc87 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack_loop.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/invalid_enum_ref_unpack_loop.exp @@ -1,6 +1,7 @@ processed 5 tasks -task 0 'publish'. lines 1-37: +task 0, lines 1-37: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 30)], } -task 1 'publish'. lines 39-76: +task 1, lines 39-76: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 32)], } -task 2 'publish'. lines 78-114: +task 2, lines 78-114: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 32)], } -task 3 'publish'. lines 116-155: +task 3, lines 116-155: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 54)], } -task 4 'publish'. lines 157-197: +task 4, lines 157-197: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::o'. Got VMError: { major_status: COPYLOC_UNAVAILABLE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_invalid.exp index 80a12b0918aa5..a1ca4204a7ab8 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_invalid.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-19: +task 0, lines 1-19: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 12)], } -task 1 'publish'. lines 21-44: +task 1, lines 21-44: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_local_twice_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_local_twice_invalid.exp index 8b2edcf88605c..b327fe6d8007c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_local_twice_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutable_borrow_local_twice_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-17: +task 0, lines 1-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_resource_holder.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_resource_holder.exp index 509d5fddf0c13..6f7083e461d66 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_resource_holder.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_resource_holder.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_invalid.exp index f7f6be1fd5607..fcf6a336eec23 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_struct_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_struct_invalid.exp index 06d18baed1ef5..b101c7e24f99f 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_struct_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/mutate_with_borrowed_loc_struct_invalid.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-17: +task 0, lines 1-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 7)], } -task 1 'publish'. lines 19-35: +task 1, lines 19-35: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::N'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/no_borrow_ref.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/no_borrow_ref.exp index a5a6aa21c3ff1..cdaecc4c1db19 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/no_borrow_ref.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/no_borrow_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-14: +task 0, lines 1-14: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: BORROWLOC_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_field_after_assign_local.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_field_after_assign_local.exp index bac0e5bb93245..70d5bb1a7844d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_field_after_assign_local.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_field_after_assign_local.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-21: +task 0, lines 1-21: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Tester'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_assign.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_assign.exp index 5a7bb22177d47..d391ef155e946 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_assign.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_assign.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-20: +task 0, lines 1-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: READREF_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_move.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_move.exp index a75f7d19c4653..cff3db8132b5f 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_move.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/read_local_ref_after_move.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-15: +task 0, lines 1-15: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_local_ref.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_local_ref.exp index e9f47104d9015..a669effce42df 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_local_ref.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_local_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Tester'. Got VMError: { major_status: UNSAFE_RET_LOCAL_OR_RESOURCE_STILL_BORROWED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_invalid.exp index d1360176893f8..82597492d4ab9 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_invalid.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-15: +task 0, lines 1-15: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: UNSAFE_RET_LOCAL_OR_RESOURCE_STILL_BORROWED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 5)], } -task 1 'publish'. lines 17-30: +task 1, lines 17-30: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: UNSAFE_RET_LOCAL_OR_RESOURCE_STILL_BORROWED, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 5)], } -task 2 'publish'. lines 32-49: +task 2, lines 32-49: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: UNSAFE_RET_LOCAL_OR_RESOURCE_STILL_BORROWED, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 13)], } -task 3 'publish'. lines 51-68: +task 3, lines 51-68: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M4'. Got VMError: { major_status: UNSAFE_RET_LOCAL_OR_RESOURCE_STILL_BORROWED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_resource_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_resource_invalid.exp index 28a4b4f71eabe..0c79a21741a17 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_resource_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/return_with_borrowed_loc_resource_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_after_move.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_after_move.exp index e9762e99ad711..ffee00404b626 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_after_move.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_after_move.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'publish'. lines 12-37: +task 1, lines 12-37: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_suffix_after_move.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_suffix_after_move.exp index 4a14be9c9a552..49447588a3057 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_suffix_after_move.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/use_suffix_after_move.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'publish'. lines 19-41: +task 1, lines 19-41: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_double_borrow.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_double_borrow.exp index 1e4eb82c29ea6..1ec363b4f0e7f 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_double_borrow.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_double_borrow.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'run'. lines 1-19: +task 0, lines 1-19: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: VEC_BORROW_ELEMENT_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 14)], } -task 1 'run'. lines 20-38: +task 1, lines 20-38: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: BORROWLOC_EXISTS_BORROW_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 12)], } -task 2 'run'. lines 39-57: +task 2, lines 39-57: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: VEC_BORROW_ELEMENT_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_move_after_borrow.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_move_after_borrow.exp index ab27230589072..9287a5cdd9b7e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_move_after_borrow.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_move_after_borrow.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'run'. lines 1-16: +task 0, lines 1-16: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_EXISTS_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 9)], } -task 1 'run'. lines 17-32: +task 1, lines 17-32: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: MOVELOC_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_pop_after_borrow.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_pop_after_borrow.exp index c4aa07bb22087..9ff8914be743c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_pop_after_borrow.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/vector_ops_pop_after_borrow.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'run'. lines 1-16: +task 0, lines 1-16: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: VEC_UPDATE_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 10)], } -task 1 'run'. lines 17-32: +task 1, lines 17-32: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: VEC_UPDATE_EXISTS_MUTABLE_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/writeref_borrow_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/writeref_borrow_invalid.exp index 7eb266510233b..3b108bf4bb6a7 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/writeref_borrow_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/writeref_borrow_invalid.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-17: +task 0, lines 1-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: WRITEREF_EXISTS_BORROW_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/script_with_type_parameters.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/script_with_type_parameters.exp index be24328973c68..56fac10072278 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/script_with_type_parameters.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/script_with_type_parameters.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 20-28: +task 1, lines 20-28: +//# run --type-args u64 u8 0x1::Coin::Coin Error: Function execution failed with VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/signer_double_signer.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/signer_double_signer.exp index 42c6b5aa517bd..9cf2f3b0f1ef7 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/signer_double_signer.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/signer_double_signer.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'run'. lines 1-8: +task 0, lines 1-8: +//# run --signers 0x1 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [], } -task 1 'run'. lines 10-17: +task 1, lines 10-17: +//# run --signers 0x1 --args 0 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/struct_arguments.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/struct_arguments.exp index e677b0f02a70d..d508c09dd04f8 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/struct_arguments.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/script_signature/struct_arguments.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 1 'run'. lines 15-22: +task 1, lines 15-22: +//# run --args 0 0 0 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'run'. lines 24-24: +task 2, line 24: +//# run 0x42::M::foo --args 0 0 0 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_resource.exp index b15334ba4bf10..b99f7f2037ab0 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_resource.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_unrestricted.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_unrestricted.exp index b15334ba4bf10..b99f7f2037ab0 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_unrestricted.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/all_as_unrestricted.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script.exp index 2562da2c417aa..9b7ce8abb17ea 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 1 'run'. lines 19-26: +task 1, lines 19-26: +//# run --type-args u64 --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'run'. lines 28-35: +task 2, lines 28-35: +//# run --type-args u64 --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'run'. lines 37-44: +task 3, lines 37-44: +//# run --type-args u64 --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'run'. lines 46-53: +task 4, lines 46-53: +//# run --type-args 0x1::M::K --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 5 'run'. lines 55-62: +task 5, lines 55-62: +//# run --type-args u64 --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 6 'run'. lines 64-71: +task 6, lines 64-71: +//# run --type-args u64 --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'run'. lines 73-80: +task 7, lines 73-80: +//# run --type-args u64 --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'run'. lines 82-89: +task 8, lines 82-89: +//# run --type-args u64 --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script_invalid.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script_invalid.exp index 4b177e4f00cbb..165c19b85505a 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script_invalid.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/check_constraints_script_invalid.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 1 'run'. lines 17-24: +task 1, lines 17-24: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'run'. lines 26-33: +task 2, lines 26-33: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'run'. lines 35-42: +task 3, lines 35-42: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'run'. lines 44-51: +task 4, lines 44-51: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'run'. lines 53-60: +task 5, lines 53-60: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 6 'run'. lines 62-69: +task 6, lines 62-69: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'run'. lines 71-78: +task 7, lines 71-78: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 8 'run'. lines 80-87: +task 8, lines 80-87: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_bytecode_instruction.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_bytecode_instruction.exp index 7993ace08503c..ae3bf5b48c9a6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_bytecode_instruction.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_bytecode_instruction.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_struct.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_struct.exp index 55b3a248eea20..714a1e5749737 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_struct.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_for_struct.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_in_struct_inst_for_bytecode_instruction.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_in_struct_inst_for_bytecode_instruction.exp index 6e0c78e84686a..f2291c63ce746 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_in_struct_inst_for_bytecode_instruction.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_as_type_actual_in_struct_inst_for_bytecode_instruction.exp @@ -1,6 +1,7 @@ processed 5 tasks -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 15-29: +task 1, lines 15-29: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 31-43: +task 2, lines 31-43: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 45-54: +task 3, lines 45-54: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 56-65: +task 4, lines 56-65: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_in_fields.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_in_fields.exp index 5c57c63f50614..dbd81f00e280b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_in_fields.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/reference_in_fields.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-5: +task 0, lines 1-5: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/resource_as_unrestricted.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/resource_as_unrestricted.exp index ec7bb4cd015e1..1ca7c64e7694b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/resource_as_unrestricted.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/resource_as_unrestricted.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/two_type_actuals_reverse_order.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/two_type_actuals_reverse_order.exp index a6a85c403676b..1f86b39c08f6b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/two_type_actuals_reverse_order.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/two_type_actuals_reverse_order.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 13-24: +task 1, lines 13-24: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/unrestricted_as_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/unrestricted_as_resource.exp index b15334ba4bf10..b99f7f2037ab0 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/unrestricted_as_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/unrestricted_as_resource.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/vector_ops_invalid_type_args.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/vector_ops_invalid_type_args.exp index 76bd17912e01a..1248ad8e2a935 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/vector_ops_invalid_type_args.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/signature/vector_ops_invalid_type_args.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'run'. lines 1-10: +task 0, lines 1-10: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'run'. lines 11-20: +task 1, lines 11-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'run'. lines 21-30: +task 2, lines 21-30: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_negative_stack_size.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_negative_stack_size.exp index 57ebe2fd2c616..21051a1bf1476 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_negative_stack_size.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_negative_stack_size.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-10: +task 0, lines 1-10: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_no_return.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_no_return.exp index 3a16ca719e4d9..18b784359711e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_no_return.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_no_return.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-10: +task 0, lines 1-10: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_positive_stack_size.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_positive_stack_size.exp index de064d97b9c4f..90744c64a3bee 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_positive_stack_size.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/abort_positive_stack_size.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 11-21: +task 1, lines 11-21: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_negative_stack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_negative_stack.exp index 9cd487b84eaac..c225167ca88a6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_negative_stack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_negative_stack.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'run'. lines 1-10: +task 0, lines 1-10: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'run'. lines 11-20: +task 1, lines 11-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 2 'run'. lines 21-30: +task 2, lines 21-30: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 3 'run'. lines 31-40: +task 3, lines 31-40: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 4 'run'. lines 41-50: +task 4, lines 41-50: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 5 'run'. lines 51-60: +task 5, lines 51-60: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_positive_stack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_positive_stack.exp index a11ed8c4a161b..990489897072d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_positive_stack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/cast_positive_stack.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'run'. lines 1-11: +task 0, lines 1-11: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'run'. lines 12-22: +task 1, lines 12-22: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 2 'run'. lines 23-33: +task 2, lines 23-33: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 3 'run'. lines 34-44: +task 3, lines 34-44: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 4 'run'. lines 45-55: +task 4, lines 45-55: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 5 'run'. lines 56-66: +task 5, lines 56-66: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/exp_in_if_and_else_branch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/exp_in_if_and_else_branch.exp index f99343929e780..43f9639bd9170 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/exp_in_if_and_else_branch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/exp_in_if_and_else_branch.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-19: +task 0, lines 1-19: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_1.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_1.exp index c1805b156bdc7..418605294972f 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_1.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_1.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 11-21: +task 1, lines 11-21: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_2.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_2.exp index 9c8598de0c99e..13a9381578237 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_2.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_call_negative_stack_err_2.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 24-37: +task 1, lines 24-37: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_pos_and_neg_stack_err.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_pos_and_neg_stack_err.exp index eb80ec8035737..702fc6668257e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_pos_and_neg_stack_err.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_pos_and_neg_stack_err.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 23-40: +task 1, lines 23-40: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_1.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_1.exp index cd75a322eb50d..31e87c25339a8 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_1.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_1.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 18-33: +task 1, lines 18-33: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_2.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_2.exp index 817380ec026a8..e0981711f77fa 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_2.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/function_composition_positive_stack_err_2.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 18-32: +task 1, lines 18-32: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_negative.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_negative.exp index 14f3442e13379..699a4ac9c6149 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_negative.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_negative.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 1 'publish'. lines 17-30: +task 1, lines 17-30: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 2 'publish'. lines 32-45: +task 2, lines 32-45: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 3 'publish'. lines 47-60: +task 3, lines 47-60: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 4 'publish'. lines 62-75: +task 4, lines 62-75: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 5 'publish'. lines 77-90: +task 5, lines 77-90: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_positive.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_positive.exp index e3e8ca2c39aac..0159c527ec643 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_positive.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/integer_stack_positive.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 1 'publish'. lines 17-30: +task 1, lines 17-30: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 2 'publish'. lines 32-45: +task 2, lines 32-45: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 3 'publish'. lines 47-60: +task 3, lines 47-60: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 4 'publish'. lines 62-75: +task 4, lines 62-75: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 5 'publish'. lines 77-90: +task 5, lines 77-90: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/load_positive_stack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/load_positive_stack.exp index 6ceba7ddc31b1..e889ba7cca133 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/load_positive_stack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/load_positive_stack.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'run'. lines 1-10: +task 0, lines 1-10: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'run'. lines 11-20: +task 1, lines 11-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 2 'run'. lines 21-30: +task 2, lines 21-30: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 3 'run'. lines 31-40: +task 3, lines 31-40: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 4 'run'. lines 41-50: +task 4, lines 41-50: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 5 'run'. lines 51-60: +task 5, lines 51-60: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_negative_stack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_negative_stack.exp index f83ed3391ff11..e852ce708349b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_negative_stack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_negative_stack.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-14: +task 0, lines 1-14: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_positive_stack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_positive_stack.exp index 71b1adad58c16..77139be6c2916 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_positive_stack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_bindings_positive_stack.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_binding.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_binding.exp index cbed82e8f99cd..20f9b47e29856 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_binding.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_binding.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 23-45: +task 1, lines 23-45: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_value.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_value.exp index 892b8117ea364..c01500ef5563e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_value.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_extra_value.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-22: +task 0, lines 1-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_binding.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_binding.exp index eb80ec8035737..702fc6668257e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_binding.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_binding.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 23-40: +task 1, lines 23-40: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_value.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_value.exp index e7dbcda0a6607..375de9b58eccb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_value.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/multiple_return_values_missing_value.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-22: +task 0, lines 1-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pack_invalid_number_arguments_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pack_invalid_number_arguments_enum.exp index 8ba44f4249824..d4f83da77d825 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pack_invalid_number_arguments_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pack_invalid_number_arguments_enum.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::MonoTooMany'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'publish'. lines 13-23: +task 1, lines 13-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::MonoTooFew'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 2 'publish'. lines 25-35: +task 2, lines 25-35: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::PolyTooMany'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 3 'publish'. lines 37-47: +task 3, lines 37-47: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::PolyTooFew'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_negative.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_negative.exp index 559dd06120be6..141eed8a420c2 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_negative.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_negative.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_positive.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_positive.exp index 269d1dd064ab9..6b6a4314f8861 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_positive.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/pop_positive.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::A'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding.exp index 99f3813d6921a..fe4dbe30c9a65 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-23: +task 0, lines 1-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding_enum.exp index 43362a1eda0ea..f9c16469dbf08 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_extra_binding_enum.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-23: +task 0, lines 1-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 1 'publish'. lines 25-46: +task 1, lines 25-46: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 1)], } -task 2 'publish'. lines 48-69: +task 2, lines 48-69: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 3 'publish'. lines 71-92: +task 3, lines 71-92: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding.exp index 49c6e9980ccaf..76928c5efe648 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-23: +task 0, lines 1-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding_enum.exp index 42b683af48f07..c5fe244682fa9 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/unpack_missing_binding_enum.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-22: +task 0, lines 1-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 1 'publish'. lines 24-45: +task 1, lines 24-45: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 1)], } -task 2 'publish'. lines 47-68: +task 2, lines 47-68: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 0)], } -task 3 'publish'. lines 70-91: +task 3, lines 70-91: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/vector_ops_pack_unpack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/vector_ops_pack_unpack.exp index dcf2aa3519a1e..db91a6561a094 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/vector_ops_pack_unpack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/stack_usage_verifier/vector_ops_pack_unpack.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'run'. lines 1-11: +task 0, lines 1-11: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'run'. lines 12-22: +task 1, lines 12-22: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 2 'run'. lines 23-35: +task 2, lines 23-35: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: POSITIVE_STACK_SIZE_AT_BLOCK_END, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 3 'run'. lines 36-48: +task 3, lines 36-48: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/mutual_recursive_struct.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/mutual_recursive_struct.exp index f237bf495001c..8bb2a00a7af8a 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/mutual_recursive_struct.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/mutual_recursive_struct.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/recursive_struct.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/recursive_struct.exp index 3a1d0f2f7fcfd..208154981a898 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/recursive_struct.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/recursive_struct.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 1 'publish'. lines 10-14: +task 1, lines 10-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M0'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 16-28: +task 2, lines 16-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M1'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 30-37: +task 3, lines 30-37: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 39-46: +task 4, lines 39-46: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 48-58: +task 5, lines 48-58: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: RECURSIVE_DATATYPE_DEFINITION, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/ref_in_struct.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/ref_in_struct.exp index 380f15444518f..674864226cc37 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/ref_in_struct.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/struct_defs/ref_in_struct.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-4: +task 0, lines 1-4: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M1'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 6-9: +task 1, lines 6-9: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M2'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 11-14: +task 2, lines 11-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M3'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 16-19: +task 3, lines 16-19: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M4'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource.exp index efc5d7e33e559..06939d3094542 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 1 'publish'. lines 13-22: +task 1, lines 13-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource_twice.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource_twice.exp index 07fe9896c8c48..80e59299a5af5 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource_twice.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_local_resource_twice.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::A'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type.exp index a830d1e9baf17..ffbe5b0d39a71 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type_enum.exp index a830d1e9baf17..ffbe5b0d39a71 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_resource_type_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::A'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_wrong_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_wrong_type.exp index ca80c7b64a22d..227f404536020 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_wrong_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/assign_wrong_type.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-11: +task 0, lines 1-11: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/boolean_not_non_boolean.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/boolean_not_non_boolean.exp index d33c358b3ac11..12617365c6f1d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/boolean_not_non_boolean.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/boolean_not_non_boolean.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-12: +task 0, lines 1-12: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: BOOLEAN_OP_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp index b82d0ea0b8c71..b435375c82a0f 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-42: +task 0, lines 1-42: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Token'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(4), 13)], } -task 1 'publish'. lines 44-85: +task 1, lines 44-85: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::Token'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/casting_operators_types_mismatch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/casting_operators_types_mismatch.exp index 370ebe467eba1..5fa5f8c209b77 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/casting_operators_types_mismatch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/casting_operators_types_mismatch.exp @@ -1,6 +1,7 @@ processed 18 tasks -task 0 'run'. lines 1-9: +task 0, lines 1-9: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'run'. lines 11-20: +task 1, lines 11-20: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'run'. lines 21-30: +task 2, lines 21-30: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'run'. lines 31-40: +task 3, lines 31-40: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'run'. lines 41-50: +task 4, lines 41-50: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 5 'run'. lines 51-60: +task 5, lines 51-60: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 6 'run'. lines 62-71: +task 6, lines 62-71: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'run'. lines 72-81: +task 7, lines 72-81: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'run'. lines 82-91: +task 8, lines 82-91: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 9 'run'. lines 92-101: +task 9, lines 92-101: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 10 'run'. lines 102-111: +task 10, lines 102-111: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 11 'run'. lines 112-121: +task 11, lines 112-121: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -108,7 +120,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 12 'publish'. lines 123-131: +task 12, lines 123-131: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -117,7 +130,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 13 'publish'. lines 133-141: +task 13, lines 133-141: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -126,7 +140,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'publish'. lines 143-151: +task 14, lines 143-151: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -135,7 +150,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'publish'. lines 153-161: +task 15, lines 153-161: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -144,7 +160,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'publish'. lines 163-171: +task 16, lines 163-171: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -153,7 +170,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 17 'publish'. lines 173-181: +task 17, lines 173-181: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_non_reference.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_non_reference.exp index 125e602b14fa3..83243d0f624a1 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_non_reference.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_non_reference.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: READREF_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_not_reference_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_not_reference_bad.exp index de9a2c908d358..241bc1ad55bc5 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_not_reference_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/deref_not_reference_bad.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: BOOLEAN_OP_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/destroy_resource_holder.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/destroy_resource_holder.exp index 4649cb71e268e..8798ef53794a8 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/destroy_resource_holder.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/destroy_resource_holder.exp @@ -1,4 +1,5 @@ processed 2 tasks -task 1 'run'. lines 22-35: +task 1, lines 22-35: +//# run Error: Unbound module alias Diem diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_one_ref.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_one_ref.exp index aba1abef14128..10b0af89cea02 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_one_ref.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_one_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-15: +task 0, lines 1-15: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_resource_values.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_resource_values.exp index 6b929dd95b327..d036757e5c7c7 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_resource_values.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/equality_resource_values.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Token'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 1 'publish'. lines 13-23: +task 1, lines 13-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::Token'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_makes_imm.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_makes_imm.exp index 1d655d3f6b7bc..5f877c87e4bdb 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_makes_imm.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_makes_imm.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-17: +task 0, lines 1-17: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: WRITEREF_NO_MUTABLE_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_on_imm.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_on_imm.exp index d8e623b9eb637..a5adc8c3971b9 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_on_imm.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_on_imm.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-16: +task 0, lines 1-16: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: FREEZEREF_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_wrong_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_wrong_type.exp index d4c5434f9599e..4784b2cc31787 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_wrong_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/freeze_wrong_type.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-17: +task 0, lines 1-17: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_call.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_call.exp index 69762fde12943..8b9970c2e9a0c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_call.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_call.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-15: +task 0, lines 1-15: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_struct_non_nominal_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_struct_non_nominal_resource.exp index d27714f20ec3e..0ff35ba4b91c0 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_struct_non_nominal_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_struct_non_nominal_resource.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_all.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_all.exp index 1a4232f281586..cda363742597d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_all.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_all.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-9: +task 0, lines 1-9: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_resource.exp index 1a4232f281586..cda363742597d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_type_param_resource.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-9: +task 0, lines 1-9: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_unpack.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_unpack.exp index c9a735a9dd74b..77ff2a8ef19ab 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_unpack.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_abilities_unpack.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 1 'publish'. lines 13-23: +task 1, lines 13-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_import_function.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_import_function.exp index 11bd781f9f2ac..4ef3d2c7a269a 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_import_function.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_import_function.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 1 'run'. lines 21-30: +task 1, lines 21-30: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'run'. lines 32-41: +task 2, lines 32-41: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_pack_type_mismatch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_pack_type_mismatch.exp index 342fbf770e586..253963ae9c997 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_pack_type_mismatch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_pack_type_mismatch.exp @@ -1,6 +1,7 @@ processed 8 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 13-24: +task 1, lines 13-24: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::N'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'publish'. lines 26-37: +task 2, lines 26-37: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::O'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 3 'publish'. lines 39-50: +task 3, lines 39-50: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::P'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 4 'publish'. lines 53-63: +task 4, lines 53-63: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 5 'publish'. lines 65-76: +task 5, lines 65-76: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::N'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 6 'publish'. lines 78-89: +task 6, lines 78-89: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'publish'. lines 91-102: +task 7, lines 91-102: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::P'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_unpack_type_mismatch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_unpack_type_mismatch.exp index 3e09a9890d79b..7a2dbdfb1e25b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_unpack_type_mismatch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_unpack_type_mismatch.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::O'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 1 'publish'. lines 15-27: +task 1, lines 15-27: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/integer_binary_operators_types_mismatch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/integer_binary_operators_types_mismatch.exp index 3a1e5ebb82b3d..f66e0a874dce6 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/integer_binary_operators_types_mismatch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/integer_binary_operators_types_mismatch.exp @@ -1,6 +1,7 @@ processed 191 tasks -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 1 'run'. lines 15-24: +task 1, lines 15-24: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 26-35: +task 2, lines 26-35: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 3 'run'. lines 37-46: +task 3, lines 37-46: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 48-57: +task 4, lines 48-57: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 59-68: +task 5, lines 59-68: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 6 'run'. lines 70-79: +task 6, lines 70-79: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 81-90: +task 7, lines 81-90: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 92-101: +task 8, lines 92-101: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 9 'run'. lines 103-112: +task 9, lines 103-112: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 114-123: +task 10, lines 114-123: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 125-134: +task 11, lines 125-134: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -108,7 +120,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'publish'. lines 136-144: +task 12, lines 136-144: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -117,7 +130,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 13 'publish'. lines 146-154: +task 13, lines 146-154: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -126,7 +140,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 14 'publish'. lines 156-168: +task 14, lines 156-168: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -135,7 +150,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 15 'run'. lines 169-178: +task 15, lines 169-178: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -144,7 +160,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 180-189: +task 16, lines 180-189: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -153,7 +170,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 17 'run'. lines 191-200: +task 17, lines 191-200: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -162,7 +180,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 18 'run'. lines 202-211: +task 18, lines 202-211: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -171,7 +190,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 19 'run'. lines 213-222: +task 19, lines 213-222: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -180,7 +200,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 20 'run'. lines 224-233: +task 20, lines 224-233: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -189,7 +210,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 21 'run'. lines 235-244: +task 21, lines 235-244: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -198,7 +220,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 22 'run'. lines 246-255: +task 22, lines 246-255: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -207,7 +230,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 23 'run'. lines 257-266: +task 23, lines 257-266: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -216,7 +240,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 24 'run'. lines 268-277: +task 24, lines 268-277: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -225,7 +250,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 25 'run'. lines 279-288: +task 25, lines 279-288: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -234,7 +260,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 26 'run'. lines 290-299: +task 26, lines 290-299: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -243,7 +270,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 27 'publish'. lines 301-309: +task 27, lines 301-309: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -252,7 +280,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 28 'publish'. lines 311-319: +task 28, lines 311-319: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -261,7 +290,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 29 'publish'. lines 321-333: +task 29, lines 321-333: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -270,7 +300,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 30 'run'. lines 334-343: +task 30, lines 334-343: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -279,7 +310,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 31 'run'. lines 345-354: +task 31, lines 345-354: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -288,7 +320,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 32 'run'. lines 356-365: +task 32, lines 356-365: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -297,7 +330,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 33 'run'. lines 367-376: +task 33, lines 367-376: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -306,7 +340,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 34 'run'. lines 378-387: +task 34, lines 378-387: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -315,7 +350,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 35 'run'. lines 389-398: +task 35, lines 389-398: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -324,7 +360,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 36 'run'. lines 400-409: +task 36, lines 400-409: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -333,7 +370,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 37 'run'. lines 411-420: +task 37, lines 411-420: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -342,7 +380,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 38 'run'. lines 422-431: +task 38, lines 422-431: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -351,7 +390,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 39 'run'. lines 433-442: +task 39, lines 433-442: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -360,7 +400,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 40 'run'. lines 444-453: +task 40, lines 444-453: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -369,7 +410,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 41 'run'. lines 455-464: +task 41, lines 455-464: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -378,7 +420,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 42 'publish'. lines 466-474: +task 42, lines 466-474: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -387,7 +430,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 43 'publish'. lines 476-484: +task 43, lines 476-484: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -396,7 +440,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 44 'publish'. lines 486-498: +task 44, lines 486-498: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -405,7 +450,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 45 'run'. lines 499-508: +task 45, lines 499-508: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -414,7 +460,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 46 'run'. lines 510-519: +task 46, lines 510-519: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -423,7 +470,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 47 'run'. lines 521-530: +task 47, lines 521-530: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -432,7 +480,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 48 'run'. lines 532-541: +task 48, lines 532-541: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -441,7 +490,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 49 'run'. lines 543-552: +task 49, lines 543-552: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -450,7 +500,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 50 'run'. lines 554-563: +task 50, lines 554-563: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -459,7 +510,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 51 'run'. lines 565-574: +task 51, lines 565-574: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -468,7 +520,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 52 'run'. lines 576-585: +task 52, lines 576-585: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -477,7 +530,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 53 'run'. lines 587-596: +task 53, lines 587-596: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -486,7 +540,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 54 'run'. lines 598-607: +task 54, lines 598-607: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -495,7 +550,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 55 'run'. lines 609-618: +task 55, lines 609-618: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -504,7 +560,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 56 'run'. lines 620-629: +task 56, lines 620-629: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -513,7 +570,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 57 'publish'. lines 631-639: +task 57, lines 631-639: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -522,7 +580,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 58 'publish'. lines 641-649: +task 58, lines 641-649: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -531,7 +590,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 59 'publish'. lines 651-663: +task 59, lines 651-663: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -540,7 +600,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 60 'run'. lines 664-673: +task 60, lines 664-673: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -549,7 +610,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 61 'run'. lines 675-684: +task 61, lines 675-684: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -558,7 +620,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 62 'run'. lines 686-695: +task 62, lines 686-695: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -567,7 +630,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 63 'run'. lines 697-706: +task 63, lines 697-706: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -576,7 +640,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 64 'run'. lines 708-717: +task 64, lines 708-717: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -585,7 +650,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 65 'run'. lines 719-728: +task 65, lines 719-728: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -594,7 +660,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 66 'run'. lines 730-739: +task 66, lines 730-739: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -603,7 +670,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 67 'run'. lines 741-750: +task 67, lines 741-750: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -612,7 +680,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 68 'run'. lines 752-761: +task 68, lines 752-761: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -621,7 +690,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 69 'run'. lines 763-772: +task 69, lines 763-772: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -630,7 +700,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 70 'run'. lines 774-783: +task 70, lines 774-783: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -639,7 +710,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 71 'run'. lines 785-794: +task 71, lines 785-794: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -648,7 +720,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 72 'publish'. lines 796-804: +task 72, lines 796-804: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -657,7 +730,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 73 'publish'. lines 806-814: +task 73, lines 806-814: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -666,7 +740,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 74 'publish'. lines 816-828: +task 74, lines 816-828: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -675,7 +750,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 75 'run'. lines 829-838: +task 75, lines 829-838: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -684,7 +760,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 76 'run'. lines 840-849: +task 76, lines 840-849: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -693,7 +770,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 77 'run'. lines 851-860: +task 77, lines 851-860: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -702,7 +780,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 78 'run'. lines 862-871: +task 78, lines 862-871: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -711,7 +790,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 79 'run'. lines 873-882: +task 79, lines 873-882: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -720,7 +800,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 80 'run'. lines 884-893: +task 80, lines 884-893: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -729,7 +810,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 81 'run'. lines 895-904: +task 81, lines 895-904: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -738,7 +820,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 82 'run'. lines 906-915: +task 82, lines 906-915: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -747,7 +830,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 83 'run'. lines 917-926: +task 83, lines 917-926: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -756,7 +840,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 84 'run'. lines 928-937: +task 84, lines 928-937: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -765,7 +850,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 85 'run'. lines 939-948: +task 85, lines 939-948: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -774,7 +860,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 86 'run'. lines 950-959: +task 86, lines 950-959: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -783,7 +870,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 87 'publish'. lines 961-969: +task 87, lines 961-969: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -792,7 +880,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 88 'publish'. lines 971-979: +task 88, lines 971-979: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -801,7 +890,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 89 'publish'. lines 981-993: +task 89, lines 981-993: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -810,7 +900,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 90 'run'. lines 994-1003: +task 90, lines 994-1003: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -819,7 +910,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 91 'run'. lines 1005-1014: +task 91, lines 1005-1014: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -828,7 +920,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 92 'run'. lines 1016-1025: +task 92, lines 1016-1025: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -837,7 +930,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 93 'run'. lines 1027-1036: +task 93, lines 1027-1036: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -846,7 +940,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 94 'run'. lines 1038-1047: +task 94, lines 1038-1047: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -855,7 +950,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 95 'run'. lines 1049-1058: +task 95, lines 1049-1058: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -864,7 +960,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 96 'run'. lines 1060-1069: +task 96, lines 1060-1069: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -873,7 +970,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 97 'run'. lines 1071-1080: +task 97, lines 1071-1080: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -882,7 +980,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 98 'run'. lines 1082-1091: +task 98, lines 1082-1091: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -891,7 +990,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 99 'run'. lines 1093-1102: +task 99, lines 1093-1102: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -900,7 +1000,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 100 'run'. lines 1104-1113: +task 100, lines 1104-1113: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -909,7 +1010,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 101 'run'. lines 1115-1124: +task 101, lines 1115-1124: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -918,7 +1020,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 102 'publish'. lines 1126-1134: +task 102, lines 1126-1134: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -927,7 +1030,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 103 'publish'. lines 1136-1144: +task 103, lines 1136-1144: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -936,7 +1040,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 104 'publish'. lines 1146-1158: +task 104, lines 1146-1158: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -945,7 +1050,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 105 'run'. lines 1159-1168: +task 105, lines 1159-1168: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -954,7 +1060,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 106 'run'. lines 1170-1179: +task 106, lines 1170-1179: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -963,7 +1070,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 107 'run'. lines 1181-1190: +task 107, lines 1181-1190: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -972,7 +1080,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 108 'run'. lines 1192-1201: +task 108, lines 1192-1201: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -981,7 +1090,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 109 'run'. lines 1203-1212: +task 109, lines 1203-1212: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -990,7 +1100,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 110 'run'. lines 1214-1223: +task 110, lines 1214-1223: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -999,7 +1110,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 111 'run'. lines 1225-1234: +task 111, lines 1225-1234: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1008,7 +1120,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 112 'run'. lines 1236-1245: +task 112, lines 1236-1245: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1017,7 +1130,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 113 'run'. lines 1247-1256: +task 113, lines 1247-1256: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1026,7 +1140,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 114 'run'. lines 1258-1267: +task 114, lines 1258-1267: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1035,7 +1150,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 115 'publish'. lines 1269-1277: +task 115, lines 1269-1277: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1044,7 +1160,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 116 'publish'. lines 1279-1290: +task 116, lines 1279-1290: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1053,7 +1170,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 117 'run'. lines 1291-1300: +task 117, lines 1291-1300: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1062,7 +1180,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 118 'run'. lines 1302-1311: +task 118, lines 1302-1311: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1071,7 +1190,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 119 'run'. lines 1313-1322: +task 119, lines 1313-1322: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1080,7 +1200,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 120 'run'. lines 1324-1333: +task 120, lines 1324-1333: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1089,7 +1210,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 121 'run'. lines 1335-1344: +task 121, lines 1335-1344: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1098,7 +1220,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 122 'run'. lines 1346-1355: +task 122, lines 1346-1355: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1107,7 +1230,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 123 'run'. lines 1357-1366: +task 123, lines 1357-1366: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1116,7 +1240,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 124 'run'. lines 1368-1377: +task 124, lines 1368-1377: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1125,7 +1250,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 125 'run'. lines 1379-1388: +task 125, lines 1379-1388: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1134,7 +1260,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 126 'run'. lines 1390-1399: +task 126, lines 1390-1399: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1143,7 +1270,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 127 'publish'. lines 1401-1409: +task 127, lines 1401-1409: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1152,7 +1280,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 128 'publish'. lines 1411-1423: +task 128, lines 1411-1423: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: EQUALITY_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1161,7 +1290,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 129 'run'. lines 1424-1433: +task 129, lines 1424-1433: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1170,7 +1300,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 130 'run'. lines 1435-1444: +task 130, lines 1435-1444: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1179,7 +1310,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 131 'run'. lines 1446-1455: +task 131, lines 1446-1455: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1188,7 +1320,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 132 'run'. lines 1457-1466: +task 132, lines 1457-1466: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1197,7 +1330,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 133 'run'. lines 1468-1477: +task 133, lines 1468-1477: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1206,7 +1340,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 134 'run'. lines 1479-1488: +task 134, lines 1479-1488: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1215,7 +1350,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 135 'run'. lines 1490-1499: +task 135, lines 1490-1499: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1224,7 +1360,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 136 'run'. lines 1501-1510: +task 136, lines 1501-1510: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1233,7 +1370,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 137 'run'. lines 1512-1521: +task 137, lines 1512-1521: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1242,7 +1380,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 138 'run'. lines 1523-1534: +task 138, lines 1523-1534: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1251,7 +1390,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 139 'run'. lines 1535-1544: +task 139, lines 1535-1544: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1260,7 +1400,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 140 'run'. lines 1546-1555: +task 140, lines 1546-1555: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1269,7 +1410,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 141 'run'. lines 1557-1566: +task 141, lines 1557-1566: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1278,7 +1420,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 142 'run'. lines 1568-1577: +task 142, lines 1568-1577: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1287,7 +1430,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 143 'run'. lines 1579-1588: +task 143, lines 1579-1588: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1296,7 +1440,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 144 'run'. lines 1590-1599: +task 144, lines 1590-1599: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1305,7 +1450,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 145 'run'. lines 1601-1610: +task 145, lines 1601-1610: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1314,7 +1460,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 146 'run'. lines 1612-1621: +task 146, lines 1612-1621: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1323,7 +1470,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 147 'run'. lines 1623-1632: +task 147, lines 1623-1632: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1332,7 +1480,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 148 'run'. lines 1634-1645: +task 148, lines 1634-1645: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1341,7 +1490,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 149 'run'. lines 1646-1655: +task 149, lines 1646-1655: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1350,7 +1500,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 150 'run'. lines 1657-1666: +task 150, lines 1657-1666: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1359,7 +1510,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 151 'run'. lines 1668-1677: +task 151, lines 1668-1677: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1368,7 +1520,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 152 'run'. lines 1679-1688: +task 152, lines 1679-1688: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1377,7 +1530,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 153 'run'. lines 1690-1699: +task 153, lines 1690-1699: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1386,7 +1540,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 154 'run'. lines 1701-1710: +task 154, lines 1701-1710: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1395,7 +1550,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 155 'run'. lines 1712-1721: +task 155, lines 1712-1721: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1404,7 +1560,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 156 'run'. lines 1723-1732: +task 156, lines 1723-1732: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1413,7 +1570,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 157 'run'. lines 1734-1743: +task 157, lines 1734-1743: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1422,7 +1580,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 158 'run'. lines 1745-1756: +task 158, lines 1745-1756: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1431,7 +1590,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 159 'run'. lines 1757-1766: +task 159, lines 1757-1766: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1440,7 +1600,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 160 'run'. lines 1768-1777: +task 160, lines 1768-1777: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1449,7 +1610,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 161 'run'. lines 1779-1788: +task 161, lines 1779-1788: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1458,7 +1620,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 162 'run'. lines 1790-1799: +task 162, lines 1790-1799: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1467,7 +1630,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 163 'run'. lines 1801-1810: +task 163, lines 1801-1810: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1476,7 +1640,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 164 'run'. lines 1812-1821: +task 164, lines 1812-1821: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1485,7 +1650,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 165 'run'. lines 1823-1832: +task 165, lines 1823-1832: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1494,7 +1660,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 166 'run'. lines 1834-1843: +task 166, lines 1834-1843: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1503,7 +1670,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 167 'run'. lines 1845-1854: +task 167, lines 1845-1854: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1512,7 +1680,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 168 'run'. lines 1856-1867: +task 168, lines 1856-1867: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1521,7 +1690,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 169 'run'. lines 1868-1877: +task 169, lines 1868-1877: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1530,7 +1700,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 170 'run'. lines 1879-1888: +task 170, lines 1879-1888: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1539,7 +1710,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 171 'run'. lines 1890-1899: +task 171, lines 1890-1899: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1548,7 +1720,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 172 'run'. lines 1901-1910: +task 172, lines 1901-1910: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1557,7 +1730,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 173 'run'. lines 1912-1921: +task 173, lines 1912-1921: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1566,7 +1740,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 174 'run'. lines 1923-1932: +task 174, lines 1923-1932: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1575,7 +1750,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 175 'run'. lines 1934-1943: +task 175, lines 1934-1943: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1584,7 +1760,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 176 'run'. lines 1945-1954: +task 176, lines 1945-1954: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1593,7 +1770,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 177 'publish'. lines 1956-1964: +task 177, lines 1956-1964: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1602,7 +1780,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 178 'publish'. lines 1966-1974: +task 178, lines 1966-1974: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1611,7 +1790,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 179 'publish'. lines 1976-1988: +task 179, lines 1976-1988: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1620,7 +1800,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 180 'run'. lines 1989-1998: +task 180, lines 1989-1998: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1629,7 +1810,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 181 'run'. lines 2000-2009: +task 181, lines 2000-2009: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1638,7 +1820,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 182 'run'. lines 2011-2020: +task 182, lines 2011-2020: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1647,7 +1830,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 183 'run'. lines 2022-2031: +task 183, lines 2022-2031: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1656,7 +1840,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 184 'run'. lines 2033-2042: +task 184, lines 2033-2042: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1665,7 +1850,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 185 'run'. lines 2044-2053: +task 185, lines 2044-2053: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1674,7 +1860,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 186 'run'. lines 2055-2064: +task 186, lines 2055-2064: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1683,7 +1870,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 187 'run'. lines 2066-2075: +task 187, lines 2066-2075: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1692,7 +1880,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 188 'publish'. lines 2077-2085: +task 188, lines 2077-2085: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1701,7 +1890,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 189 'publish'. lines 2087-2095: +task 189, lines 2087-2095: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, @@ -1710,7 +1900,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 190 'publish'. lines 2097-2105: +task 190, lines 2097-2105: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: INTEGER_OP_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write.exp index 9927b5107daae..4ef286835914d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-18: +task 0, lines 1-18: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: WRITEREF_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write_mut_unpack_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write_mut_unpack_enum.exp index cbd2e1afd6010..6cda4b04b7324 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write_mut_unpack_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_field_write_mut_unpack_enum.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-18: +task 0, lines 1-18: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: WRITEREF_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 5)], } -task 1 'publish'. lines 20-37: +task 1, lines 20-37: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: WRITEREF_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resouce_write_unpack_mut_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resouce_write_unpack_mut_enum.exp index 33e1bc9c8953c..797906e3d15a4 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resouce_write_unpack_mut_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resouce_write_unpack_mut_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::RTest'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resource_write.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resource_write.exp index b1ff69815060e..e0aa0ddc51d0a 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resource_write.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/invalid_resource_write.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::RTest'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref.exp index 5e1d9de7a69fb..b2f43317dcab5 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-25: +task 0, lines 1-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Token'. Got VMError: { major_status: BORROWFIELD_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref_enum.exp index 3a26085aabbd4..1befa3cdcf7a3 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_borrow_from_imm_ref_enum.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-25: +task 0, lines 1-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Token'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(2), 1)], } -task 1 'publish'. lines 27-38: +task 1, lines 27-38: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Token'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref.exp index db9153197af6e..4c7cdf7d9e6ed 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-33: +task 0, lines 1-33: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Token'. Got VMError: { major_status: CALL_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref_enum.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref_enum.exp index db9153197af6e..4c7cdf7d9e6ed 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref_enum.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_with_imm_ref_enum.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-33: +task 0, lines 1-33: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Token'. Got VMError: { major_status: CALL_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_enum_with_refs.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_enum_with_refs.exp index 20f8665c0de64..c397b65ecd7ae 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_enum_with_refs.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_enum_with_refs.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 13-23: +task 1, lines 13-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 25-28: +task 2, lines 25-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 30-40: +task 3, lines 30-40: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'publish'. lines 42-52: +task 4, lines 42-52: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 54-60: +task 5, lines 54-60: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 6 'publish'. lines 62-72: +task 6, lines 62-72: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'publish'. lines 74-84: +task 7, lines 74-84: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 8 'publish'. lines 86-89: +task 8, lines 86-89: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_SIGNATURE_TOKEN, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_invalid_type_arguments.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_invalid_type_arguments.exp index f3db392fd90fc..0ad35d36c8fde 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_invalid_type_arguments.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_invalid_type_arguments.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 13-23: +task 1, lines 13-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: RET_TYPE_MISMATCH_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 2 'publish'. lines 25-35: +task 2, lines 25-35: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 3 'publish'. lines 37-47: +task 3, lines 37-47: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 49-59: +task 4, lines 49-59: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 61-71: +task 5, lines 61-71: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 79-90: +task 7, lines 79-90: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: RET_TYPE_MISMATCH_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 8 'publish'. lines 92-103: +task 8, lines 92-103: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_non_generically.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_non_generically.exp index 2db8d8685cade..e09b33321f2d9 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_non_generically.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_generic_enum_non_generically.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_non_generic_enum_generically.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_non_generic_enum_generically.exp index 1500bfdbb522c..de87985f18f33 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_non_generic_enum_generically.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/pack_non_generic_enum_generically.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/bytecode_ops_abilities_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/bytecode_ops_abilities_bad.exp index c2551604b6316..83ef3cba2c3a7 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/bytecode_ops_abilities_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/bytecode_ops_abilities_bad.exp @@ -1,6 +1,7 @@ processed 12 tasks -task 1 'publish'. lines 10-22: +task 1, lines 10-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 2 'publish'. lines 24-36: +task 2, lines 24-36: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: POP_WITHOUT_DROP_ABILITY, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 3 'publish'. lines 38-49: +task 3, lines 38-49: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M4'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 4 'publish'. lines 51-61: +task 4, lines 51-61: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M5'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 5 'publish'. lines 63-74: +task 5, lines 63-74: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M9'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 82-94: +task 7, lines 82-94: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M2'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 8 'publish'. lines 96-108: +task 8, lines 96-108: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M3'. Got VMError: { major_status: POP_WITHOUT_DROP_ABILITY, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 9 'publish'. lines 110-121: +task 9, lines 110-121: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M4'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 10 'publish'. lines 123-133: +task 10, lines 123-133: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M5'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, @@ -81,7 +90,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 11 'publish'. lines 135-146: +task 11, lines 135-146: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M9'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/constraints_abilities_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/constraints_abilities_bad.exp index 6ae865c2d107b..4b11d611c57dc 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/constraints_abilities_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/constraints_abilities_bad.exp @@ -1,6 +1,7 @@ processed 12 tasks -task 1 'publish'. lines 7-15: +task 1, lines 7-15: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 17-34: +task 2, lines 17-34: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 36-46: +task 3, lines 36-46: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M4'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 60-75: +task 5, lines 60-75: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M5'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 83-91: +task 7, lines 83-91: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 8 'publish'. lines 93-112: +task 8, lines 93-112: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M3'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 9 'publish'. lines 114-124: +task 9, lines 114-124: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M4'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 11 'publish'. lines 138-153: +task 11, lines 138-153: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M5'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/fields_abilities_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/fields_abilities_bad.exp index eec1e39402cef..3c200201d53cc 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/fields_abilities_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/fields_abilities_bad.exp @@ -1,6 +1,7 @@ processed 10 tasks -task 1 'publish'. lines 16-21: +task 1, lines 16-21: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 23-28: +task 2, lines 23-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 30-35: +task 3, lines 30-35: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M4'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 37-42: +task 4, lines 37-42: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M5'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 6 'publish'. lines 56-61: +task 6, lines 56-61: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M2'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 63-68: +task 7, lines 63-68: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M3'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 8 'publish'. lines 70-75: +task 8, lines 70-75: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M4'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 9 'publish'. lines 77-82: +task 9, lines 77-82: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M5'. Got VMError: { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/struct_definition_bad.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/struct_definition_bad.exp index 2699bb8c17736..d449132007fde 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/struct_definition_bad.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/phantom_params/struct_definition_bad.exp @@ -1,6 +1,7 @@ processed 12 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M1'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 13-19: +task 1, lines 13-19: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 21-28: +task 2, lines 21-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 30-39: +task 3, lines 30-39: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M4'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 41-47: +task 4, lines 41-47: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M5'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 49-56: +task 5, lines 49-56: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M6'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 6 'publish'. lines 58-68: +task 6, lines 58-68: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M1'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 70-76: +task 7, lines 70-76: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M2'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 8 'publish'. lines 78-85: +task 8, lines 78-85: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M3'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -81,7 +90,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 9 'publish'. lines 87-96: +task 9, lines 87-96: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M4'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -90,7 +100,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 10 'publish'. lines 98-104: +task 10, lines 98-104: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M5'. Got VMError: { major_status: INVALID_PHANTOM_TYPE_PARAM_POSITION, sub_status: None, @@ -99,7 +110,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 11 'publish'. lines 106-113: +task 11, lines 106-113: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M6'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_args_subtype.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_args_subtype.exp index b6ee37c183f16..f906fe0743f2e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_args_subtype.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_args_subtype.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 11-24: +task 1, lines 11-24: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CALL_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_subtype.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_subtype.exp index b1a59d8fc5fdb..aa98faca2e79d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_subtype.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_subtype.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-9: +task 0, lines 1-9: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: RET_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_type.exp index b1a59d8fc5fdb..aa98faca2e79d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/procedure_return_invalid_type.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-9: +task 0, lines 1-9: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: RET_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param.exp index c06e2b281c323..ff5c78eb9016d 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param.exp @@ -1,6 +1,7 @@ processed 8 tasks -task 0 'publish'. lines 1-10: +task 0, lines 1-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M1'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 12-21: +task 1, lines 12-21: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 23-32: +task 2, lines 23-32: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M3'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 34-44: +task 3, lines 34-44: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M4'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 46-55: +task 4, lines 46-55: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M1'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 57-66: +task 5, lines 57-66: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 6 'publish'. lines 68-77: +task 6, lines 68-77: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M3'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 79-89: +task 7, lines 79-89: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M4'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param_exploits.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param_exploits.exp index 6d0efc6903d51..b25ce0d3d80c9 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param_exploits.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/ref_type_param_exploits.exp @@ -1,6 +1,7 @@ processed 10 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M1'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 13-23: +task 1, lines 13-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 25-36: +task 2, lines 25-36: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M3'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 38-54: +task 3, lines 38-54: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M4'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 56-72: +task 4, lines 56-72: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M5'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 74-86: +task 5, lines 74-86: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M1'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 6 'publish'. lines 88-98: +task 6, lines 88-98: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 100-112: +task 7, lines 100-112: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M3'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 8 'publish'. lines 114-130: +task 8, lines 114-130: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M4'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -81,7 +90,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 9 'publish'. lines 132-148: +task 9, lines 132-148: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M5'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/release.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/release.exp index b60171276fcd0..39484d1fbc98b 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/release.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/release.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-10: +task 0, lines 1-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'publish'. lines 12-21: +task 1, lines 12-21: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M'. Got VMError: { major_status: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/resource_instantiate_bad_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/resource_instantiate_bad_type.exp index 37f8c1746afbf..ac9e64c0cd8bd 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/resource_instantiate_bad_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/resource_instantiate_bad_type.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 16-28: +task 1, lines 16-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::Test'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/return_type_mismatch_and_unused_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/return_type_mismatch_and_unused_resource.exp index bf517ace6f8e7..fccd811d36b81 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/return_type_mismatch_and_unused_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/return_type_mismatch_and_unused_resource.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'publish'. lines 1-13: +task 0, lines 1-13: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: RET_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 1 'publish'. lines 15-27: +task 1, lines 15-27: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: RET_TYPE_MISMATCH_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 5)], } -task 2 'publish'. lines 29-40: +task 2, lines 29-40: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 3 'publish'. lines 42-53: +task 3, lines 42-53: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: UNSAFE_RET_LOCAL_OR_RESOURCE_STILL_BORROWED, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 5)], } -task 4 'publish'. lines 55-67: +task 4, lines 55-67: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M'. Got VMError: { major_status: RET_TYPE_MISMATCH_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 5 'publish'. lines 69-80: +task 5, lines 69-80: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc.exp index c1dde036e20c0..faf8ad0e4b003 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-8: +task 0, lines 1-8: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc_transitive.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc_transitive.exp index 0325d662d1ba6..37341eb8ea360 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc_transitive.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_copy_loc_transitive.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_does_not_have_store.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_does_not_have_store.exp index 4f4e59805a051..76b33efb4b500 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_does_not_have_store.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_does_not_have_store.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-15: +task 0, lines 1-15: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref.exp index 8bad387623f99..4553c247d0672 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-8: +task 0, lines 1-8: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref_transitive.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref_transitive.exp index 91e9dd2f2bb8e..e4fb85e4ccec8 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref_transitive.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/signer_read_ref_transitive.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 4)], } -task 1 'publish'. lines 13-23: +task 1, lines 13-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/struct_kind_inference.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/struct_kind_inference.exp index 42d184643827e..b17e327c106ea 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/struct_kind_inference.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/struct_kind_inference.exp @@ -1,6 +1,7 @@ processed 10 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M1'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M2'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'publish'. lines 27-37: +task 2, lines 27-37: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M3'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'publish'. lines 39-50: +task 3, lines 39-50: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M4'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'publish'. lines 52-62: +task 4, lines 52-62: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::M5'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 5 'publish'. lines 64-75: +task 5, lines 64-75: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M1'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 0)], } -task 6 'publish'. lines 77-88: +task 6, lines 77-88: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M2'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'publish'. lines 90-100: +task 7, lines 90-100: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M3'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'publish'. lines 102-113: +task 8, lines 102-113: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M4'. Got VMError: { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, @@ -81,7 +90,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 9 'publish'. lines 115-125: +task 9, lines 115-125: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::M5'. Got VMError: { major_status: COPYLOC_WITHOUT_COPY_ABILITY, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/type_error_after_branch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/type_error_after_branch.exp index f06938b6a0d05..1f3a6ab922c53 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/type_error_after_branch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/type_error_after_branch.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-19: +task 0, lines 1-19: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_non_generically.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_non_generically.exp index 1b164f1a5379f..87312d32643bc 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_non_generically.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_non_generically.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'publish'. lines 27-38: +task 2, lines 27-38: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'publish'. lines 40-51: +task 3, lines 40-51: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'publish'. lines 53-64: +task 4, lines 53-64: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 5 'publish'. lines 66-77: +task 5, lines 66-77: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 6 'publish'. lines 79-90: +task 6, lines 79-90: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'publish'. lines 92-103: +task 7, lines 92-103: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'publish'. lines 105-116: +task 8, lines 105-116: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: GENERIC_MEMBER_OPCODE_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_wrong_type_arg.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_wrong_type_arg.exp index 888a1ba190653..16f2e597c308c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_wrong_type_arg.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_generic_enum_wrong_type_arg.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'publish'. lines 27-38: +task 2, lines 27-38: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'publish'. lines 40-51: +task 3, lines 40-51: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'publish'. lines 53-64: +task 4, lines 53-64: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 5 'publish'. lines 66-77: +task 5, lines 66-77: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 6 'publish'. lines 79-90: +task 6, lines 79-90: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'publish'. lines 92-103: +task 7, lines 92-103: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'publish'. lines 105-116: +task 8, lines 105-116: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_non_generic_enum_generically.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_non_generic_enum_generically.exp index eeda9dd87477c..c0296b5838c44 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_non_generic_enum_generically.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_non_generic_enum_generically.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 0 'publish'. lines 1-12: +task 0, lines 1-12: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 14-25: +task 1, lines 14-25: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 27-38: +task 2, lines 27-38: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 40-51: +task 3, lines 40-51: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 53-64: +task 4, lines 53-64: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 66-77: +task 5, lines 66-77: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 6 'publish'. lines 79-90: +task 6, lines 79-90: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByValue'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 7 'publish'. lines 92-103: +task 7, lines 92-103: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByImmRef'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 8 'publish'. lines 105-116: +task 8, lines 105-116: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::ByMutRef'. Got VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_wrong_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_wrong_type.exp index 50ce6b9144a04..c0ed06c2f997f 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_wrong_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unpack_wrong_type.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-19: +task 0, lines 1-19: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Test'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(1), 1)], } -task 1 'publish'. lines 21-38: +task 1, lines 21-38: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::Test'. Got VMError: { major_status: UNPACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unrestricted_instantiate_bad_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unrestricted_instantiate_bad_type.exp index bed47e219a539..42f85aeff1517 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unrestricted_instantiate_bad_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unrestricted_instantiate_bad_type.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-10: +task 0, lines 1-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Test'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 12-21: +task 1, lines 12-21: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::Test'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unused_resource_holder.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unused_resource_holder.exp index 219cc64871ae6..e19be1172685e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unused_resource_holder.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/unused_resource_holder.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 1 'run'. lines 18-33: +task 1, lines 18-33: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 5)], } -task 3 'run'. lines 51-66: +task 3, lines 51-66: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::m'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_invalid_head_type.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_invalid_head_type.exp index fd8e982e07225..a1b8c88e714c2 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_invalid_head_type.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_invalid_head_type.exp @@ -1,6 +1,7 @@ processed 11 tasks -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: ENUM_SWITCH_BAD_OPERAND, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'publish'. lines 16-29: +task 1, lines 16-29: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: ENUM_SWITCH_BAD_OPERAND, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'publish'. lines 31-44: +task 2, lines 31-44: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: ENUM_SWITCH_BAD_OPERAND, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'publish'. lines 46-59: +task 3, lines 46-59: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: ENUM_TYPE_MISMATCH, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'publish'. lines 61-74: +task 4, lines 61-74: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: ENUM_SWITCH_BAD_OPERAND, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 5 'publish'. lines 77-92: +task 5, lines 77-92: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: ENUM_TYPE_MISMATCH, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 6 'publish'. lines 94-109: +task 6, lines 94-109: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: ENUM_SWITCH_BAD_OPERAND, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'publish'. lines 127-141: +task 8, lines 127-141: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::P'. Got VMError: { major_status: ENUM_TYPE_MISMATCH, sub_status: None, @@ -72,7 +80,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 9 'publish'. lines 143-157: +task 9, lines 143-157: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::P'. Got VMError: { major_status: ENUM_TYPE_MISMATCH, sub_status: None, @@ -81,7 +90,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 10 'publish'. lines 159-173: +task 10, lines 159-173: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::P'. Got VMError: { major_status: ENUM_TYPE_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_partial_enum_switch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_partial_enum_switch.exp index d4f8d00ce9bc7..25f4a59b1df8e 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_partial_enum_switch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/variant_switch_partial_enum_switch.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 1 'publish'. lines 16-28: +task 1, lines 16-28: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_ENUM_SWITCH, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 30-43: +task 2, lines 30-43: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::O'. Got VMError: { major_status: INVALID_ENUM_SWITCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_ops_type_mismatch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_ops_type_mismatch.exp index d2d0379f1943f..9aca58e2e2184 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_ops_type_mismatch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_ops_type_mismatch.exp @@ -1,6 +1,7 @@ processed 8 tasks -task 0 'run'. lines 1-11: +task 0, lines 1-11: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'run'. lines 12-25: +task 1, lines 12-25: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 2 'run'. lines 26-41: +task 2, lines 26-41: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 6)], } -task 3 'run'. lines 42-58: +task 3, lines 42-58: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 8)], } -task 4 'run'. lines 59-75: +task 4, lines 59-75: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 6)], } -task 5 'run'. lines 76-95: +task 5, lines 76-95: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_TYPE_MISMATCH_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 6 'run'. lines 96-107: +task 6, lines 96-107: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, @@ -63,7 +70,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'run'. lines 108-121: +task 7, lines 108-121: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_pack_mismatch.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_pack_mismatch.exp index f17f2c02bac85..b4628ddc0a36c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_pack_mismatch.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_pack_mismatch.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 1)], } -task 1 'run'. lines 15-29: +task 1, lines 15-29: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 31-42: +task 2, lines 31-42: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 3)], } -task 3 'run'. lines 44-56: +task 3, lines 44-56: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: TYPE_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param.exp index a1586d2c211c1..70f91abeae482 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'publish'. lines 1-10: +task 0, lines 1-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M1'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 12-21: +task 1, lines 12-21: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 23-32: +task 2, lines 23-32: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M3'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 34-43: +task 3, lines 34-43: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M1'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -36,7 +40,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 4 'publish'. lines 45-54: +task 4, lines 45-54: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -45,7 +50,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 5 'publish'. lines 56-65: +task 5, lines 56-65: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::M3'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param_exploits.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param_exploits.exp index 394bd41918299..a6424fe8c3090 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param_exploits.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param_exploits.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'publish'. lines 1-11: +task 0, lines 1-11: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M1'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 13-22: +task 1, lines 13-22: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M2'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 24-40: +task 2, lines 24-40: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M3'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, @@ -27,7 +30,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 3 'publish'. lines 42-58: +task 3, lines 42-58: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M4'. Got VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/default_int_size.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/default_int_size.exp index a993059435290..65cc80f8b27fa 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/default_int_size.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/default_int_size.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'run'. lines 1-14: +task 0, lines 1-14: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/derived_line_number_assertion.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/derived_line_number_assertion.exp index 91a99238111a5..b980699ad1b88 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/derived_line_number_assertion.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/derived_line_number_assertion.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 6-11: +task 1, lines 6-11: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(9223372079804448767), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation.exp index 181c303bce7be..46be9facb42bb 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 6-13: +task 1, lines 6-13: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(9223372084099416065), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation_abort.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation_abort.exp index 181c303bce7be..46be9facb42bb 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation_abort.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/error_annotation_abort.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 6-13: +task 1, lines 6-13: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(9223372084099416065), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/macro_call_line_number_assertion.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/macro_call_line_number_assertion.exp index c02c2496ea771..760fa19edda51 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/macro_call_line_number_assertion.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/macro_call_line_number_assertion.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 2 'run'. lines 25-25: +task 2, line 25: +//# run 0x42::m::t_a Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(9223372105574252543), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'run'. lines 27-27: +task 3, line 27: +//# run 0x42::m::t_calls_a Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(9223372118459154431), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/non_constant_empty_vec.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/non_constant_empty_vec.exp index 9c5bad711c44e..299c2061947fa 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/non_constant_empty_vec.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/constants/non_constant_empty_vec.exp @@ -1,22 +1,29 @@ processed 8 tasks -task 1 'run'. lines 33-33: +task 1, line 33: +//# run 0x42::M::empty_struct_vec return values: [] -task 2 'run'. lines 35-35: +task 2, line 35: +//# run 0x42::M::empty_struct_vec return values: [] -task 3 'run'. lines 37-37: +task 3, line 37: +//# run 0x42::M::empty_signer_vec return values: [] -task 4 'run'. lines 39-39: +task 4, line 39: +//# run 0x42::M::empty_generic_vec --type-args 0x42::M::S return values: [] -task 5 'run'. lines 41-41: +task 5, line 41: +//# run 0x42::M::empty_struct_vec_vec return values: [] -task 6 'run'. lines 43-43: +task 6, line 43: +//# run 0x42::M::empty_signer_vec_vec return values: [] -task 7 'run'. lines 45-45: +task 7, line 45: +//# run 0x42::M::empty_generic_vec_vec --type-args 0x42::M::S return values: [] diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/named_block_nesting.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/named_block_nesting.exp index 8d3ba6cd00e0e..f67f8b6023c03 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/named_block_nesting.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/named_block_nesting.exp @@ -1,19 +1,25 @@ processed 28 tasks -task 22 'run'. lines 249-249: +task 22, line 249: +//# run 42::m::t20 return values: 0 -task 23 'run'. lines 251-251: +task 23, line 251: +//# run 42::m::t21 return values: 0 -task 24 'run'. lines 253-253: +task 24, line 253: +//# run 42::m::t22 return values: 0 -task 25 'run'. lines 255-255: +task 25, line 255: +//# run 42::m::t23 return values: 0 -task 26 'run'. lines 257-257: +task 26, line 257: +//# run 42::m::t24 return values: 0 -task 27 'run'. lines 259-259: +task 27, line 259: +//# run 42::m::t25 return values: 0 diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/unused_signer_infinite_loop.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/unused_signer_infinite_loop.exp index 54ae4f5ed16aa..474898c174864 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/unused_signer_infinite_loop.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/control_flow/unused_signer_infinite_loop.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-7: +task 0, lines 1-7: +//# run --gas-budget 700 --signers 0x1 Error: Function execution failed with VMError: { major_status: OUT_OF_GAS, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package.exp index 599fb3b82f9da..2a4d6377d4f12 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package.exp @@ -1,4 +1,5 @@ processed 3 tasks -task 2 'run'. lines 20-20: +task 2, line 20: +//# run 0x42::y::foo return values: { false } diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package_different_packages.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package_different_packages.exp index 9eef7bb9e35b7..43f5075188a61 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package_different_packages.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/dependencies/public_package_different_packages.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 2 'publish'. lines 11-17: +task 2, lines 11-17: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Y'. Got VMError: { major_status: LOOKUP_FAILED, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/binop_aborts.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/binop_aborts.exp index a8bbbdd74dc98..6974f42fec473 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/binop_aborts.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/binop_aborts.exp @@ -1,6 +1,7 @@ processed 8 tasks -task 1 'run'. lines 14-20: +task 1, lines 14-20: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(2), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'run'. lines 22-29: +task 2, lines 22-29: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(1), @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'run'. lines 31-37: +task 3, lines 31-37: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 39-45: +task 4, lines 39-45: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 47-53: +task 5, lines 47-53: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 6 'run'. lines 55-61: +task 6, lines 55-61: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'run'. lines 63-69: +task 7, lines 63-69: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/lazy_assert.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/lazy_assert.exp index 4d4c7d902edf5..974b607f0c2c6 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/lazy_assert.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/lazy_assert.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 1 'run'. lines 9-15: +task 1, lines 9-15: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 17-23: +task 2, lines 17-23: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/short_circuiting_invalid.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/short_circuiting_invalid.exp index b5abb5888638d..e8d63c87cbba4 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/short_circuiting_invalid.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/short_circuiting_invalid.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 1 'run'. lines 10-16: +task 1, lines 10-16: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(42), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 2 'run'. lines 19-25: +task 2, lines 19-25: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(42), @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'run'. lines 27-33: +task 3, lines 27-33: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(42), @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'run'. lines 35-41: +task 4, lines 35-41: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(42), @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 5 'run'. lines 43-48: +task 5, lines 43-48: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/struct_arguments.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/struct_arguments.exp index 4b8cb7ee6cd8b..200d11632975a 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/struct_arguments.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/evaluation_order/struct_arguments.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 1 'run'. lines 40-47: +task 1, lines 40-47: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 49-56: +task 2, lines 49-56: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(1), 2)], } -task 3 'run'. lines 58-65: +task 3, lines 58-65: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(2), 2)], } -task 4 'run'. lines 67-74: +task 4, lines 67-74: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(3), 2)], } -task 5 'run'. lines 76-83: +task 5, lines 76-83: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/break_from_macro_arg.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/break_from_macro_arg.exp index b86c1ef56a082..8e95f7fe45b01 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/break_from_macro_arg.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/break_from_macro_arg.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 3 'run'. lines 27-27: +task 3, line 27: +//# run 42::m::t --args false Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/lambda_return.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/lambda_return.exp index 0019d5d7c72fd..5743efb15a34a 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/lambda_return.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/lambda_return.exp @@ -1,7 +1,9 @@ processed 4 tasks -task 2 'run'. lines 26-26: +task 2, line 26: +//# run 42::m::t --args true return values: [2, 8, 16] -task 3 'run'. lines 28-28: +task 3, line 28: +//# run 42::m::t --args false return values: [0, 4, 16] diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value.exp index 25eb8ef96bd9d..f7491af91eca1 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 2 'run'. lines 37-37: +task 2, line 37: +//# run 42::m::aborts0 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'run'. lines 39-39: +task 3, line 39: +//# run 42::m::aborts1 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(1), @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(1), 1)], } -task 4 'run'. lines 41-41: +task 4, line 41: +//# run 42::m::aborts2_not_0 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(2), @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(4), 1)], } -task 5 'run'. lines 43-43: +task 5, line 43: +//# run 42::m::aborts2_not_1 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(2), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value_even_when_ignored.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value_even_when_ignored.exp index d812846c4a3d4..318772f1fd2ba 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value_even_when_ignored.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/macros/method_is_by_value_even_when_ignored.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 2 'run'. lines 26-26: +task 2, line 26: +//# run 42::m::aborts0 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 3 'run'. lines 28-28: +task 3, line 28: +//# run 42::m::aborts1 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(1), diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u128.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u128.exp index cbb7b7ea9af14..ac072b9f8e689 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u128.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u128.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 17-23: +task 1, lines 17-23: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 25-31: +task 2, lines 25-31: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 50-56: +task 4, lines 50-56: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 58-64: +task 5, lines 58-64: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 80-86: +task 7, lines 80-86: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 88-94: +task 8, lines 88-94: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 113-119: +task 10, lines 113-119: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 121-127: +task 11, lines 121-127: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 131-137: +task 12, lines 131-137: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 155-161: +task 14, lines 155-161: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 163-169: +task 15, lines 163-169: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 171-177: +task 16, lines 171-177: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u16.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u16.exp index 2016470572658..63e7c5e2514e7 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u16.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u16.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 17-23: +task 1, lines 17-23: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 25-31: +task 2, lines 25-31: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 48-54: +task 4, lines 48-54: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 56-62: +task 5, lines 56-62: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 79-85: +task 7, lines 79-85: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 87-93: +task 8, lines 87-93: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 112-119: +task 10, lines 112-119: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 121-126: +task 11, lines 121-126: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 128-134: +task 12, lines 128-134: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 152-158: +task 14, lines 152-158: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 160-166: +task 15, lines 160-166: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 168-174: +task 16, lines 168-174: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u256.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u256.exp index b0d3278ebea2c..cae5c7d7312b6 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u256.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u256.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 17-23: +task 1, lines 17-23: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 25-31: +task 2, lines 25-31: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 48-54: +task 4, lines 48-54: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 56-62: +task 5, lines 56-62: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 79-85: +task 7, lines 79-85: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 112-119: +task 10, lines 112-119: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 121-126: +task 11, lines 121-126: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 128-134: +task 12, lines 128-134: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 152-158: +task 14, lines 152-158: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 160-166: +task 15, lines 160-166: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 168-174: +task 16, lines 168-174: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u32.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u32.exp index 06c8c0358de27..30105f51054fa 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u32.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u32.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 17-23: +task 1, lines 17-23: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 25-31: +task 2, lines 25-31: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 48-54: +task 4, lines 48-54: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 56-62: +task 5, lines 56-62: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 79-85: +task 7, lines 79-85: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 112-119: +task 10, lines 112-119: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 121-126: +task 11, lines 121-126: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 128-134: +task 12, lines 128-134: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 152-158: +task 14, lines 152-158: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 160-166: +task 15, lines 160-166: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 168-174: +task 16, lines 168-174: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u64.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u64.exp index 78f096fa79c4a..28e9297df66d1 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u64.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u64.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 17-23: +task 1, lines 17-23: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 25-31: +task 2, lines 25-31: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 50-56: +task 4, lines 50-56: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 58-64: +task 5, lines 58-64: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 81-87: +task 7, lines 81-87: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 89-95: +task 8, lines 89-95: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 114-121: +task 10, lines 114-121: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 123-128: +task 11, lines 123-128: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 130-136: +task 12, lines 130-136: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 154-160: +task 14, lines 154-160: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 162-168: +task 15, lines 162-168: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 170-176: +task 16, lines 170-176: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u8.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u8.exp index 76beb6d17197d..d38d1229a7e2d 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u8.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/arithmetic_operators_u8.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 17-23: +task 1, lines 17-23: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 25-31: +task 2, lines 25-31: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 48-54: +task 4, lines 48-54: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 56-62: +task 5, lines 56-62: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 79-85: +task 7, lines 79-85: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 87-93: +task 8, lines 87-93: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 111-117: +task 10, lines 111-117: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 119-125: +task 11, lines 119-125: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 127-133: +task 12, lines 127-133: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 152-158: +task 14, lines 152-158: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 160-166: +task 15, lines 160-166: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 168-174: +task 16, lines 168-174: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/casting_operators.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/casting_operators.exp index b7e76c71cbb7f..ddfee69ec3101 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/casting_operators.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/casting_operators.exp @@ -1,6 +1,7 @@ processed 35 tasks -task 6 'run'. lines 182-188: +task 6, lines 182-188: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'run'. lines 190-196: +task 7, lines 190-196: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'run'. lines 198-204: +task 8, lines 198-204: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 9 'run'. lines 206-212: +task 9, lines 206-212: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 10 'run'. lines 214-220: +task 10, lines 214-220: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 11 'run'. lines 222-228: +task 11, lines 222-228: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 12 'run'. lines 230-236: +task 12, lines 230-236: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 13 'run'. lines 238-244: +task 13, lines 238-244: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 14 'run'. lines 246-252: +task 14, lines 246-252: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 15 'run'. lines 254-262: +task 15, lines 254-262: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 16 'run'. lines 263-269: +task 16, lines 263-269: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 17 'run'. lines 271-277: +task 17, lines 271-277: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -108,7 +120,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 18 'run'. lines 279-285: +task 18, lines 279-285: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -117,7 +130,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 19 'run'. lines 287-293: +task 19, lines 287-293: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -126,7 +140,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 20 'run'. lines 295-301: +task 20, lines 295-301: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -135,7 +150,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 21 'run'. lines 303-309: +task 21, lines 303-309: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -144,7 +160,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 22 'run'. lines 311-317: +task 22, lines 311-317: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -153,7 +170,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 23 'run'. lines 319-325: +task 23, lines 319-325: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -162,7 +180,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 24 'run'. lines 327-335: +task 24, lines 327-335: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -171,7 +190,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 25 'run'. lines 336-342: +task 25, lines 336-342: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -180,7 +200,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 27 'run'. lines 352-358: +task 27, lines 352-358: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -189,7 +210,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 28 'run'. lines 360-366: +task 28, lines 360-366: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -198,7 +220,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 29 'run'. lines 368-374: +task 29, lines 368-374: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -207,7 +230,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 30 'run'. lines 376-382: +task 30, lines 376-382: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -216,7 +240,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 31 'run'. lines 384-392: +task 31, lines 384-392: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -225,7 +250,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 32 'run'. lines 393-399: +task 32, lines 393-399: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -234,7 +260,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 33 'run'. lines 401-407: +task 33, lines 401-407: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -243,7 +270,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 34 'run'. lines 409-415: +task 34, lines 409-415: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/shift_operators.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/shift_operators.exp index c9fcd5e770462..9142a02ea9bb7 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/shift_operators.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/operators/shift_operators.exp @@ -1,6 +1,7 @@ processed 16 tasks -task 0 'run'. lines 1-8: +task 0, lines 1-8: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 1 'run'. lines 10-16: +task 1, lines 10-16: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 18-24: +task 2, lines 18-24: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 3 'run'. lines 26-32: +task 3, lines 26-32: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 34-40: +task 4, lines 34-40: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 42-48: +task 5, lines 42-48: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 6 'run'. lines 50-56: +task 6, lines 50-56: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 58-64: +task 7, lines 58-64: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 66-72: +task 8, lines 66-72: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 9 'run'. lines 74-83: +task 9, lines 74-83: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/control_exp_associativity.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/control_exp_associativity.exp index c1f87c04a8c99..b178549d3f5cd 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/control_exp_associativity.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/control_exp_associativity.exp @@ -1,4 +1,5 @@ processed 2 tasks -task 1 'run'. lines 24-24: +task 1, line 24: +//# run 0x42::M::t return values: 42 diff --git a/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/return_not_binary.exp b/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/return_not_binary.exp index 7b8e3b69e2e26..1f60884be2075 100644 --- a/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/return_not_binary.exp +++ b/external-crates/move/crates/move-compiler-transactional-tests/tests/parser/return_not_binary.exp @@ -1,7 +1,9 @@ processed 3 tasks -task 1 'run'. lines 18-18: +task 1, line 18: +//# run 0x42::M::t1 --args 0 return values: 0 -task 2 'run'. lines 20-20: +task 2, line 20: +//# run 0x42::M::t2 --args 0 return values: 0 diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/function.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/function.exp index 3da00d8143d5b..5d7c8a1cf7b51 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/function.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/function.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'print-bytecode'. lines 1-31: +task 0, lines 1-31: +//# print-bytecode // Move bytecode v6 module 3d10.Example { struct Coin { @@ -51,7 +52,8 @@ B0: } } -task 1 'print-bytecode'. lines 33-46: +task 1, lines 33-46: +//# print-bytecode // Move bytecode v6 module 4d10.M { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/let.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/let.exp index e0e945b77e58c..aa7fce81d80be 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/let.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/declarations/let.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'print-bytecode'. lines 1-9: +task 0, lines 1-9: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -15,5 +16,6 @@ B0: } } -task 1 'print-bytecode'. lines 11-20: +task 1, lines 11-20: +//# print-bytecode Error: variable redefinition x diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/binary_add.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/binary_add.exp index cf1ea23753d14..db621b20defd1 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/binary_add.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/binary_add.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'print-bytecode'. lines 1-13: +task 0, lines 1-13: +//# print-bytecode // Move bytecode v6 module e.Expressions { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow.exp index cf5b2fa6429a6..c69235c0fde3c 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow.exp @@ -1,6 +1,7 @@ processed 9 tasks -task 0 'print-bytecode'. lines 1-13: +task 0, lines 1-13: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -22,7 +23,8 @@ B0: } } -task 1 'print-bytecode'. lines 15-28: +task 1, lines 15-28: +//# print-bytecode // Move bytecode v6 module 2.m { @@ -45,7 +47,8 @@ B0: } } -task 2 'print-bytecode'. lines 30-63: +task 2, lines 30-63: +//# print-bytecode // Move bytecode v6 module 1d4.M { struct T { @@ -86,7 +89,8 @@ B0: } } -task 3 'print-bytecode'. lines 65-84: +task 3, lines 65-84: +//# print-bytecode // Move bytecode v6 module 2d4.M { struct T { @@ -117,14 +121,18 @@ B0: } } -task 5 'print-bytecode'. lines 97-112: +task 5, lines 97-112: +//# print-bytecode Error: Unbound struct Self.T -task 6 'print-bytecode'. lines 114-125: +task 6, lines 114-125: +//# print-bytecode Error: Unbound struct Self.T -task 7 'print-bytecode'. lines 127-142: +task 7, lines 127-142: +//# print-bytecode Error: Unbound struct Self.T -task 8 'print-bytecode'. lines 144-154: +task 8, lines 144-154: +//# print-bytecode Error: Unbound module alias M diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow_mut.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow_mut.exp index bc883934a76a0..d0f315319959a 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow_mut.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/borrow_mut.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-12: +task 0, lines 1-12: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -23,7 +24,8 @@ B0: } } -task 1 'print-bytecode'. lines 14-25: +task 1, lines 14-25: +//# print-bytecode // Move bytecode v6 module 3d.Foobar { struct FooCoin { @@ -44,7 +46,8 @@ B0: } } -task 2 'print-bytecode'. lines 27-38: +task 2, lines 27-38: +//# print-bytecode // Move bytecode v6 module 4d.Foobar { struct FooCoin { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/builtins/vector.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/builtins/vector.exp index 054c46169f6eb..1ac319a8abb53 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/builtins/vector.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/builtins/vector.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'print-bytecode'. lines 1-33: +task 0, lines 1-33: +//# print-bytecode // Move bytecode v6 module 1.m { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/combined.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/combined.exp index 5c02c5ed49fb6..a005304454356 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/combined.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/combined.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'print-bytecode'. lines 1-13: +task 0, lines 1-13: +//# print-bytecode // Move bytecode v6 module 1.m { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/pack.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/pack.exp index 94e70515d3a39..9a42c7051e93e 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/pack.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/pack.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-9: +task 0, lines 1-9: +//# print-bytecode // Move bytecode v6 module 2d20.M { struct T { @@ -18,8 +19,10 @@ B0: } } -task 1 'print-bytecode'. lines 11-20: +task 1, lines 11-20: +//# print-bytecode Error: Unbound field x -task 2 'print-bytecode'. lines 22-31: +task 2, lines 22-31: +//# print-bytecode Error: Field y defined out of order for struct T diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/unpack.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/unpack.exp index 0775b4ac1e415..b63abb556bd53 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/unpack.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/expressions/unpack.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-18: +task 0, lines 1-18: +//# print-bytecode // Move bytecode v6 module 1d12.M { struct T { @@ -30,5 +31,6 @@ B0: } } -task 2 'print-bytecode'. lines 31-44: +task 2, lines 31-44: +//# print-bytecode Error: Missing struct definition for T diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assert.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assert.exp index 900e583e465e7..a86934cc2fc84 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assert.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assert.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'print-bytecode'. lines 1-10: +task 0, lines 1-10: +//# print-bytecode // Move bytecode v6 module 1.m { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assign.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assign.exp index d0c64f05b754f..ae9134123dc95 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assign.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/assign.exp @@ -1,4 +1,5 @@ processed 1 task -task 0 'print-bytecode'. lines 1-9: +task 0, lines 1-9: +//# print-bytecode Error: variable x undefined diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/enums.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/enums.exp index 405466b11b0fd..475125466015b 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/enums.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/enums.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'print-bytecode'. lines 1-71: +task 0, lines 1-71: +//# print-bytecode // Move bytecode v7 module 3d8.M { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump.exp index 4211ebb9e60c4..93db6005b0807 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-8: +task 0, lines 1-8: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -14,7 +15,8 @@ B0: } } -task 1 'print-bytecode'. lines 10-19: +task 1, lines 10-19: +//# print-bytecode // Move bytecode v6 module 2.m { @@ -30,5 +32,6 @@ B1: } } -task 2 'print-bytecode'. lines 21-32: +task 2, lines 21-32: +//# print-bytecode Error: Invalid block labels, labels were used without being declared (bar) diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if.exp index 7f285c05a9e12..fc7789076eb48 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'print-bytecode'. lines 1-24: +task 0, lines 1-24: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -30,7 +31,8 @@ B4: } } -task 1 'print-bytecode'. lines 26-45: +task 1, lines 26-45: +//# print-bytecode // Move bytecode v6 module 2.m { @@ -57,7 +59,8 @@ B3: } } -task 2 'print-bytecode'. lines 47-65: +task 2, lines 47-65: +//# print-bytecode // Move bytecode v6 module 3.m { @@ -93,7 +96,8 @@ B5: } } -task 3 'print-bytecode'. lines 67-82: +task 3, lines 67-82: +//# print-bytecode // Move bytecode v6 module 4.m { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if_false.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if_false.exp index f842c279967b7..427c1c557b28b 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if_false.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/statements/jump_if_false.exp @@ -1,6 +1,7 @@ processed 4 tasks -task 0 'print-bytecode'. lines 1-20: +task 0, lines 1-20: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -29,7 +30,8 @@ B3: } } -task 1 'print-bytecode'. lines 22-36: +task 1, lines 22-36: +//# print-bytecode // Move bytecode v6 module 2.m { @@ -54,7 +56,8 @@ B4: } } -task 2 'print-bytecode'. lines 38-48: +task 2, lines 38-48: +//# print-bytecode // Move bytecode v6 module 3.m { @@ -73,7 +76,8 @@ B2: } } -task 3 'print-bytecode'. lines 50-63: +task 3, lines 50-63: +//# print-bytecode // Move bytecode v6 module 4.m { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/types/struct.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/types/struct.exp index 9b676c8f15138..d2b6e845a3fac 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/types/struct.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/bytecode-generation/types/struct.exp @@ -1,4 +1,5 @@ processed 1 task -task 0 'print-bytecode'. lines 1-8: +task 0, lines 1-8: +//# print-bytecode Error: Unbound struct Self.M diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/comments.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/comments.exp index af6632ccece65..659464597357b 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/comments.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/comments.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'print-bytecode'. lines 1-8: +task 0, lines 1-8: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -14,7 +15,8 @@ B0: } } -task 1 'print-bytecode'. lines 10-18: +task 1, lines 10-18: +//# print-bytecode // Move bytecode v6 module 2.m { @@ -28,7 +30,8 @@ B0: } } -task 2 'print-bytecode'. lines 20-26: +task 2, lines 20-26: +//# print-bytecode // Move bytecode v6 module 3.m { @@ -42,7 +45,8 @@ B0: } } -task 3 'print-bytecode'. lines 28-35: +task 3, lines 28-35: +//# print-bytecode // Move bytecode v6 module 4.m { @@ -56,10 +60,12 @@ B0: } } -task 4 'print-bytecode'. lines 37-46: +task 4, lines 37-46: +//# print-bytecode Error: ParserError: Invalid Token: invalid token kind for statement Slash -task 5 'print-bytecode'. lines 48-58: +task 5, lines 48-58: +//# print-bytecode // Move bytecode v6 module 6.m { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/crlf.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/crlf.exp index af6632ccece65..659464597357b 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/crlf.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/crlf.exp @@ -1,6 +1,7 @@ processed 6 tasks -task 0 'print-bytecode'. lines 1-8: +task 0, lines 1-8: +//# print-bytecode // Move bytecode v6 module 1.m { @@ -14,7 +15,8 @@ B0: } } -task 1 'print-bytecode'. lines 10-18: +task 1, lines 10-18: +//# print-bytecode // Move bytecode v6 module 2.m { @@ -28,7 +30,8 @@ B0: } } -task 2 'print-bytecode'. lines 20-26: +task 2, lines 20-26: +//# print-bytecode // Move bytecode v6 module 3.m { @@ -42,7 +45,8 @@ B0: } } -task 3 'print-bytecode'. lines 28-35: +task 3, lines 28-35: +//# print-bytecode // Move bytecode v6 module 4.m { @@ -56,10 +60,12 @@ B0: } } -task 4 'print-bytecode'. lines 37-46: +task 4, lines 37-46: +//# print-bytecode Error: ParserError: Invalid Token: invalid token kind for statement Slash -task 5 'print-bytecode'. lines 48-58: +task 5, lines 48-58: +//# print-bytecode // Move bytecode v6 module 6.m { diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/enums.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/enums.exp index 356f8e6040c3b..aa30c0635ad04 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/enums.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/enums.exp @@ -1,4 +1,5 @@ processed 1 task -task 0 'print-bytecode'. lines 1-6: +task 0, lines 1-6: +//# print-bytecode Error: ParserError: Invalid Token: expected Tok::NameValue diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/keywords.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/keywords.exp index 97fa00b8818e7..4fe796ad57a52 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/keywords.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/keywords.exp @@ -1,4 +1,5 @@ processed 1 task -task 0 'print-bytecode'. lines 1-8: +task 0, lines 1-8: +//# print-bytecode Error: ParserError: Invalid Token: expected Tok::NameValue diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/named_addresses.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/named_addresses.exp index 00c6572ee8643..37cce18bb1bae 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/named_addresses.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/named_addresses.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 2 'print-bytecode'. lines 16-36: +task 2, lines 16-36: +//# print-bytecode // Move bytecode v6 module 1.M { use 0000000000000000000000000000000000000000000000000000000000000001::T; diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/structs.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/structs.exp index 4702e5335b91d..11bab2703ca99 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/structs.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/structs.exp @@ -1,4 +1,5 @@ processed 1 task -task 0 'print-bytecode'. lines 1-13: +task 0, lines 1-13: +//# print-bytecode Error: ParserError: Invalid Token: expected Colon, not LParen diff --git a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/types.exp b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/types.exp index 359ce3c8d5eab..dd7eb5f590abf 100644 --- a/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/types.exp +++ b/external-crates/move/crates/move-ir-compiler-transactional-tests/tests/parsing/types.exp @@ -1,7 +1,9 @@ processed 2 tasks -task 0 'print-bytecode'. lines 1-8: +task 0, lines 1-8: +//# print-bytecode Error: ParserError: Invalid Token: expected Tok::NameValue -task 1 'print-bytecode'. lines 10-17: +task 1, lines 10-17: +//# print-bytecode Error: ParserError: Invalid Token: expected Tok::NameValue diff --git a/external-crates/move/crates/move-transactional-test-runner/src/framework.rs b/external-crates/move/crates/move-transactional-test-runner/src/framework.rs index 93d97b02b2361..54f935d88d65c 100644 --- a/external-crates/move/crates/move-transactional-test-runner/src/framework.rs +++ b/external-crates/move/crates/move-transactional-test-runner/src/framework.rs @@ -146,6 +146,21 @@ pub trait MoveTestAdapter<'a>: Sized + Send { subcommand: TaskInput, ) -> Result>; + fn render_command_input( + &self, + _task: &TaskInput< + TaskCommand< + Self::ExtraInitArgs, + Self::ExtraPublishArgs, + Self::ExtraValueArgs, + Self::ExtraRunArgs, + Self::Subcommand, + >, + >, + ) -> Option { + None + } + async fn process_error(&self, error: anyhow::Error) -> anyhow::Error; async fn handle_command( @@ -171,6 +186,7 @@ pub trait MoveTestAdapter<'a>: Sized + Send { command_lines_stop, stop_line, data, + task_text, } = task; match command { TaskCommand::Init { .. } => { @@ -257,7 +273,10 @@ pub trait MoveTestAdapter<'a>: Sized + Send { ) .await?; let (module_id, name) = single_entry_function(&modules).unwrap_or_else(|err| { - panic!("{} on lines {}-{}", err, start_line, command_lines_stop) + panic!( + "{} on lines {}-{} for task\n{}", + err, start_line, command_lines_stop, task_text + ) }); let output = merge_output(warnings_opt, output); store_modules(self, syntax, data, modules); @@ -320,6 +339,7 @@ pub trait MoveTestAdapter<'a>: Sized + Send { command_lines_stop, stop_line, data, + task_text, }) .await } @@ -782,9 +802,11 @@ async fn handle_known_task<'a, Adapter: MoveTestAdapter<'a>>( >, ) { let task_number = task.number; - let task_name = task.name.to_owned(); let start_line = task.start_line; let stop_line = task.stop_line; + let task_text = adapter + .render_command_input(&task) + .unwrap_or_else(|| task.task_text.clone()); let result = adapter.handle_command(task).await; let result_string = match result { Ok(None) => return, @@ -793,10 +815,15 @@ async fn handle_known_task<'a, Adapter: MoveTestAdapter<'a>>( }; assert!(!result_string.is_empty()); + let line_number = if start_line == stop_line { + format!("line {}", start_line) + } else { + format!("lines {}-{}", start_line, stop_line) + }; + writeln!( output, - "\ntask {} '{}'. lines {}-{}:\n{}", - task_number, task_name, start_line, stop_line, result_string + "\ntask {task_number}, {line_number}:\n{task_text}\n{result_string}" ) .unwrap(); } diff --git a/external-crates/move/crates/move-transactional-test-runner/src/tasks.rs b/external-crates/move/crates/move-transactional-test-runner/src/tasks.rs index dcedbd51aec38..c1e62c544f60b 100644 --- a/external-crates/move/crates/move-transactional-test-runner/src/tasks.rs +++ b/external-crates/move/crates/move-transactional-test-runner/src/tasks.rs @@ -26,6 +26,7 @@ pub struct TaskInput { pub command_lines_stop: usize, pub stop_line: usize, pub data: Option, + pub task_text: String, } pub fn taskify(filename: &Path) -> Result>> { @@ -98,20 +99,19 @@ pub fn taskify(filename: &Path) -> Result>(); + let mut command_split = command_text.split_ascii_whitespace().collect::>(); + command_split.insert(0, "task"); let name_opt = command_split.get(1).map(|s| (*s).to_owned()); let command = match Command::try_parse_from(command_split) { Ok(command) => command, Err(e) => { - let mut spit_iter = command_text.split_ascii_whitespace(); - // skip 'task' - spit_iter.next(); - let help_command = match spit_iter.next() { + let mut split_iter = command_text.split_ascii_whitespace(); + let help_command = match split_iter.next() { None => vec!["task", "--help"], Some(c) => vec!["task", c, "--help"], }; @@ -158,6 +158,8 @@ pub fn taskify(filename: &Path) -> Result(filename: &Path) -> Result TaskInput { command_lines_stop, stop_line, data, + task_text, } = self; TaskInput { command: f(command), @@ -190,6 +194,7 @@ impl TaskInput { command_lines_stop, stop_line, data, + task_text, } } } diff --git a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/example.exp b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/example.exp index 6902197c9a2f0..efafd474446d0 100644 --- a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/example.exp +++ b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/example.exp @@ -1,6 +1,7 @@ processed 8 tasks -task 3 'run'. lines 29-29: +task 3, line 29: +//# run --signers 0x1 --args 0 -- 0x42::N::ex Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(0), @@ -9,8 +10,10 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(2), 1)], } -task 6 'run'. lines 53-53: +task 6, line 53: +//# run 0x42::N::make --args 42 return values: { 42 } -task 7 'run'. lines 55-55: +task 7, line 55: +//# run 0x42::N::take --args struct(42) return values: 42 diff --git a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/multiple_modules.exp b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/multiple_modules.exp index 88c8dce96c0d7..b33499d3fd113 100644 --- a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/multiple_modules.exp +++ b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/multiple_modules.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 2 'publish'. lines 16-21: +task 2, lines 16-21: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000044::m'. Got VMError: { major_status: MODULE_ADDRESS_DOES_NOT_MATCH_SENDER, sub_status: None, diff --git a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/named_addresses_in_commands.exp b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/named_addresses_in_commands.exp index 021f180679363..7cdb1a383ce4f 100644 --- a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/named_addresses_in_commands.exp +++ b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/named_addresses_in_commands.exp @@ -1,4 +1,5 @@ processed 4 tasks -task 3 'run'. lines 21-21: +task 3, line 21: +//# run 42::M::test return values: { 42 } diff --git a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/print_bytecode.exp b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/print_bytecode.exp index d8069ac15f85e..ffe8b4bf2392a 100644 --- a/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/print_bytecode.exp +++ b/external-crates/move/crates/move-transactional-test-runner/tests/vm_test_harness/print_bytecode.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'print-bytecode'. lines 1-7: +task 0, lines 1-7: +//# print-bytecode --syntax=mvir // Move bytecode v6 module 42.M { @@ -14,7 +15,8 @@ B0: } } -task 1 'print-bytecode'. lines 9-13: +task 1, lines 9-13: +//# print-bytecode // Move bytecode v6 module 42.M { diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_out_of_bound.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_out_of_bound.exp index f17c63f994fa2..7762627f9d1c1 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_out_of_bound.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_out_of_bound.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'run'. lines 1-14: +task 0, lines 1-14: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(1), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 7)], } -task 1 'run'. lines 15-28: +task 1, lines 15-28: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(1), @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 7)], } -task 2 'run'. lines 29-41: +task 2, lines 29-41: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(1), diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_pop_empty.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_pop_empty.exp index 667d21272d3d0..c8d9fff04e741 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_pop_empty.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_pop_empty.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(2), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 3)], } -task 1 'run'. lines 14-27: +task 1, lines 14-27: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(2), diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_less.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_less.exp index 821e03cc71eb7..d3a05993394d4 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_less.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_less.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(3), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 4)], } -task 1 'run'. lines 14-26: +task 1, lines 14-26: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(3), @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 5)], } -task 2 'run'. lines 27-40: +task 2, lines 27-40: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(3), diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_more.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_more.exp index 07dcd8f3488d9..0e73733403bb2 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_more.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/vector_ops_unpack_more.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'run'. lines 1-13: +task 0, lines 1-13: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(3), @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 3)], } -task 1 'run'. lines 14-26: +task 1, lines 14-26: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(3), @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 4)], } -task 2 'run'. lines 27-40: +task 2, lines 27-40: +//# run Error: Function execution failed with VMError: { major_status: VECTOR_OPERATION_ERROR, sub_status: Some(3), diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/commands/abort_in_module.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/commands/abort_in_module.exp index 72f0c3345b7ed..2fdf39797a6e2 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/commands/abort_in_module.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/commands/abort_in_module.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 10-20: +task 1, lines 10-20: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(22), diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/control_flow/fields_packed_in_order.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/control_flow/fields_packed_in_order.exp index af98881800134..b404d5e02081d 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/control_flow/fields_packed_in_order.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/control_flow/fields_packed_in_order.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 19-28: +task 1, lines 19-28: +//# run Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(42), diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp index 3282ed6352881..7dc107f50aff1 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp @@ -1,10 +1,13 @@ processed 3 tasks -task 0 'run'. lines 2-2: +task 0, line 2: +//# run std::bcs::to_bytes --type-args u256 --args 0u256 return values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] -task 1 'run'. lines 4-4: +task 1, line 4: +//# run std::signer::borrow_address --args @3735928559 return values: 00000000000000000000000000000000000000000000000000000000deadbeef -task 2 'run'. lines 6-6: +task 2, line 6: +//# run std::type_name::get --type-args vector return values: { { [118, 101, 99, 116, 111, 114, 60, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 58, 58, 116, 121, 112, 101, 95, 110, 97, 109, 101, 58, 58, 84, 121, 112, 101, 78, 97, 109, 101, 62] } } diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_args_got_1.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_args_got_1.exp index 830e7165ad4dc..07de81564f4d6 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_args_got_1.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_args_got_1.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-6: +task 0, lines 1-6: +//# run --args 0 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_signer_args_got_1_ok.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_signer_args_got_1_ok.exp index e9104138cb5e3..c56a90b674813 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_signer_args_got_1_ok.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_0_signer_args_got_1_ok.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5: +task 0, lines 1-5: +//# run --signers 0x1 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_0.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_0.exp index 830e7165ad4dc..c35dde700ad01 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_0.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_0.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-6: +task 0, lines 1-6: +//# run Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_2.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_2.exp index e9104138cb5e3..a5ea0a4825c24 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_2.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_1_arg_got_2.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5: +task 0, lines 1-5: +//# run --args 1 2 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_args_got_3.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_args_got_3.exp index e9104138cb5e3..121cadfd9c7fc 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_args_got_3.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_args_got_3.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5: +task 0, lines 1-5: +//# run --args 42 0x1 42 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_signer_args_got_1.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_signer_args_got_1.exp index 830e7165ad4dc..ef0d0bc2699b1 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_signer_args_got_1.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_2_signer_args_got_1.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-6: +task 0, lines 1-6: +//# run --signers 0x1 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr.exp index e9104138cb5e3..36deb24ae1440 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5: +task 0, lines 1-5: +//# run --args 0x1 Error: Function execution failed with VMError: { major_status: NUMBER_OF_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr_u64.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr_u64.exp index 11bbbea0ab696..1e33d56b614cc 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr_u64.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_addr_u64.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5: +task 0, lines 1-5: +//# run --args 0x1 42 Error: Function execution failed with VMError: { major_status: FAILED_TO_DESERIALIZE_ARGUMENT, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_u64_u64.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_u64_u64.exp index 11bbbea0ab696..94df0b96f84e1 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_u64_u64.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_addr_got_u64_u64.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5: +task 0, lines 1-5: +//# run --args 42 42 Error: Function execution failed with VMError: { major_status: FAILED_TO_DESERIALIZE_ARGUMENT, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_got_address.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_got_address.exp index 11bbbea0ab696..d476806ee666c 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_got_address.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/expected_u64_got_address.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-5: +task 0, lines 1-5: +//# run --args @0x1 Error: Function execution failed with VMError: { major_status: FAILED_TO_DESERIALIZE_ARGUMENT, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/generic_return_values.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/generic_return_values.exp index 5045f170009ae..8e6f56c16fee8 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/generic_return_values.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/generic_return_values.exp @@ -1,49 +1,65 @@ processed 17 tasks -task 1 'run'. lines 25-25: +task 1, line 25: +//# run 0x42::Test::t1 --type-args u64 --args 0 return values: 0 -task 2 'run'. lines 27-27: +task 2, line 27: +//# run 0x42::Test::t1 --type-args u8 --args 0u8 return values: 0 -task 3 'run'. lines 29-29: +task 3, line 29: +//# run 0x42::Test::t1 --type-args vector --args b"wat" return values: [119, 97, 116] -task 4 'run'. lines 31-31: +task 4, line 31: +//# run 0x42::Test::t1 --type-args 0x42::Test::Cup --args 0 return values: { 0 } -task 5 'run'. lines 35-35: +task 5, line 35: +//# run 0x42::Test::t2 --type-args u64 --args 0 return values: [0] -task 6 'run'. lines 37-37: +task 6, line 37: +//# run 0x42::Test::t2 --type-args u8 --args 0u8 return values: [0] -task 7 'run'. lines 39-39: +task 7, line 39: +//# run 0x42::Test::t2 --type-args vector --args b"wat" return values: [[119, 97, 116]] -task 8 'run'. lines 41-41: +task 8, line 41: +//# run 0x42::Test::t2 --type-args 0x42::Test::Cup --args 0 return values: [{ 0 }] -task 9 'run'. lines 45-45: +task 9, line 45: +//# run 0x42::Test::t3 --type-args u64 --args 0 return values: { 0 } -task 10 'run'. lines 47-47: +task 10, line 47: +//# run 0x42::Test::t3 --type-args u8 --args 0u8 return values: { 0 } -task 11 'run'. lines 49-49: +task 11, line 49: +//# run 0x42::Test::t3 --type-args vector --args b"wat" return values: { [119, 97, 116] } -task 12 'run'. lines 51-51: +task 12, line 51: +//# run 0x42::Test::t3 --type-args 0x42::Test::Cup --args 0 return values: { { 0 } } -task 13 'run'. lines 55-55: +task 13, line 55: +//# run 0x42::Test::t4 --type-args u64 u8 --args 0 0u8 return values: 0, 0 -task 14 'run'. lines 57-57: +task 14, line 57: +//# run 0x42::Test::t4 --type-args u8 bool --args 0u8 false return values: false, 0 -task 15 'run'. lines 59-59: +task 15, line 59: +//# run 0x42::Test::t4 --type-args vector 0x42::Test::Cup --args b"wat" 0 return values: { 0 }, [119, 97, 116] -task 16 'run'. lines 61-61: +task 16, line 61: +//# run 0x42::Test::t4 --type-args 0x42::Test::Cup address --args 0 @0x42 return values: 0000000000000000000000000000000000000000000000000000000000000042, { 0 } diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/modify_mutable_ref_inputs.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/modify_mutable_ref_inputs.exp index 2731635443a27..00fd0288805ae 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/modify_mutable_ref_inputs.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/modify_mutable_ref_inputs.exp @@ -1,7 +1,9 @@ processed 3 tasks -task 1 'run'. lines 28-42: +task 1, lines 28-42: +//# run --args 0 1 b"xyz" mutable inputs after call: local#0: 112, local#1: { 224 }, local#2: [120, 0, 122] -task 2 'run'. lines 44-44: +task 2, line 44: +//# run 0x42::M::t --args 0 1 b"xyz" mutable inputs after call: local#0: 112, local#1: { 224 }, local#2: [120, 0, 122] diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/ref_inputs.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/ref_inputs.exp index bf0c49a61c9fb..f8fe9c2f99477 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/ref_inputs.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/ref_inputs.exp @@ -1,19 +1,25 @@ processed 9 tasks -task 2 'run'. lines 38-46: +task 2, lines 38-46: +//# run --args false mutable inputs after call: local#0: false -task 3 'run'. lines 47-54: +task 3, lines 47-54: +//# run --args 0 false 0 0 mutable inputs after call: local#1: false, local#3: { 0 } -task 4 'run'. lines 56-64: +task 4, lines 56-64: +//# run --type-args u64 bool 0x42::M::S 0x42::M::S --args 0 false 0 0 mutable inputs after call: local#1: false, local#3: { 0 } -task 6 'run'. lines 67-67: +task 6, line 67: +//# run 0x42::M::t2 --args false mutable inputs after call: local#0: false -task 7 'run'. lines 69-69: +task 7, line 69: +//# run 0x42::M::t3 --args 0 false 0 0 mutable inputs after call: local#1: false, local#3: { 0 } -task 8 'run'. lines 71-71: +task 8, line 71: +//# run 0x42::M::tgen --type-args u64 bool 0x42::M::S 0x42::M::S --args 0 false 0 0 mutable inputs after call: local#1: false, local#3: { 0 } diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/return_values.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/return_values.exp index 13f10dcbdf982..813890f0ade3a 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/return_values.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/return_values.exp @@ -1,5 +1,6 @@ processed 2 tasks -task 1 'run'. lines 20-20: +task 1, line 20: +//# run 0x42::M::t --args 0 @0x1 2 3 4 mutable inputs after call: local#4: { 4 } return values: 0, { 0000000000000000000000000000000000000000000000000000000000000001 }, { 2 }, { 3 }, 3, 4 diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args.exp index 0a45918768ed3..ea98567245cc5 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-9: +task 0, lines 1-9: +//# run Error: Function execution failed with VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args_inner.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args_inner.exp index 2a4a7fe32bb0f..dd7e266900f13 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args_inner.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_few_type_args_inner.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 6-14: +task 1, lines 6-14: +//# run --type-args 0x1::M::Ex Error: Function execution failed with VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args.exp index 0a45918768ed3..477adab28b25a 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-9: +task 0, lines 1-9: +//# run --type-args u64 Error: Function execution failed with VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args_inner.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args_inner.exp index 2a4a7fe32bb0f..5984802c3ed5b 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args_inner.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_too_many_type_args_inner.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 6-14: +task 1, lines 6-14: +//# run --type-args 0x1::M::Ex Error: Function execution failed with VMError: { major_status: NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_1.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_1.exp index be24328973c68..ffe63af74549c 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_1.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_1.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 20-28: +task 1, lines 20-28: +//# run --type-args 0x1::Coin::Coin Error: Function execution failed with VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_2.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_2.exp index aa09ee4fdb2a0..5a779a81427a5 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_2.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/script_type_arg_kind_mismatch_2.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'run'. lines 1-9: +task 0, lines 1-9: +//# run --type-args bool Error: Function execution failed with VMError: { major_status: CONSTRAINT_NOT_SATISFIED, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/serializer_deserializer.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/serializer_deserializer.exp index 1aaafb5309d92..42ee1c1d2e9bd 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/serializer_deserializer.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/serializer_deserializer.exp @@ -1,4 +1,5 @@ processed 3 tasks -task 1 'run'. lines 37-37: +task 1, line 37: +//# run 0x42::t::new return values: { 128, 32768, 2147483648, 9223372036854775808, 170141183460469231731687303715884105728, 57896044618658097711785492504343953926634992332820282019728792003956564819968 } diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/struct_arguments.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/struct_arguments.exp index 15206c2bc7a54..c4f788e354d42 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/struct_arguments.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/struct_arguments.exp @@ -1,13 +1,17 @@ processed 5 tasks -task 1 'run'. lines 19-26: +task 1, lines 19-26: +//# run --args 0 0 0 mutable inputs after call: local#2: { 0 } -task 2 'run'. lines 28-34: +task 2, lines 28-34: +//# run --type-args 0x42::M::S --args 0 0 0 mutable inputs after call: local#2: { 0 } -task 3 'run'. lines 36-36: +task 3, line 36: +//# run 0x42::M::foo --args 0 0 0 mutable inputs after call: local#2: { 0 } -task 4 'run'. lines 38-38: +task 4, line 38: +//# run 0x42::M::foo_gen --type-args 0x42::M::S --args 0 0 0 mutable inputs after call: local#2: { 0 } diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/basic_poly_enum_type_mismatch.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/basic_poly_enum_type_mismatch.exp index cc10f958ac8b6..efd9aedd8abdb 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/basic_poly_enum_type_mismatch.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/basic_poly_enum_type_mismatch.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'print-bytecode'. lines 1-24: +task 0, lines 1-24: +//# print-bytecode // Move bytecode v7 module 1.MonomorphicEnums { @@ -36,7 +37,8 @@ Jump tables: } } -task 1 'publish'. lines 26-49: +task 1, lines 26-49: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::MonomorphicEnums'. Got VMError: { major_status: PACK_TYPE_MISMATCH_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_jump_same_label.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_jump_same_label.exp index e4d56a66fe3f8..1130075ce5566 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_jump_same_label.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_jump_same_label.exp @@ -1,6 +1,7 @@ processed 5 tasks -task 0 'print-bytecode'. lines 1-43: +task 0, lines 1-43: +//# print-bytecode // Move bytecode v7 module 1.Enums { @@ -60,7 +61,8 @@ Jump tables: } } -task 3 'run'. lines 101-101: +task 3, line 101: +//# run 0x1::Enums::call_fail_1 --type-args u64 Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -69,7 +71,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(3), 3)], } -task 4 'run'. lines 103-103: +task 4, line 103: +//# run 0x1::Enums::call_fail_3 --type-args u64 Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_mismatch.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_mismatch.exp index 3e4fbcbdf6bc1..5da6e6f7992c6 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_mismatch.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_mismatch.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-24: +task 0, lines 1-24: +//# print-bytecode // Move bytecode v7 module 1.MonomorphicEnums { @@ -36,7 +37,8 @@ Jump tables: } } -task 2 'run'. lines 51-61: +task 2, lines 51-61: +//# run Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_tag_unpack_invalid.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_tag_unpack_invalid.exp index 2e7faf4b8af90..711880ea71291 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_tag_unpack_invalid.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/enum_variant_tag_unpack_invalid.exp @@ -1,6 +1,7 @@ processed 14 tasks -task 2 'run'. lines 222-222: +task 2, line 222: +//# run 0x1::Enums::poly_invalid1_mut_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(4), 1)], } -task 3 'run'. lines 224-224: +task 3, line 224: +//# run 0x1::Enums::poly_invalid1_imm_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(5), 1)], } -task 4 'run'. lines 226-226: +task 4, line 226: +//# run 0x1::Enums::poly_invalid1 Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(3), 1)], } -task 5 'run'. lines 228-228: +task 5, line 228: +//# run 0x1::Enums::poly_invalid2_mut_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(1), 1)], } -task 6 'run'. lines 230-230: +task 6, line 230: +//# run 0x1::Enums::poly_invalid2_imm_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(2), 1)], } -task 7 'run'. lines 232-232: +task 7, line 232: +//# run 0x1::Enums::poly_invalid2 Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'run'. lines 234-234: +task 8, line 234: +//# run 0x1::Enums::mono_invalid1_mut_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(10), 1)], } -task 9 'run'. lines 236-236: +task 9, line 236: +//# run 0x1::Enums::mono_invalid1_imm_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(11), 1)], } -task 10 'run'. lines 238-238: +task 10, line 238: +//# run 0x1::Enums::mono_invalid1 Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(9), 1)], } -task 11 'run'. lines 240-240: +task 11, line 240: +//# run 0x1::Enums::mono_invalid2_mut_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(7), 1)], } -task 12 'run'. lines 242-242: +task 12, line 242: +//# run 0x1::Enums::mono_invalid2_imm_ref Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(8), 1)], } -task 13 'run'. lines 244-244: +task 13, line 244: +//# run 0x1::Enums::mono_invalid2 Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic.exp index 2b4b3651507e4..a5d7e0983a397 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-33: +task 0, lines 1-33: +//# print-bytecode // Move bytecode v7 module 1.MonomorphicEnums { diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_fail_unpack.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_fail_unpack.exp index 0e7dfb62bba36..a81fde32caf57 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_fail_unpack.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_fail_unpack.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 0 'publish'. lines 1-23: +task 0, lines 1-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::MonomorphicEnums'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, @@ -9,5 +10,6 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 6)], } -task 1 'run'. lines 25-35: +task 1, lines 25-35: +//# run Error: Dependency not provided for 0000000000000000000000000000000000000000000000000000000000000001.MonomorphicEnums diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_mismatched_variants.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_mismatched_variants.exp index fbc8e985e9529..424c48fe43006 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_mismatched_variants.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/enum_decl_monomorphic_mismatched_variants.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 26-36: +task 1, lines 26-36: +//# run Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update.exp index be79c1e654eac..88a0cd62b78c0 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 3-50: +task 0, lines 3-50: +//# print-bytecode // Move bytecode v7 module 1.MonomorphicEnums { diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update_variant.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update_variant.exp index b04087db38e8a..7350d286796e6 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update_variant.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/mono/mut_ref_update_variant.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 3-34: +task 0, lines 3-34: +//# print-bytecode // Move bytecode v7 module 1.MonomorphicEnums { diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/basic_poly_enum.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/basic_poly_enum.exp index 2b5c1f0e3cc28..a8432bc48ba64 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/basic_poly_enum.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/basic_poly_enum.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-24: +task 0, lines 1-24: +//# print-bytecode // Move bytecode v7 module 1.MonomorphicEnums { diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/enum_decl_poly_mismatched_variants.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/enum_decl_poly_mismatched_variants.exp index 2827b253d77b3..dff9569efa68e 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/enum_decl_poly_mismatched_variants.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/enum_decl_poly_mismatched_variants.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 26-36: +task 1, lines 26-36: +//# run Error: Function execution failed with VMError: { major_status: VARIANT_TAG_MISMATCH, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update.exp index 89918a879ac74..1609996dfc501 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 3-50: +task 0, lines 3-50: +//# print-bytecode // Move bytecode v7 module 1.PolymorphicEnums { diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update_variant.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update_variant.exp index 0b2ed965525f5..973254dceca2c 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update_variant.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/poly/poly_mut_ref_update_variant.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 3-34: +task 0, lines 3-34: +//# print-bytecode // Move bytecode v7 module 1.PolymorphicEnums { diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/variant_switch_loop.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/variant_switch_loop.exp index 359b92e19c5e1..fb83a96e61d7c 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/enums/variant_switch_loop.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/enums/variant_switch_loop.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'print-bytecode'. lines 1-22: +task 0, lines 1-22: +//# print-bytecode // Move bytecode v7 module 1.InfiniteSwith { @@ -31,7 +32,8 @@ B0: } } -task 2 'run'. lines 48-58: +task 2, lines 48-58: +//# run --gas-budget 10000 Error: Function execution failed with VMError: { major_status: OUT_OF_GAS, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u128.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u128.exp index 26bdcb9a25759..836503a7365a7 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u128.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u128.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 20-29: +task 1, lines 20-29: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 30-39: +task 2, lines 30-39: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 60-69: +task 4, lines 60-69: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 70-79: +task 5, lines 70-79: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 99-108: +task 7, lines 99-108: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 109-118: +task 8, lines 109-118: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 139-148: +task 10, lines 139-148: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 149-158: +task 11, lines 149-158: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 161-170: +task 12, lines 161-170: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 190-199: +task 14, lines 190-199: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 200-209: +task 15, lines 200-209: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 210-219: +task 16, lines 210-219: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u16.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u16.exp index c82d903d44e3c..8845a3099df53 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u16.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u16.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 20-29: +task 1, lines 20-29: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 30-39: +task 2, lines 30-39: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 60-69: +task 4, lines 60-69: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 70-79: +task 5, lines 70-79: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 98-107: +task 7, lines 98-107: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 108-117: +task 8, lines 108-117: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 138-147: +task 10, lines 138-147: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 148-157: +task 11, lines 148-157: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 158-167: +task 12, lines 158-167: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 187-196: +task 14, lines 187-196: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 197-206: +task 15, lines 197-206: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 207-216: +task 16, lines 207-216: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u256.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u256.exp index 26bdcb9a25759..836503a7365a7 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u256.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u256.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 20-29: +task 1, lines 20-29: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 30-39: +task 2, lines 30-39: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 60-69: +task 4, lines 60-69: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 70-79: +task 5, lines 70-79: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 99-108: +task 7, lines 99-108: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 109-118: +task 8, lines 109-118: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 139-148: +task 10, lines 139-148: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 149-158: +task 11, lines 149-158: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 161-170: +task 12, lines 161-170: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 190-199: +task 14, lines 190-199: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 200-209: +task 15, lines 200-209: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 210-219: +task 16, lines 210-219: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u32.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u32.exp index c82d903d44e3c..8845a3099df53 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u32.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u32.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 20-29: +task 1, lines 20-29: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 30-39: +task 2, lines 30-39: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 60-69: +task 4, lines 60-69: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 70-79: +task 5, lines 70-79: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 98-107: +task 7, lines 98-107: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 108-117: +task 8, lines 108-117: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 138-147: +task 10, lines 138-147: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 148-157: +task 11, lines 148-157: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 158-167: +task 12, lines 158-167: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 187-196: +task 14, lines 187-196: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 197-206: +task 15, lines 197-206: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 207-216: +task 16, lines 207-216: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u64.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u64.exp index c82d903d44e3c..8845a3099df53 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u64.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u64.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 20-29: +task 1, lines 20-29: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 30-39: +task 2, lines 30-39: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 60-69: +task 4, lines 60-69: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 70-79: +task 5, lines 70-79: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 98-107: +task 7, lines 98-107: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 108-117: +task 8, lines 108-117: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 138-147: +task 10, lines 138-147: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 148-157: +task 11, lines 148-157: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 158-167: +task 12, lines 158-167: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 187-196: +task 14, lines 187-196: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 197-206: +task 15, lines 197-206: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 207-216: +task 16, lines 207-216: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u8.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u8.exp index a6416112baf7b..c54c3461396c9 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u8.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/arithmetic_operators_u8.exp @@ -1,6 +1,7 @@ processed 17 tasks -task 1 'run'. lines 20-29: +task 1, lines 20-29: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 30-39: +task 2, lines 30-39: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 60-69: +task 4, lines 60-69: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 70-79: +task 5, lines 70-79: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 98-107: +task 7, lines 98-107: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 108-117: +task 8, lines 108-117: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 10 'run'. lines 138-147: +task 10, lines 138-147: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 11 'run'. lines 148-157: +task 11, lines 148-157: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 12 'run'. lines 158-167: +task 12, lines 158-167: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 14 'run'. lines 188-197: +task 14, lines 188-197: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 15 'run'. lines 198-207: +task 15, lines 198-207: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 16 'run'. lines 208-217: +task 16, lines 208-217: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/assign_struct_field.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/assign_struct_field.exp index 269996037403c..1dd4bd705ba93 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/assign_struct_field.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/assign_struct_field.exp @@ -1,6 +1,7 @@ processed 2 tasks -task 1 'run'. lines 27-49: +task 1, lines 27-49: +//# run Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: CALL_BORROWED_MUTABLE_REFERENCE_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/casting_operators.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/casting_operators.exp index d7b0de319ae16..1dff1e7d8229a 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/casting_operators.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/casting_operators.exp @@ -1,6 +1,7 @@ processed 38 tasks -task 6 'run'. lines 193-202: +task 6, lines 193-202: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 7 'run'. lines 204-213: +task 7, lines 204-213: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 8 'run'. lines 215-224: +task 8, lines 215-224: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 9 'run'. lines 226-235: +task 9, lines 226-235: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 10 'run'. lines 237-246: +task 10, lines 237-246: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 11 'run'. lines 248-257: +task 11, lines 248-257: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 12 'run'. lines 259-268: +task 12, lines 259-268: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 13 'run'. lines 270-279: +task 13, lines 270-279: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 14 'run'. lines 281-290: +task 14, lines 281-290: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 15 'run'. lines 292-301: +task 15, lines 292-301: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -90,7 +100,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 16 'run'. lines 303-312: +task 16, lines 303-312: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -99,7 +110,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 17 'run'. lines 314-325: +task 17, lines 314-325: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -108,7 +120,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 18 'run'. lines 326-335: +task 18, lines 326-335: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -117,7 +130,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 19 'run'. lines 337-346: +task 19, lines 337-346: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -126,7 +140,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 20 'run'. lines 348-357: +task 20, lines 348-357: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -135,7 +150,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 21 'run'. lines 359-368: +task 21, lines 359-368: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -144,7 +160,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 22 'run'. lines 370-379: +task 22, lines 370-379: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -153,7 +170,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 23 'run'. lines 381-392: +task 23, lines 381-392: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -162,7 +180,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 24 'run'. lines 393-402: +task 24, lines 393-402: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -171,7 +190,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 25 'run'. lines 404-413: +task 25, lines 404-413: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -180,7 +200,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 26 'run'. lines 415-424: +task 26, lines 415-424: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -189,7 +210,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 27 'run'. lines 426-435: +task 27, lines 426-435: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -198,7 +220,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 28 'run'. lines 437-446: +task 28, lines 437-446: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -207,7 +230,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 29 'run'. lines 448-457: +task 29, lines 448-457: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -216,7 +240,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 30 'run'. lines 459-468: +task 30, lines 459-468: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -225,7 +250,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 31 'run'. lines 470-481: +task 31, lines 470-481: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -234,7 +260,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 32 'run'. lines 482-491: +task 32, lines 482-491: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -243,7 +270,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 33 'run'. lines 493-502: +task 33, lines 493-502: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -252,7 +280,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 34 'run'. lines 504-513: +task 34, lines 504-513: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -261,7 +290,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 35 'run'. lines 515-524: +task 35, lines 515-524: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -270,7 +300,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 36 'run'. lines 526-535: +task 36, lines 526-535: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -279,7 +310,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 37 'run'. lines 537-546: +task 37, lines 537-546: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/equality_reference_value.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/equality_reference_value.exp index ad203a8753dcc..d045a82ca3aba 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/equality_reference_value.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/equality_reference_value.exp @@ -1,9 +1,11 @@ processed 3 tasks -task 1 'run'. lines 15-15: +task 1, line 15: +//# run 0x1::test::test --args 0 mutable inputs after call: local#0: 0 -task 2 'run'. lines 17-17: +task 2, line 17: +//# run 0x1::test::test --args 1 Error: Function execution failed with VMError: { major_status: ABORTED, sub_status: Some(42), diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/shift_operators.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/shift_operators.exp index 893e0f5398886..e11e90d9beea6 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/shift_operators.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/instructions/shift_operators.exp @@ -1,6 +1,7 @@ processed 16 tasks -task 0 'run'. lines 1-9: +task 0, lines 1-9: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 1 'run'. lines 11-20: +task 1, lines 11-20: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 2 'run'. lines 21-30: +task 2, lines 21-30: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -27,7 +30,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 3 'run'. lines 31-40: +task 3, lines 31-40: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -36,7 +40,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 4 'run'. lines 41-50: +task 4, lines 41-50: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -45,7 +50,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 5 'run'. lines 51-60: +task 5, lines 51-60: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -54,7 +60,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 6 'run'. lines 61-70: +task 6, lines 61-70: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -63,7 +70,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 7 'run'. lines 71-80: +task 7, lines 71-80: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -72,7 +80,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 8 'run'. lines 81-90: +task 8, lines 81-90: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, @@ -81,7 +90,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 2)], } -task 9 'run'. lines 91-102: +task 9, lines 91-102: +//# run Error: Function execution failed with VMError: { major_status: ARITHMETIC_ERROR, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/module_publishing/use_modules_published.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/module_publishing/use_modules_published.exp index c6e31f3df86db..a783042f6c861 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/module_publishing/use_modules_published.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/module_publishing/use_modules_published.exp @@ -1,10 +1,13 @@ processed 6 tasks -task 2 'publish'. lines 17-31: +task 2, lines 17-31: +//# publish Error: Unbound function 0000000000000000000000000000000000000000000000000000000000000043.M.foo -task 3 'run'. lines 33-42: +task 3, lines 33-42: +//# run Error: Unbound function 0000000000000000000000000000000000000000000000000000000000000042.M.run -task 5 'run'. lines 52-69: +task 5, lines 52-69: +//# run Error: Dependency not provided for 0000000000000000000000000000000000000000000000000000000000000044.M diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/clever_non_existant_native_function.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/clever_non_existant_native_function.exp index a00d200aca24d..afeb065b43903 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/clever_non_existant_native_function.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/clever_non_existant_native_function.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'publish'. lines 1-5: +task 0, lines 1-5: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::Hash'. Got VMError: { major_status: MISSING_DEPENDENCY, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 1 'publish'. lines 7-10: +task 1, lines 7-10: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000043::Hash'. Got VMError: { major_status: MISSING_DEPENDENCY, sub_status: None, @@ -18,7 +20,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [], } -task 2 'publish'. lines 12-15: +task 2, lines 12-15: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000044::Hash'. Got VMError: { major_status: MISSING_DEPENDENCY, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/non_existant_native_function.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/non_existant_native_function.exp index 58c5370050cb2..72e71ca0f760b 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/non_existant_native_function.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/non_existant_native_function.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-5: +task 0, lines 1-5: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::No'. Got VMError: { major_status: MISSING_DEPENDENCY, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/vector_resource_not_destroyed_at_return.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/vector_resource_not_destroyed_at_return.exp index c7ff68dbedb5b..45adef0515fcd 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/vector_resource_not_destroyed_at_return.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/native_functions/vector_resource_not_destroyed_at_return.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-14: +task 0, lines 1-14: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/native_structs/non_existant_native_struct.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/native_structs/non_existant_native_struct.exp index 966d133be2800..b002985917d40 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/native_structs/non_existant_native_struct.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/native_structs/non_existant_native_struct.exp @@ -1,6 +1,7 @@ processed 1 task -task 0 'publish'. lines 1-6: +task 0, lines 1-6: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::M'. Got VMError: { major_status: MISSING_DEPENDENCY, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_layout_deeply_nested.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_layout_deeply_nested.exp index 0eb72733a5275..126b7a6bc30dd 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_layout_deeply_nested.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_layout_deeply_nested.exp @@ -1,9 +1,11 @@ processed 5 tasks -task 1 'run'. lines 75-75: +task 1, line 75: +//# run 0x42::M::publish_127 return values: { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { true } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } -task 2 'run'. lines 77-77: +task 2, line 77: +//# run 0x42::M::publish_128 Error: Function execution failed with VMError: { major_status: VM_MAX_VALUE_DEPTH_REACHED, sub_status: None, @@ -12,7 +14,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(6), 2)], } -task 3 'run'. lines 79-79: +task 3, line 79: +//# run 0x42::M::publish_256 Error: Function execution failed with VMError: { major_status: VM_MAX_VALUE_DEPTH_REACHED, sub_status: None, @@ -21,7 +24,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(0), 1)], } -task 4 'run'. lines 81-81: +task 4, line 81: +//# run 0x42::M::publish_257 Error: Function execution failed with VMError: { major_status: VM_MAX_VALUE_DEPTH_REACHED, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_type_deeply_nested.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_type_deeply_nested.exp index a6db258965499..6b85a7452ec04 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_type_deeply_nested.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/recursion/runtime_type_deeply_nested.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 1 'run'. lines 72-81: +task 1, lines 72-81: +//# run Error: Function execution failed with VMError: { major_status: TOO_MANY_TYPE_NODES, sub_status: None, @@ -9,7 +10,8 @@ Error: Function execution failed with VMError: { offsets: [(FunctionDefinitionIndex(48), 0)], } -task 2 'run'. lines 83-93: +task 2, lines 83-93: +//# run Error: Function execution failed with VMError: { major_status: TOO_MANY_TYPE_NODES, sub_status: None, diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/references/borrow_in_loop.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/references/borrow_in_loop.exp index 756baf94325ca..12d7f4b3fe6bb 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/references/borrow_in_loop.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/references/borrow_in_loop.exp @@ -1,6 +1,7 @@ processed 3 tasks -task 0 'publish'. lines 1-23: +task 0, lines 1-23: +//# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, @@ -9,7 +10,8 @@ Error: Unable to publish module '00000000000000000000000000000000000000000000000 offsets: [(FunctionDefinitionIndex(0), 11)], } -task 1 'run'. lines 25-25: +task 1, line 25: +//# run 0x42::m::foo --gas-budget 100000 Error: Function execution failed with VMError: { major_status: LINKER_ERROR, sub_status: None, @@ -18,7 +20,8 @@ Error: Function execution failed with VMError: { offsets: [], } -task 2 'run'. lines 27-45: +task 2, lines 27-45: +//# run --gas-budget 100000 Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000042::m'. Got VMError: { major_status: STLOC_UNSAFE_TO_DESTROY_ERROR, sub_status: None, From e23823d9334f209050e65a01f833b1b07db99c4a Mon Sep 17 00:00:00 2001 From: Xun Li Date: Fri, 19 Jul 2024 16:44:40 -0700 Subject: [PATCH 098/163] Only spawn validator tx finalizer for newly signed tx (#18746) ## Description This PR moves the validator tx finalizer into AuthorityState, since there we have the most accurate information on whether a transaction is newly signed. Only spawn a thread if it's newly signed. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-core/src/authority.rs | 29 +++++++++-- .../src/authority/test_authority_builder.rs | 1 + crates/sui-core/src/authority_server.rs | 25 +-------- crates/sui-core/src/validator_tx_finalizer.rs | 15 ++++-- .../tests/validator_tx_finalizer_e2e_tests.rs | 52 +++++++++++++++++++ crates/sui-node/src/lib.rs | 23 ++++---- 6 files changed, 98 insertions(+), 47 deletions(-) diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index dbf8210a4f936..87ad0ae676e34 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -159,6 +159,8 @@ pub use crate::checkpoints::checkpoint_executor::{ init_checkpoint_timeout_config, CheckpointTimeoutConfig, }; +use crate::authority_client::NetworkAuthorityClient; +use crate::validator_tx_finalizer::ValidatorTxFinalizer; #[cfg(msim)] use sui_types::committee::CommitteeTrait; use sui_types::deny_list_v2::check_coin_deny_list_v2_during_signing; @@ -799,6 +801,8 @@ pub struct AuthorityState { /// Current overload status in this authority. Updated periodically. pub overload_info: AuthorityOverloadInfo, + + pub validator_tx_finalizer: Option>>, } /// The authority state encapsulates all state, drives execution, and ensures safety. @@ -951,9 +955,22 @@ impl AuthorityState { let signed = self.handle_transaction_impl(transaction, epoch_store).await; match signed { - Ok(s) => Ok(HandleTransactionResponse { - status: TransactionStatus::Signed(s.into_inner().into_sig()), - }), + Ok(s) => { + if self.is_validator(epoch_store) { + if let Some(validator_tx_finalizer) = &self.validator_tx_finalizer { + let tx = s.clone(); + let validator_tx_finalizer = validator_tx_finalizer.clone(); + let cache_reader = self.get_transaction_cache_reader().clone(); + let epoch_store = epoch_store.clone(); + spawn_monitored_task!(epoch_store.within_alive_epoch( + validator_tx_finalizer.track_signed_tx(cache_reader, tx) + )); + } + } + Ok(HandleTransactionResponse { + status: TransactionStatus::Signed(s.into_inner().into_sig()), + }) + } // It happens frequently that while we are checking the validity of the transaction, it // has just been executed. // In that case, we could still return Ok to avoid showing confusing errors. @@ -2641,6 +2658,7 @@ impl AuthorityState { config: NodeConfig, indirect_objects_threshold: usize, archive_readers: ArchiveReaderBalancer, + validator_tx_finalizer: Option>>, ) -> Arc { Self::check_protocol_version(supported_protocol_versions, epoch_store.protocol_version()); @@ -2696,6 +2714,7 @@ impl AuthorityState { db_checkpoint_config: db_checkpoint_config.clone(), config, overload_info: AuthorityOverloadInfo::default(), + validator_tx_finalizer, }); // Start a task to execute ready certificates. @@ -4442,8 +4461,8 @@ impl AuthorityState { cap.available_system_packages, ); - // A validator that only supports the current protosl version is also voting - // against any change, because framework upgrades aways require a protocol version + // A validator that only supports the current protocol version is also voting + // against any change, because framework upgrades always require a protocol version // bump. cap.supported_protocol_versions .get_version_digest(proposed_protocol_version) diff --git a/crates/sui-core/src/authority/test_authority_builder.rs b/crates/sui-core/src/authority/test_authority_builder.rs index 15c293baee9ca..a1fc9c40020c8 100644 --- a/crates/sui-core/src/authority/test_authority_builder.rs +++ b/crates/sui-core/src/authority/test_authority_builder.rs @@ -321,6 +321,7 @@ impl<'a> TestAuthorityBuilder<'a> { config.clone(), usize::MAX, ArchiveReaderBalancer::default(), + None, ) .await; diff --git a/crates/sui-core/src/authority_server.rs b/crates/sui-core/src/authority_server.rs index 6e8bdb88f1163..067ae8343c1eb 100644 --- a/crates/sui-core/src/authority_server.rs +++ b/crates/sui-core/src/authority_server.rs @@ -23,9 +23,7 @@ use sui_network::{ }; use sui_types::effects::TransactionEffectsAPI; use sui_types::messages_consensus::ConsensusTransaction; -use sui_types::messages_grpc::{ - HandleCertificateRequestV3, HandleCertificateResponseV3, TransactionStatus, -}; +use sui_types::messages_grpc::{HandleCertificateRequestV3, HandleCertificateResponseV3}; use sui_types::messages_grpc::{ HandleCertificateResponseV2, HandleTransactionResponse, ObjectInfoRequest, ObjectInfoResponse, SubmitCertificateResponse, SystemStateRequest, TransactionInfoRequest, TransactionInfoResponse, @@ -49,8 +47,6 @@ use tonic::metadata::{Ascii, MetadataValue}; use tracing::{error, error_span, info, Instrument}; use crate::authority::authority_per_epoch_store::AuthorityPerEpochStore; -use crate::authority_client::NetworkAuthorityClient; -use crate::validator_tx_finalizer::ValidatorTxFinalizer; use crate::{ authority::AuthorityState, consensus_adapter::{ConsensusAdapter, ConsensusAdapterMetrics}, @@ -298,7 +294,6 @@ pub struct ValidatorService { metrics: Arc, traffic_controller: Option>, client_id_source: Option, - validator_tx_finalizer: Option>>, } impl ValidatorService { @@ -309,7 +304,6 @@ impl ValidatorService { traffic_controller_metrics: TrafficControllerMetrics, policy_config: Option, firewall_config: Option, - validator_tx_finalizer: Option>>, ) -> Self { Self { state, @@ -323,7 +317,6 @@ impl ValidatorService { )) }), client_id_source: policy_config.map(|policy| policy.client_id_source), - validator_tx_finalizer, } } @@ -338,7 +331,6 @@ impl ValidatorService { metrics, traffic_controller: None, client_id_source: None, - validator_tx_finalizer: None, } } @@ -372,7 +364,6 @@ impl ValidatorService { metrics, traffic_controller: _, client_id_source: _, - validator_tx_finalizer, } = self.clone(); let transaction = request.into_inner(); let epoch_store = state.load_epoch_store_one_call_per_task(); @@ -435,20 +426,6 @@ impl ValidatorService { return Err(error.into()); } - if let Some(validator_tx_finalizer) = validator_tx_finalizer { - if let TransactionStatus::Signed(sig) = &info.status { - let signed_tx = VerifiedSignedTransaction::new_unchecked( - SignedTransaction::new_from_data_and_sig( - transaction.into_inner().into_data(), - sig.clone(), - ), - ); - spawn_monitored_task!(epoch_store.within_alive_epoch( - validator_tx_finalizer - .track_signed_tx(state.get_transaction_cache_reader().clone(), signed_tx,) - )); - } - } Ok((tonic::Response::new(info), Weight::zero())) } diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index 2d97a14255590..45a9115f77911 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -11,7 +11,7 @@ use prometheus::{ Registry, }; use std::ops::Add; -#[cfg(test)] +#[cfg(any(msim, test))] use std::sync::atomic::{AtomicU64, Ordering::Relaxed}; use std::sync::Arc; use std::time::Duration; @@ -37,7 +37,7 @@ struct ValidatorTxFinalizerMetrics { num_successful_finalizations: IntCounter, finalization_latency: Histogram, validator_tx_finalizer_attempt_position: Histogram, - #[cfg(test)] + #[cfg(any(msim, test))] num_finalization_attempts_for_testing: AtomicU64, #[cfg(test)] num_successful_finalizations_for_testing: AtomicU64, @@ -72,7 +72,7 @@ impl ValidatorTxFinalizerMetrics { registry, ) .unwrap(), - #[cfg(test)] + #[cfg(any(msim, test))] num_finalization_attempts_for_testing: AtomicU64::new(0), #[cfg(test)] num_successful_finalizations_for_testing: AtomicU64::new(0), @@ -81,7 +81,7 @@ impl ValidatorTxFinalizerMetrics { fn start_finalization(&self) -> Instant { self.num_finalization_attempts.inc(); - #[cfg(test)] + #[cfg(any(msim, test))] self.num_finalization_attempts_for_testing .fetch_add(1, Relaxed); Instant::now() @@ -144,6 +144,13 @@ impl ValidatorTxFinalizer { pub(crate) fn auth_agg(&self) -> &Arc>> { &self.agg } + + #[cfg(any(msim, test))] + pub fn num_finalization_attempts_for_testing(&self) -> u64 { + self.metrics + .num_finalization_attempts_for_testing + .load(Relaxed) + } } impl ValidatorTxFinalizer diff --git a/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs b/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs index b1e934520df0e..d6cfb3ae63018 100644 --- a/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs +++ b/crates/sui-e2e-tests/tests/validator_tx_finalizer_e2e_tests.rs @@ -64,3 +64,55 @@ async fn test_validator_tx_finalizer_consensus_tx() { node.with(|n| assert!(n.state().is_tx_already_executed(&tx_digest).unwrap())); } } + +#[cfg(msim)] +#[sim_test] +async fn test_validator_tx_finalizer_equivocation() { + let cluster = TestClusterBuilder::new() + .with_num_validators(4) + // Make epoch duration large enough so that reconfig is never triggered. + .with_epoch_duration_ms(1000 * 1000) + .build() + .await; + let tx_data1 = cluster + .test_transaction_builder() + .await + .transfer_sui(None, dbg_addr(1)) + .build(); + let tx1 = cluster.sign_transaction(&tx_data1); + let tx_data2 = cluster + .test_transaction_builder() + .await + .transfer_sui(None, dbg_addr(2)) + .build(); + let tx2 = cluster.sign_transaction(&tx_data2); + let tx_digest1 = *tx1.digest(); + let tx_digest2 = *tx2.digest(); + let auth_agg = cluster.authority_aggregator(); + for (idx, client) in auth_agg.authority_clients.values().enumerate() { + if idx < 2 { + client.handle_transaction(tx1.clone(), None).await.unwrap(); + } else { + client.handle_transaction(tx2.clone(), None).await.unwrap(); + } + } + // It takes up to 90s for each validator to wake up and finalize the txs once. + // We wait for long enough and check that no validator will spawn another thread + // twice to try to finalize the same txs. + tokio::time::sleep(Duration::from_secs(200)).await; + for node in cluster.swarm.validator_node_handles() { + node.with(|n| { + let state = n.state(); + assert!(!state.is_tx_already_executed(&tx_digest1).unwrap()); + assert!(!state.is_tx_already_executed(&tx_digest2).unwrap()); + assert_eq!( + state + .validator_tx_finalizer + .as_ref() + .unwrap() + .num_finalization_attempts_for_testing(), + 1 + ); + }); + } +} diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index cdbe544e907d0..46badb2d4ce1f 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -656,9 +656,16 @@ impl SuiNode { .set_killswitch_tombstone_pruning(true); } + let authority_name = config.protocol_public_key(); + let enable_validator_tx_finalizer = + config.enable_validator_tx_finalizer && chain_identifier.chain() != Chain::Mainnet; + let validator_tx_finalizer = enable_validator_tx_finalizer.then_some(Arc::new( + ValidatorTxFinalizer::new(auth_agg.clone(), authority_name, &prometheus_registry), + )); + info!("create authority state"); let state = AuthorityState::new( - config.protocol_public_key(), + authority_name, secret, config.supported_protocol_versions.unwrap(), store.clone(), @@ -674,6 +681,7 @@ impl SuiNode { config.clone(), config.indirect_objects_threshold, archive_readers, + validator_tx_finalizer, ) .await; // ensure genesis txn was executed @@ -786,7 +794,6 @@ impl SuiNode { connection_monitor_status.clone(), ®istry_service, sui_node_metrics.clone(), - auth_agg.clone(), ) .await?; // This is only needed during cold start. @@ -1151,7 +1158,6 @@ impl SuiNode { connection_monitor_status: Arc, registry_service: &RegistryService, sui_node_metrics: Arc, - auth_agg: Arc>>, ) -> Result { let mut config_clone = config.clone(); let consensus_config = config_clone @@ -1186,8 +1192,6 @@ impl SuiNode { &config, state.clone(), consensus_adapter.clone(), - auth_agg, - epoch_store.get_chain_identifier().chain(), ®istry_service.default_registry(), ) .await?; @@ -1416,15 +1420,8 @@ impl SuiNode { config: &NodeConfig, state: Arc, consensus_adapter: Arc, - auth_agg: Arc>>, - chain: Chain, prometheus_registry: &Registry, ) -> Result>> { - let enable_validator_tx_finalizer = - config.enable_validator_tx_finalizer && chain != Chain::Mainnet; - let validator_tx_finalizer = enable_validator_tx_finalizer.then_some(Arc::new( - ValidatorTxFinalizer::new(auth_agg, state.name, prometheus_registry), - )); let validator_service = ValidatorService::new( state.clone(), consensus_adapter, @@ -1432,7 +1429,6 @@ impl SuiNode { TrafficControllerMetrics::new(prometheus_registry), config.policy_config.clone(), config.firewall_config.clone(), - validator_tx_finalizer, ); let mut server_conf = mysten_network::config::Config::new(); @@ -1754,7 +1750,6 @@ impl SuiNode { self.connection_monitor_status.clone(), &self.registry_service, self.metrics.clone(), - self.auth_agg.clone(), ) .await?, ) From c16607953ba0f369d2929ec3a080d0596aa2c879 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Fri, 19 Jul 2024 17:30:14 -0700 Subject: [PATCH 099/163] [tx-finalizer] Cap validator wait time (#18739) ## Description This PR adds a cap to how long a validator can wait before waking up. It makes it slightly easier to reason about the max amount of time these kinds of threads will stay alive. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-core/src/validator_tx_finalizer.rs | 83 +++++++++---------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/crates/sui-core/src/validator_tx_finalizer.rs b/crates/sui-core/src/validator_tx_finalizer.rs index 45a9115f77911..4183eed0fbadc 100644 --- a/crates/sui-core/src/validator_tx_finalizer.rs +++ b/crates/sui-core/src/validator_tx_finalizer.rs @@ -10,6 +10,7 @@ use prometheus::{ register_histogram_with_registry, register_int_counter_with_registry, Histogram, IntCounter, Registry, }; +use std::cmp::min; use std::ops::Add; #[cfg(any(msim, test))] use std::sync::atomic::{AtomicU64, Ordering::Relaxed}; @@ -32,11 +33,13 @@ const FINALIZATION_TIMEOUT: Duration = Duration::from_secs(60); /// Incremental delay for validators to wake up to finalize a transaction. const VALIDATOR_DELAY_INCREMENTS_SEC: u64 = 10; +const VALIDATOR_MAX_DELAY: Duration = Duration::from_secs(180); + struct ValidatorTxFinalizerMetrics { num_finalization_attempts: IntCounter, num_successful_finalizations: IntCounter, finalization_latency: Histogram, - validator_tx_finalizer_attempt_position: Histogram, + validator_tx_finalizer_attempt_delay: Histogram, #[cfg(any(msim, test))] num_finalization_attempts_for_testing: AtomicU64, #[cfg(test)] @@ -65,10 +68,10 @@ impl ValidatorTxFinalizerMetrics { registry, ) .unwrap(), - validator_tx_finalizer_attempt_position: register_histogram_with_registry!( - "validator_tx_finalizer_attempt_position", - "Position of the validator in the committee that attempted to finalize the transaction after waking up", - vec![0.0, 1.0, 2.0, 3.0, 4.0, 5.0], + validator_tx_finalizer_attempt_delay: register_histogram_with_registry!( + "validator_tx_finalizer_attempt_delay", + "Duration that a validator in the committee waited before attempting to finalize the transaction", + vec![60.0, 70.0, 80.0, 90.0, 100.0, 110.0, 120.0, 130.0, 140.0, 150.0, 160.0, 170.0, 180.0], registry, ) .unwrap(), @@ -182,7 +185,9 @@ where tx: VerifiedSignedTransaction, ) -> anyhow::Result { let tx_digest = *tx.digest(); - let (position, tx_finalization_delay) = self.determine_finalization_delay(&tx_digest)?; + let Some(tx_finalization_delay) = self.determine_finalization_delay(&tx_digest) else { + return Ok(false); + }; let digests = [tx_digest]; select! { _ = tokio::time::sleep(tx_finalization_delay) => { @@ -193,9 +198,10 @@ where return Ok(false); } } + self.metrics - .validator_tx_finalizer_attempt_position - .observe(position as f64); + .validator_tx_finalizer_attempt_delay + .observe(tx_finalization_delay.as_secs_f64()); let start_time = self.metrics.start_finalization(); debug!( ?tx_digest, @@ -218,29 +224,21 @@ where // Validators will wake up one by one with incremental delays to finalize the transaction. // The hope is that the first few should be able to finalize the transaction, // and the rest will see it already executed and do not need to do anything. - fn determine_finalization_delay( - &self, - tx_digest: &TransactionDigest, - ) -> anyhow::Result<(usize, Duration)> { - let order = self - .agg - .load() - .committee - .shuffle_by_stake_from_tx_digest(tx_digest); - let position = order - .iter() - .position(|&name| name == self.name) - .ok_or_else(|| { - // Somehow the validator is not found in the committee. This should never happen. - // TODO: This is where we should report system invariant violation. - anyhow::anyhow!("Validator {} not found in the committee", self.name) - })?; - + fn determine_finalization_delay(&self, tx_digest: &TransactionDigest) -> Option { + let agg = self.agg.load(); + let order = agg.committee.shuffle_by_stake_from_tx_digest(tx_digest); + let Some(position) = order.iter().position(|&name| name == self.name) else { + // Somehow the validator is not found in the committee. This should never happen. + // TODO: This is where we should report system invariant violation. + error!("Validator {} not found in the committee", self.name); + return None; + }; + // TODO: As an optimization, we could also limit the number of validators that would do this. let extra_delay = position as u64 * VALIDATOR_DELAY_INCREMENTS_SEC; let delay = self .tx_finalization_delay .add(Duration::from_secs(extra_delay)); - Ok((position, delay)) + Some(min(delay, VALIDATOR_MAX_DELAY)) } } @@ -250,10 +248,11 @@ mod tests { use crate::authority::AuthorityState; use crate::authority_aggregator::{AuthorityAggregator, AuthorityAggregatorBuilder}; use crate::authority_client::AuthorityAPI; - use crate::validator_tx_finalizer::ValidatorTxFinalizer; + use crate::validator_tx_finalizer::{ValidatorTxFinalizer, VALIDATOR_MAX_DELAY}; use arc_swap::ArcSwap; use async_trait::async_trait; use prometheus::Registry; + use std::cmp::min; use std::collections::BTreeMap; use std::iter; use std::net::SocketAddr; @@ -577,13 +576,14 @@ mod tests { #[tokio::test] async fn test_validator_tx_finalizer_determine_finalization_delay() { + const COMMITTEE_SIZE: usize = 15; let network_config = ConfigBuilder::new_with_temp_dir() - .committee_size(NonZeroUsize::new(10).unwrap()) + .committee_size(NonZeroUsize::new(COMMITTEE_SIZE).unwrap()) .build(); let (auth_agg, _) = AuthorityAggregatorBuilder::from_network_config(&network_config) .build_network_clients(); let auth_agg = Arc::new(auth_agg); - let finalizers = (0..10) + let finalizers = (0..COMMITTEE_SIZE) .map(|idx| { ValidatorTxFinalizer::new( Arc::new(ArcSwap::new(auth_agg.clone())), @@ -599,26 +599,17 @@ mod tests { .map(|finalizer| { finalizer .determine_finalization_delay(&tx_digest) - .map(|(pos, delay)| (pos, delay.as_secs())) + .map(|delay| delay.as_secs()) .unwrap() }) .collect(); delays.sort(); - assert_eq!( - delays, - vec![ - (0, 60), - (1, 70), - (2, 80), - (3, 90), - (4, 100), - (5, 110), - (6, 120), - (7, 130), - (8, 140), - (9, 150) - ] - ) + for (idx, delay) in delays.iter().enumerate() { + assert_eq!( + *delay, + min(VALIDATOR_MAX_DELAY.as_secs(), 60 + idx as u64 * 10) + ); + } } } From 4f5dc220e852820a03d8e3d63ba2dc7a4b68edc3 Mon Sep 17 00:00:00 2001 From: Adam Welc Date: Fri, 19 Jul 2024 19:03:49 -0700 Subject: [PATCH 100/163] [move-compiler] Added parsing resilience for name access chains (#18706) ## Description This adds parsing resilience for name access chains needed for IDE-level auto-completion ## Test plan All old and new tests must pass --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [x] CLI: Additional compiler errors for incomplete name access chains (e.g., `some_pkg::some_module::`) may appear in the compiler output - [ ] Rust SDK: --- .../crates/move-analyzer/src/completion.rs | 6 +- .../move/crates/move-analyzer/src/symbols.rs | 6 +- .../cursor_tests/cursor_dot_call_tests.exp | 4 +- .../src/expansion/path_expander.rs | 37 ++++++- .../crates/move-compiler/src/parser/ast.rs | 15 ++- .../crates/move-compiler/src/parser/syntax.rs | 11 ++- .../src/unit_test/filter_test_members.rs | 1 + .../ide_mode/colon_colon_incomplete.exp | 24 +++++ .../ide_mode/colon_colon_incomplete.ide | 0 .../ide_mode/colon_colon_incomplete.ide.exp | 98 +++++++++++++++++++ .../ide_mode/colon_colon_incomplete.move | 29 ++++++ 11 files changed, 223 insertions(+), 8 deletions(-) create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.move diff --git a/external-crates/move/crates/move-analyzer/src/completion.rs b/external-crates/move/crates/move-analyzer/src/completion.rs index 99097231486a6..de0173b4938e2 100644 --- a/external-crates/move/crates/move-analyzer/src/completion.rs +++ b/external-crates/move/crates/move-analyzer/src/completion.rs @@ -705,7 +705,11 @@ fn cursor_completion_items( (vec![], false) } P::NameAccessChain_::Path(path) => { - let P::NamePath { root, entries } = path; + let P::NamePath { + root, + entries, + is_incomplete: _, + } = path; if root.name.loc.contains(&cursor.loc) { // This is technically unreachable because we wouldn't be at a `::` (vec![], false) diff --git a/external-crates/move/crates/move-analyzer/src/symbols.rs b/external-crates/move/crates/move-analyzer/src/symbols.rs index 98c97946f801e..cff3cac4793d9 100644 --- a/external-crates/move/crates/move-analyzer/src/symbols.rs +++ b/external-crates/move/crates/move-analyzer/src/symbols.rs @@ -2984,7 +2984,11 @@ impl<'a> ParsingSymbolicator<'a> { }; } NA::Path(path) => { - let P::NamePath { root, entries } = path; + let P::NamePath { + root, + entries, + is_incomplete: _, + } = path; self.root_path_entry_symbols(root); if let Some(root_loc) = loc_start_to_lsp_position_opt(self.files, &root.name.loc) { if let P::LeadingNameAccess_::Name(n) = root.name.value { diff --git a/external-crates/move/crates/move-analyzer/tests/cursor_tests/cursor_dot_call_tests.exp b/external-crates/move/crates/move-analyzer/tests/cursor_tests/cursor_dot_call_tests.exp index 8daa0fd6c888a..a91697647cd19 100644 --- a/external-crates/move/crates/move-analyzer/tests/cursor_tests/cursor_dot_call_tests.exp +++ b/external-crates/move/crates/move-analyzer/tests/cursor_tests/cursor_dot_call_tests.exp @@ -124,7 +124,7 @@ cursor info: - module: Move2024::M2 - definition: function baz - position: seq item -- value: Bind([Var(None, Var("some_struct"))], Some(Apply(Single(PathEntry { name: "SomeStructAlias", tyargs: None, is_macro: None }))), Call(Path(NamePath { root: RootPathEntry { name: M1, tyargs: None, is_macro: None }, entries: [PathEntry { name: "snew", tyargs: None, is_macro: None }] }), [])) +- value: Bind([Var(None, Var("some_struct"))], Some(Apply(Single(PathEntry { name: "SomeStructAlias", tyargs: None, is_macro: None }))), Call(Path(NamePath { root: RootPathEntry { name: M1, tyargs: None, is_macro: None }, entries: [PathEntry { name: "snew", tyargs: None, is_macro: None }], is_incomplete: false }), [])) -- test 17 @ 31:18 ------------ expected: binding in the lhs of a let-binding @@ -140,7 +140,7 @@ cursor info: - module: Move2024::M2 - definition: function baz - position: exp -- value: Call(Path(NamePath { root: RootPathEntry { name: M1, tyargs: None, is_macro: None }, entries: [PathEntry { name: "snew", tyargs: None, is_macro: None }] }), []) +- value: Call(Path(NamePath { root: RootPathEntry { name: M1, tyargs: None, is_macro: None }, entries: [PathEntry { name: "snew", tyargs: None, is_macro: None }], is_incomplete: false }), []) -- test 19 @ 34:28 ------------ expected: name in a dot call diff --git a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs index b5cf39b0d17c7..31bd3a5af940a 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs @@ -146,6 +146,7 @@ enum AccessChainNameResult { ModuleIdent(Loc, E::ModuleIdent), UnresolvedName(Loc, Name), ResolutionFailure(Box, AccessChainFailure), + IncompleteChain(Loc), } struct AccessChainResult { @@ -336,7 +337,7 @@ impl Move2024PathExpander { } } - match chain { + match chain.clone() { PN::Single(path_entry!(name, ptys_opt, is_macro)) => { use crate::naming::ast::BuiltinFunction_; use crate::naming::ast::BuiltinTypeName_; @@ -366,7 +367,11 @@ impl Move2024PathExpander { } } PN::Path(path) => { - let NamePath { root, entries } = path; + let NamePath { + root, + entries, + is_incomplete: incomplete, + } = path; let mut result = match self.resolve_root(context, root.name) { // In Move Legacy, we always treated three-place names as fully-qualified. // For migration mode, if we could have gotten the correct result doing so, @@ -468,9 +473,13 @@ impl Move2024PathExpander { break; } NR::ResolutionFailure(_, _) => break, + NR::IncompleteChain(_) => break, } } + if incomplete { + result = NR::IncompleteChain(loc); + } AccessChainResult { result, ptys_opt, @@ -575,6 +584,10 @@ impl PathExpander for Move2024PathExpander { context.env.add_diag(access_chain_resolution_error(result)); return None; } + NR::IncompleteChain(loc) => { + context.env.add_diag(access_chain_incomplete_error(loc)); + return None; + } } } }, @@ -652,6 +665,10 @@ impl PathExpander for Move2024PathExpander { context.env.add_diag(access_chain_resolution_error(result)); return None; } + NR::IncompleteChain(loc) => { + context.env.add_diag(access_chain_incomplete_error(loc)); + return None; + } } } Access::Term | Access::Pattern => match chain.value { @@ -685,6 +702,10 @@ impl PathExpander for Move2024PathExpander { context.env.add_diag(access_chain_resolution_error(result)); return None; } + NR::IncompleteChain(loc) => { + context.env.add_diag(access_chain_incomplete_error(loc)); + return None; + } } } }, @@ -735,6 +756,10 @@ impl PathExpander for Move2024PathExpander { context.env.add_diag(access_chain_resolution_error(result)); None } + NR::IncompleteChain(loc) => { + context.env.add_diag(access_chain_incomplete_error(loc)); + None + } } } @@ -757,6 +782,7 @@ impl AccessChainNameResult { AccessChainNameResult::ModuleIdent(loc, _) => *loc, AccessChainNameResult::UnresolvedName(loc, _) => *loc, AccessChainNameResult::ResolutionFailure(inner, _) => inner.loc(), + AccessChainNameResult::IncompleteChain(loc) => *loc, } } @@ -768,6 +794,7 @@ impl AccessChainNameResult { AccessChainNameResult::UnresolvedName(_, _) => "name".to_string(), AccessChainNameResult::Address(_, _) => "address".to_string(), AccessChainNameResult::ResolutionFailure(inner, _) => inner.err_name(), + AccessChainNameResult::IncompleteChain(_) => "".to_string(), } } @@ -779,6 +806,7 @@ impl AccessChainNameResult { AccessChainNameResult::UnresolvedName(_, _) => "a name".to_string(), AccessChainNameResult::Address(_, _) => "an address".to_string(), AccessChainNameResult::ResolutionFailure(inner, _) => inner.err_name(), + AccessChainNameResult::IncompleteChain(_) => "".to_string(), } } } @@ -834,6 +862,11 @@ fn access_chain_resolution_error(result: AccessChainNameResult) -> Diagnostic { } } +fn access_chain_incomplete_error(loc: Loc) -> Diagnostic { + let msg = "Incomplete name in this position. Expected an identifier after '::'"; + diag!(Syntax::InvalidName, (loc, msg)) +} + //************************************************************************************************** // Legacy Path Expander //************************************************************************************************** diff --git a/external-crates/move/crates/move-compiler/src/parser/ast.rs b/external-crates/move/crates/move-compiler/src/parser/ast.rs index 722bbcac07f07..a4378ed18a950 100644 --- a/external-crates/move/crates/move-compiler/src/parser/ast.rs +++ b/external-crates/move/crates/move-compiler/src/parser/ast.rs @@ -363,6 +363,8 @@ pub struct RootPathEntry { pub struct NamePath { pub root: RootPathEntry, pub entries: Vec, + // if parsing of this name path was incomplete + pub is_incomplete: bool, } // See the NameAccess trait below for usage. @@ -763,6 +765,7 @@ impl NameAccessChain_ { NamePath { root, entries: vec![], + is_incomplete: false, } } } @@ -1849,12 +1852,22 @@ impl AstDebug for PathEntry { impl AstDebug for NamePath { fn ast_debug(&self, w: &mut AstWriter) { - let NamePath { root, entries } = self; + let NamePath { + root, + entries, + is_incomplete, + } = self; w.write(format!("{}::", root)); w.list(entries, "::", |w, e| { e.ast_debug(w); false }); + if *is_incomplete { + if !entries.is_empty() { + w.write("::"); + } + w.write("_#incomplete#_"); + } } } diff --git a/external-crates/move/crates/move-compiler/src/parser/syntax.rs b/external-crates/move/crates/move-compiler/src/parser/syntax.rs index 895d27c68b4b5..aec02f56d8f13 100644 --- a/external-crates/move/crates/move-compiler/src/parser/syntax.rs +++ b/external-crates/move/crates/move-compiler/src/parser/syntax.rs @@ -824,7 +824,16 @@ fn parse_name_access_chain_<'a, F: Fn() -> &'a str>( context.tokens.start_loc(), " after an address in a module access chain", )?; - let name = parse_identifier(context)?; + let name = match parse_identifier(context) { + Ok(ident) => ident, + Err(_) => { + // diagnostic for this is reported in path expansion (as a parsing error) when we + // detect incomplete chaing (adding "default" diag here would make error reporting + // somewhat redundant in this case) + path.is_incomplete = true; + return Ok(NameAccessChain_::Path(path)); + } + }; let (mut is_macro, mut tys) = parse_macro_opt_and_tyargs_opt(context, tyargs_whitespace_allowed, name.loc); if let Some(loc) = &is_macro { diff --git a/external-crates/move/crates/move-compiler/src/unit_test/filter_test_members.rs b/external-crates/move/crates/move-compiler/src/unit_test/filter_test_members.rs index 3714f0aeb4fad..225b4f91628b5 100644 --- a/external-crates/move/crates/move-compiler/src/unit_test/filter_test_members.rs +++ b/external-crates/move/crates/move-compiler/src/unit_test/filter_test_members.rs @@ -197,6 +197,7 @@ fn create_test_poison(mloc: Loc) -> P::ModuleMember { is_macro: None, }, ], + is_incomplete: false, }; let args_ = vec![sp( mloc, diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.exp new file mode 100644 index 0000000000000..4e0dee349a969 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.exp @@ -0,0 +1,24 @@ +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 + │ +10 │ A + │ ^ Expected a type, function, or constant in this position, not an address + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 + │ +14 │ a:: + │ ^^^ Incomplete name in this position. Expected an identifier after '::' + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 + │ +18 │ a::m:: + │ ^^^^^^ Incomplete name in this position. Expected an identifier after '::' + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 + │ +22 │ a::m::SomeEnum:: + │ ^^^^^^^^^^^^^^^^ Incomplete name in this position. Expected an identifier after '::' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide.exp new file mode 100644 index 0000000000000..6b0871621b12e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide.exp @@ -0,0 +1,98 @@ +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:1:1 + │ + 1 │ ╭ module a::m { + 2 │ │ + 3 │ │ public enum SomeEnum { + 4 │ │ SomeVariant, + · │ +24 │ │ +25 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 + │ +10 │ A + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 + │ +10 │ A + │ ^ Expected a type, function, or constant in this position, not an address + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 + │ +14 │ a:: + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 + │ +14 │ a:: + │ ^^^ Incomplete name in this position. Expected an identifier after '::' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 + │ +18 │ a::m:: + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 + │ +18 │ a::m:: + │ ^^^^^^ Incomplete name in this position. Expected an identifier after '::' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 + │ +22 │ a::m::SomeEnum:: + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 + │ +22 │ a::m::SomeEnum:: + │ ^^^^^^^^^^^^^^^^ Incomplete name in this position. Expected an identifier after '::' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:27:1 + │ +27 │ ╭ module a::m2 { +28 │ │ public fun foo() {} +29 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option' or 'foo -> a::m2::foo' + = modules: 'Self -> a::m2', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.move new file mode 100644 index 0000000000000..a3dfc3f4c578c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.move @@ -0,0 +1,29 @@ +module a::m { + + public enum SomeEnum { + SomeVariant, + } + + public fun foo() {} + + public fun pkg_complete() { + A + } + + public fun mod_complete() { + a:: + } + + public fun member_complete() { + a::m:: + } + + public fun variant_incomplete() { + a::m::SomeEnum:: + } + +} + +module a::m2 { + public fun foo() {} +} From d42ec4894125ff947cc122cd1125b3519b467e19 Mon Sep 17 00:00:00 2001 From: William Smith Date: Fri, 19 Jul 2024 22:14:53 -0400 Subject: [PATCH 101/163] [TrafficControl] Support multi-hop forwarding (#18699) ## Description Sometimes there can be more than one proxy between the client and the server. In such cases, the `x-forwarded-for` header is appended with the full path of IPs, ostensibly with the client IP being the first. For this reason, we need to fix the parsing to accommodate a list of IPs. However, we additionally have the problem of knowing which IP in the list is the client IP. We cannot assume the first IP in the list is the client IP, as a malicious client could attempt to spoof by writing a junk value in `x-forwarded-for` in the request, to which the internal LBs would append. There are two possible solutions to this: a) define a custom header and configure our gcs LBS to write to this and overwrite any existing value for that header. b) add configuration such that the node operator defines the number of intermediate load balancers (`num_hops`) it runs. In such a case, for a `num_hops = N`, the client IP should always be the `N`th **to last**. To illustrate (note that for N proxies, only the IP addresses of proxy 1, ..., N-1 will be contained in the header, as proxy N is directly connected to the server and does not write its own IP): ``` [ , , <-- we want this <1>, ..., ] ``` The first solution would require extra configuration on their infra by the node operator, and would be specific to gcs (we'd have to confirm that something similar is supported in other cloud hosting services). So this PR implements option (2). ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- crates/sui-core/src/authority_server.rs | 40 ++++++++++++----- crates/sui-json-rpc/src/axum_router.rs | 57 +++++++++++++++++-------- crates/sui-types/src/traffic_control.rs | 44 ++++++++++++++++++- 3 files changed, 112 insertions(+), 29 deletions(-) diff --git a/crates/sui-core/src/authority_server.rs b/crates/sui-core/src/authority_server.rs index 067ae8343c1eb..31aec18b6aecc 100644 --- a/crates/sui-core/src/authority_server.rs +++ b/crates/sui-core/src/authority_server.rs @@ -1008,24 +1008,44 @@ macro_rules! handle_with_decoration { None } } - ClientIdSource::XForwardedFor => { + ClientIdSource::XForwardedFor(num_hops) => { let do_header_parse = |op: &MetadataValue| { match op.to_str() { Ok(header_val) => { - match header_val.parse::() { - Ok(socket_addr) => Some(socket_addr.ip()), - Err(err) => { + let header_contents = header_val.split(',').map(str::trim).collect::>(); + if *num_hops == 0 { + error!( + "x-forwarded-for: 0 specified. x-forwarded-for contents: {:?}. Please assign nonzero value for \ + number of hops here, or use `socket-addr` client-id-source type if requests are not being proxied \ + to this node. Skipping traffic controller request handling.", + header_contents, + ); + return None; + } + let contents_len = header_contents.len(); + let Some(client_ip) = header_contents.get(contents_len - num_hops) else { + error!( + "x-forwarded-for header value of {:?} contains {} values, but {} hops were specificed. \ + Expected at least {} values. Skipping traffic controller request handling.", + header_contents, + contents_len, + num_hops, + contents_len, + ); + return None; + }; + client_ip.parse::().ok().or_else(|| { + client_ip.parse::().ok().map(|socket_addr| socket_addr.ip()).or_else(|| { $self.metrics.forwarded_header_parse_error.inc(); error!( - "Failed to parse x-forwarded-for header value of {:?} to ip address: {:?}. \ + "Failed to parse x-forwarded-for header value of {:?} to ip address or socket. \ Please ensure that your proxy is configured to resolve client domains to an \ IP address before writing header", - header_val, - err, + client_ip, ); None - } - } + }) + }) } Err(e) => { // TODO: once we have confirmed that no legitimate traffic @@ -1043,7 +1063,7 @@ macro_rules! handle_with_decoration { do_header_parse(op) } else { $self.metrics.forwarded_header_not_included.inc(); - error!("x-forwarded-header not present for request despite node configuring XForwardedFor tracking type"); + error!("x-forwarded-for header not present for request despite node configuring x-forwarded-for tracking type"); None } } diff --git a/crates/sui-json-rpc/src/axum_router.rs b/crates/sui-json-rpc/src/axum_router.rs index 0505bd196ac6a..c46cc04a74494 100644 --- a/crates/sui-json-rpc/src/axum_router.rs +++ b/crates/sui-json-rpc/src/axum_router.rs @@ -156,33 +156,54 @@ async fn process_raw_request( ) -> MethodResponse { let client = match service.client_id_source { Some(ClientIdSource::SocketAddr) => Some(client_addr.ip()), - Some(ClientIdSource::XForwardedFor) => { - let do_header_parse = |header: &HeaderValue| { - header.to_str().map(|s| { - match s.parse::() { - Ok(addr) => Some(addr.ip()), - Err(err) => { - error!( - "Failed to parse x-forwarded-for header value of {:?} to ip address: {:?}. \ - Please ensure that your proxy is configured to resolve client domains to an \ - IP address before writing header", - s, - err, + Some(ClientIdSource::XForwardedFor(num_hops)) => { + let do_header_parse = |header: &HeaderValue| match header.to_str() { + Ok(header_val) => { + let header_contents = header_val.split(',').map(str::trim).collect::>(); + if num_hops == 0 { + error!( + "x-forwarded-for: 0 specified. x-forwarded-for contents: {:?}. Please assign nonzero value for \ + number of hops here, or use `socket-addr` client-id-source type if requests are not being proxied \ + to this node. Skipping traffic controller request handling.", + header_contents, ); - None - } + return None; } - }).unwrap_or_else(|_| { - error!("Failed to parse x-forwarded-for header value of {:?} to string", header); + let contents_len = header_contents.len(); + let Some(client_ip) = header_contents.get(contents_len - num_hops) else { + error!( + "x-forwarded-for header value of {:?} contains {} values, but {} hops were specificed. \ + Expected {} values. Skipping traffic controller request handling.", + header_contents, + contents_len, + num_hops, + num_hops + 1, + ); + return None; + }; + client_ip.parse::().ok().or_else(|| { + client_ip.parse::().ok().map(|socket_addr| socket_addr.ip()).or_else(|| { + error!( + "Failed to parse x-forwarded-for header value of {:?} to ip address or socket. \ + Please ensure that your proxy is configured to resolve client domains to an \ + IP address before writing header", + client_ip, + ); + None + }) + }) + } + Err(e) => { + error!("Invalid UTF-8 in x-forwarded-for header: {:?}", e); None - }) + } }; if let Some(header) = headers.get("x-forwarded-for") { do_header_parse(header) } else if let Some(header) = headers.get("X-Forwarded-For") { do_header_parse(header) } else { - error!("X-Forwarded-For header not found in request. Skipping traffic controller request handling."); + error!("x-forwarded-for header not present for request despite node configuring x-forwarded-for tracking type"); None } } diff --git a/crates/sui-types/src/traffic_control.rs b/crates/sui-types/src/traffic_control.rs index e976081abcecd..95e5ee534887b 100644 --- a/crates/sui-types/src/traffic_control.rs +++ b/crates/sui-types/src/traffic_control.rs @@ -22,11 +22,53 @@ const TRAFFIC_SINK_TIMEOUT_SEC: u64 = 300; /// protocol, such as a load balancer. Note that this is not the /// same as the client type (e.g a direct client vs a proxy client, /// as in the case of a fullnode driving requests from many clients). +/// +/// For x-forwarded-for, the usize parameter is the number of forwarding +/// hops between the client and the node for requests going your infra +/// or infra provider. Example: +/// +/// ```ignore +/// (client) -> { (global proxy) -> (regional proxy) -> (node) } +/// ``` +/// +/// where +/// +/// ```ignore +/// { , ... } +/// ``` +/// +/// are controlled by the Node operator / their cloud provider. +/// In this case, we set: +/// +/// ```ignore +/// policy-config: +/// client-id-source: +/// x-forwarded-for: 2 +/// ... +/// ``` +/// +/// NOTE: x-forwarded-for: 0 is a special case value that can be used by Node +/// operators to discover the number of hops that should be configured. To use: +/// +/// 1. Set `x-forwarded-for: 0` for the `client-id-source` in the config. +/// 2. Run the node and query any endpoint (AuthorityServer for validator, or json rpc for rpc node) +/// from a known IP address. +/// 3. Search for lines containing `x-forwarded-for` in the logs. The log lines should contain +/// the contents of the `x-forwarded-for` header, if present, or a corresponding error if not. +/// 4. The value for number of hops is derived from any such log line that contains your known IP +/// address, and is defined as 1 + the number of IP addresses in the `x-forwarded-for` that occur +/// **after** the known client IP address. Example: +/// +/// ```ignore +/// [] <--- number of hops is 1 +/// ["1.2.3.4", , "5.6.7.8", "9.10.11.12"] <--- number of hops is 3 +/// ``` #[derive(Clone, Debug, Deserialize, Serialize, Default)] +#[serde(rename_all = "kebab-case")] pub enum ClientIdSource { #[default] SocketAddr, - XForwardedFor, + XForwardedFor(usize), } #[derive(Clone, Debug, Deserialize, Serialize)] From 7bc276d534c6c758ac2cfefe96431c2b1318ca01 Mon Sep 17 00:00:00 2001 From: benr-ml <112846738+benr-ml@users.noreply.github.com> Date: Sun, 21 Jul 2024 07:42:05 +0300 Subject: [PATCH 102/163] [beacon] Print a fixed error message instead of a panic (#18751) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-types/src/messages_consensus.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/sui-types/src/messages_consensus.rs b/crates/sui-types/src/messages_consensus.rs index 169b64f8ccdc2..5a55f18b5b5aa 100644 --- a/crates/sui-types/src/messages_consensus.rs +++ b/crates/sui-types/src/messages_consensus.rs @@ -301,7 +301,7 @@ pub enum VersionedDkgConfirmation { impl Debug for VersionedDkgMessage { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { - VersionedDkgMessage::V0() => panic!("BUG: invalid VersionedDkgMessage version"), + VersionedDkgMessage::V0() => write!(f, "Deprecated VersionedDkgMessage version 0"), VersionedDkgMessage::V1(msg) => write!( f, "DKG V1 Message with sender={}, vss_pk.degree={}, encrypted_shares.len()={}", From 62019420588d8b7c9fcc9c6a34edc200e57193b8 Mon Sep 17 00:00:00 2001 From: Anastasios Kichidis Date: Mon, 22 Jul 2024 12:24:23 +0100 Subject: [PATCH 103/163] [Consensus] reduce connection shutdown grace period (#18687) ## Description Currently in testnet we seem to frequently hit the `5 second` connection shutdown timeout which seems to stall even more the epoch change. We can lower the grace period (similar to what used in Anemo - 1 second) . ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- consensus/core/src/network/tonic_network.rs | 8 ++++++-- crates/sui-core/src/epoch/epoch_metrics.rs | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/consensus/core/src/network/tonic_network.rs b/consensus/core/src/network/tonic_network.rs index cc12d15dd00c5..b3a9a7d441f5f 100644 --- a/consensus/core/src/network/tonic_network.rs +++ b/consensus/core/src/network/tonic_network.rs @@ -69,6 +69,10 @@ const MAX_TOTAL_FETCHED_BYTES: usize = 128 * 1024 * 1024; #[cfg(not(msim))] const MAX_CONNECTIONS_BACKLOG: u32 = 1024; +// The time we are willing to wait for a connection to get gracefully shutdown before we attempt to +// forcefully shutdown its task. +const CONNECTION_SHUTDOWN_GRACE_PERIOD: Duration = Duration::from_secs(1); + // Implements Tonic RPC client for Consensus. pub(crate) struct TonicClient { context: Arc, @@ -797,10 +801,10 @@ impl NetworkManager for TonicManager { }, _ = shutdown_notif.wait() => { info!("Received shutdown. Stopping consensus service."); - if timeout(Duration::from_secs(5), async { + if timeout(CONNECTION_SHUTDOWN_GRACE_PERIOD, async { while connection_handlers.join_next().await.is_some() {} }).await.is_err() { - warn!("Failed to stop all connection handlers in 5s. Forcing shutdown."); + warn!("Failed to stop all connection handlers in {CONNECTION_SHUTDOWN_GRACE_PERIOD:?}. Forcing shutdown."); connection_handlers.shutdown().await; } return; diff --git a/crates/sui-core/src/epoch/epoch_metrics.rs b/crates/sui-core/src/epoch/epoch_metrics.rs index 172b430a64eef..82d83e10dbd13 100644 --- a/crates/sui-core/src/epoch/epoch_metrics.rs +++ b/crates/sui-core/src/epoch/epoch_metrics.rs @@ -27,12 +27,12 @@ pub struct EpochMetrics { // An active validator reconfigures through the following steps: // 1. Halt validator (a.k.a. close epoch) and stop accepting user transaction certs. // 2. Finishes processing all pending certificates and then send EndOfPublish message. - // 3. Stop accepting messages from Narwhal after seeing 2f+1 EndOfPublish messages. + // 3. Stop accepting messages from consensus after seeing 2f+1 EndOfPublish messages. // 4. Creating the last checkpoint of the epoch by augmenting it with AdvanceEpoch transaction. // 5. CheckpointExecutor finishes executing the last checkpoint, and triggers reconfiguration. - // 6. During reconfiguration, we tear down Narwhal, reconfigure state (at which point we opens - // up user certs), and start Narwhal again. - // 7. After reconfiguration, and eventually Narwhal starts successfully, at some point the first + // 6. During reconfiguration, we tear down consensus, reconfigure state (at which point we opens + // up user certs), and start consensus again. + // 7. After reconfiguration, and eventually consensus starts successfully, at some point the first // checkpoint of the new epoch will be created. // We introduce various metrics to cover the latency of above steps. /// The duration from when the epoch is closed (i.e. validator halted) to when all pending From cb0417438e9b343faecdbac059a5873d7e313424 Mon Sep 17 00:00:00 2001 From: Anastasios Kichidis Date: Mon, 22 Jul 2024 13:33:53 +0100 Subject: [PATCH 104/163] [Consensus 2.0] Recover from amnesia - part 2 (#18190) ## Description The second part of the recovering from amnesia feature. This PR is implementing the logic to fetch the last own block from the peer network in the synchronizer. It is also adding several tests to confirm the behaviour correctness. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- consensus/core/src/authority_node.rs | 168 ++++++++++++++- consensus/core/src/error.rs | 8 + consensus/core/src/metrics.rs | 6 + consensus/core/src/synchronizer.rs | 298 +++++++++++++++++++++++++-- 4 files changed, 462 insertions(+), 18 deletions(-) diff --git a/consensus/core/src/authority_node.rs b/consensus/core/src/authority_node.rs index ff2c7d043e66b..d30ff3cadec11 100644 --- a/consensus/core/src/authority_node.rs +++ b/consensus/core/src/authority_node.rs @@ -319,7 +319,7 @@ where ); // First shutdown components calling into Core. - self.synchronizer.stop().await; + self.synchronizer.stop().await.ok(); self.commit_syncer.stop().await; self.leader_timeout_handle.stop().await; // Shutdown Core to stop block productions and broadcast. @@ -350,6 +350,7 @@ where mod tests { #![allow(non_snake_case)] + use std::sync::Mutex; use std::{collections::BTreeSet, sync::Arc, time::Duration}; use consensus_config::{local_committee_and_keys, Parameters}; @@ -495,6 +496,170 @@ mod tests { } } + #[rstest] + #[tokio::test(flavor = "current_thread")] + async fn test_amnesia_success( + #[values(ConsensusNetwork::Anemo, ConsensusNetwork::Tonic)] network_type: ConsensusNetwork, + ) { + telemetry_subscribers::init_for_testing(); + let db_registry = Registry::new(); + DBMetrics::init(&db_registry); + + let (committee, keypairs) = local_committee_and_keys(0, vec![1, 1, 1, 1]); + let mut output_receivers = vec![]; + let mut authorities = vec![]; + + for (index, _authority_info) in committee.authorities() { + let (authority, receiver) = make_authority( + index, + &TempDir::new().unwrap(), + committee.clone(), + keypairs.clone(), + network_type, + ) + .await; + output_receivers.push(receiver); + authorities.push(authority); + } + + const NUM_TRANSACTIONS: u8 = 15; + let mut submitted_transactions = BTreeSet::>::new(); + for i in 0..NUM_TRANSACTIONS { + let txn = vec![i; 16]; + submitted_transactions.insert(txn.clone()); + authorities[i as usize % authorities.len()] + .transaction_client() + .submit(vec![txn]) + .await + .unwrap(); + } + + for receiver in &mut output_receivers { + let mut expected_transactions = submitted_transactions.clone(); + loop { + let committed_subdag = + tokio::time::timeout(Duration::from_secs(1), receiver.recv()) + .await + .unwrap() + .unwrap(); + for b in committed_subdag.blocks { + for txn in b.transactions().iter().map(|t| t.data().to_vec()) { + assert!( + expected_transactions.remove(&txn), + "Transaction not submitted or already seen: {:?}", + txn + ); + } + } + assert_eq!(committed_subdag.reputation_scores_desc, vec![]); + if expected_transactions.is_empty() { + break; + } + } + } + + // Stop authority 1. + let index = committee.to_authority_index(1).unwrap(); + authorities.remove(index.value()).stop().await; + sleep(Duration::from_secs(5)).await; + + // now create a new directory to simulate amnesia. The node will start having participated previously + // to consensus but now will attempt to synchronize the last own block and recover from there. + let (authority, mut receiver) = make_authority( + index, + &TempDir::new().unwrap(), + committee.clone(), + keypairs, + network_type, + ) + .await; + authorities.insert(index.value(), authority); + sleep(Duration::from_secs(5)).await; + + // We wait until we see at least one committed block authored from this authority + 'outer: while let Some(result) = receiver.recv().await { + for block in result.blocks { + if block.author() == index { + break 'outer; + } + } + } + + // Stop all authorities and exit. + for authority in authorities { + authority.stop().await; + } + } + + #[rstest] + #[tokio::test] + async fn test_amnesia_failure( + #[values(ConsensusNetwork::Anemo, ConsensusNetwork::Tonic)] network_type: ConsensusNetwork, + ) { + telemetry_subscribers::init_for_testing(); + + let occurred_panic = Arc::new(Mutex::new(None)); + let occurred_panic_cloned = occurred_panic.clone(); + + let default_panic_handler = std::panic::take_hook(); + std::panic::set_hook(Box::new(move |panic| { + let mut l = occurred_panic_cloned.lock().unwrap(); + *l = Some(panic.to_string()); + default_panic_handler(panic); + })); + + let db_registry = Registry::new(); + DBMetrics::init(&db_registry); + + let (committee, keypairs) = local_committee_and_keys(0, vec![1, 1, 1, 1]); + let mut output_receivers = vec![]; + let mut authorities = vec![]; + + for (index, _authority_info) in committee.authorities() { + let (authority, receiver) = make_authority( + index, + &TempDir::new().unwrap(), + committee.clone(), + keypairs.clone(), + network_type, + ) + .await; + output_receivers.push(receiver); + authorities.push(authority); + } + + // Let the network run for a few seconds + sleep(Duration::from_secs(5)).await; + + // Stop all authorities + while let Some(authority) = authorities.pop() { + authority.stop().await; + } + + sleep(Duration::from_secs(2)).await; + + let index = AuthorityIndex::new_for_test(0); + let (_authority, _receiver) = make_authority( + index, + &TempDir::new().unwrap(), + committee, + keypairs, + network_type, + ) + .await; + sleep(Duration::from_secs(5)).await; + + // Now reset the panic hook + let _default_panic_handler = std::panic::take_hook(); + + // We expect this test to panic as all the other peers are down and the node that tries to + // recover its last produced block fails. + let panic_info = occurred_panic.lock().unwrap().take().unwrap(); + assert!(panic_info.contains( + "No peer has returned any acceptable result, can not safely update min round" + )); + } + // TODO: create a fixture async fn make_authority( index: AuthorityIndex, @@ -511,6 +676,7 @@ mod tests { dag_state_cached_rounds: 5, commit_sync_parallel_fetches: 3, commit_sync_batch_size: 3, + sync_last_proposed_block_timeout: Duration::from_millis(2_000), ..Default::default() }; let txn_verifier = NoopTransactionVerifier {}; diff --git a/consensus/core/src/error.rs b/consensus/core/src/error.rs index b18f17557e6f7..d9fdb99e37ed0 100644 --- a/consensus/core/src/error.rs +++ b/consensus/core/src/error.rs @@ -51,6 +51,14 @@ pub(crate) enum ConsensusError { block_ref: BlockRef, }, + #[error( + "Unexpected block {block_ref} returned while fetching last own block from peer {index}" + )] + UnexpectedLastOwnBlock { + index: AuthorityIndex, + block_ref: BlockRef, + }, + #[error("Too many blocks have been returned from authority {0} when requesting to fetch missing blocks")] TooManyFetchedBlocksReturned(AuthorityIndex), diff --git a/consensus/core/src/metrics.rs b/consensus/core/src/metrics.rs index af1c9a64d75a5..f6b2e470c0eea 100644 --- a/consensus/core/src/metrics.rs +++ b/consensus/core/src/metrics.rs @@ -132,6 +132,7 @@ pub(crate) struct NodeMetrics { pub(crate) last_committed_authority_round: IntGaugeVec, pub(crate) last_committed_leader_round: IntGauge, pub(crate) last_commit_index: IntGauge, + pub(crate) last_known_own_block_round: IntGauge, pub(crate) commit_round_advancement_interval: Histogram, pub(crate) last_decided_leader_round: IntGauge, pub(crate) leader_timeout_total: IntCounterVec, @@ -321,6 +322,11 @@ impl NodeMetrics { &["authority", "type"], registry, ).unwrap(), + last_known_own_block_round: register_int_gauge_with_registry!( + "last_known_own_block_round", + "The highest round of our own block as this has been synced from peers during an amnesia recovery", + registry, + ).unwrap(), // TODO: add a short status label. invalid_blocks: register_int_counter_vec_with_registry!( "invalid_blocks", diff --git a/consensus/core/src/synchronizer.rs b/consensus/core/src/synchronizer.rs index 5291a4f70fd81..504cd63249b6e 100644 --- a/consensus/core/src/synchronizer.rs +++ b/consensus/core/src/synchronizer.rs @@ -19,9 +19,10 @@ use parking_lot::{Mutex, RwLock}; #[cfg(not(test))] use rand::{prelude::SliceRandom, rngs::ThreadRng}; use sui_macros::fail_point_async; +use tap::TapFallible; use tokio::{ sync::{mpsc::error::TrySendError, oneshot}, - task::JoinSet, + task::{JoinError, JoinSet}, time::{sleep, sleep_until, timeout, Instant}, }; use tracing::{debug, error, info, trace, warn}; @@ -161,12 +162,13 @@ enum Command { peer_index: AuthorityIndex, result: oneshot::Sender>, }, + FetchOwnLastBlock, KickOffScheduler, } pub(crate) struct SynchronizerHandle { commands_sender: Sender, - tasks: Mutex>, + tasks: tokio::sync::Mutex>, } impl SynchronizerHandle { @@ -189,9 +191,13 @@ impl SynchronizerHandle { receiver.await.map_err(|_err| ConsensusError::Shutdown)? } - pub(crate) async fn stop(&self) { - let mut tasks = self.tasks.lock(); + pub(crate) async fn stop(&self) -> Result<(), JoinError> { + let mut tasks = self.tasks.lock().await; tasks.abort_all(); + while let Some(result) = tasks.join_next().await { + result? + } + Ok(()) } } @@ -212,6 +218,10 @@ impl SynchronizerHandle { /// missing blocks that were not ancestors of a received block via the "block send" path. /// The scheduler operates on either a fixed periodic basis or is triggered immediately /// after explicit fetches described in (1), ensuring continued block retrieval if gaps persist. +/// +/// Additionally to the above, the synchronizer can synchronize and fetch the last own proposed block +/// from the network peers as best effort approach to recover node from amnesia and avoid making the +/// node equivocate. pub(crate) struct Synchronizer { context: Arc, commands_receiver: Receiver, @@ -220,6 +230,7 @@ pub(crate) struct Synchronizer, dag_state: Arc>, fetch_blocks_scheduler_task: JoinSet<()>, + fetch_own_last_block_task: JoinSet<()>, network_client: Arc, block_verifier: Arc, inflight_blocks_map: Arc, @@ -270,6 +281,12 @@ impl Synchronizer Synchronizer Synchronizer Synchronizer { + if self.fetch_own_last_block_task.is_empty() { + self.start_fetch_own_last_block_task(); + } + } Command::KickOffScheduler => { // just reset the scheduler timeout timer to run immediately if not already running. // If the scheduler is already running then just reduce the remaining time to run. @@ -357,6 +380,19 @@ impl Synchronizer { + match result { + Ok(()) => {}, + Err(e) => { + if e.is_cancelled() { + } else if e.is_panic() { + std::panic::resume_unwind(e.into_panic()); + } else { + panic!("fetch our last block task failed: {e}"); + } + }, + }; + }, Some(result) = self.fetch_blocks_scheduler_task.join_next(), if !self.fetch_blocks_scheduler_task.is_empty() => { match result { Ok(()) => {}, @@ -654,6 +690,115 @@ impl Synchronizer, authority_index: AuthorityIndex| -> ConsensusResult> { + let mut result = Vec::new(); + for serialized_block in blocks { + let signed_block = bcs::from_bytes(&serialized_block).map_err(ConsensusError::MalformedBlock)?; + block_verifier.verify(&signed_block).tap_err(|err|{ + context + .metrics + .node_metrics + .invalid_blocks + .with_label_values(&[&signed_block.author().to_string(), "synchronizer_own_block"]) + .inc(); + warn!("Invalid block received from {}: {}", authority_index, err); + })?; + + let verified_block = VerifiedBlock::new_verified(signed_block, serialized_block); + if verified_block.author() != context.own_index { + return Err(ConsensusError::UnexpectedLastOwnBlock { index: authority_index, block_ref: verified_block.reference()}); + } + result.push(verified_block); + } + Ok(result) + }; + + // Get the highest of all the results + let mut total_stake = 0; + let mut highest_round = 0; + loop { + tokio::select! { + result = results.next() => { + let Some((result, authority_index)) = result else { + break; + }; + match result { + Ok(result) => { + match process_blocks(result, authority_index) { + Ok(blocks) => { + let max_round = blocks.into_iter().map(|b|b.round()).max().unwrap_or(0); + highest_round = highest_round.max(max_round); + + total_stake += context.committee.stake(authority_index); + }, + Err(err) => { + warn!("Invalid result returned from {authority_index} while fetching last own block: {err}"); + } + } + }, + Err(err) => { + warn!("Error {err} while fetching our own block from peer {authority_index}. Will retry."); + results.push(fetch_own_block(authority_index, FETCH_OWN_BLOCK_RETRY_DELAY)); + } + } + }, + () = &mut timer => { + info!("Timeout while trying to sync our own last block from peers"); + break; + } + } + } + + // Update the Core with the highest detected round + if total_stake == 0 { + panic!("No peer has returned any acceptable result, can not safely update min round"); + } + + context.metrics.node_metrics.last_known_own_block_round.set(highest_round as i64); + + info!("{} out of {} total stake returned acceptable results for our own last block with highest round {}", total_stake, context.committee.total_stake(), highest_round); + if let Err(err) = core_dispatcher.set_last_known_proposed_round(highest_round) { + warn!("Error received while calling dispatcher, probably dispatcher is shutting down, will now exit: {err:?}"); + } + })); + } + async fn start_fetch_missing_blocks_task(&mut self) -> ConsensusResult<()> { let (commit_lagging, last_commit_index, quorum_commit_index) = self.is_commit_lagging(); if commit_lagging { @@ -847,9 +992,9 @@ mod tests { use async_trait::async_trait; use bytes::Bytes; - use consensus_config::AuthorityIndex; + use consensus_config::{AuthorityIndex, Parameters}; use parking_lot::RwLock; - use tokio::time::sleep; + use tokio::{sync::Mutex, time::sleep}; use crate::authority_service::COMMIT_LAG_MULTIPLIER; use crate::commit::{CommitVote, TrustedCommit}; @@ -873,8 +1018,9 @@ mod tests { // TODO: create a complete Mock for thread dispatcher to be used from several tests #[derive(Default)] struct MockCoreThreadDispatcher { - add_blocks: tokio::sync::Mutex>, - missing_blocks: tokio::sync::Mutex>, + add_blocks: Mutex>, + missing_blocks: Mutex>, + last_known_proposed_round: parking_lot::Mutex>, } impl MockCoreThreadDispatcher { @@ -887,6 +1033,11 @@ mod tests { let mut lock = self.missing_blocks.lock().await; lock.extend(block_refs); } + + async fn get_last_own_proposed_round(&self) -> Vec { + let lock = self.last_known_proposed_round.lock(); + lock.clone() + } } #[async_trait] @@ -901,7 +1052,7 @@ mod tests { } async fn new_block(&self, _round: Round, _force: bool) -> Result<(), CoreError> { - todo!() + Ok(()) } async fn get_missing_blocks(&self) -> Result, CoreError> { @@ -915,17 +1066,23 @@ mod tests { todo!() } - fn set_last_known_proposed_round(&self, _round: Round) -> Result<(), CoreError> { - todo!() + fn set_last_known_proposed_round(&self, round: Round) -> Result<(), CoreError> { + let mut lock = self.last_known_proposed_round.lock(); + lock.push(round); + Ok(()) } } type FetchRequestKey = (Vec, AuthorityIndex); type FetchRequestResponse = (Vec, Option); + type FetchLatestBlockKey = (AuthorityIndex, Vec); + type FetchLatestBlockResponse = (Vec, Option); #[derive(Default)] struct MockNetworkClient { - fetch_blocks_requests: tokio::sync::Mutex>, + fetch_blocks_requests: Mutex>, + fetch_latest_blocks_requests: + Mutex>, } impl MockNetworkClient { @@ -942,6 +1099,17 @@ mod tests { .collect::>(); lock.insert((block_refs, peer), (blocks, latency)); } + + async fn stub_fetch_latest_blocks( + &self, + blocks: Vec, + peer: AuthorityIndex, + authorities: Vec, + latency: Option, + ) { + let mut lock = self.fetch_latest_blocks_requests.lock().await; + lock.insert((peer, authorities), (blocks, latency)); + } } #[async_trait] @@ -1004,11 +1172,28 @@ mod tests { async fn fetch_latest_blocks( &self, - _peer: AuthorityIndex, - _authorities: Vec, + peer: AuthorityIndex, + authorities: Vec, _timeout: Duration, ) -> ConsensusResult> { - todo!() + let mut lock = self.fetch_latest_blocks_requests.lock().await; + let response = lock + .remove(&(peer, authorities)) + .expect("Unexpected fetch blocks request made"); + + let serialised = response + .0 + .into_iter() + .map(|block| block.serialized().clone()) + .collect::>(); + + if let Some(latency) = response.1 { + sleep(latency).await; + } + + drop(lock); + + Ok(serialised) } } @@ -1355,4 +1540,83 @@ mod tests { let added_blocks = core_dispatcher.get_add_blocks().await; assert_eq!(added_blocks, expected_blocks); } + + #[tokio::test(flavor = "current_thread", start_paused = true)] + async fn synchronizer_fetch_own_last_block() { + // GIVEN + let (context, _) = Context::new_for_test(4); + let context = Arc::new(context.with_parameters(Parameters { + sync_last_proposed_block_timeout: Duration::from_millis(2_000), + ..Default::default() + })); + let block_verifier = Arc::new(NoopBlockVerifier {}); + let core_dispatcher = Arc::new(MockCoreThreadDispatcher::default()); + let network_client = Arc::new(MockNetworkClient::default()); + let commit_vote_monitor = Arc::new(CommitVoteMonitor::new(context.clone())); + let store = Arc::new(MemStore::new()); + let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store))); + let our_index = AuthorityIndex::new_for_test(0); + + // Create some test blocks + let mut expected_blocks = (9..=10) + .map(|round| VerifiedBlock::new_for_test(TestBlock::new(round, 0).build())) + .collect::>(); + + // Now set different latest blocks for the peers + // For peer 1 we give the block of round 10 (highest) + network_client + .stub_fetch_latest_blocks( + vec![expected_blocks.pop().unwrap()], + AuthorityIndex::new_for_test(1), + vec![our_index], + None, + ) + .await; + + // For peer 2 we give the block of round 9 + network_client + .stub_fetch_latest_blocks( + vec![expected_blocks.pop().unwrap()], + AuthorityIndex::new_for_test(2), + vec![our_index], + None, + ) + .await; + + // For peer 3 we don't give any block - and it should return an empty vector + network_client + .stub_fetch_latest_blocks( + vec![], + AuthorityIndex::new_for_test(3), + vec![our_index], + None, + ) + .await; + + // WHEN start the synchronizer and wait for a couple of seconds + let handle = Synchronizer::start( + network_client.clone(), + context.clone(), + core_dispatcher.clone(), + commit_vote_monitor, + block_verifier, + dag_state, + ); + + // Wait at least for the timeout time + sleep(context.parameters.sync_last_proposed_block_timeout * 2).await; + + // Assert that core has been called to set the min propose round + assert_eq!( + core_dispatcher.get_last_own_proposed_round().await, + vec![10] + ); + + // Ensure that no panic occurred + if let Err(err) = handle.stop().await { + if err.is_panic() { + std::panic::resume_unwind(err.into_panic()); + } + } + } } From ff941c13f7dafe3394191309d6b32c3d498deacf Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:29:09 -0700 Subject: [PATCH 105/163] [DB] increase parallelism per db from 4 to 8, and allow env var override (#18748) ## Description If a DB has a large number of column families, and each of them receives a large amount of writes, there will be a large number of memtable flushes and compactions that need to be processed. Only allowing 4 concurrent processing per DB seems not enough, as observed on some column families stopping writes because of too many memtables pending to flush. The default is increased to 8. Allow the value to be overridden by env var, so operators can increase / decrease the value on their own. Remove the `set_max_background_jobs()` call since it effect is overwritten by the subsequent `increase_parallelism()` call. ## Test plan Private testnet. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/typed-store/src/rocks/mod.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/crates/typed-store/src/rocks/mod.rs b/crates/typed-store/src/rocks/mod.rs index 3999add625e65..6b759c340e064 100644 --- a/crates/typed-store/src/rocks/mod.rs +++ b/crates/typed-store/src/rocks/mod.rs @@ -71,7 +71,7 @@ const DEFAULT_TARGET_FILE_SIZE_BASE_MB: usize = 128; // Set to 1 to disable blob storage for transactions and effects. const ENV_VAR_DISABLE_BLOB_STORAGE: &str = "DISABLE_BLOB_STORAGE"; -const ENV_VAR_MAX_BACKGROUND_JOBS: &str = "MAX_BACKGROUND_JOBS"; +const ENV_VAR_DB_PARALLELISM: &str = "DB_PARALLELISM"; // TODO: remove this after Rust rocksdb has the TOTAL_BLOB_FILES_SIZE property built-in. // From https://github.com/facebook/rocksdb/blob/bd80433c73691031ba7baa65c16c63a83aef201a/include/rocksdb/db.h#L1169 @@ -2444,13 +2444,6 @@ pub fn default_db_options() -> DBOptions { opt.set_bottommost_compression_type(rocksdb::DBCompressionType::Zstd); opt.set_bottommost_zstd_max_train_bytes(1024 * 1024, true); - opt.set_max_background_jobs( - read_size_from_env(ENV_VAR_MAX_BACKGROUND_JOBS) - .unwrap_or(2) - .try_into() - .unwrap(), - ); - // Sui uses multiple RocksDB in a node, so total sizes of write buffers and WAL can be higher // than the limits below. // @@ -2469,8 +2462,8 @@ pub fn default_db_options() -> DBOptions { read_size_from_env(ENV_VAR_DB_WAL_SIZE).unwrap_or(DEFAULT_DB_WAL_SIZE) as u64 * 1024 * 1024, ); - // Num threads for compaction and flush. - opt.increase_parallelism(4); + // Num threads for compactions and memtable flushes. + opt.increase_parallelism(read_size_from_env(ENV_VAR_DB_PARALLELISM).unwrap_or(8) as i32); opt.set_enable_pipelined_write(true); From ef4639cc7095820e7ff8471bf77fa2a46a81a719 Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Mon, 22 Jul 2024 15:18:23 -0400 Subject: [PATCH 106/163] add randomness workload to sui-benchmark (#18758) --- crates/sui-benchmark/src/options.rs | 5 +- crates/sui-benchmark/src/workloads/mod.rs | 1 + .../sui-benchmark/src/workloads/randomness.rs | 215 ++++++++++++++++++ .../src/workloads/workload_configuration.rs | 17 +- crates/sui-benchmark/tests/simtest.rs | 4 + .../sui-test-transaction-builder/src/lib.rs | 17 ++ 6 files changed, 257 insertions(+), 2 deletions(-) create mode 100644 crates/sui-benchmark/src/workloads/randomness.rs diff --git a/crates/sui-benchmark/src/options.rs b/crates/sui-benchmark/src/options.rs index 1dc0f5c3ce53e..f924aa54f110a 100644 --- a/crates/sui-benchmark/src/options.rs +++ b/crates/sui-benchmark/src/options.rs @@ -175,9 +175,12 @@ pub enum RunSpec { // relative weight of adversarial transactions in the benchmark workload #[clap(long, num_args(1..), value_delimiter = ',', default_values_t = [0])] adversarial: Vec, - // relative weight of adversarial transactions in the benchmark workload + // relative weight of shared deletion transactions in the benchmark workload #[clap(long, num_args(1..), value_delimiter = ',', default_values_t = [0])] shared_deletion: Vec, + // relative weight of randomness transactions in the benchmark workload + #[clap(long, num_args(1..), value_delimiter = ',', default_values_t = [0])] + randomness: Vec, // --- workload-specific options --- (TODO: use subcommands or similar) // 100 for max hotness i.e all requests target diff --git a/crates/sui-benchmark/src/workloads/mod.rs b/crates/sui-benchmark/src/workloads/mod.rs index 3d2910fa55292..5dd11418f1a5f 100644 --- a/crates/sui-benchmark/src/workloads/mod.rs +++ b/crates/sui-benchmark/src/workloads/mod.rs @@ -5,6 +5,7 @@ pub mod adversarial; pub mod batch_payment; pub mod delegation; pub mod payload; +pub mod randomness; pub mod shared_counter; pub mod shared_object_deletion; pub mod transfer_object; diff --git a/crates/sui-benchmark/src/workloads/randomness.rs b/crates/sui-benchmark/src/workloads/randomness.rs new file mode 100644 index 0000000000000..6729f49f13f43 --- /dev/null +++ b/crates/sui-benchmark/src/workloads/randomness.rs @@ -0,0 +1,215 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::drivers::Interval; +use crate::system_state_observer::SystemStateObserver; +use crate::util::publish_basics_package; +use crate::workloads::payload::Payload; +use crate::workloads::workload::{ + Workload, WorkloadBuilder, ESTIMATED_COMPUTATION_COST, MAX_GAS_FOR_TESTING, +}; +use crate::workloads::GasCoinConfig; +use crate::workloads::{Gas, WorkloadBuilderInfo, WorkloadParams}; +use crate::{ExecutionEffects, ValidatorProxy}; +use async_trait::async_trait; +use std::sync::Arc; +use sui_test_transaction_builder::TestTransactionBuilder; +use sui_types::crypto::get_key_pair; +use sui_types::object::Owner; +use sui_types::SUI_RANDOMNESS_STATE_OBJECT_ID; +use sui_types::{ + base_types::{ObjectID, SequenceNumber}, + transaction::Transaction, +}; +use tracing::{error, info}; + +/// The max amount of gas units needed for a payload. +pub const MAX_GAS_IN_UNIT: u64 = 1_000_000_000; + +#[derive(Debug)] +pub struct RandomnessTestPayload { + package_id: ObjectID, + randomness_initial_shared_version: SequenceNumber, + gas: Gas, + system_state_observer: Arc, +} + +impl std::fmt::Display for RandomnessTestPayload { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "randomness") + } +} + +impl Payload for RandomnessTestPayload { + fn make_new_payload(&mut self, effects: &ExecutionEffects) { + if !effects.is_ok() { + effects.print_gas_summary(); + error!("Randomness tx failed... Status: {:?}", effects.status()); + } + self.gas.0 = effects.gas_object().0; + } + fn make_transaction(&mut self) -> Transaction { + let rgp = self + .system_state_observer + .state + .borrow() + .reference_gas_price; + TestTransactionBuilder::new(self.gas.1, self.gas.0, rgp) + .call_emit_random(self.package_id, self.randomness_initial_shared_version) + .build_and_sign(self.gas.2.as_ref()) + } +} + +#[derive(Debug)] +pub struct RandomnessWorkloadBuilder { + num_payloads: u64, + rgp: u64, +} + +impl RandomnessWorkloadBuilder { + pub fn from( + workload_weight: f32, + target_qps: u64, + num_workers: u64, + in_flight_ratio: u64, + reference_gas_price: u64, + duration: Interval, + group: u32, + ) -> Option { + let target_qps = (workload_weight * target_qps as f32) as u64; + let num_workers = (workload_weight * num_workers as f32).ceil() as u64; + let max_ops = target_qps * in_flight_ratio; + if max_ops == 0 || num_workers == 0 { + None + } else { + let workload_params = WorkloadParams { + group, + target_qps, + num_workers, + max_ops, + duration, + }; + let workload_builder = Box::>::from(Box::new( + RandomnessWorkloadBuilder { + num_payloads: max_ops, + rgp: reference_gas_price, + }, + )); + let builder_info = WorkloadBuilderInfo { + workload_params, + workload_builder, + }; + Some(builder_info) + } + } +} + +#[async_trait] +impl WorkloadBuilder for RandomnessWorkloadBuilder { + async fn generate_coin_config_for_init(&self) -> Vec { + let (address, keypair) = get_key_pair(); + vec![GasCoinConfig { + amount: MAX_GAS_FOR_TESTING, + address, + keypair: Arc::new(keypair), + }] + } + async fn generate_coin_config_for_payloads(&self) -> Vec { + let mut configs = vec![]; + let amount = MAX_GAS_IN_UNIT * self.rgp + ESTIMATED_COMPUTATION_COST; + // Gas coins for running workload + for _i in 0..self.num_payloads { + let (address, keypair) = get_key_pair(); + configs.push(GasCoinConfig { + amount, + address, + keypair: Arc::new(keypair), + }); + } + configs + } + async fn build( + &self, + init_gas: Vec, + payload_gas: Vec, + ) -> Box> { + Box::>::from(Box::new(RandomnessWorkload { + basics_package_id: None, + randomness_initial_shared_version: None, + init_gas, + payload_gas, + })) + } +} + +#[derive(Debug)] +pub struct RandomnessWorkload { + pub basics_package_id: Option, + pub randomness_initial_shared_version: Option, + pub init_gas: Vec, + pub payload_gas: Vec, +} + +#[async_trait] +impl Workload for RandomnessWorkload { + async fn init( + &mut self, + proxy: Arc, + system_state_observer: Arc, + ) { + if self.basics_package_id.is_some() { + return; + } + let gas_price = system_state_observer.state.borrow().reference_gas_price; + let gas = self + .init_gas + .first() + .expect("Not enough gas to initialize randomness workload"); + + // Publish basics package + if self.basics_package_id.is_none() { + info!("Publishing basics package"); + self.basics_package_id = Some( + publish_basics_package(gas.0, proxy.clone(), gas.1, &gas.2, gas_price) + .await + .0, + ); + info!("Basics package id {:?}", self.basics_package_id); + } + + // Get randomness shared object initial version + if self.randomness_initial_shared_version.is_none() { + let obj = proxy + .get_object(SUI_RANDOMNESS_STATE_OBJECT_ID) + .await + .expect("Failed to get randomness object"); + let Owner::Shared { + initial_shared_version, + } = obj.owner() + else { + panic!("randomness object must be shared"); + }; + self.randomness_initial_shared_version = Some(*initial_shared_version); + } + } + async fn make_test_payloads( + &self, + _proxy: Arc, + system_state_observer: Arc, + ) -> Vec> { + let mut shared_payloads = vec![]; + for g in self.payload_gas.iter() { + shared_payloads.push(Box::new(RandomnessTestPayload { + package_id: self.basics_package_id.unwrap(), + randomness_initial_shared_version: self.randomness_initial_shared_version.unwrap(), + gas: g.clone(), + system_state_observer: system_state_observer.clone(), + })); + } + let payloads: Vec> = shared_payloads + .into_iter() + .map(|b| Box::::from(b)) + .collect(); + payloads + } +} diff --git a/crates/sui-benchmark/src/workloads/workload_configuration.rs b/crates/sui-benchmark/src/workloads/workload_configuration.rs index e94cb435c710c..aae4924eaf469 100644 --- a/crates/sui-benchmark/src/workloads/workload_configuration.rs +++ b/crates/sui-benchmark/src/workloads/workload_configuration.rs @@ -17,6 +17,7 @@ use std::sync::Arc; use tracing::info; use super::adversarial::{AdversarialPayloadCfg, AdversarialWorkloadBuilder}; +use super::randomness::RandomnessWorkloadBuilder; use super::shared_object_deletion::SharedCounterDeletionWorkloadBuilder; pub struct WorkloadConfiguration; @@ -39,6 +40,7 @@ impl WorkloadConfiguration { delegation, batch_payment, adversarial, + randomness, shared_counter_hotness_factor, num_shared_counters, shared_counter_max_tip, @@ -69,6 +71,7 @@ impl WorkloadConfiguration { shared_deletion[i], adversarial[i], AdversarialPayloadCfg::from_str(&adversarial_cfg[i]).unwrap(), + randomness[i], batch_payment_size[i], shared_counter_hotness_factor[i], num_shared_counters.as_ref().map(|n| n[i]), @@ -146,6 +149,7 @@ impl WorkloadConfiguration { shared_deletion_weight: u32, adversarial_weight: u32, adversarial_cfg: AdversarialPayloadCfg, + randomness_weight: u32, batch_payment_size: u32, shared_counter_hotness_factor: u32, num_shared_counters: Option, @@ -160,7 +164,8 @@ impl WorkloadConfiguration { + transfer_object_weight + delegation_weight + batch_payment_weight - + adversarial_weight; + + adversarial_weight + + randomness_weight; let reference_gas_price = system_state_observer.state.borrow().reference_gas_price; let mut workload_builders = vec![]; let shared_workload = SharedCounterWorkloadBuilder::from( @@ -227,6 +232,16 @@ impl WorkloadConfiguration { workload_group, ); workload_builders.push(adversarial_workload); + let randomness_workload = RandomnessWorkloadBuilder::from( + randomness_weight as f32 / total_weight as f32, + target_qps, + num_workers, + in_flight_ratio, + reference_gas_price, + duration, + workload_group, + ); + workload_builders.push(randomness_workload); workload_builders } diff --git a/crates/sui-benchmark/tests/simtest.rs b/crates/sui-benchmark/tests/simtest.rs index 270a2fd6af878..b1698066da3b2 100644 --- a/crates/sui-benchmark/tests/simtest.rs +++ b/crates/sui-benchmark/tests/simtest.rs @@ -811,6 +811,7 @@ mod test { batch_payment_weight: u32, shared_deletion_weight: u32, shared_counter_hotness_factor: u32, + randomness_weight: u32, num_shared_counters: Option, use_shared_counter_max_tip: bool, shared_counter_max_tip: u64, @@ -826,6 +827,7 @@ mod test { batch_payment_weight: 1, shared_deletion_weight: 1, shared_counter_hotness_factor: 50, + randomness_weight: 1, num_shared_counters: Some(1), use_shared_counter_max_tip: false, shared_counter_max_tip: 0, @@ -886,6 +888,7 @@ mod test { let delegation_weight = config.delegation_weight; let batch_payment_weight = config.batch_payment_weight; let shared_object_deletion_weight = config.shared_deletion_weight; + let randomness_weight = config.randomness_weight; // Run random payloads at 100% load let adversarial_cfg = AdversarialPayloadCfg::from_str("0-1.0").unwrap(); @@ -916,6 +919,7 @@ mod test { shared_object_deletion_weight, adversarial_weight, adversarial_cfg, + randomness_weight, batch_payment_size, shared_counter_hotness_factor, num_shared_counters, diff --git a/crates/sui-test-transaction-builder/src/lib.rs b/crates/sui-test-transaction-builder/src/lib.rs index 95a27462e3508..6b79fdef33b4f 100644 --- a/crates/sui-test-transaction-builder/src/lib.rs +++ b/crates/sui-test-transaction-builder/src/lib.rs @@ -183,6 +183,23 @@ impl TestTransactionBuilder { ) } + pub fn call_emit_random( + self, + package_id: ObjectID, + randomness_initial_shared_version: SequenceNumber, + ) -> Self { + self.move_call( + package_id, + "random", + "new", + vec![CallArg::Object(ObjectArg::SharedObject { + id: SUI_RANDOMNESS_STATE_OBJECT_ID, + initial_shared_version: randomness_initial_shared_version, + mutable: false, + })], + ) + } + pub fn call_request_add_validator(self) -> Self { self.move_call( SUI_SYSTEM_PACKAGE_ID, From 907e571805570bbaf5dda22884c071cfe1f5edf3 Mon Sep 17 00:00:00 2001 From: techdebt-99 <150741822+techdebt-99@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:55:44 -0600 Subject: [PATCH 107/163] Update zklogin.mdx (#18766) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- docs/content/concepts/cryptography/zklogin.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/concepts/cryptography/zklogin.mdx b/docs/content/concepts/cryptography/zklogin.mdx index c6b6a82ab27e7..220c2b5131e82 100644 --- a/docs/content/concepts/cryptography/zklogin.mdx +++ b/docs/content/concepts/cryptography/zklogin.mdx @@ -59,7 +59,7 @@ In rough sketches, the zkLogin protocol relies on the following: 1. Application frontend: This describes the wallet or frontend application that supports zkLogin. This frontend is responsible for storing the ephemeral private key, directing users to complete the OAuth login flow, creating and signing a zkLogin transaction. -2. Salt Backup Service: This is a backend service responsible for returning a salt per unique user. See [integration guide](#integration-guide) for other strategies to maintain salt. +2. Salt Backup Service: This is a backend service responsible for returning a salt per unique user. See [zkLogin Integration Guide](../../guides/developer/cryptography/zklogin-integration.mdx) for other strategies to maintain salt. 3. ZK Proving Service: This is a backend service responsible for generating ZK proofs based on JWT, JWT randomness, user salt and max epoch. This proof is submitted on-chain along with the ephemeral signature for a zkLogin transaction. @@ -325,4 +325,4 @@ Yes. See the [Multisig Guide](https://sdk.mystenlabs.com/typescript/cryptography ## Related links - [zkLogin Implementation Guide](../../guides/developer/cryptography/zklogin-integration.mdx) -- [zkLogin Example](../../guides/developer/cryptography/zklogin-integration/zklogin-example.mdx) \ No newline at end of file +- [zkLogin Example](../../guides/developer/cryptography/zklogin-integration/zklogin-example.mdx) From c24115c282a53601dfd2778a491841cd649fc079 Mon Sep 17 00:00:00 2001 From: Todd Nowacki Date: Mon, 22 Jul 2024 18:58:02 -0700 Subject: [PATCH 108/163] [move-2024] Fixed issue with macro fun declarations causing circular dependencies (#18747) ## Description - Macro signatures were erroneously being included in dependency checking ## Test plan - Added a new test and macro --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../packages/move-stdlib/sources/vector.move | 10 ++++++++++ .../packages/move-stdlib/tests/vector_tests.move | 11 +++++++++++ .../src/typing/dependency_ordering.rs | 11 ++++++++--- .../move_2024/typing/macro_dependency_cycle.move | 14 ++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.move diff --git a/crates/sui-framework/packages/move-stdlib/sources/vector.move b/crates/sui-framework/packages/move-stdlib/sources/vector.move index a619296d67aa9..92936616a084a 100644 --- a/crates/sui-framework/packages/move-stdlib/sources/vector.move +++ b/crates/sui-framework/packages/move-stdlib/sources/vector.move @@ -229,6 +229,16 @@ module std::vector { (r1, r2) } + /// Finds the index of first element in the vector `v` that satisfies the predicate `f`. + /// Returns `some(index)` if such an element is found, otherwise `none()`. + public macro fun find_index<$T>($v: vector<$T>, $f: |&$T| -> bool): Option { + let v = $v; + 'find_index: { + v.length().do!(|i| if ($f(&v[i])) return 'find_index option::some(i)); + option::none() + } + } + /// Reduce the vector `v` to a single value by applying the function `f` to each element. /// Similar to `fold_left` in Rust and `reduce` in Python and JavaScript. public macro fun fold<$T, $Acc>($v: vector<$T>, $init: $Acc, $f: |$Acc, $T| -> $Acc): $Acc { diff --git a/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move b/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move index f1ad5c2bfa64f..5ce37113f8031 100644 --- a/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move +++ b/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move @@ -649,6 +649,17 @@ module std::vector_tests { assert!(odd == vector[1, 3]); } + #[test] + fun find_index_macro() { + let e = vector[]; + assert!(e.find_index!(|e| *e == 0).is_none()); + assert!(e.find_index!(|_| true).is_none()); + + let r = vector[0, 10, 100, 1_000]; + assert!(r.find_index!(|e| *e == 100).destroy_some() == 2); + assert!(r.find_index!(|e| *e == 10_000).is_none()); + } + #[test] fun fold_macro() { let e = vector[]; diff --git a/external-crates/move/crates/move-compiler/src/typing/dependency_ordering.rs b/external-crates/move/crates/move-compiler/src/typing/dependency_ordering.rs index c87c12b0718b1..be058f0afac57 100644 --- a/external-crates/move/crates/move-compiler/src/typing/dependency_ordering.rs +++ b/external-crates/move/crates/move-compiler/src/typing/dependency_ordering.rs @@ -261,9 +261,14 @@ fn module(context: &mut Context, mident: ModuleIdent, mdef: &T::ModuleDefinition //************************************************************************************************** fn function(context: &mut Context, fdef: &T::Function) { - function_signature(context, &fdef.signature); - if let T::FunctionBody_::Defined(seq) = &fdef.body.value { - sequence(context, seq) + match &fdef.body.value { + T::FunctionBody_::Defined(seq) => { + function_signature(context, &fdef.signature); + sequence(context, seq) + } + T::FunctionBody_::Native => function_signature(context, &fdef.signature), + // macros do not add dependencies + T::FunctionBody_::Macro => (), } } diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.move new file mode 100644 index 0000000000000..3ce9d0a3df97e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.move @@ -0,0 +1,14 @@ +module a::m { + public fun foo() {} + public macro fun bar() { a::n::bar() } +} + +module a::n { + public fun bar() {} + public macro fun foo() { a::m::foo() } +} + +module a::t { + public fun foo() { a::m::bar!() } + public fun bar() { a::n::foo!() } +} From 36f6a8652baf57e1ec3172109ccf01c337d01d6d Mon Sep 17 00:00:00 2001 From: Ge Gao <106119108+gegaowp@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:38:24 -0400 Subject: [PATCH 109/163] indexer: move partition dropping to pruner (#18762) ## Description split epoch advance and partition dropping, and move partition dropping to pruner so that all pruning tasks are in sync and tracked by pruner watermark table. ## Test plan local run and verify that - partition dropping still works - pruning are indeed in sync and accurately tracked by `pruner_watermark_cp` table --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-indexer/src/handlers/pruner.rs | 52 ++++++++++-- crates/sui-indexer/src/indexer.rs | 3 +- crates/sui-indexer/src/store/mod.rs | 2 +- .../sui-indexer/src/store/pg_indexer_store.rs | 8 +- .../src/store/pg_partition_manager.rs | 79 ++++++++++--------- 5 files changed, 92 insertions(+), 52 deletions(-) diff --git a/crates/sui-indexer/src/handlers/pruner.rs b/crates/sui-indexer/src/handlers/pruner.rs index 389a375a0275c..aec9a8839eb5b 100644 --- a/crates/sui-indexer/src/handlers/pruner.rs +++ b/crates/sui-indexer/src/handlers/pruner.rs @@ -3,27 +3,41 @@ use std::time::Duration; +use diesel::r2d2::R2D2Connection; use tokio_util::sync::CancellationToken; use tracing::{error, info}; +use crate::errors::IndexerError; +use crate::store::pg_partition_manager::PgPartitionManager; use crate::{metrics::IndexerMetrics, store::IndexerStore, types::IndexerResult}; -pub struct Pruner { +use super::checkpoint_handler::CheckpointHandler; + +pub struct Pruner { pub store: S, + pub partition_manager: PgPartitionManager, pub epochs_to_keep: u64, pub metrics: IndexerMetrics, } -impl Pruner +impl Pruner where S: IndexerStore + Clone + Sync + Send + 'static, + T: R2D2Connection + 'static, { - pub fn new(store: S, epochs_to_keep: u64, metrics: IndexerMetrics) -> Self { - Self { + pub fn new( + store: S, + epochs_to_keep: u64, + metrics: IndexerMetrics, + ) -> Result { + let blocking_cp = CheckpointHandler::::pg_blocking_cp(store.clone()).unwrap(); + let partition_manager = PgPartitionManager::new(blocking_cp.clone())?; + Ok(Self { store, + partition_manager, epochs_to_keep, metrics, - } + }) } pub async fn start(&self, cancel: CancellationToken) -> IndexerResult<()> { @@ -43,12 +57,38 @@ where (min_epoch, max_epoch) = self.store.get_available_epoch_range().await?; } - for epoch in min_epoch..=max_epoch - self.epochs_to_keep { + let table_partitions = self.partition_manager.get_table_partitions()?; + let table_names = table_partitions.keys().cloned().collect::>(); + for (table_name, (min_partition, max_partition)) in table_partitions { + if max_epoch != max_partition { + error!( + "Epochs are out of sync for table {}: max_epoch={}, max_partition={}", + table_name, max_epoch, max_partition + ); + } + // drop partitions if pruning is enabled afterwards, where all epochs before min_epoch + // would have been pruned already if the pruner was running. + for epoch in min_partition..min_epoch { + self.partition_manager + .drop_table_partition(table_name.clone(), epoch)?; + info!( + "Batch dropped table partition {} epoch {}", + table_name, epoch + ); + } + } + + for epoch in min_epoch..max_epoch.saturating_sub(self.epochs_to_keep - 1) { if cancel.is_cancelled() { info!("Pruner task cancelled."); return Ok(()); } info!("Pruning epoch {}", epoch); + for table_name in table_names.clone() { + self.partition_manager + .drop_table_partition(table_name.clone(), epoch)?; + info!("Dropped table partition {} epoch {}", table_name, epoch); + } self.store.prune_epoch(epoch).await.unwrap_or_else(|e| { error!("Failed to prune epoch {}: {}", epoch, e); }); diff --git a/crates/sui-indexer/src/indexer.rs b/crates/sui-indexer/src/indexer.rs index 72361e405e785..3b71cf795d37f 100644 --- a/crates/sui-indexer/src/indexer.rs +++ b/crates/sui-indexer/src/indexer.rs @@ -117,7 +117,8 @@ impl Indexer { "Starting indexer pruner with epochs to keep: {}", epochs_to_keep ); - let pruner = Pruner::new(store.clone(), epochs_to_keep, metrics.clone()); + assert!(epochs_to_keep > 0, "Epochs to keep must be positive"); + let pruner: Pruner = Pruner::new(store.clone(), epochs_to_keep, metrics.clone())?; spawn_monitored_task!(pruner.start(CancellationToken::new())); } diff --git a/crates/sui-indexer/src/store/mod.rs b/crates/sui-indexer/src/store/mod.rs index 87bbbda82b577..ae04c2ea1c1c2 100644 --- a/crates/sui-indexer/src/store/mod.rs +++ b/crates/sui-indexer/src/store/mod.rs @@ -7,7 +7,7 @@ pub use pg_indexer_store::PgIndexerStore; pub mod indexer_store; pub mod package_resolver; mod pg_indexer_store; -mod pg_partition_manager; +pub mod pg_partition_manager; pub mod diesel_macro { thread_local! { diff --git a/crates/sui-indexer/src/store/pg_indexer_store.rs b/crates/sui-indexer/src/store/pg_indexer_store.rs index 02ba0347a0774..fc4537cf73084 100644 --- a/crates/sui-indexer/src/store/pg_indexer_store.rs +++ b/crates/sui-indexer/src/store/pg_indexer_store.rs @@ -993,7 +993,7 @@ impl PgIndexerStore { if let Some(last_epoch) = &epoch.last_epoch { let last_epoch_id = last_epoch.epoch; let last_epoch = StoredEpochInfo::from_epoch_end_info(last_epoch); - info!(last_epoch_id, "Persisting epoch end data: {:?}", last_epoch); + info!(last_epoch_id, "Persisting epoch end data."); on_conflict_do_update!( epochs::table, vec![last_epoch], @@ -1073,14 +1073,12 @@ impl PgIndexerStore { let epoch_partition_data = EpochPartitionData::compose_data(epoch_to_commit, last_epoch); let table_partitions = self.partition_manager.get_table_partitions()?; - for (table, (first_partition, last_partition)) in table_partitions { + for (table, (_, last_partition)) in table_partitions { let guard = self.metrics.advance_epoch_latency.start_timer(); - self.partition_manager.advance_and_prune_epoch_partition( + self.partition_manager.advance_epoch( table.clone(), - first_partition, last_partition, &epoch_partition_data, - self.config.epochs_to_keep, )?; let elapsed = guard.stop_and_record(); info!( diff --git a/crates/sui-indexer/src/store/pg_partition_manager.rs b/crates/sui-indexer/src/store/pg_partition_manager.rs index fc92299be3356..f67f1ed6b4041 100644 --- a/crates/sui-indexer/src/store/pg_partition_manager.rs +++ b/crates/sui-indexer/src/store/pg_partition_manager.rs @@ -116,13 +116,11 @@ impl PgPartitionManager { ) } - pub fn advance_and_prune_epoch_partition( + pub fn advance_epoch( &self, table: String, - first_partition: u64, last_partition: u64, data: &EpochPartitionData, - epochs_to_keep: Option, ) -> Result<(), IndexerError> { if data.next_epoch == 0 { tracing::info!("Epoch 0 partition has been created in the initial setup."); @@ -154,46 +152,11 @@ impl PgPartitionManager { }, Duration::from_secs(10) )?; + info!( "Advanced epoch partition for table {} from {} to {}, prev partition upper bound {}", table, last_partition, data.next_epoch, data.last_epoch_start_cp ); - - // prune old partitions beyond the retention period - if let Some(epochs_to_keep) = epochs_to_keep { - for epoch in first_partition..(data.next_epoch - epochs_to_keep + 1) { - #[cfg(feature = "postgres-feature")] - transactional_blocking_with_retry!( - &self.cp, - |conn| { - RunQueryDsl::execute( - diesel::sql_query("CALL drop_partition($1, $2)") - .bind::(table.clone()) - .bind::(epoch as i64), - conn, - ) - }, - Duration::from_secs(10) - )?; - #[cfg(feature = "mysql-feature")] - #[cfg(not(feature = "postgres-feature"))] - transactional_blocking_with_retry!( - &self.cp, - |conn| { - RunQueryDsl::execute( - diesel::sql_query(format!( - "ALTER TABLE {} DROP PARTITION partition_{}", - table.clone(), - epoch - )), - conn, - ) - }, - Duration::from_secs(10) - )?; - info!("Dropped epoch partition {} for table {}", epoch, table); - } - } } else if last_partition != data.next_epoch { // skip when the partition is already advanced once, which is possible when indexer // crashes and restarts; error otherwise. @@ -201,7 +164,45 @@ impl PgPartitionManager { "Epoch partition for table {} is not in sync with the last epoch {}.", table, data.last_epoch ); + } else { + info!( + "Epoch has been advanced to {} already, skipping.", + data.next_epoch + ); } Ok(()) } + + pub fn drop_table_partition(&self, table: String, partition: u64) -> Result<(), IndexerError> { + #[cfg(feature = "postgres-feature")] + transactional_blocking_with_retry!( + &self.cp, + |conn| { + RunQueryDsl::execute( + diesel::sql_query("CALL drop_partition($1, $2)") + .bind::(table.clone()) + .bind::(partition as i64), + conn, + ) + }, + Duration::from_secs(10) + )?; + #[cfg(feature = "mysql-feature")] + #[cfg(not(feature = "postgres-feature"))] + transactional_blocking_with_retry!( + &self.cp, + |conn| { + RunQueryDsl::execute( + diesel::sql_query(format!( + "ALTER TABLE {} DROP PARTITION partition_{}", + table.clone(), + partition + )), + conn, + ) + }, + Duration::from_secs(10) + )?; + Ok(()) + } } From 8ca9eae404b956bca9820bedab0ae2558eabb554 Mon Sep 17 00:00:00 2001 From: Stefanos Pleros <36567567+StefPler@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:44:07 +0300 Subject: [PATCH 110/163] [Docs - NFT Rental] Updates broken link (#18769) ## Description Updates a broken link in the [related links](https://docs.sui.io/guides/developer/nft/nft-rental#related-links) section ## Test plan Run locally the doc site and tested that the link has been successfully updated. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- docs/content/guides/developer/nft/nft-rental.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/guides/developer/nft/nft-rental.mdx b/docs/content/guides/developer/nft/nft-rental.mdx index 051188cfc8a6d..f77c528d1027b 100644 --- a/docs/content/guides/developer/nft/nft-rental.mdx +++ b/docs/content/guides/developer/nft/nft-rental.mdx @@ -649,7 +649,7 @@ rect rgba(191, 223, 255, 0.2) ## Related links -- [NFT Rental example](https://github.com/MystenLabs/sui-nft-rental): The source code that this document references. +- [NFT Rental example](https://github.com/MystenLabs/sui/tree/main/examples/move/nft-rental): The source code that this document references. - [Sui Kiosk](../../../standards/kiosk.mdx): Kiosk is a decentralized system for commerce applications on Sui. - [Kiosk Apps](../../../standards/kiosk-apps.mdx): The Kiosk Apps standard extends the functionality of Sui Kiosk. - [Custom Transfer Rules](../../../concepts/transfers/custom-rules.mdx): Custom transfer rules are used in this example to define rental policies. \ No newline at end of file From e1418dfe2a5246c1dcc16590982d34ee870400d5 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 16 Jul 2024 13:47:44 -0500 Subject: [PATCH 111/163] rest: properly return preferred Accept format --- crates/sui-rest-api/src/accept.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/sui-rest-api/src/accept.rs b/crates/sui-rest-api/src/accept.rs index 06b0f46afb4ec..0348388cc60ba 100644 --- a/crates/sui-rest-api/src/accept.rs +++ b/crates/sui-rest-api/src/accept.rs @@ -67,7 +67,11 @@ where let accept = Accept::from_request_parts(parts, s).await?; for mime in accept.0 { - if mime.as_ref() == APPLICATION_BCS { + let essence = mime.essence_str(); + + if essence == mime::APPLICATION_JSON.essence_str() { + return Ok(Self::Json); + } else if essence == APPLICATION_BCS { return Ok(Self::Bcs); } } From c0672be34952f1b80327a9917a5fe0d1b9c655df Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 16 Jul 2024 13:48:15 -0500 Subject: [PATCH 112/163] rest: add a JsonSchema for U64 --- crates/sui-rest-api/src/lib.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/crates/sui-rest-api/src/lib.rs b/crates/sui-rest-api/src/lib.rs index 089edfaa065d2..f0926fe79e6cc 100644 --- a/crates/sui-rest-api/src/lib.rs +++ b/crates/sui-rest-api/src/lib.rs @@ -198,6 +198,38 @@ fn info() -> openapiv3::v3_1::Info { } } +mod _schemars { + use schemars::schema::InstanceType; + use schemars::schema::Metadata; + use schemars::schema::SchemaObject; + use schemars::JsonSchema; + + pub(crate) struct U64; + + impl JsonSchema for U64 { + fn schema_name() -> String { + "u64".to_owned() + } + + fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + SchemaObject { + metadata: Some(Box::new(Metadata { + description: Some("Radix-10 encoded 64-bit unsigned integer".to_owned()), + ..Default::default() + })), + instance_type: Some(InstanceType::String.into()), + format: Some("u64".to_owned()), + ..Default::default() + } + .into() + } + + fn is_referenceable() -> bool { + false + } + } +} + #[cfg(test)] mod test { use super::*; From 179b98931a5428dee2106307b6806434138496ee Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 16 Jul 2024 13:49:54 -0500 Subject: [PATCH 113/163] rest: correct get_node_info schema --- crates/sui-rest-api/openapi/openapi.json | 52 ++++++++++++++++-------- crates/sui-rest-api/src/info.rs | 41 ++++++++++++------- 2 files changed, 62 insertions(+), 31 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index 24588c0fd3e0d..d1d44600144e0 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -20,7 +20,24 @@ ], "paths": { "/": { - "get": {} + "get": { + "tags": [ + "General" + ], + "operationId": "GetNodeInfo", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeInfo" + } + } + } + } + } + } }, "/health": { "get": {} @@ -2704,32 +2721,32 @@ "$ref": "#/components/schemas/CheckpointDigest" }, "checkpoint_height": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" }, "epoch": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" }, "lowest_available_checkpoint": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" }, "lowest_available_checkpoint_objects": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" }, "software_version": { "type": "string" }, "timestamp_ms": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" } } }, @@ -4432,6 +4449,9 @@ } }, "tags": [ + { + "name": "General" + }, { "name": "Objects" }, diff --git a/crates/sui-rest-api/src/info.rs b/crates/sui-rest-api/src/info.rs index aba6d74341758..868802194129d 100644 --- a/crates/sui-rest-api/src/info.rs +++ b/crates/sui-rest-api/src/info.rs @@ -3,10 +3,10 @@ use std::borrow::Cow; -use crate::openapi::{ApiEndpoint, RouteHandler}; -use crate::{accept::AcceptFormat, response::ResponseContent}; +use crate::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; use crate::{RestService, Result}; use axum::extract::State; +use axum::Json; use sui_sdk2::types::CheckpointDigest; use tap::Pipe; @@ -25,9 +25,16 @@ impl ApiEndpoint for GetNodeInfo { &self, generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - generator.subschema_for::(); - - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("General") + .operation_id("GetNodeInfo") + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .build(), + ) + .build() } fn handler(&self) -> crate::openapi::RouteHandler { @@ -35,10 +42,7 @@ impl ApiEndpoint for GetNodeInfo { } } -async fn get_node_info( - accept: AcceptFormat, - State(state): State, -) -> Result> { +async fn get_node_info(State(state): State) -> Result> { let latest_checkpoint = state.reader.inner().get_latest_checkpoint()?; let lowest_available_checkpoint = state.reader.inner().get_lowest_available_checkpoint()?; let lowest_available_checkpoint_objects = state @@ -46,7 +50,7 @@ async fn get_node_info( .inner() .get_lowest_available_checkpoint_objects()?; - let response = NodeInfo { + NodeInfo { checkpoint_height: latest_checkpoint.sequence_number, lowest_available_checkpoint, lowest_available_checkpoint_objects, @@ -55,23 +59,30 @@ async fn get_node_info( chain_id: CheckpointDigest::new(state.chain_id().as_bytes().to_owned()), chain: state.chain_id().chain().as_str().into(), software_version: state.software_version().into(), - }; - - match accept { - AcceptFormat::Json => ResponseContent::Json(response), - AcceptFormat::Bcs => ResponseContent::Bcs(response), } + .pipe(Json) .pipe(Ok) } +#[serde_with::serde_as] #[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] pub struct NodeInfo { pub chain_id: CheckpointDigest, pub chain: Cow<'static, str>, + #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub epoch: u64, + #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub checkpoint_height: u64, + #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub timestamp_ms: u64, + #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub lowest_available_checkpoint: u64, + #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub lowest_available_checkpoint_objects: u64, pub software_version: Cow<'static, str>, //TODO include current protocol version From 5d47ed35044ff5b8bb76628c73aafc933846ba16 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 16 Jul 2024 13:50:21 -0500 Subject: [PATCH 114/163] rest: correct list_account_objects schema --- crates/sui-rest-api/openapi/openapi.json | 87 +++++++++++++++++++++++- crates/sui-rest-api/src/accounts.rs | 75 ++++++++++++-------- 2 files changed, 131 insertions(+), 31 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index d1d44600144e0..81f96d680261e 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -43,7 +43,64 @@ "get": {} }, "/accounts/{account}/objects": { - "get": {} + "get": { + "tags": [ + "Account" + ], + "operationId": "ListAccountObjects", + "parameters": [ + { + "in": "path", + "name": "account", + "required": true, + "schema": { + "$ref": "#/components/schemas/Address" + }, + "style": "simple" + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "start", + "schema": { + "$ref": "#/components/schemas/ObjectId" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "headers": { + "x-sui-cursor": { + "style": "simple", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountOwnedObjectInfo" + } + } + } + } + } + } + } }, "/objects/{object_id}": { "get": { @@ -357,6 +414,31 @@ }, "components": { "schemas": { + "AccountOwnedObjectInfo": { + "type": "object", + "required": [ + "object_id", + "owner", + "type", + "version" + ], + "properties": { + "object_id": { + "$ref": "#/components/schemas/ObjectId" + }, + "owner": { + "$ref": "#/components/schemas/Address" + }, + "type": { + "$ref": "#/components/schemas/StructTag" + }, + "version": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + } + } + }, "ActiveJwk": { "type": "object", "required": [ @@ -4449,6 +4531,9 @@ } }, "tags": [ + { + "name": "Account" + }, { "name": "General" }, diff --git a/crates/sui-rest-api/src/accounts.rs b/crates/sui-rest-api/src/accounts.rs index 0ca4ad91433bb..8bf9af6e328ae 100644 --- a/crates/sui-rest-api/src/accounts.rs +++ b/crates/sui-rest-api/src/accounts.rs @@ -1,16 +1,15 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::openapi::{ApiEndpoint, RouteHandler}; +use crate::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; use crate::reader::StateReader; -use crate::{accept::AcceptFormat, response::ResponseContent, Result}; +use crate::{response::ResponseContent, Result}; use crate::{Page, RestService}; use axum::extract::Query; use axum::extract::{Path, State}; -use itertools::Itertools; use openapiv3::v3_1::Operation; -use sui_sdk2::types::{Address, Object, ObjectId}; -use sui_types::storage::ObjectKey; +use sui_sdk2::types::{Address, ObjectId, StructTag, Version}; +use sui_types::sui_sdk2_conversions::struct_tag_core_to_sdk; use tap::Pipe; pub struct ListAccountObjects; @@ -25,9 +24,19 @@ impl ApiEndpoint for ListAccountObjects { } fn operation(&self, generator: &mut schemars::gen::SchemaGenerator) -> Operation { - generator.subschema_for::(); - - Operation::default() + OperationBuilder::new() + .tag("Account") + .operation_id("ListAccountObjects") + .path_parameter::
("account", generator) + .query_parameters::(generator) + .response( + 200, + ResponseBuilder::new() + .json_content::>(generator) + .header::(crate::types::X_SUI_CURSOR, generator) + .build(), + ) + .build() } fn handler(&self) -> crate::openapi::RouteHandler { @@ -38,44 +47,38 @@ impl ApiEndpoint for ListAccountObjects { async fn list_account_objects( Path(address): Path
, Query(parameters): Query, - accept: AcceptFormat, State(state): State, -) -> Result> { +) -> Result> { let limit = parameters.limit(); let start = parameters.start(); - let mut object_keys = state + let mut object_info = state .inner() .account_owned_objects_info_iter(address.into(), start)? - .map(|info| ObjectKey(info.object_id, info.version)) + .map(|info| AccountOwnedObjectInfo { + owner: info.owner.into(), + object_id: info.object_id.into(), + version: info.version.into(), + type_: struct_tag_core_to_sdk(info.type_.into()), + }) .take(limit + 1) .collect::>(); - let cursor = if object_keys.len() > limit { - // SAFETY: We've already verified that object_keys is greater than limit, which is + let cursor = if object_info.len() > limit { + // SAFETY: We've already verified that object_info is greater than limit, which is // gaurenteed to be >= 1. - object_keys.pop().unwrap().0.pipe(ObjectId::from).pipe(Some) + object_info.pop().unwrap().object_id.pipe(Some) } else { None }; - let objects = state - .inner() - .multi_get_objects_by_key(&object_keys)? - .into_iter() - .flatten() - .map(Into::into) - .collect_vec(); - - match accept { - AcceptFormat::Json => ResponseContent::Json(objects), - AcceptFormat::Bcs => ResponseContent::Bcs(objects), - } - .pipe(|entries| Page { entries, cursor }) - .pipe(Ok) + object_info + .pipe(ResponseContent::Json) + .pipe(|entries| Page { entries, cursor }) + .pipe(Ok) } -#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] pub struct ListAccountOwnedObjectsQueryParameters { pub limit: Option, pub start: Option, @@ -92,3 +95,15 @@ impl ListAccountOwnedObjectsQueryParameters { self.start.map(Into::into) } } + +#[serde_with::serde_as] +#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] +pub struct AccountOwnedObjectInfo { + pub owner: Address, + pub object_id: ObjectId, + #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] + pub version: Version, + #[serde(rename = "type")] + pub type_: StructTag, +} From 730f2c63338484e881ae9372fb2821948059a620 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 09:21:08 -0500 Subject: [PATCH 115/163] rest: define openapi schema for health check endpoint --- crates/sui-rest-api/openapi/openapi.json | 27 +++++++++++++++++++++++- crates/sui-rest-api/src/health.rs | 16 ++++++++++++-- crates/sui-rest-api/src/openapi.rs | 4 ++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index 81f96d680261e..29c5ef7141b93 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -40,7 +40,32 @@ } }, "/health": { - "get": {} + "get": { + "tags": [ + "General" + ], + "operationId": "HealthCheck", + "parameters": [ + { + "in": "query", + "name": "threshold_seconds", + "schema": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "text/plain; charset=utf-8": {} + } + } + } + } }, "/accounts/{account}/objects": { "get": { diff --git a/crates/sui-rest-api/src/health.rs b/crates/sui-rest-api/src/health.rs index b7aa28bc63e63..d76e622124647 100644 --- a/crates/sui-rest-api/src/health.rs +++ b/crates/sui-rest-api/src/health.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{ - openapi::{ApiEndpoint, RouteHandler}, + openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}, reader::StateReader, RestService, Result, }; @@ -26,12 +26,24 @@ impl ApiEndpoint for HealthCheck { "/health" } + fn operation( + &self, + generator: &mut schemars::gen::SchemaGenerator, + ) -> openapiv3::v3_1::Operation { + OperationBuilder::new() + .tag("General") + .operation_id("HealthCheck") + .query_parameters::(generator) + .response(200, ResponseBuilder::new().text_content().build()) + .build() + } + fn handler(&self) -> crate::openapi::RouteHandler { RouteHandler::new(self.method(), health) } } -#[derive(serde::Deserialize, serde::Serialize)] +#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] pub struct Threshold { pub threshold_seconds: Option, } diff --git a/crates/sui-rest-api/src/openapi.rs b/crates/sui-rest-api/src/openapi.rs index c053cfce5fb28..2aeff52f48bdb 100644 --- a/crates/sui-rest-api/src/openapi.rs +++ b/crates/sui-rest-api/src/openapi.rs @@ -593,6 +593,10 @@ impl ResponseBuilder { pub fn bcs_content(&mut self) -> &mut Self { self.content(crate::APPLICATION_BCS, MediaType::default()) } + + pub fn text_content(&mut self) -> &mut Self { + self.content(mime::TEXT_PLAIN_UTF_8.as_ref(), MediaType::default()) + } } #[derive(Default)] From 808410fae71e35d545e3322e1eb680c57315fba8 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 09:34:28 -0500 Subject: [PATCH 116/163] rest: define openapi schema for checkpoint endpoints --- crates/sui-rest-api/openapi/openapi.json | 210 +++++++++++------------ crates/sui-rest-api/src/checkpoints.rs | 57 ++++-- 2 files changed, 149 insertions(+), 118 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index 29c5ef7141b93..696cc0e634367 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -263,13 +263,108 @@ } }, "/checkpoints": { - "get": {} + "get": { + "tags": [ + "Checkpoint" + ], + "operationId": "ListCheckpoints", + "parameters": [ + { + "in": "query", + "name": "direction", + "schema": { + "$ref": "#/components/schemas/Direction" + }, + "style": "form" + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "start", + "description": "The checkpoint to start listing from.\n\nDefaults to the latest checkpoint if not provided.", + "schema": { + "description": "The checkpoint to start listing from.\n\nDefaults to the latest checkpoint if not provided.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "headers": { + "x-sui-cursor": { + "style": "simple", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SignedCheckpointSummary" + } + } + }, + "application/bcs": {} + } + }, + "410": { + "description": "" + } + } + } }, "/checkpoints/{checkpoint}": { - "get": {} - }, - "/checkpoints/{checkpoint}/full": { - "get": {} + "get": { + "tags": [ + "Checkpoint" + ], + "operationId": "GetCheckpoint", + "parameters": [ + { + "in": "path", + "name": "checkpoint", + "required": true, + "schema": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignedCheckpointSummary" + } + }, + "application/bcs": {} + } + }, + "404": { + "description": "" + } + } + } }, "/transactions/{transaction}": { "get": { @@ -654,37 +749,9 @@ } ] }, - "CheckpointContents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CheckpointTransactionInfo" - } - }, "CheckpointContentsDigest": { "$ref": "#/components/schemas/Digest" }, - "CheckpointData": { - "type": "object", - "required": [ - "checkpoint_contents", - "checkpoint_summary", - "transactions" - ], - "properties": { - "checkpoint_contents": { - "$ref": "#/components/schemas/CheckpointContents" - }, - "checkpoint_summary": { - "$ref": "#/components/schemas/SignedCheckpointSummary" - }, - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CheckpointTransaction" - } - } - } - }, "CheckpointDigest": { "$ref": "#/components/schemas/Digest" }, @@ -755,77 +822,6 @@ } } }, - "CheckpointTransaction": { - "type": "object", - "required": [ - "effects", - "input_objects", - "output_objects", - "transaction" - ], - "properties": { - "effects": { - "description": "The effects produced by executing this transaction", - "allOf": [ - { - "$ref": "#/components/schemas/TransactionEffects" - } - ] - }, - "events": { - "description": "The events, if any, emitted by this transaciton during execution", - "allOf": [ - { - "$ref": "#/components/schemas/TransactionEvents" - } - ] - }, - "input_objects": { - "description": "The state of all inputs to this transaction as they were prior to execution.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Object" - } - }, - "output_objects": { - "description": "The state of all output objects created or mutated by this transaction.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Object" - } - }, - "transaction": { - "description": "The input Transaction", - "allOf": [ - { - "$ref": "#/components/schemas/SignedTransaction" - } - ] - } - } - }, - "CheckpointTransactionInfo": { - "type": "object", - "required": [ - "effects", - "signatures", - "transaction" - ], - "properties": { - "effects": { - "$ref": "#/components/schemas/TransactionEffectsDigest" - }, - "signatures": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserSignature" - } - }, - "transaction": { - "$ref": "#/components/schemas/TransactionDigest" - } - } - }, "CircomG1": { "description": "A G1 point in BN254 serialized as a vector of three strings which is the canonical decimal representation of the projective coordinates in Fq.", "type": "array", @@ -3688,9 +3684,6 @@ } ] }, - "TransactionEffectsDigest": { - "$ref": "#/components/schemas/Digest" - }, "TransactionEvents": { "type": "array", "items": { @@ -4559,6 +4552,9 @@ { "name": "Account" }, + { + "name": "Checkpoint" + }, { "name": "General" }, diff --git a/crates/sui-rest-api/src/checkpoints.rs b/crates/sui-rest-api/src/checkpoints.rs index 85dca8f437f5a..ff11549529862 100644 --- a/crates/sui-rest-api/src/checkpoints.rs +++ b/crates/sui-rest-api/src/checkpoints.rs @@ -9,7 +9,7 @@ use sui_sdk2::types::{ use sui_types::storage::ReadStore; use tap::Pipe; -use crate::openapi::{ApiEndpoint, RouteHandler}; +use crate::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; use crate::reader::StateReader; use crate::Page; use crate::{accept::AcceptFormat, response::ResponseContent, Result}; @@ -26,13 +26,27 @@ impl ApiEndpoint for GetCheckpointFull { "/checkpoints/{checkpoint}/full" } + fn hidden(&self) -> bool { + true + } + fn operation( &self, generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - generator.subschema_for::(); - - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("Checkpoint") + .operation_id("GetCheckpointFull") + .path_parameter::("checkpoint", generator) + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .bcs_content() + .build(), + ) + .response(404, ResponseBuilder::new().build()) + .build() } fn handler(&self) -> RouteHandler { @@ -83,9 +97,19 @@ impl ApiEndpoint for GetCheckpoint { &self, generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - generator.subschema_for::(); - - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("Checkpoint") + .operation_id("GetCheckpoint") + .path_parameter::("checkpoint", generator) + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .bcs_content() + .build(), + ) + .response(404, ResponseBuilder::new().build()) + .build() } fn handler(&self) -> RouteHandler { @@ -189,9 +213,20 @@ impl ApiEndpoint for ListCheckpoints { &self, generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - generator.subschema_for::(); - - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("Checkpoint") + .operation_id("ListCheckpoints") + .query_parameters::(generator) + .response( + 200, + ResponseBuilder::new() + .json_content::>(generator) + .bcs_content() + .header::(crate::types::X_SUI_CURSOR, generator) + .build(), + ) + .response(410, ResponseBuilder::new().build()) + .build() } fn handler(&self) -> RouteHandler { @@ -238,7 +273,7 @@ async fn list_checkpoints( .pipe(Ok) } -#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] pub struct ListCheckpointsQueryParameters { pub limit: Option, /// The checkpoint to start listing from. From 36fa74f916eeb1602c71c3f3938d3ebd06a7f66c Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 09:51:16 -0500 Subject: [PATCH 117/163] chore: update sui-rust-sdk with hash feature enabled --- Cargo.lock | 3 ++- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1eae6e43e74d0..2e143a6eba94a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13820,10 +13820,11 @@ dependencies = [ [[package]] name = "sui-sdk" version = "0.0.0" -source = "git+https://github.com/mystenlabs/sui-rust-sdk.git?rev=be6a30039723bf8fabd64a8869b7e89596141551#be6a30039723bf8fabd64a8869b7e89596141551" +source = "git+https://github.com/mystenlabs/sui-rust-sdk.git?rev=9a125ed5764fb5bcc1acb6074064bc8f9ea85b38#9a125ed5764fb5bcc1acb6074064bc8f9ea85b38" dependencies = [ "base64ct", "bcs", + "blake2", "bnum", "bs58 0.5.0", "hex", diff --git a/Cargo.toml b/Cargo.toml index 6f5b1b61eaadb..60fe7f0ab17be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -582,7 +582,7 @@ anemo-cli = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9a anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } # core-types with json format for REST api -sui-sdk2 = { package = "sui-sdk", git = "https://github.com/mystenlabs/sui-rust-sdk.git", rev = "be6a30039723bf8fabd64a8869b7e89596141551", features = ["serde", "schemars"] } +sui-sdk2 = { package = "sui-sdk", git = "https://github.com/mystenlabs/sui-rust-sdk.git", rev = "9a125ed5764fb5bcc1acb6074064bc8f9ea85b38", features = ["hash", "serde", "schemars"] } ### Workspace Members ### anemo-benchmark = { path = "crates/anemo-benchmark" } From bc456c8819e834acd97e8f62c9b708500d07e865 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 09:52:57 -0500 Subject: [PATCH 118/163] rest: fix TransactionResponse serialization format --- crates/sui-rest-api/openapi/openapi.json | 30 ++++++++++++++++----- crates/sui-rest-api/src/reader.rs | 13 +++++++-- crates/sui-rest-api/src/transactions/mod.rs | 24 ++++++++++++----- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index 696cc0e634367..5fa7edea406db 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -394,6 +394,9 @@ }, "application/bcs": {} } + }, + "404": { + "description": "" } } } @@ -4066,14 +4069,20 @@ "TransactionResponse": { "type": "object", "required": [ + "digest", "effects", + "signatures", "transaction" ], "properties": { "checkpoint": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "description": "Radix-10 encoded 64-bit unsigned integer", + "default": null, + "type": "string", + "format": "u64" + }, + "digest": { + "$ref": "#/components/schemas/TransactionDigest" }, "effects": { "$ref": "#/components/schemas/TransactionEffects" @@ -4081,13 +4090,20 @@ "events": { "$ref": "#/components/schemas/TransactionEvents" }, + "signatures": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserSignature" + } + }, "timestamp_ms": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "description": "Radix-10 encoded 64-bit unsigned integer", + "default": null, + "type": "string", + "format": "u64" }, "transaction": { - "$ref": "#/components/schemas/SignedTransaction" + "$ref": "#/components/schemas/Transaction" } } }, diff --git a/crates/sui-rest-api/src/reader.rs b/crates/sui-rest-api/src/reader.rs index 414a811501631..dd07ba57ae88f 100644 --- a/crates/sui-rest-api/src/reader.rs +++ b/crates/sui-rest-api/src/reader.rs @@ -3,7 +3,7 @@ use std::sync::Arc; -use sui_sdk2::types::{CheckpointSequenceNumber, EpochId, ValidatorCommittee}; +use sui_sdk2::types::{CheckpointSequenceNumber, EpochId, SignedTransaction, ValidatorCommittee}; use sui_sdk2::types::{Object, ObjectId, Version}; use sui_types::storage::error::{Error as StorageError, Result}; use sui_types::storage::ObjectStore; @@ -97,7 +97,14 @@ impl StateReader { &self, digest: sui_sdk2::types::TransactionDigest, ) -> crate::Result { - let (transaction, effects, events) = self.get_transaction(digest)?; + let ( + SignedTransaction { + transaction, + signatures, + }, + effects, + events, + ) = self.get_transaction(digest)?; let checkpoint = self.inner().get_transaction_checkpoint(&(digest.into()))?; let timestamp_ms = if let Some(checkpoint) = checkpoint { @@ -109,7 +116,9 @@ impl StateReader { }; Ok(crate::transactions::TransactionResponse { + digest: transaction.digest(), transaction, + signatures, effects, events, checkpoint, diff --git a/crates/sui-rest-api/src/transactions/mod.rs b/crates/sui-rest-api/src/transactions/mod.rs index b43c9fb33aea1..5eab49a8897d6 100644 --- a/crates/sui-rest-api/src/transactions/mod.rs +++ b/crates/sui-rest-api/src/transactions/mod.rs @@ -9,9 +9,8 @@ pub use execution::TransactionExecutor; use axum::extract::{Path, Query, State}; use axum::http::StatusCode; use sui_sdk2::types::CheckpointSequenceNumber; -use sui_sdk2::types::{ - SignedTransaction, TransactionDigest, TransactionEffects, TransactionEvents, -}; +use sui_sdk2::types::Transaction; +use sui_sdk2::types::{TransactionDigest, TransactionEffects, TransactionEvents, UserSignature}; use tap::Pipe; use crate::openapi::ApiEndpoint; @@ -52,6 +51,7 @@ impl ApiEndpoint for GetTransaction { .bcs_content() .build(), ) + .response(404, ResponseBuilder::new().build()) .build() } @@ -74,13 +74,23 @@ async fn get_transaction( .pipe(Ok) } +#[serde_with::serde_as] #[derive(Debug, serde::Serialize, serde::Deserialize, schemars::JsonSchema)] pub struct TransactionResponse { - pub transaction: SignedTransaction, + pub digest: TransactionDigest, + pub transaction: Transaction, + pub signatures: Vec, pub effects: TransactionEffects, pub events: Option, - //TODO fix format of u64s + #[serde_as( + as = "Option, _>>" + )] + #[schemars(with = "Option")] pub checkpoint: Option, + #[serde_as( + as = "Option, _>>" + )] + #[schemars(with = "Option")] pub timestamp_ms: Option, } @@ -165,7 +175,9 @@ async fn list_transactions( state .get_transaction(digest.into()) .map(|(transaction, effects, events)| TransactionResponse { - transaction, + digest: transaction.transaction.digest(), + transaction: transaction.transaction, + signatures: transaction.signatures, effects, events, checkpoint: Some(cursor_info.checkpoint), From 663da05417d78b033a5adfe5992cfaebf22437a0 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 10:06:35 -0500 Subject: [PATCH 119/163] rest: add 404 response type to object endpoints --- crates/sui-rest-api/openapi/openapi.json | 6 ++++++ crates/sui-rest-api/src/objects.rs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index 5fa7edea406db..8565fce50198b 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -155,6 +155,9 @@ }, "application/bcs": {} } + }, + "404": { + "description": "" } } } @@ -198,6 +201,9 @@ }, "application/bcs": {} } + }, + "404": { + "description": "" } } } diff --git a/crates/sui-rest-api/src/objects.rs b/crates/sui-rest-api/src/objects.rs index f5499418e89e6..be10e0e38f58c 100644 --- a/crates/sui-rest-api/src/objects.rs +++ b/crates/sui-rest-api/src/objects.rs @@ -42,6 +42,7 @@ impl ApiEndpoint for GetObject { .bcs_content() .build(), ) + .response(404, ResponseBuilder::new().build()) .build() } @@ -93,6 +94,7 @@ impl ApiEndpoint for GetObjectWithVersion { .bcs_content() .build(), ) + .response(404, ResponseBuilder::new().build()) .build() } From 6845eea9ed086bc8f7a5f7de2f9a2e364ad52ec1 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 10:07:34 -0500 Subject: [PATCH 120/163] rest: define openapi schema for get_coin_info endpoint --- crates/sui-rest-api/openapi/openapi.json | 106 ++++++++++++++++++++++- crates/sui-rest-api/src/coins.rs | 38 ++++---- 2 files changed, 125 insertions(+), 19 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index 8565fce50198b..dae607b15baae 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -490,7 +490,38 @@ "get": {} }, "/coins/{coin_type}": { - "get": {} + "get": { + "tags": [ + "Coins" + ], + "operationId": "GetCoinInfo", + "parameters": [ + { + "in": "path", + "name": "coin_type", + "required": true, + "schema": { + "$ref": "#/components/schemas/StructTag" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CoinInfo" + } + } + } + }, + "404": { + "description": "" + } + } + } }, "/openapi": { "get": { @@ -872,6 +903,76 @@ } } }, + "CoinInfo": { + "type": "object", + "required": [ + "coin_type" + ], + "properties": { + "coin_type": { + "$ref": "#/components/schemas/StructTag" + }, + "metadata": { + "$ref": "#/components/schemas/CoinMetadata" + }, + "treasury": { + "$ref": "#/components/schemas/CoinTreasury" + } + } + }, + "CoinMetadata": { + "type": "object", + "required": [ + "decimals", + "description", + "id", + "name", + "symbol" + ], + "properties": { + "decimals": { + "description": "Number of decimal places the coin uses.", + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "description": { + "description": "Description of the token", + "type": "string" + }, + "icon_url": { + "description": "URL for the token logo", + "type": "string" + }, + "id": { + "$ref": "#/components/schemas/ObjectId" + }, + "name": { + "description": "Name for the token", + "type": "string" + }, + "symbol": { + "description": "Symbol for the token", + "type": "string" + } + } + }, + "CoinTreasury": { + "type": "object", + "required": [ + "total_supply" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/ObjectId" + }, + "total_supply": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + } + } + }, "Command": { "description": "A single command in a programmable transaction.", "oneOf": [ @@ -4577,6 +4678,9 @@ { "name": "Checkpoint" }, + { + "name": "Coins" + }, { "name": "General" }, diff --git a/crates/sui-rest-api/src/coins.rs b/crates/sui-rest-api/src/coins.rs index dc6e438584302..6d2661f10ab43 100644 --- a/crates/sui-rest-api/src/coins.rs +++ b/crates/sui-rest-api/src/coins.rs @@ -1,12 +1,13 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::openapi::{ApiEndpoint, RouteHandler}; +use crate::openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}; use crate::RestError; use crate::RestService; -use crate::{accept::AcceptFormat, reader::StateReader, Result}; +use crate::{reader::StateReader, Result}; use axum::extract::{Path, State}; use axum::Json; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use sui_sdk2::types::{ObjectId, StructTag}; use sui_types::sui_sdk2_conversions::struct_tag_sdk_to_core; @@ -24,9 +25,20 @@ impl ApiEndpoint for GetCoinInfo { fn operation( &self, - _generator: &mut schemars::gen::SchemaGenerator, + generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("Coins") + .operation_id("GetCoinInfo") + .path_parameter::("coin_type", generator) + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .build(), + ) + .response(404, ResponseBuilder::new().build()) + .build() } fn handler(&self) -> crate::openapi::RouteHandler { @@ -36,19 +48,8 @@ impl ApiEndpoint for GetCoinInfo { async fn get_coin_info( Path(coin_type): Path, - accept: AcceptFormat, State(state): State, ) -> Result> { - match accept { - AcceptFormat::Json => {} - _ => { - return Err(RestError::new( - axum::http::StatusCode::BAD_REQUEST, - "invalid accept type", - )) - } - } - let core_coin_type = struct_tag_sdk_to_core(coin_type.clone()); let sui_types::storage::CoinInfo { @@ -122,14 +123,14 @@ impl From for crate::RestError { } } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct CoinInfo { pub coin_type: StructTag, pub metadata: Option, pub treasury: Option, } -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, JsonSchema)] pub struct CoinMetadata { pub id: ObjectId, /// Number of decimal places the coin uses. @@ -158,10 +159,11 @@ impl From for CoinMetadata { } #[serde_with::serde_as] -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, JsonSchema)] pub struct CoinTreasury { pub id: Option, #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub total_supply: u64, } From 80814b4fb9234b6b5b4fa6e1805e849cf8d0e744 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 10:26:33 -0500 Subject: [PATCH 121/163] rest: define openapi schema for system endpoints --- crates/sui-rest-api/openapi/openapi.json | 636 ++++++++++++++++++++++- crates/sui-rest-api/src/system.rs | 121 ++++- 2 files changed, 742 insertions(+), 15 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index dae607b15baae..f3211b7b74589 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -478,16 +478,128 @@ "get": {} }, "/system": { - "get": {} + "get": { + "tags": [ + "System" + ], + "operationId": "GetSystemStateSummary", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemStateSummary" + } + } + } + } + } + } }, "/system/protocol": { - "get": {} + "get": { + "tags": [ + "System" + ], + "operationId": "GetCurrentProtocolConfig", + "responses": { + "200": { + "description": "", + "headers": { + "x-sui-min-supported-protocol-version": { + "style": "simple", + "schema": { + "type": "string" + } + }, + "x-sui-max-supported-protocol-version": { + "style": "simple", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProtocolConfig" + } + } + } + } + } + } }, "/system/protocol/{version}": { - "get": {} + "get": { + "tags": [ + "System" + ], + "operationId": "GetProtocolConfig", + "parameters": [ + { + "in": "path", + "name": "version", + "required": true, + "schema": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "headers": { + "x-sui-min-supported-protocol-version": { + "style": "simple", + "schema": { + "type": "string" + } + }, + "x-sui-max-supported-protocol-version": { + "style": "simple", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProtocolConfig" + } + } + } + }, + "404": { + "description": "" + } + } + } }, "/system/gas": { - "get": {} + "get": { + "tags": [ + "System" + ], + "operationId": "GetGasInfo", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GasInfo" + } + } + } + } + } + } }, "/coins/{coin_type}": { "get": { @@ -2408,6 +2520,19 @@ } } }, + "GasInfo": { + "type": "object", + "required": [ + "reference_gas_price" + ], + "properties": { + "reference_gas_price": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + } + } + }, "GasPayment": { "type": "object", "required": [ @@ -3369,6 +3494,33 @@ } ] }, + "ProtocolConfig": { + "type": "object", + "required": [ + "attributes", + "feature_flags", + "protocol_version" + ], + "properties": { + "attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "feature_flags": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "protocol_version": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + } + } + }, "Secp256k1PublicKey": { "description": "Base64 encoded data", "type": "string", @@ -3529,6 +3681,282 @@ } } }, + "SystemStateSummary": { + "type": "object", + "required": [ + "active_validators", + "at_risk_validators", + "epoch", + "epoch_duration_ms", + "epoch_start_timestamp_ms", + "inactive_pools_id", + "inactive_pools_size", + "max_validator_count", + "min_validator_joining_stake", + "pending_active_validators_id", + "pending_active_validators_size", + "pending_removals", + "protocol_version", + "reference_gas_price", + "safe_mode", + "safe_mode_computation_rewards", + "safe_mode_non_refundable_storage_fee", + "safe_mode_storage_rebates", + "safe_mode_storage_rewards", + "stake_subsidy_balance", + "stake_subsidy_current_distribution_amount", + "stake_subsidy_decrease_rate", + "stake_subsidy_distribution_counter", + "stake_subsidy_period_length", + "stake_subsidy_start_epoch", + "staking_pool_mappings_id", + "staking_pool_mappings_size", + "storage_fund_non_refundable_balance", + "storage_fund_total_object_storage_rebates", + "system_state_version", + "total_stake", + "validator_candidates_id", + "validator_candidates_size", + "validator_low_stake_grace_period", + "validator_low_stake_threshold", + "validator_report_records", + "validator_very_low_stake_threshold" + ], + "properties": { + "active_validators": { + "description": "The list of active validators in the current epoch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ValidatorSummary" + } + }, + "at_risk_validators": { + "description": "Map storing the number of epochs for which each validator has been below the low stake threshold.", + "type": "array", + "items": { + "type": "array", + "items": [ + { + "$ref": "#/components/schemas/Address" + }, + { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "epoch": { + "description": "The current epoch ID, starting from 0.", + "type": "string", + "format": "u64" + }, + "epoch_duration_ms": { + "description": "The duration of an epoch, in milliseconds.", + "type": "string", + "format": "u64" + }, + "epoch_start_timestamp_ms": { + "description": "Unix timestamp of the current epoch start", + "type": "string", + "format": "u64" + }, + "inactive_pools_id": { + "description": "ID of the object that maps from a staking pool ID to the inactive validator that has that pool as its staking pool.", + "allOf": [ + { + "$ref": "#/components/schemas/ObjectId" + } + ] + }, + "inactive_pools_size": { + "description": "Number of inactive staking pools.", + "type": "string", + "format": "u64" + }, + "max_validator_count": { + "description": "Maximum number of active validators at any moment. We do not allow the number of validators in any epoch to go above this.", + "type": "string", + "format": "u64" + }, + "min_validator_joining_stake": { + "description": "Lower-bound on the amount of stake required to become a validator.", + "type": "string", + "format": "u64" + }, + "pending_active_validators_id": { + "description": "ID of the object that contains the list of new validators that will join at the end of the epoch.", + "allOf": [ + { + "$ref": "#/components/schemas/ObjectId" + } + ] + }, + "pending_active_validators_size": { + "description": "Number of new validators that will join at the end of the epoch.", + "type": "string", + "format": "u64" + }, + "pending_removals": { + "description": "Removal requests from the validators. Each element is an index pointing to `active_validators`.", + "type": "array", + "items": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + } + }, + "protocol_version": { + "description": "The current protocol version, starting from 1.", + "type": "string", + "format": "u64" + }, + "reference_gas_price": { + "description": "The reference gas price for the current epoch.", + "type": "string", + "format": "u64" + }, + "safe_mode": { + "description": "Whether the system is running in a downgraded safe mode due to a non-recoverable bug. This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode. It can be reset once we are able to successfully execute advance_epoch.", + "type": "boolean" + }, + "safe_mode_computation_rewards": { + "description": "Amount of computation rewards accumulated (and not yet distributed) during safe mode.", + "type": "string", + "format": "u64" + }, + "safe_mode_non_refundable_storage_fee": { + "description": "Amount of non-refundable storage fee accumulated during safe mode.", + "type": "string", + "format": "u64" + }, + "safe_mode_storage_rebates": { + "description": "Amount of storage rebates accumulated (and not yet burned) during safe mode.", + "type": "string", + "format": "u64" + }, + "safe_mode_storage_rewards": { + "description": "Amount of storage rewards accumulated (and not yet distributed) during safe mode.", + "type": "string", + "format": "u64" + }, + "stake_subsidy_balance": { + "description": "Balance of SUI set aside for stake subsidies that will be drawn down over time.", + "type": "string", + "format": "u64" + }, + "stake_subsidy_current_distribution_amount": { + "description": "The amount of stake subsidy to be drawn down per epoch. This amount decays and decreases over time.", + "type": "string", + "format": "u64" + }, + "stake_subsidy_decrease_rate": { + "description": "The rate at which the distribution amount decays at the end of each period. Expressed in basis points.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "stake_subsidy_distribution_counter": { + "description": "This counter may be different from the current epoch number if in some epochs we decide to skip the subsidy.", + "type": "string", + "format": "u64" + }, + "stake_subsidy_period_length": { + "description": "Number of distributions to occur before the distribution amount decays.", + "type": "string", + "format": "u64" + }, + "stake_subsidy_start_epoch": { + "description": "The starting epoch in which stake subsidies start being paid out", + "type": "string", + "format": "u64" + }, + "staking_pool_mappings_id": { + "description": "ID of the object that maps from staking pool's ID to the sui address of a validator.", + "allOf": [ + { + "$ref": "#/components/schemas/ObjectId" + } + ] + }, + "staking_pool_mappings_size": { + "description": "Number of staking pool mappings.", + "type": "string", + "format": "u64" + }, + "storage_fund_non_refundable_balance": { + "description": "The non-refundable portion of the storage fund coming from storage reinvestment, non-refundable storage rebates and any leftover staking rewards.", + "type": "string", + "format": "u64" + }, + "storage_fund_total_object_storage_rebates": { + "description": "The storage rebates of all the objects on-chain stored in the storage fund.", + "type": "string", + "format": "u64" + }, + "system_state_version": { + "description": "The current version of the system state data structure type.", + "type": "string", + "format": "u64" + }, + "total_stake": { + "description": "Total amount of stake from all active validators at the beginning of the epoch.", + "type": "string", + "format": "u64" + }, + "validator_candidates_id": { + "description": "ID of the object that stores preactive validators, mapping their addresses to their `Validator` structs.", + "allOf": [ + { + "$ref": "#/components/schemas/ObjectId" + } + ] + }, + "validator_candidates_size": { + "description": "Number of preactive validators.", + "type": "string", + "format": "u64" + }, + "validator_low_stake_grace_period": { + "description": "A validator can have stake below `validator_low_stake_threshold` for this many epochs before being kicked out.", + "type": "string", + "format": "u64" + }, + "validator_low_stake_threshold": { + "description": "Validators with stake amount below `validator_low_stake_threshold` are considered to have low stake and will be escorted out of the validator set after being below this threshold for more than `validator_low_stake_grace_period` number of epochs.", + "type": "string", + "format": "u64" + }, + "validator_report_records": { + "description": "A map storing the records of validator reporting each other.", + "type": "array", + "items": { + "type": "array", + "items": [ + { + "$ref": "#/components/schemas/Address" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + } + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "validator_very_low_stake_threshold": { + "description": "Validators with stake below `validator_very_low_stake_threshold` will be removed immediately at epoch change, no grace period.", + "type": "string", + "format": "u64" + } + } + }, "Transaction": { "oneOf": [ { @@ -4608,6 +5036,203 @@ } } }, + "ValidatorSummary": { + "description": "This is the REST type for the sui validator. It flattens all inner structures to top-level fields so that they are decoupled from the internal definitions.", + "type": "object", + "required": [ + "address", + "commission_rate", + "description", + "exchange_rates_id", + "exchange_rates_size", + "gas_price", + "image_url", + "name", + "net_address", + "network_public_key", + "next_epoch_commission_rate", + "next_epoch_gas_price", + "next_epoch_stake", + "operation_cap_id", + "p2p_address", + "pending_pool_token_withdraw", + "pending_stake", + "pending_total_sui_withdraw", + "pool_token_balance", + "primary_address", + "project_url", + "proof_of_possession_bytes", + "protocol_public_key", + "rewards_pool", + "staking_pool_id", + "staking_pool_sui_balance", + "voting_power", + "worker_address", + "worker_public_key" + ], + "properties": { + "address": { + "$ref": "#/components/schemas/Address" + }, + "commission_rate": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + }, + "description": { + "type": "string" + }, + "exchange_rates_id": { + "description": "ID of the exchange rate table object.", + "allOf": [ + { + "$ref": "#/components/schemas/ObjectId" + } + ] + }, + "exchange_rates_size": { + "description": "Number of exchange rates in the table.", + "type": "string", + "format": "u64" + }, + "gas_price": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + }, + "image_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "net_address": { + "type": "string" + }, + "network_public_key": { + "$ref": "#/components/schemas/Ed25519PublicKey" + }, + "next_epoch_commission_rate": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + }, + "next_epoch_gas_price": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + }, + "next_epoch_net_address": { + "type": "string" + }, + "next_epoch_network_public_key": { + "$ref": "#/components/schemas/Ed25519PublicKey" + }, + "next_epoch_p2p_address": { + "type": "string" + }, + "next_epoch_primary_address": { + "type": "string" + }, + "next_epoch_proof_of_possession": { + "default": null, + "type": "string" + }, + "next_epoch_protocol_public_key": { + "$ref": "#/components/schemas/Bls12381PublicKey" + }, + "next_epoch_stake": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + }, + "next_epoch_worker_address": { + "type": "string" + }, + "next_epoch_worker_public_key": { + "$ref": "#/components/schemas/Ed25519PublicKey" + }, + "operation_cap_id": { + "$ref": "#/components/schemas/ObjectId" + }, + "p2p_address": { + "type": "string" + }, + "pending_pool_token_withdraw": { + "description": "Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.", + "type": "string", + "format": "u64" + }, + "pending_stake": { + "description": "Pending stake amount for this epoch.", + "type": "string", + "format": "u64" + }, + "pending_total_sui_withdraw": { + "description": "Pending stake withdrawn during the current epoch, emptied at epoch boundaries.", + "type": "string", + "format": "u64" + }, + "pool_token_balance": { + "description": "Total number of pool tokens issued by the pool.", + "type": "string", + "format": "u64" + }, + "primary_address": { + "type": "string" + }, + "project_url": { + "type": "string" + }, + "proof_of_possession_bytes": { + "type": "string" + }, + "protocol_public_key": { + "$ref": "#/components/schemas/Bls12381PublicKey" + }, + "rewards_pool": { + "description": "The epoch stake rewards will be added here at the end of each epoch.", + "type": "string", + "format": "u64" + }, + "staking_pool_activation_epoch": { + "description": "The epoch at which this pool became active.", + "default": null, + "type": "string", + "format": "u64" + }, + "staking_pool_deactivation_epoch": { + "description": "The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},", + "default": null, + "type": "string", + "format": "u64" + }, + "staking_pool_id": { + "description": "ID of the staking pool object.", + "allOf": [ + { + "$ref": "#/components/schemas/ObjectId" + } + ] + }, + "staking_pool_sui_balance": { + "description": "The total number of SUI tokens in this pool.", + "type": "string", + "format": "u64" + }, + "voting_power": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + }, + "worker_address": { + "type": "string" + }, + "worker_public_key": { + "$ref": "#/components/schemas/Ed25519PublicKey" + } + } + }, "VersionAssignment": { "type": "object", "required": [ @@ -4690,6 +5315,9 @@ { "name": "OpenApi" }, + { + "name": "System" + }, { "name": "Transactions" } diff --git a/crates/sui-rest-api/src/system.rs b/crates/sui-rest-api/src/system.rs index f20121ff1ea5d..e358a895350e8 100644 --- a/crates/sui-rest-api/src/system.rs +++ b/crates/sui-rest-api/src/system.rs @@ -3,7 +3,7 @@ use crate::{ accept::AcceptFormat, - openapi::{ApiEndpoint, RouteHandler}, + openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}, reader::StateReader, RestError, RestService, Result, }; @@ -11,6 +11,7 @@ use axum::{ extract::{Path, State}, Json, }; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use sui_protocol_config::{ProtocolConfig, ProtocolConfigValue, ProtocolVersion}; @@ -29,9 +30,18 @@ impl ApiEndpoint for GetSystemStateSummary { fn operation( &self, - _generator: &mut schemars::gen::SchemaGenerator, + generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("System") + .operation_id("GetSystemStateSummary") + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .build(), + ) + .build() } fn handler(&self) -> RouteHandler { @@ -59,26 +69,32 @@ async fn get_system_state_summary( } #[serde_with::serde_as] -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, JsonSchema)] pub struct SystemStateSummary { /// The current epoch ID, starting from 0. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub epoch: u64, /// The current protocol version, starting from 1. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub protocol_version: u64, /// The current version of the system state data structure type. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub system_state_version: u64, /// The storage rebates of all the objects on-chain stored in the storage fund. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub storage_fund_total_object_storage_rebates: u64, /// The non-refundable portion of the storage fund coming from storage reinvestment, non-refundable /// storage rebates and any leftover staking rewards. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub storage_fund_non_refundable_balance: u64, /// The reference gas price for the current epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub reference_gas_price: u64, /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug. /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode. @@ -86,68 +102,84 @@ pub struct SystemStateSummary { pub safe_mode: bool, /// Amount of storage rewards accumulated (and not yet distributed) during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub safe_mode_storage_rewards: u64, /// Amount of computation rewards accumulated (and not yet distributed) during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub safe_mode_computation_rewards: u64, /// Amount of storage rebates accumulated (and not yet burned) during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub safe_mode_storage_rebates: u64, /// Amount of non-refundable storage fee accumulated during safe mode. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub safe_mode_non_refundable_storage_fee: u64, /// Unix timestamp of the current epoch start #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub epoch_start_timestamp_ms: u64, // System parameters /// The duration of an epoch, in milliseconds. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub epoch_duration_ms: u64, /// The starting epoch in which stake subsidies start being paid out #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub stake_subsidy_start_epoch: u64, /// Maximum number of active validators at any moment. /// We do not allow the number of validators in any epoch to go above this. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub max_validator_count: u64, /// Lower-bound on the amount of stake required to become a validator. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub min_validator_joining_stake: u64, /// Validators with stake amount below `validator_low_stake_threshold` are considered to /// have low stake and will be escorted out of the validator set after being below this /// threshold for more than `validator_low_stake_grace_period` number of epochs. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub validator_low_stake_threshold: u64, /// Validators with stake below `validator_very_low_stake_threshold` will be removed /// immediately at epoch change, no grace period. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub validator_very_low_stake_threshold: u64, /// A validator can have stake below `validator_low_stake_threshold` /// for this many epochs before being kicked out. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub validator_low_stake_grace_period: u64, // Stake subsidy information /// Balance of SUI set aside for stake subsidies that will be drawn down over time. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub stake_subsidy_balance: u64, /// This counter may be different from the current epoch number if /// in some epochs we decide to skip the subsidy. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub stake_subsidy_distribution_counter: u64, /// The amount of stake subsidy to be drawn down per epoch. /// This amount decays and decreases over time. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub stake_subsidy_current_distribution_amount: u64, /// Number of distributions to occur before the distribution amount decays. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub stake_subsidy_period_length: u64, /// The rate at which the distribution amount decays at the end of each /// period. Expressed in basis points. @@ -156,6 +188,7 @@ pub struct SystemStateSummary { // Validator set /// Total amount of stake from all active validators at the beginning of the epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub total_stake: u64, /// The list of active validators in the current epoch. pub active_validators: Vec, @@ -163,28 +196,34 @@ pub struct SystemStateSummary { pub pending_active_validators_id: ObjectId, /// Number of new validators that will join at the end of the epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub pending_active_validators_size: u64, /// Removal requests from the validators. Each element is an index /// pointing to `active_validators`. #[serde_as(as = "Vec>")] + #[schemars(with = "Vec")] pub pending_removals: Vec, /// ID of the object that maps from staking pool's ID to the sui address of a validator. pub staking_pool_mappings_id: ObjectId, /// Number of staking pool mappings. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub staking_pool_mappings_size: u64, /// ID of the object that maps from a staking pool ID to the inactive validator that has that pool as its staking pool. pub inactive_pools_id: ObjectId, /// Number of inactive staking pools. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub inactive_pools_size: u64, /// ID of the object that stores preactive validators, mapping their addresses to their `Validator` structs. pub validator_candidates_id: ObjectId, /// Number of preactive validators. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub validator_candidates_size: u64, /// Map storing the number of epochs for which each validator has been below the low stake threshold. #[serde_as(as = "Vec<(_, sui_types::sui_serde::BigInt)>")] + #[schemars(with = "Vec<(Address, crate::_schemars::U64)>")] pub at_risk_validators: Vec<(Address, u64)>, /// A map storing the records of validator reporting each other. pub validator_report_records: Vec<(Address, Vec
)>, @@ -193,7 +232,7 @@ pub struct SystemStateSummary { /// This is the REST type for the sui validator. It flattens all inner structures /// to top-level fields so that they are decoupled from the internal definitions. #[serde_with::serde_as] -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, JsonSchema)] pub struct ValidatorSummary { // Metadata pub address: Address, @@ -201,6 +240,7 @@ pub struct ValidatorSummary { pub network_public_key: sui_sdk2::types::Ed25519PublicKey, pub worker_public_key: sui_sdk2::types::Ed25519PublicKey, #[serde_as(as = "fastcrypto::encoding::Base64")] + #[schemars(with = "String")] pub proof_of_possession_bytes: Vec, pub name: String, pub description: String, @@ -214,6 +254,7 @@ pub struct ValidatorSummary { pub next_epoch_network_public_key: Option, pub next_epoch_worker_public_key: Option, #[serde_as(as = "Option")] + #[schemars(with = "Option")] pub next_epoch_proof_of_possession: Option>, pub next_epoch_net_address: Option, pub next_epoch_p2p_address: Option, @@ -221,17 +262,23 @@ pub struct ValidatorSummary { pub next_epoch_worker_address: Option, #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub voting_power: u64, pub operation_cap_id: ObjectId, #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub gas_price: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub commission_rate: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub next_epoch_stake: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub next_epoch_gas_price: u64, #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub next_epoch_commission_rate: u64, // Staking pool information @@ -239,32 +286,41 @@ pub struct ValidatorSummary { pub staking_pool_id: ObjectId, /// The epoch at which this pool became active. #[serde_as(as = "Option>")] + #[schemars(with = "Option")] pub staking_pool_activation_epoch: Option, /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active}, #[serde_as(as = "Option>")] + #[schemars(with = "Option")] pub staking_pool_deactivation_epoch: Option, /// The total number of SUI tokens in this pool. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub staking_pool_sui_balance: u64, /// The epoch stake rewards will be added here at the end of each epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub rewards_pool: u64, /// Total number of pool tokens issued by the pool. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub pool_token_balance: u64, /// Pending stake amount for this epoch. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub pending_stake: u64, /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub pending_total_sui_withdraw: u64, /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub pending_pool_token_withdraw: u64, /// ID of the exchange rate table object. pub exchange_rates_id: ObjectId, /// Number of exchange rates in the table. #[serde_as(as = "sui_types::sui_serde::BigInt")] + #[schemars(with = "crate::_schemars::U64")] pub exchange_rates_size: u64, } @@ -480,9 +536,20 @@ impl ApiEndpoint for GetCurrentProtocolConfig { fn operation( &self, - _generator: &mut schemars::gen::SchemaGenerator, + generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("System") + .operation_id("GetCurrentProtocolConfig") + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .header::(X_SUI_MIN_SUPPORTED_PROTOCOL_VERSION, generator) + .header::(X_SUI_MAX_SUPPORTED_PROTOCOL_VERSION, generator) + .build(), + ) + .build() } fn handler(&self) -> RouteHandler { @@ -528,9 +595,22 @@ impl ApiEndpoint for GetProtocolConfig { fn operation( &self, - _generator: &mut schemars::gen::SchemaGenerator, + generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("System") + .operation_id("GetProtocolConfig") + .path_parameter::("version", generator) + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .header::(X_SUI_MIN_SUPPORTED_PROTOCOL_VERSION, generator) + .header::(X_SUI_MAX_SUPPORTED_PROTOCOL_VERSION, generator) + .build(), + ) + .response(404, ResponseBuilder::new().build()) + .build() } fn handler(&self) -> RouteHandler { @@ -607,9 +687,11 @@ fn supported_protocol_headers() -> SupportedProtocolHeaders { ] } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema)] #[serde(rename = "ProtocolConfig")] pub struct ProtocolConfigResponse { + #[serde(with = "serde_with::As::")] + #[schemars(with = "crate::_schemars::U64")] pub protocol_version: u64, pub feature_flags: BTreeMap, pub attributes: BTreeMap, @@ -651,6 +733,22 @@ impl ApiEndpoint for GetGasInfo { "/system/gas" } + fn operation( + &self, + generator: &mut schemars::gen::SchemaGenerator, + ) -> openapiv3::v3_1::Operation { + OperationBuilder::new() + .tag("System") + .operation_id("GetGasInfo") + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .build(), + ) + .build() + } + fn handler(&self) -> RouteHandler { RouteHandler::new(self.method(), get_gas_info) } @@ -677,8 +775,9 @@ async fn get_gas_info( })) } -#[derive(serde::Serialize, serde::Deserialize)] +#[derive(serde::Serialize, serde::Deserialize, JsonSchema)] pub struct GasInfo { #[serde(with = "serde_with::As::")] + #[schemars(with = "crate::_schemars::U64")] reference_gas_price: u64, } From 5dc8975e4a829b32b95b8c74ffea630b10188686 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 10:30:29 -0500 Subject: [PATCH 122/163] rest: define openapi schema for committee endpoints --- crates/sui-rest-api/openapi/openapi.json | 60 ++++++++++++++++++++++-- crates/sui-rest-api/src/committee.rs | 34 +++++++++++--- 2 files changed, 83 insertions(+), 11 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index f3211b7b74589..72910345fd12a 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -471,11 +471,63 @@ }, "post": {} }, - "/committee/{epoch}": { - "get": {} + "/system/committee/{epoch}": { + "get": { + "tags": [ + "System" + ], + "operationId": "GetCommittee", + "parameters": [ + { + "in": "path", + "name": "epoch", + "required": true, + "schema": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidatorCommittee" + } + }, + "application/bcs": {} + } + }, + "404": { + "description": "" + } + } + } }, - "/committee": { - "get": {} + "/system/committee": { + "get": { + "tags": [ + "System" + ], + "operationId": "GetLatestCommittee", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidatorCommittee" + } + }, + "application/bcs": {} + } + } + } + } }, "/system": { "get": { diff --git a/crates/sui-rest-api/src/committee.rs b/crates/sui-rest-api/src/committee.rs index 95bd13d62a02b..166405f6f2fa5 100644 --- a/crates/sui-rest-api/src/committee.rs +++ b/crates/sui-rest-api/src/committee.rs @@ -3,7 +3,7 @@ use crate::{ accept::AcceptFormat, - openapi::{ApiEndpoint, RouteHandler}, + openapi::{ApiEndpoint, OperationBuilder, ResponseBuilder, RouteHandler}, reader::StateReader, response::ResponseContent, RestService, Result, @@ -21,15 +21,24 @@ impl ApiEndpoint for GetLatestCommittee { } fn path(&self) -> &'static str { - "/committee" + "/system/committee" } fn operation( &self, generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - generator.subschema_for::(); - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("System") + .operation_id("GetLatestCommittee") + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .bcs_content() + .build(), + ) + .build() } fn handler(&self) -> RouteHandler { @@ -61,15 +70,26 @@ impl ApiEndpoint for GetCommittee { } fn path(&self) -> &'static str { - "/committee/{epoch}" + "/system/committee/{epoch}" } fn operation( &self, generator: &mut schemars::gen::SchemaGenerator, ) -> openapiv3::v3_1::Operation { - generator.subschema_for::(); - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("System") + .operation_id("GetCommittee") + .path_parameter::("epoch", generator) + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .bcs_content() + .build(), + ) + .response(404, ResponseBuilder::new().build()) + .build() } fn handler(&self) -> RouteHandler { From 7aea45687c04e00194742f41ec806bd3b2ed93a5 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 17 Jul 2024 11:45:27 -0500 Subject: [PATCH 123/163] rest: define openapi scheam for transaction execution --- crates/sui-rest-api/openapi/openapi.json | 172 +++++++++++++++++- crates/sui-rest-api/src/openapi.rs | 5 + .../src/transactions/execution.rs | 38 +++- 3 files changed, 208 insertions(+), 7 deletions(-) diff --git a/crates/sui-rest-api/openapi/openapi.json b/crates/sui-rest-api/openapi/openapi.json index 72910345fd12a..2e4ff81d8f3b2 100644 --- a/crates/sui-rest-api/openapi/openapi.json +++ b/crates/sui-rest-api/openapi/openapi.json @@ -469,7 +469,76 @@ } } }, - "post": {} + "post": { + "tags": [ + "Transactions" + ], + "operationId": "ExecuteTransaction", + "parameters": [ + { + "in": "query", + "name": "balance_changes", + "description": "Request `BalanceChanges` be included in the Response.", + "schema": { + "description": "Request `BalanceChanges` be included in the Response.", + "default": false, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "events", + "description": "Request `TransactionEvents` be included in the Response.", + "schema": { + "description": "Request `TransactionEvents` be included in the Response.", + "default": false, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "input_objects", + "description": "Request input `Object`s be included in the Response.", + "schema": { + "description": "Request input `Object`s be included in the Response.", + "default": false, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "output_objects", + "description": "Request output `Object`s be included in the Response.", + "schema": { + "description": "Request output `Object`s be included in the Response.", + "default": false, + "type": "boolean" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/bcs": {} + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionExecutionResponse" + } + }, + "application/bcs": {} + } + } + } + } }, "/system/committee/{epoch}": { "get": { @@ -860,6 +929,37 @@ } ] }, + "BalanceChange": { + "type": "object", + "required": [ + "address", + "amount", + "coin_type" + ], + "properties": { + "address": { + "description": "Owner of the balance change", + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ] + }, + "amount": { + "description": "The amount indicate the balance value changes.\n\nA negative amount means spending coin value and positive means receiving coin value.", + "type": "string", + "format": "i128" + }, + "coin_type": { + "description": "Type of the Coin", + "allOf": [ + { + "$ref": "#/components/schemas/TypeTag" + } + ] + } + } + }, "Bls12381PublicKey": { "description": "Base64 encoded data", "type": "string", @@ -1683,6 +1783,39 @@ "EffectsAuxiliaryDataDigest": { "$ref": "#/components/schemas/Digest" }, + "EffectsFinality": { + "anyOf": [ + { + "type": "object", + "required": [ + "signature" + ], + "properties": { + "signature": { + "description": "Validator aggregated signature", + "allOf": [ + { + "$ref": "#/components/schemas/ValidatorAggregatedSignature" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "checkpoint" + ], + "properties": { + "checkpoint": { + "description": "Radix-10 encoded 64-bit unsigned integer", + "type": "string", + "format": "u64" + } + } + } + ] + }, "EndOfEpochData": { "type": "object", "required": [ @@ -4283,6 +4416,43 @@ "TransactionEventsDigest": { "$ref": "#/components/schemas/Digest" }, + "TransactionExecutionResponse": { + "description": "Response type for the execute transaction endpoint", + "type": "object", + "required": [ + "effects", + "finality" + ], + "properties": { + "balance_changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BalanceChange" + } + }, + "effects": { + "$ref": "#/components/schemas/TransactionEffects" + }, + "events": { + "$ref": "#/components/schemas/TransactionEvents" + }, + "finality": { + "$ref": "#/components/schemas/EffectsFinality" + }, + "input_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Object" + } + }, + "output_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Object" + } + } + } + }, "TransactionExpiration": { "oneOf": [ { diff --git a/crates/sui-rest-api/src/openapi.rs b/crates/sui-rest-api/src/openapi.rs index 2aeff52f48bdb..26f287dfc6a89 100644 --- a/crates/sui-rest-api/src/openapi.rs +++ b/crates/sui-rest-api/src/openapi.rs @@ -523,6 +523,11 @@ impl OperationBuilder { self } + + pub fn request_body(&mut self, request_body: RequestBody) -> &mut Self { + self.inner.request_body = Some(ReferenceOr::Item(request_body)); + self + } } #[derive(Default)] diff --git a/crates/sui-rest-api/src/transactions/execution.rs b/crates/sui-rest-api/src/transactions/execution.rs index 7f2b3eb1c9ea5..c075ad6a3de99 100644 --- a/crates/sui-rest-api/src/transactions/execution.rs +++ b/crates/sui-rest-api/src/transactions/execution.rs @@ -5,6 +5,7 @@ use std::net::SocketAddr; use std::sync::Arc; use axum::extract::{Query, State}; +use schemars::JsonSchema; use sui_sdk2::types::framework::Coin; use sui_sdk2::types::{ Address, BalanceChange, CheckpointSequenceNumber, Object, Owner, SignedTransaction, @@ -12,7 +13,9 @@ use sui_sdk2::types::{ }; use tap::Pipe; -use crate::openapi::{ApiEndpoint, RouteHandler}; +use crate::openapi::{ + ApiEndpoint, OperationBuilder, RequestBodyBuilder, ResponseBuilder, RouteHandler, +}; use crate::response::Bcs; use crate::{accept::AcceptFormat, response::ResponseContent}; use crate::{RestService, Result}; @@ -50,7 +53,19 @@ impl ApiEndpoint for ExecuteTransaction { ) -> openapiv3::v3_1::Operation { generator.subschema_for::(); - openapiv3::v3_1::Operation::default() + OperationBuilder::new() + .tag("Transactions") + .operation_id("ExecuteTransaction") + .query_parameters::(generator) + .request_body(RequestBodyBuilder::new().bcs_content().build()) + .response( + 200, + ResponseBuilder::new() + .json_content::(generator) + .bcs_content() + .build(), + ) + .build() } fn handler(&self) -> RouteHandler { @@ -160,7 +175,7 @@ async fn execute_transaction( } /// Query parameters for the execute transaction endpoint -#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema)] pub struct ExecuteTransactionQueryParameters { // TODO once transaction finality support is more fully implemented up and down the stack, add // back in this parameter, which will be mutally-exclusive with the other parameters. When @@ -181,7 +196,7 @@ pub struct ExecuteTransactionQueryParameters { } /// Response type for the execute transaction endpoint -#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema)] pub struct TransactionExecutionResponse { effects: TransactionEffects, @@ -259,9 +274,19 @@ impl<'de> serde::Deserialize<'de> for EffectsFinality { } } +impl JsonSchema for EffectsFinality { + fn schema_name() -> String { + ReadableEffectsFinality::schema_name() + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + ReadableEffectsFinality::json_schema(gen) + } +} + #[serde_with::serde_as] -#[derive(serde::Serialize, serde::Deserialize)] -#[serde(tag = "untagged")] +#[derive(serde::Serialize, serde::Deserialize, JsonSchema)] +#[serde(rename = "EffectsFinality", untagged)] enum ReadableEffectsFinality { Certified { /// Validator aggregated signature @@ -269,6 +294,7 @@ enum ReadableEffectsFinality { }, Checkpointed { #[serde_as(as = "sui_types::sui_serde::Readable, _>")] + #[schemars(with = "crate::_schemars::U64")] checkpoint: CheckpointSequenceNumber, }, } From 21d2a340859353732e314adcc597ec4123d03dda Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:00:35 -0700 Subject: [PATCH 124/163] Refactor consensus output to write to an intermediate store before going to the db (#18447) This PR should have no behavior changes. It introduces a new struct, `ConsensusCommitOutput`, which stores all writes generated while processing a consensus commit, prior to writing them to the db. This is the first stage of caching/quarantining consensus-specific epoch-db state. The next step will be to hold `ConsensusCommitOutput` structs in memory until the checkpoints created for the commit have been certified. This will also require reading from `ConsensusCommitOutput` (or more likely, a broader caching struct which holds information from a set of `ConsensusCommitOutput` objects), since required information will not always be available from the db. --- .../authority/authority_per_epoch_store.rs | 513 ++++++++++++------ crates/sui-core/src/checkpoints/mod.rs | 10 +- crates/sui-core/src/consensus_handler.rs | 2 +- crates/sui-core/src/epoch/randomness.rs | 72 +-- crates/sui-types/src/messages_consensus.rs | 2 +- 5 files changed, 372 insertions(+), 227 deletions(-) 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 dfa5dc5c1eae5..9803d29300353 100644 --- a/crates/sui-core/src/authority/authority_per_epoch_store.rs +++ b/crates/sui-core/src/authority/authority_per_epoch_store.rs @@ -70,7 +70,7 @@ use crate::consensus_manager::ConsensusManager; use crate::epoch::epoch_metrics::EpochMetrics; use crate::epoch::randomness::{ DkgStatus, RandomnessManager, RandomnessReporter, VersionedProcessedMessage, - VersionedUsedProcessedMessages, + VersionedUsedProcessedMessages, SINGLETON_KEY, }; use crate::epoch::reconfiguration::ReconfigState; use crate::execution_cache::ObjectCacheRead; @@ -1120,18 +1120,6 @@ impl AuthorityPerEpochStore { Ok(()) } - fn store_reconfig_state_batch( - &self, - new_state: &ReconfigState, - batch: &mut DBBatch, - ) -> SuiResult { - batch.insert_batch( - &self.tables()?.reconfig_state, - [(&RECONFIG_STATE_INDEX, new_state)], - )?; - Ok(()) - } - pub fn insert_signed_transaction(&self, transaction: VerifiedSignedTransaction) -> SuiResult { Ok(self .tables()? @@ -1644,34 +1632,25 @@ impl AuthorityPerEpochStore { Ok(()) } - fn defer_transactions( - &self, - batch: &mut DBBatch, - key: DeferralKey, - transactions: Vec, - ) -> SuiResult { - batch.insert_batch( - &self.tables()?.deferred_transactions, - std::iter::once((key, transactions)), - )?; - Ok(()) - } - fn load_deferred_transactions_for_randomness( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, ) -> SuiResult)>> { let (min, max) = DeferralKey::full_range_for_randomness(); - self.load_deferred_transactions(batch, min, max) + self.load_deferred_transactions(output, min, max) } fn load_and_process_deferred_transactions_for_randomness( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, previously_deferred_tx_digests: &mut HashMap, sequenced_randomness_transactions: &mut Vec, ) -> SuiResult { - let deferred_randomness_txs = self.load_deferred_transactions_for_randomness(batch)?; + let deferred_randomness_txs = self.load_deferred_transactions_for_randomness(output)?; + trace!( + "loading deferred randomness transactions: {:?}", + deferred_randomness_txs + ); previously_deferred_tx_digests.extend(deferred_randomness_txs.iter().flat_map( |(deferral_key, txs)| { txs.iter().map(|tx| match tx.0.transaction.key() { @@ -1691,17 +1670,17 @@ impl AuthorityPerEpochStore { fn load_deferred_transactions_for_up_to_consensus_round( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, consensus_round: u64, ) -> SuiResult)>> { let (min, max) = DeferralKey::range_for_up_to_consensus_round(consensus_round); - self.load_deferred_transactions(batch, min, max) + self.load_deferred_transactions(output, min, max) } // factoring of the above fn load_deferred_transactions( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, min: DeferralKey, max: DeferralKey, ) -> SuiResult)>> { @@ -1737,10 +1716,7 @@ impl AuthorityPerEpochStore { } } - // Transactional DBs do not support range deletes, so we have to delete keys one-by-one. - // This shouldn't be a problem, there should not usually be more than a small handful of - // keys loaded in each round. - batch.delete_batch(&self.tables()?.deferred_transactions, keys)?; + output.delete_loaded_deferred_transactions(&keys); Ok(txns) } @@ -1904,22 +1880,6 @@ impl AuthorityPerEpochStore { .is_empty() } - /// Stores a list of pending certificates to be executed. - pub fn insert_pending_execution( - &self, - certs: &[TrustedExecutableTransaction], - ) -> SuiResult<()> { - let mut batch = self.tables()?.pending_execution.batch(); - batch.insert_batch( - &self.tables()?.pending_execution, - certs - .iter() - .map(|cert| (*cert.inner().digest(), cert.clone())), - )?; - batch.write()?; - Ok(()) - } - /// Check whether certificate was processed by consensus. /// For shared lock certificates, if this function returns true means shared locks for this certificate are set pub fn is_tx_cert_consensus_message_processed( @@ -2207,9 +2167,9 @@ impl AuthorityPerEpochStore { Ok(result?) } - pub fn record_jwk_vote( + fn record_jwk_vote( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, round: u64, authority: AuthorityName, id: &JwkId, @@ -2245,10 +2205,7 @@ impl AuthorityPerEpochStore { return Ok(()); } - batch.insert_batch( - &self.tables()?.pending_jwks, - std::iter::once(((authority, id.clone(), jwk.clone()), ())), - )?; + output.insert_pending_jwk(authority, id.clone(), jwk.clone()); let key = (id.clone(), jwk.clone()); let previously_active = jwk_aggregator.has_quorum_for_key(&key); @@ -2256,10 +2213,7 @@ impl AuthorityPerEpochStore { if !previously_active && insert_result.is_quorum_reached() { info!(epoch = ?self.epoch(), ?round, jwk = ?key, "jwk became active"); - batch.insert_batch( - &self.tables()?.active_jwks, - std::iter::once(((round, key), ())), - )?; + output.insert_active_jwk(round, key); } Ok(()) @@ -2296,40 +2250,6 @@ impl AuthorityPerEpochStore { jwk_aggregator.has_quorum_for_key(&(jwk_id.clone(), jwk.clone())) } - /// Record when finished processing a transaction from consensus. - fn record_consensus_message_processed( - &self, - batch: &mut DBBatch, - key: SequencedConsensusTransactionKey, - ) -> SuiResult { - batch.insert_batch(&self.tables()?.consensus_message_processed, [(key, true)])?; - Ok(()) - } - - /// Record when finished processing a consensus commit. - fn record_consensus_commit_stats( - &self, - batch: &mut DBBatch, - consensus_stats: &ExecutionIndicesWithStats, - ) -> SuiResult { - // TODO: remove writing to last_consensus_index. - batch.insert_batch( - &self.tables()?.last_consensus_index, - [( - LAST_CONSENSUS_STATS_ADDR, - ExecutionIndicesWithHash { - index: consensus_stats.index, - hash: consensus_stats.hash, - }, - )], - )?; - batch.insert_batch( - &self.tables()?.last_consensus_stats, - [(LAST_CONSENSUS_STATS_ADDR, consensus_stats)], - )?; - Ok(()) - } - pub fn test_insert_user_signature( &self, digest: TransactionDigest, @@ -2350,26 +2270,24 @@ impl AuthorityPerEpochStore { self.consensus_notify_read.notify(&key, &()); } - pub fn finish_consensus_certificate_process_with_batch( + fn finish_consensus_certificate_process_with_batch( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, certificates: &[VerifiedExecutableTransaction], ) -> SuiResult { - for certificate in certificates { - batch.insert_batch( - &self.tables()?.pending_execution, - [(*certificate.digest(), certificate.clone().serializable())], - )?; - // User signatures are written in the same batch as consensus certificate processed flag, - // which means we won't attempt to insert this twice for the same tx digest - debug_assert!(!self - .tables()? - .user_signatures_for_checkpoints - .contains_key(certificate.digest())?); - batch.insert_batch( - &self.tables()?.user_signatures_for_checkpoints, - [(*certificate.digest(), certificate.tx_signatures().to_vec())], - )?; + output.insert_pending_execution(certificates); + output.insert_user_signatures_for_checkpoints(certificates); + + if cfg!(debug_assertions) { + for certificate in certificates { + // User signatures are written in the same batch as consensus certificate processed flag, + // which means we won't attempt to insert this twice for the same tx digest + assert!(!self + .tables()? + .user_signatures_for_checkpoints + .contains_key(certificate.digest()) + .unwrap()); + } } Ok(()) } @@ -2632,14 +2550,13 @@ impl AuthorityPerEpochStore { current_commit_sequenced_consensus_transactions.push(tx); } } - let mut batch = self - .db_batch() - .expect("Failed to create DBBatch for processing consensus transactions"); + + let mut output = ConsensusCommitOutput::new(); // Load transactions deferred from previous commits. let deferred_txs: Vec<(DeferralKey, Vec)> = self .load_deferred_transactions_for_up_to_consensus_round( - &mut batch, + &mut output, consensus_commit_info.round, )? .into_iter() @@ -2698,7 +2615,7 @@ impl AuthorityPerEpochStore { .should_accept_tx() { randomness_manager - .reserve_next_randomness(consensus_commit_info.timestamp, &mut batch)? + .reserve_next_randomness(consensus_commit_info.timestamp, &mut output)? } else { None } @@ -2713,7 +2630,7 @@ impl AuthorityPerEpochStore { // - if randomness is being generated, so we can process them if dkg_failed || randomness_round.is_some() { self.load_and_process_deferred_transactions_for_randomness( - &mut batch, + &mut output, &mut previously_deferred_tx_digests, &mut sequenced_randomness_transactions, )?; @@ -2784,7 +2701,7 @@ impl AuthorityPerEpochStore { consensus_commit_prologue_root, ) = self .process_consensus_transactions( - &mut batch, + &mut output, &consensus_transactions, &end_of_publish_transactions, checkpoint_service, @@ -2800,10 +2717,10 @@ impl AuthorityPerEpochStore { ) .await?; self.finish_consensus_certificate_process_with_batch( - &mut batch, + &mut output, &transactions_to_schedule, )?; - self.record_consensus_commit_stats(&mut batch, consensus_stats)?; + output.record_consensus_commit_stats(consensus_stats.clone()); // Create pending checkpoints if we are still accepting tx. let should_accept_tx = if let Some(lock) = &lock { @@ -2846,7 +2763,7 @@ impl AuthorityPerEpochStore { checkpoint_height, }, }); - self.write_pending_checkpoint(&mut batch, &pending_checkpoint)?; + 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 @@ -2869,10 +2786,12 @@ impl AuthorityPerEpochStore { checkpoint_height: checkpoint_height + 1, }, }); - self.write_pending_checkpoint(&mut batch, &pending_checkpoint)?; + self.write_pending_checkpoint(&mut output, &pending_checkpoint)?; } } + let mut batch = self.db_batch()?; + output.write_to_batch(self, &mut batch)?; batch.write()?; // Only after batch is written, notify checkpoint service to start building any new @@ -2916,7 +2835,7 @@ impl AuthorityPerEpochStore { // Returns the root of the consensus commit prologue transaction if it was added to the input. fn add_consensus_commit_prologue_transaction( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, transactions: &mut VecDeque, consensus_commit_info: &ConsensusCommitInfo, cancelled_txns: &BTreeMap, @@ -2971,10 +2890,9 @@ impl AuthorityPerEpochStore { _ => unreachable!("process_consensus_system_transaction returned unexpected ConsensusCertificateResult."), }; - self.record_consensus_message_processed( - batch, - SequencedConsensusTransactionKey::System(*transaction.digest()), - )?; + output.record_consensus_message_processed(SequencedConsensusTransactionKey::System( + *transaction.digest(), + )); Ok(consensus_commit_prologue_root) } @@ -2987,7 +2905,7 @@ impl AuthorityPerEpochStore { transactions: &[VerifiedExecutableTransaction], randomness_round: Option, cancelled_txns: &BTreeMap, - db_batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, ) -> SuiResult { let ConsensusSharedObjVerAssignment { shared_input_next_versions, @@ -3000,12 +2918,7 @@ impl AuthorityPerEpochStore { cancelled_txns, ) .await?; - self.set_assigned_shared_object_versions_with_db_batch(assigned_versions, db_batch) - .await?; - db_batch.insert_batch( - &self.tables()?.next_shared_object_versions, - shared_input_next_versions, - )?; + output.set_assigned_shared_object_versions(assigned_versions, shared_input_next_versions); Ok(()) } @@ -3070,15 +2983,17 @@ impl AuthorityPerEpochStore { cache_reader: &dyn ObjectCacheRead, transactions: &[VerifiedExecutableTransaction], ) -> SuiResult { - let mut batch = self.db_batch()?; + let mut output = ConsensusCommitOutput::new(); self.process_consensus_transaction_shared_object_versions( cache_reader, transactions, None, &BTreeMap::new(), - &mut batch, + &mut output, ) .await?; + let mut batch = self.db_batch()?; + output.write_to_batch(self, &mut batch)?; batch.write()?; Ok(()) } @@ -3105,7 +3020,7 @@ impl AuthorityPerEpochStore { #[allow(clippy::type_complexity)] pub(crate) async fn process_consensus_transactions( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, transactions: &[VerifiedSequencedConsensusTransaction], end_of_publish_transactions: &[VerifiedSequencedConsensusTransaction], checkpoint_service: &Arc, @@ -3173,7 +3088,7 @@ impl AuthorityPerEpochStore { }; match self .process_consensus_transaction( - batch, + output, tx, checkpoint_service, consensus_commit_info.round, @@ -3224,7 +3139,7 @@ impl AuthorityPerEpochStore { } } if !ignored { - self.record_consensus_message_processed(batch, key.clone())?; + output.record_consensus_message_processed(key.clone()); } if filter_roots { if let Some(txn_key) = @@ -3242,7 +3157,7 @@ impl AuthorityPerEpochStore { let mut total_deferred_txns = 0; for (key, txns) in deferred_txns.into_iter() { total_deferred_txns += txns.len(); - self.defer_transactions(batch, key, txns)?; + output.defer_transactions(key, txns); } authority_metrics .consensus_handler_deferred_transactions @@ -3262,14 +3177,14 @@ impl AuthorityPerEpochStore { if randomness_state_updated { if let Some(randomness_manager) = randomness_manager.as_mut() { randomness_manager - .advance_dkg(batch, consensus_commit_info.round) + .advance_dkg(output, consensus_commit_info.round) .await?; } } // Add the consensus commit prologue transaction to the beginning of `verified_certificates`. let consensus_commit_prologue_root = self.add_consensus_commit_prologue_transaction( - batch, + output, &mut verified_certificates, consensus_commit_info, &cancelled_txns, @@ -3282,12 +3197,12 @@ impl AuthorityPerEpochStore { &verified_certificates, randomness_round, &cancelled_txns, - batch, + output, ) .await?; let (lock, final_round) = self.process_end_of_publish_transactions_and_reconfig( - batch, + output, end_of_publish_transactions, commit_has_deferred_txns, )?; @@ -3303,7 +3218,7 @@ impl AuthorityPerEpochStore { fn process_end_of_publish_transactions_and_reconfig( &self, - write_batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, transactions: &[VerifiedSequencedConsensusTransaction], commit_has_deferred_txns: bool, ) -> SuiResult<( @@ -3336,7 +3251,7 @@ impl AuthorityPerEpochStore { .get_reconfig_state_read_lock_guard() .should_accept_consensus_certs() { - write_batch.insert_batch(&self.tables()?.end_of_publish, [(authority, ())])?; + output.insert_end_of_publish(*authority); self.end_of_publish.try_lock() .expect("No contention on Authority::end_of_publish as it is only accessed from consensus handler") .insert_generic(*authority, ()).is_quorum_reached() @@ -3356,7 +3271,7 @@ impl AuthorityPerEpochStore { ); let mut l = self.get_reconfig_state_write_lock_guard(); l.close_all_certs(); - self.store_reconfig_state_batch(&l, write_batch)?; + output.store_reconfig_state(l.clone()); // Holding this lock until end of process_consensus_transactions_and_commit_boundary() where we write batch to DB lock = Some(l); }; @@ -3364,7 +3279,7 @@ impl AuthorityPerEpochStore { // operation returns error. If some day we won't panic in ConsensusHandler on error // we need to figure out here how to revert in-memory state of .end_of_publish // and .reconfig_state when write fails. - self.record_consensus_message_processed(write_batch, transaction.key())?; + output.record_consensus_message_processed(transaction.key()); } else { panic!( "process_end_of_publish_transactions_and_reconfig called with non-end-of-publish transaction" @@ -3397,14 +3312,14 @@ impl AuthorityPerEpochStore { // Acquire lock to advance state if we don't already have it. let mut lock = lock.unwrap_or_else(|| self.get_reconfig_state_write_lock_guard()); lock.close_all_tx(); - self.store_reconfig_state_batch(&lock, write_batch)?; + output.store_reconfig_state(lock.clone()); Ok((Some(lock), true)) } #[instrument(level = "trace", skip_all)] async fn process_consensus_transaction( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, transaction: &VerifiedSequencedConsensusTransaction, checkpoint_service: &Arc, commit_round: Round, @@ -3610,7 +3525,7 @@ impl AuthorityPerEpochStore { .should_accept_consensus_certs() { self.record_jwk_vote( - batch, + output, consensus_index.last_committed_round, *authority, jwk_id, @@ -3676,7 +3591,7 @@ impl AuthorityPerEpochStore { ); match bcs::from_bytes(bytes) { Ok(message) => { - randomness_manager.add_confirmation(batch, authority, message)? + randomness_manager.add_confirmation(output, authority, message)? } Err(e) => { warn!( @@ -3724,19 +3639,15 @@ impl AuthorityPerEpochStore { pub(crate) fn write_pending_checkpoint( &self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, checkpoint: &PendingCheckpointV2, ) -> SuiResult { - if let Some(pending) = self.get_pending_checkpoint(&checkpoint.height())? { - if pending.roots() != checkpoint.roots() { - panic!("Received checkpoint at index {} that contradicts previously stored checkpoint. Old roots: {:?}, new roots: {:?}", checkpoint.height(), pending.roots(), checkpoint.roots()); - } - debug!( - checkpoint_commit_height = checkpoint.height(), - "Ignoring duplicate checkpoint notification", - ); - return Ok(()); - } + assert!( + self.get_pending_checkpoint(&checkpoint.height())?.is_none(), + "Duplicate pending checkpoint notification at height {:?}", + checkpoint.height() + ); + debug!( checkpoint_commit_height = checkpoint.height(), "Pending checkpoint has {} roots", @@ -3748,17 +3659,7 @@ impl AuthorityPerEpochStore { checkpoint.roots() ); - if self.randomness_state_enabled() { - batch.insert_batch( - &self.tables()?.pending_checkpoints_v2, - std::iter::once((checkpoint.height(), checkpoint)), - )?; - } else { - batch.insert_batch( - &self.tables()?.pending_checkpoints, - std::iter::once((checkpoint.height(), checkpoint.clone().expect_v1())), - )?; - } + output.insert_pending_checkpoint(checkpoint.clone()); Ok(()) } @@ -4046,6 +3947,264 @@ impl AuthorityPerEpochStore { } } +#[derive(Default)] +pub(crate) struct ConsensusCommitOutput { + // Consensus and reconfig state + consensus_messages_processed: BTreeSet, + end_of_publish: BTreeSet, + reconfig_state: Option, + consensus_commit_stats: Option, + pending_execution: Vec, + + // transaction scheduling state + shared_object_versions: Option<(AssignedTxAndVersions, HashMap)>, + + deferred_txns: Vec<(DeferralKey, Vec)>, + // deferred txns that have been loaded and can be removed + deleted_deferred_txns: BTreeSet, + + // checkpoint state + user_signatures_for_checkpoints: Vec<(TransactionDigest, Vec)>, + pending_checkpoints: Vec, + + // random beacon state + next_randomness_round: Option<(RandomnessRound, TimestampMs)>, + + dkg_confirmations: BTreeMap, + dkg_processed_messages: BTreeMap, + dkg_used_message: Option, + dkg_output: Option>, + + // jwk state + pending_jwks: BTreeSet<(AuthorityName, JwkId, JWK)>, + active_jwks: BTreeSet<(u64, (JwkId, JWK))>, +} + +impl ConsensusCommitOutput { + pub fn new() -> Self { + Default::default() + } + + fn insert_end_of_publish(&mut self, authority: AuthorityName) { + self.end_of_publish.insert(authority); + } + + fn insert_pending_execution(&mut self, transactions: &[VerifiedExecutableTransaction]) { + self.pending_execution.reserve(transactions.len()); + self.pending_execution.extend_from_slice(transactions); + } + + fn insert_user_signatures_for_checkpoints( + &mut self, + transactions: &[VerifiedExecutableTransaction], + ) { + self.user_signatures_for_checkpoints.extend( + transactions + .iter() + .map(|tx| (*tx.digest(), tx.tx_signatures().to_vec())), + ); + } + + fn record_consensus_commit_stats(&mut self, stats: ExecutionIndicesWithStats) { + self.consensus_commit_stats = Some(stats); + } + + fn store_reconfig_state(&mut self, state: ReconfigState) { + self.reconfig_state = Some(state); + } + + fn record_consensus_message_processed(&mut self, key: SequencedConsensusTransactionKey) { + self.consensus_messages_processed.insert(key); + } + + fn set_assigned_shared_object_versions( + &mut self, + versions: AssignedTxAndVersions, + next_versions: HashMap, + ) { + assert!(self.shared_object_versions.is_none()); + self.shared_object_versions = Some((versions, next_versions)); + } + + fn defer_transactions( + &mut self, + key: DeferralKey, + transactions: Vec, + ) { + self.deferred_txns.push((key, transactions)); + } + + fn delete_loaded_deferred_transactions(&mut self, deferral_keys: &[DeferralKey]) { + self.deleted_deferred_txns + .extend(deferral_keys.iter().cloned()); + } + + fn insert_pending_checkpoint(&mut self, checkpoint: PendingCheckpointV2) { + self.pending_checkpoints.push(checkpoint); + } + + pub fn reserve_next_randomness_round( + &mut self, + next_randomness_round: RandomnessRound, + commit_timestamp: TimestampMs, + ) { + assert!(self.next_randomness_round.is_none()); + self.next_randomness_round = Some((next_randomness_round, commit_timestamp)); + } + + pub fn insert_dkg_confirmation(&mut self, conf: VersionedDkgConfirmation) { + self.dkg_confirmations.insert(conf.sender(), conf); + } + + pub fn insert_dkg_processed_message(&mut self, message: VersionedProcessedMessage) { + self.dkg_processed_messages + .insert(message.sender(), message); + } + + pub fn insert_dkg_used_messages(&mut self, used_messages: VersionedUsedProcessedMessages) { + self.dkg_used_message = Some(used_messages); + } + + pub fn set_dkg_output(&mut self, output: dkg::Output) { + self.dkg_output = Some(output); + } + + fn insert_pending_jwk(&mut self, authority: AuthorityName, id: JwkId, jwk: JWK) { + self.pending_jwks.insert((authority, id, jwk)); + } + + fn insert_active_jwk(&mut self, round: u64, key: (JwkId, JWK)) { + self.active_jwks.insert((round, key)); + } + + pub fn write_to_batch( + self, + epoch_store: &AuthorityPerEpochStore, + batch: &mut DBBatch, + ) -> SuiResult { + let tables = epoch_store.tables()?; + batch.insert_batch( + &tables.consensus_message_processed, + self.consensus_messages_processed + .iter() + .map(|key| (key, true)), + )?; + + batch.insert_batch( + &tables.end_of_publish, + self.end_of_publish.iter().map(|authority| (authority, ())), + )?; + + if let Some(reconfig_state) = &self.reconfig_state { + batch.insert_batch( + &tables.reconfig_state, + [(RECONFIG_STATE_INDEX, reconfig_state)], + )?; + } + + if let Some(consensus_commit_stats) = &self.consensus_commit_stats { + batch.insert_batch( + &tables.last_consensus_index, + [( + LAST_CONSENSUS_STATS_ADDR, + ExecutionIndicesWithHash { + index: consensus_commit_stats.index, + hash: consensus_commit_stats.hash, + }, + )], + )?; + batch.insert_batch( + &tables.last_consensus_stats, + [(LAST_CONSENSUS_STATS_ADDR, consensus_commit_stats)], + )?; + } + + batch.insert_batch( + &tables.pending_execution, + self.pending_execution + .into_iter() + .map(|tx| (*tx.inner().digest(), tx.serializable())), + )?; + + if let Some((assigned_versions, next_versions)) = self.shared_object_versions { + if epoch_store.randomness_state_enabled() { + batch.insert_batch( + &tables.assigned_shared_object_versions_v2, + assigned_versions, + )?; + } else { + batch.insert_batch( + &tables.assigned_shared_object_versions, + assigned_versions + .into_iter() + .map(|(key, versions)| (*key.unwrap_digest(), versions)), + )?; + } + + batch.insert_batch(&tables.next_shared_object_versions, next_versions)?; + } + + batch.delete_batch(&tables.deferred_transactions, self.deleted_deferred_txns)?; + batch.insert_batch(&tables.deferred_transactions, self.deferred_txns)?; + + batch.insert_batch( + &tables.user_signatures_for_checkpoints, + self.user_signatures_for_checkpoints, + )?; + + if epoch_store.randomness_state_enabled() { + batch.insert_batch( + &tables.pending_checkpoints_v2, + self.pending_checkpoints + .into_iter() + .map(|cp| (cp.height(), cp)), + )?; + } else { + batch.insert_batch( + &tables.pending_checkpoints, + self.pending_checkpoints + .into_iter() + .map(|cp| (cp.height(), cp.expect_v1())), + )?; + } + + if let Some((round, commit_timestamp)) = self.next_randomness_round { + batch.insert_batch(&tables.randomness_next_round, [(SINGLETON_KEY, round)])?; + batch.insert_batch( + &tables.randomness_last_round_timestamp, + [(SINGLETON_KEY, commit_timestamp)], + )?; + } + + batch.insert_batch(&tables.dkg_confirmations_v2, self.dkg_confirmations)?; + batch.insert_batch( + &tables.dkg_processed_messages_v2, + self.dkg_processed_messages, + )?; + batch.insert_batch( + &tables.dkg_used_messages_v2, + // using Option as iter + self.dkg_used_message + .into_iter() + .map(|used_msgs| (SINGLETON_KEY, used_msgs)), + )?; + if let Some(output) = self.dkg_output { + batch.insert_batch(&tables.dkg_output, [(SINGLETON_KEY, output)])?; + } + + batch.insert_batch( + &tables.pending_jwks, + self.pending_jwks.into_iter().map(|j| (j, ())), + )?; + batch.insert_batch( + &tables.active_jwks, + self.active_jwks.into_iter().map(|j| (j, ())), + )?; + + Ok(()) + } +} + impl GetSharedLocks for AuthorityPerEpochStore { fn get_shared_locks( &self, diff --git a/crates/sui-core/src/checkpoints/mod.rs b/crates/sui-core/src/checkpoints/mod.rs index 2bf1dfaca8fcd..e139fe3ae42f7 100644 --- a/crates/sui-core/src/checkpoints/mod.rs +++ b/crates/sui-core/src/checkpoints/mod.rs @@ -2288,8 +2288,12 @@ impl CheckpointService { epoch_store: &AuthorityPerEpochStore, checkpoint: PendingCheckpointV2, ) -> SuiResult { + use crate::authority::authority_per_epoch_store::ConsensusCommitOutput; + + let mut output = ConsensusCommitOutput::new(); + epoch_store.write_pending_checkpoint(&mut output, &checkpoint)?; let mut batch = epoch_store.db_batch_for_test(); - epoch_store.write_pending_checkpoint(&mut batch, &checkpoint)?; + output.write_to_batch(epoch_store, &mut batch)?; batch.write()?; self.notify_checkpoint()?; Ok(()) @@ -2535,10 +2539,6 @@ mod tests { checkpoint_service .write_and_notify_checkpoint_for_testing(&epoch_store, p(0, vec![4], 0)) .unwrap(); - // Verify that sending same digests at same height is noop - checkpoint_service - .write_and_notify_checkpoint_for_testing(&epoch_store, p(0, vec![4], 1000)) - .unwrap(); checkpoint_service .write_and_notify_checkpoint_for_testing(&epoch_store, p(1, vec![1, 3], 2000)) .unwrap(); diff --git a/crates/sui-core/src/consensus_handler.rs b/crates/sui-core/src/consensus_handler.rs index 26bab2d6fa9fd..05c0168b831fd 100644 --- a/crates/sui-core/src/consensus_handler.rs +++ b/crates/sui-core/src/consensus_handler.rs @@ -644,7 +644,7 @@ impl From for SequencedConsensusT } } -#[derive(Serialize, Deserialize, Clone, Hash, PartialEq, Eq, Debug)] +#[derive(Serialize, Deserialize, Clone, Hash, PartialEq, Eq, Debug, Ord, PartialOrd)] pub enum SequencedConsensusTransactionKey { External(ConsensusTransactionKey), System(TransactionDigest), diff --git a/crates/sui-core/src/epoch/randomness.rs b/crates/sui-core/src/epoch/randomness.rs index 6699459e1e844..952ea5952d8f1 100644 --- a/crates/sui-core/src/epoch/randomness.rs +++ b/crates/sui-core/src/epoch/randomness.rs @@ -30,10 +30,9 @@ use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemS use tokio::sync::OnceCell; use tokio::task::JoinHandle; use tracing::{debug, error, info, warn}; -use typed_store::rocks::DBBatch; use typed_store::Map; -use crate::authority::authority_per_epoch_store::{AuthorityEpochTables, AuthorityPerEpochStore}; +use crate::authority::authority_per_epoch_store::{AuthorityPerEpochStore, ConsensusCommitOutput}; use crate::authority::epoch_start_configuration::EpochStartConfigTrait; use crate::consensus_adapter::SubmitToConsensus; @@ -61,7 +60,7 @@ impl VersionedProcessedMessage { } } - fn unwrap_v1(self) -> dkg_v1::ProcessedMessage { + pub fn unwrap_v1(self) -> dkg_v1::ProcessedMessage { if let VersionedProcessedMessage::V1(msg) = self { msg } else { @@ -440,7 +439,11 @@ impl RandomnessManager { /// Processes all received messages and advances the randomness DKG state machine when possible, /// sending out a dkg::Confirmation and generating final output. - pub async fn advance_dkg(&mut self, batch: &mut DBBatch, round: Round) -> SuiResult { + pub(crate) async fn advance_dkg( + &mut self, + consensus_output: &mut ConsensusCommitOutput, + round: Round, + ) -> SuiResult { let epoch_store = self.epoch_store()?; // Once we have enough Messages, send a Confirmation. @@ -453,10 +456,7 @@ impl RandomnessManager { if let Ok(Some(processed)) = res { self.processed_messages .insert(processed.sender(), processed.clone()); - batch.insert_batch( - &epoch_store.tables()?.dkg_processed_messages_v2, - std::iter::once((processed.sender(), processed)), - )?; + consensus_output.insert_dkg_processed_message(processed); } } @@ -476,10 +476,7 @@ impl RandomnessManager { if self.used_messages.set(used_msgs.clone()).is_err() { error!("BUG: used_messages should only ever be set once"); } - batch.insert_batch( - &epoch_store.tables()?.dkg_used_messages_v2, - std::iter::once((SINGLETON_KEY, used_msgs)), - )?; + consensus_output.insert_dkg_used_messages(used_msgs); let transaction = ConsensusTransaction::new_randomness_dkg_confirmation( epoch_store.name, @@ -549,10 +546,7 @@ impl RandomnessManager { self.party.t(), None, ); - batch.insert_batch( - &epoch_store.tables()?.dkg_output, - std::iter::once((SINGLETON_KEY, output)), - )?; + consensus_output.set_dkg_output(output); } Err(FastCryptoError::NotEnoughInputs) => (), // wait for more input Err(e) => error!("random beacon: error while processing DKG Confirmations: {e:?}"), @@ -628,9 +622,9 @@ impl RandomnessManager { } /// Adds a received dkg::Confirmation to the randomness DKG state machine. - pub fn add_confirmation( + pub(crate) fn add_confirmation( &mut self, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, authority: &AuthorityName, conf: VersionedDkgConfirmation, ) -> SuiResult { @@ -659,10 +653,7 @@ impl RandomnessManager { return Ok(()); } self.confirmations.insert(conf.sender(), conf.clone()); - batch.insert_batch( - &self.tables()?.dkg_confirmations_v2, - std::iter::once((conf.sender(), conf)), - )?; + output.insert_dkg_confirmation(conf); Ok(()) } @@ -670,10 +661,10 @@ impl RandomnessManager { /// elapsed, or returns None if not yet ready (based on ProtocolConfig setting). Once the given /// batch is written, `generate_randomness` must be called to start the process. On restart, /// any reserved rounds for which the batch was written will automatically be resumed. - pub fn reserve_next_randomness( + pub(crate) fn reserve_next_randomness( &mut self, commit_timestamp: TimestampMs, - batch: &mut DBBatch, + output: &mut ConsensusCommitOutput, ) -> SuiResult> { let epoch_store = self.epoch_store()?; let tables = epoch_store.tables()?; @@ -698,14 +689,7 @@ impl RandomnessManager { .checked_add(1) .expect("RandomnessRound should not overflow"); - batch.insert_batch( - &tables.randomness_next_round, - std::iter::once((SINGLETON_KEY, self.next_randomness_round)), - )?; - batch.insert_batch( - &tables.randomness_last_round_timestamp, - std::iter::once((SINGLETON_KEY, commit_timestamp)), - )?; + output.reserve_next_randomness_round(self.next_randomness_round, commit_timestamp); Ok(Some(randomness_round)) } @@ -740,10 +724,6 @@ impl RandomnessManager { .ok_or(SuiError::EpochEnded(self.epoch)) } - fn tables(&self) -> SuiResult> { - self.epoch_store()?.tables() - } - fn randomness_dkg_info_from_committee( committee: &Committee, ) -> Vec<( @@ -916,16 +896,18 @@ mod tests { } } for i in 0..randomness_managers.len() { - let mut batch = epoch_stores[i].db_batch_for_test(); + let mut output = ConsensusCommitOutput::new(); for (j, dkg_message) in dkg_messages.iter().cloned().enumerate() { randomness_managers[i] .add_message(&epoch_stores[j].name, dkg_message) .unwrap(); } randomness_managers[i] - .advance_dkg(&mut batch, 0) + .advance_dkg(&mut output, 0) .await .unwrap(); + let mut batch = epoch_stores[i].db_batch_for_test(); + output.write_to_batch(&epoch_stores[i], &mut batch).unwrap(); batch.write().unwrap(); } @@ -944,16 +926,18 @@ mod tests { } } for i in 0..randomness_managers.len() { - let mut batch = epoch_stores[i].db_batch_for_test(); + let mut output = ConsensusCommitOutput::new(); for (j, dkg_confirmation) in dkg_confirmations.iter().cloned().enumerate() { randomness_managers[i] - .add_confirmation(&mut batch, &epoch_stores[j].name, dkg_confirmation) + .add_confirmation(&mut output, &epoch_stores[j].name, dkg_confirmation) .unwrap(); } randomness_managers[i] - .advance_dkg(&mut batch, 0) + .advance_dkg(&mut output, 0) .await .unwrap(); + let mut batch = epoch_stores[i].db_batch_for_test(); + output.write_to_batch(&epoch_stores[i], &mut batch).unwrap(); batch.write().unwrap(); } @@ -1044,16 +1028,18 @@ mod tests { } } for i in 0..randomness_managers.len() { - let mut batch = epoch_stores[i].db_batch_for_test(); + let mut output = ConsensusCommitOutput::new(); for (j, dkg_message) in dkg_messages.iter().cloned().enumerate() { randomness_managers[i] .add_message(&epoch_stores[j].name, dkg_message) .unwrap(); } randomness_managers[i] - .advance_dkg(&mut batch, u64::MAX) + .advance_dkg(&mut output, u64::MAX) .await .unwrap(); + let mut batch = epoch_stores[i].db_batch_for_test(); + output.write_to_batch(&epoch_stores[i], &mut batch).unwrap(); batch.write().unwrap(); } diff --git a/crates/sui-types/src/messages_consensus.rs b/crates/sui-types/src/messages_consensus.rs index 5a55f18b5b5aa..eeade5ba4b1d3 100644 --- a/crates/sui-types/src/messages_consensus.rs +++ b/crates/sui-types/src/messages_consensus.rs @@ -89,7 +89,7 @@ pub struct ConsensusTransaction { pub kind: ConsensusTransactionKind, } -#[derive(Serialize, Deserialize, Clone, Hash, PartialEq, Eq)] +#[derive(Serialize, Deserialize, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] pub enum ConsensusTransactionKey { Certificate(TransactionDigest), CheckpointSignature(AuthorityName, CheckpointSequenceNumber), From 46f24c321f3dda0f411dd2a8745fa153c7f32b30 Mon Sep 17 00:00:00 2001 From: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:26:11 -0600 Subject: [PATCH 125/163] [docs] Content updates and style changes (#18745) ## Description Addresses requests made by aslan. Adds a style guide entry for using code in headings. Previous opinions were 50/50 and he tipped the scale. Original request was to remove the bullets in `swap_exact_quote_for_base` to make it the same as the previous description. But the suggestion is to keep the bullets to break up the content and make the object list easier to read. Also breaks up the last paragraph on Design because it looked weird. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../references/contribute/style-guide.mdx | 19 ++++++++++---- docs/content/standards/deepbookv3/design.mdx | 25 +++++++++++++++++-- docs/content/standards/deepbookv3/swaps.mdx | 10 +++++++- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/docs/content/references/contribute/style-guide.mdx b/docs/content/references/contribute/style-guide.mdx index db8bc01e53f55..1406655e9044a 100644 --- a/docs/content/references/contribute/style-guide.mdx +++ b/docs/content/references/contribute/style-guide.mdx @@ -1,12 +1,9 @@ --- title: Style Guide slug: /style-guide -toc_max_heading_level: 2 --- -# Style Guide - -This document defines the styles, word and term usage, and content formatting for Sui documentation. Entries are in alphabetical order. A style guide is never finished. Expect continued iterations to add additional styles, additional information to existing styles, and infrequently a change to an existing style. +This document defines the styles, vocabulary usage, and content formatting for Sui documentation. Entries are in alphabetical order. A style guide is never finished. Expect continued iterations to add additional styles, additional information to existing styles, and infrequently a change to an existing style. ## Accessibility {#accessibility} @@ -133,7 +130,7 @@ Backup your configuration files before you delete your network. **Do:** -Use sentence capitalization for section headings, table cells, list items, captions, alt text, and error messages. +Use sentence capitalization for section headings, table cells/headers, list items, captions, alt text, and error messages. Capitalize proper nouns. [Proper nouns](#proper-nouns). @@ -346,6 +343,18 @@ Use sentence casing for section headers. +### Code elements in section headings + +Do not use code styling in section headings. Instead, use regular font in the heading and code styling in the content. + +**Example:** + +``` +## ObjectName + +`ObjectName` is an object. +``` + ## Images / Graphics {#images-graphics} Only use images and screenshots to supplement and help explain text. Images do not replace text. Readers should be able to understand the documentation without the images. However, images can help readers understand the text more clearly. diff --git a/docs/content/standards/deepbookv3/design.mdx b/docs/content/standards/deepbookv3/design.mdx index 8b9f02e6e2cff..f55c49b637be9 100644 --- a/docs/content/standards/deepbookv3/design.mdx +++ b/docs/content/standards/deepbookv3/design.mdx @@ -39,6 +39,21 @@ The `Governance` module stores data related to the pool's trading params. These Every epoch, users with non zero stake can submit a proposal to change these parameters. The proposed fees are bounded. + + | min_value (bps) | max_value (bps) | Pool type | Taker or maker | | --- | --- | --- | --- | | 5 | 10 | Volatile | Taker | @@ -96,7 +111,7 @@ Every transaction that a user performs on DeepBook resets their settled and owed The vault also stores the `DeepPrice` struct. This object holds up to 100 data points representing the conversion rate between the pool's base or quote asset and DEEP. These data points are sourced from a whitelisted pool, DEEP/USDC or DEEP/SUI. This conversion rate is used to determine the quantity of DEEP tokens required to pay for trading fees. -### `BigVector` +### BigVector `BigVector` is an arbitrary sized vector-like data structure, implemented using an on-chain B+ Tree to support almost constant time (log base max_fan_out) random access, insertion and removal. @@ -143,4 +158,10 @@ Finally, the function calculates the partial taker fills and maker order quantit ### Vault -The `settle_balance_manager` function in `Vault` is responsible for managing the transfer of any settled and owed amounts for the `BalanceManager`. It starts by validating that the trader is authorized to use the `BalanceManager`. For each asset type, if the `balances_out` exceeds the `balances_in`, the difference is split from the vault's balance and deposited into the `BalanceManager`. Conversely, if the `balances_in` exceeds the `balances_out`, the difference is withdrawn from the `BalanceManager` and joined to the vault's balance. This process is repeated for base, quote, and DEEP asset balances, ensuring all asset balances are accurately reflected and settled between the vault and the `BalanceManager`. \ No newline at end of file +The `settle_balance_manager` function in `Vault` is responsible for managing the transfer of any settled and owed amounts for the `BalanceManager`. + +First, the function validates that a trader is authorized to use the `BalanceManager`. + +Then, for each asset type the process compares `balances_out` against `balances_in`. If the `balances_out` total exceeds `balances_in`, the function splits the difference from the vault's balance and deposits it into the `BalanceManager`. Conversely, if the `balances_in` total exceeds `balances_out`, the function withdraws the difference from the `BalanceManager` and joins it to the vault's balance. + +This process is repeated for base, quote, and DEEP asset balances, ensuring all asset balances are accurately reflected and settled between the vault and the `BalanceManager`. \ No newline at end of file diff --git a/docs/content/standards/deepbookv3/swaps.mdx b/docs/content/standards/deepbookv3/swaps.mdx index ccd82e6bd66c2..12fb68dbc5c4c 100644 --- a/docs/content/standards/deepbookv3/swaps.mdx +++ b/docs/content/standards/deepbookv3/swaps.mdx @@ -14,7 +14,12 @@ Following are the endpoints that the `Pool` exposes for swaps. ### Swap exact base for quote -Swap exact base quantity without needing a `balance_manager`. DEEP quantity can be overestimated. Returns three `Coin` objects: base, quote, and deep. Some base quantity may be left over, if the input quantity is not divisible by lot size. +Swap exact base quantity without needing a `balance_manager`. DEEP quantity can be overestimated. Returns three `Coin` objects: + - `BaseAsset` + - `QuoteAsset` + - `DEEP` + +Some base quantity may be left over, if the input quantity is not divisible by lot size. You can overestimate the amount of DEEP required. The remaining balance is returned. @@ -23,6 +28,7 @@ public fun swap_exact_base_for_quote( self: &mut Pool, base_in: Coin, deep_in: Coin, + min_quote_out: u64, clock: &Clock, ctx: &mut TxContext, ): (Coin, Coin, Coin) @@ -42,6 +48,7 @@ public fun swap_exact_quote_for_base( self: &mut Pool, quote_in: Coin, deep_in: Coin, + min_base_out: u64, clock: &Clock, ctx: &mut TxContext, ): (Coin, Coin, Coin) @@ -58,6 +65,7 @@ public fun swap_exact_quantity( base_in: Coin, quote_in: Coin, deep_in: Coin, + min_out: u64, clock: &Clock, ctx: &mut TxContext, ): (Coin, Coin, Coin) From eda1abffb11c924479ebdaa0d58d9362d8ad8d8e Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Tue, 23 Jul 2024 13:12:33 -0700 Subject: [PATCH 126/163] [move][move-2024] Add macro visibility error tests (#18741) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Add tests I wrote but forgot to include on #18735 😭 ## Test plan New tests --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../typing/macro_visibility_enum_error.exp | 30 +++++++++++++++++++ .../typing/macro_visibility_enum_error.move | 21 +++++++++++++ .../macro_visibility_function_error.exp | 27 +++++++++++++++++ .../macro_visibility_function_error.move | 16 ++++++++++ .../typing/macro_visibility_struct_error.exp | 30 +++++++++++++++++++ .../typing/macro_visibility_struct_error.move | 17 +++++++++++ 6 files changed, 141 insertions(+) create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.move create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.move create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.move diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.exp new file mode 100644 index 0000000000000..5fe822f5e0c8d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.exp @@ -0,0 +1,30 @@ +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_enum_error.move:8:17 + │ + 3 │ public enum E { + │ - Enum defined in module 'a::m' + · + 8 │ let e = E::V(); + │ ^^^^^^ Enum variant 'a::m::E::V' can only be instantiated within its defining module 'a::m' + · +19 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_enum_error.move:10:13 + │ + 3 │ public enum E { + │ - Enum defined in module 'a::m' + · +10 │ E::V() => (), + │ ^^^^^^ Enum variant 'a::m::E::V' can only be matched within its defining module 'a::m' + · +19 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.move new file mode 100644 index 0000000000000..ce1d2418545cc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.move @@ -0,0 +1,21 @@ +module a::m { + + public enum E { + V() + } + + public macro fun test() { + let e = E::V(); + match (e) { + E::V() => (), + }; + } +} + +module a::n { + use a::m::test; + + public fun t() { + test!(); + } +} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.exp new file mode 100644 index 0000000000000..300a7b27797b6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.exp @@ -0,0 +1,27 @@ +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macro_visibility_function_error.move:5:22 + │ + 5 │ public macro fun test() { + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: '()' + · +14 │ test!(); + │ ------- Given: 'u64' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_function_error.move:6:6 + │ + 3 │ fun zero(): u64 { 0 } + │ ---- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · + 6 │ zero() + │ ^^^^^^ Invalid call to internal function 'a::m::zero' + · +14 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.move new file mode 100644 index 0000000000000..f7f8d4b8e1805 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.move @@ -0,0 +1,16 @@ +module a::m { + + fun zero(): u64 { 0 } + + public macro fun test() { + zero() + } +} + +module a::n { + use a::m::test; + + public fun t() { + test!(); + } +} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.exp new file mode 100644 index 0000000000000..d5722933655a8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.exp @@ -0,0 +1,30 @@ +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_struct_error.move:6:17 + │ + 3 │ public struct S { } + │ - Struct defined in module 'a::m' + · + 6 │ let s = S { }; + │ ^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +15 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_struct_error.move:7:13 + │ + 3 │ public struct S { } + │ - Struct defined in module 'a::m' + · + 7 │ let S { } = s; + │ ^^^^^ Struct 'a::m::S' can only be used in deconstruction binding within its defining module 'a::m' + · +15 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.move new file mode 100644 index 0000000000000..eba5d02dffe43 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.move @@ -0,0 +1,17 @@ +module a::m { + + public struct S { } + + public macro fun test() { + let s = S { }; + let S { } = s; + } +} + +module a::n { + use a::m::test; + + public fun t() { + test!(); + } +} From a345ba497b14882c6e4cb242799742c6d18bf171 Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Tue, 23 Jul 2024 13:26:34 -0700 Subject: [PATCH 127/163] Enable writeback cache in antithesis (#18776) --- docker/sui-network/docker-compose-antithesis.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/sui-network/docker-compose-antithesis.yaml b/docker/sui-network/docker-compose-antithesis.yaml index 0ee506b8a14b5..eada610c7c315 100644 --- a/docker/sui-network/docker-compose-antithesis.yaml +++ b/docker/sui-network/docker-compose-antithesis.yaml @@ -9,6 +9,7 @@ services: container_name: validator1 hostname: validator1 environment: + - ENABLE_WRITEBACK_CACHE=1 - RUST_BACKTRACE=1 - RUST_LOG=info,sui_core=debug,consensus=debug,jsonrpsee=error - RPC_WORKER_THREAD=12 @@ -36,6 +37,7 @@ services: container_name: validator2 hostname: validator2 environment: + - ENABLE_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 @@ -117,6 +119,7 @@ services: hostname: fullnode1 container_name: fullnode1 environment: + - ENABLE_WRITEBACK_CACHE=1 - RUST_BACKTRACE=1 - RUST_LOG=info,jsonrpsee=error - RPC_WORKER_THREAD=12 From f72859afcf0fb35085ae4475b03c0b96c4e36e76 Mon Sep 17 00:00:00 2001 From: kyoshisuki <143475866+kyoshisuki@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:50:33 -0600 Subject: [PATCH 128/163] Update SECURITY.md (#14675) Fixed a typo in SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 7d99223164226..acb097c361d21 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -84,7 +84,7 @@ Bug reports covering previously-discovered bugs are not eligible for any reward | ------------- | ------------- | | In our staking contract, we have the concept of pool tokens and keep track of exchange rates between pool tokens and SUI tokens of all epochs, which increase as more rewards are added to the staking pools. When a user withdraws their stake, we retrieve from that record both the exchange rate at staking time and the current exchange rate (at withdrawing time), and calculate the rewards to be paid out based on the difference in exchange rates. While doing this calculation, we do conversions both ways: pool tokens -> SUI and SUI -> pool tokens. Rounding may happen along the way due to integer division. The exchange rate between the two tokens should stay roughly the same since we will be burning a proportional amount of pool tokens as SUI is withdrawn. However, in the extreme case where a user is unstaking 1 MIST, this rounding error may cause ZERO pool tokens to be burnt, causing the pool token to effectively depreciate. If an attacker has a lot of 1 MIST stakes, they can withdraw them one by one, causing the pool token exchange rate to drop and other takers to “lose” their staking rewards. I put quotation marks around “lose” because the attacker themselves won’t get any of that rewards so this attacker doesn’t actually make economic sense. Rather the rewards stay in the rewards pool and will become dust. This issue is mitigated by enforcing a minimum staking amount of 1 SUI or 10^9 MIST in this PR: https://github.com/MystenLabs/sui/pull/9961 | Critical - Any other issue leading to theft or loss of valuable objects, with severity depending on the consequences of the issue and the preconditions for exploiting it | | Excessive storage rebate on 0x5 object right after epoch change: -Each on-chain object is associated with a storage rebate, which would be refunded to the owner if it ever gets deleted. Epoch change transactions are special in that they are system transactions without a sender, hence any excessive storage rebate generated in that transaction is kept in the 0x5 object. This means that the first person touching the 0x5 object in each epoch may be able to obtain those excessive rebate by simply touching this object (e.g. a failed staking request). We will look into a way to evenly distribute those excessive rebates such that is does not lead to any undesired behaviors. | | +Each on-chain object is associated with a storage rebate, which would be refunded to the owner if it ever gets deleted. Epoch change transactions are special in that they are system transactions without a sender, hence any storage rebate generated in that transaction is kept in the 0x5 object. This means that the first person touching the 0x5 object in each epoch may be able to obtain these storage rebates by simply touching this object (e.g. a failed staking request). We will look into a way to evenly distribute any these rebates such that it does not lead to any undesired behaviors. | | | Crash Validator by providing a gas price of u64:max | Network not being able to confirm new transactions (total network shutdown) | From 8169f0529f477c52a2565404e406a70ce3aefa8e Mon Sep 17 00:00:00 2001 From: Zihe Huang Date: Tue, 23 Jul 2024 16:20:15 -0700 Subject: [PATCH 129/163] [docs] add custom indexer example to doc page (#18711) ## Description Linking custom indexer example to doc page ## Test plan manually --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> --- .../developer/advanced/custom-indexer.mdx | 3 ++ .../snippets/custom-indexer-source.mdx | 6 ++++ examples/custom-indexer/rust/.gitignore | 14 ++++++++ examples/custom-indexer/rust/Cargo.toml | 17 ++++++++++ examples/custom-indexer/rust/README.md | 18 +++++++++++ examples/custom-indexer/rust/main.rs | 32 +++++++++++++++++++ 6 files changed, 90 insertions(+) create mode 100644 docs/content/snippets/custom-indexer-source.mdx create mode 100644 examples/custom-indexer/rust/.gitignore create mode 100644 examples/custom-indexer/rust/Cargo.toml create mode 100644 examples/custom-indexer/rust/README.md create mode 100644 examples/custom-indexer/rust/main.rs diff --git a/docs/content/guides/developer/advanced/custom-indexer.mdx b/docs/content/guides/developer/advanced/custom-indexer.mdx index e5487a5a9b204..5b0c81bed335e 100644 --- a/docs/content/guides/developer/advanced/custom-indexer.mdx +++ b/docs/content/guides/developer/advanced/custom-indexer.mdx @@ -20,6 +20,7 @@ trait Worker: Send + Sync { In this example, the `CheckpointData` struct represents full checkpoint content. The struct contains checkpoint summary and contents, as well as detailed information about each individual transaction. The individual transaction data includes events and input/output objects. The full definition for this content is in the [full_checkpoint_content.rs](https://github.com/MystenLabs/sui/blob/releases/sui-graphql-rpc-v2024.1.0-release/crates/sui-types/src/full_checkpoint_content.rs) file of the `sui-types` crate. +{@include: ../../../snippets//custom-indexer-source.mdx} ## Checkpoint stream sources @@ -157,6 +158,8 @@ The data ingestion executor can run multiple workflows simultaneously. For each The concurrency parameter specifies how many threads the workflow uses. Having a concurrency value greater than 1 is helpful when tasks are idempotent and can be processed in parallel and out of order. The executor only updates the progress/watermark to a certain checkpoint when all preceding checkpoints are processed. +{@include: ../../../snippets//custom-indexer-source.mdx} + Find more examples of custom ingestion pipelines in the Sui repository: * Sui data ingestion daemon that runs internal [pipelines](https://github.com/MystenLabs/sui/tree/main/crates/sui-data-ingestion/src/). * Sui Name Service's custom [indexer](https://github.com/MystenLabs/sui/tree/main/crates/suins-indexer/src). diff --git a/docs/content/snippets/custom-indexer-source.mdx b/docs/content/snippets/custom-indexer-source.mdx new file mode 100644 index 0000000000000..df33e594019cb --- /dev/null +++ b/docs/content/snippets/custom-indexer-source.mdx @@ -0,0 +1,6 @@ +:::info + +You can view the [complete source code for this example](https://github.com/mystenlabs/sui/tree/main/examples/custom-indexer/rust) in the Sui repository. + +::: + diff --git a/examples/custom-indexer/rust/.gitignore b/examples/custom-indexer/rust/.gitignore new file mode 100644 index 0000000000000..6985cf1bd09dd --- /dev/null +++ b/examples/custom-indexer/rust/.gitignore @@ -0,0 +1,14 @@ +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/examples/custom-indexer/rust/Cargo.toml b/examples/custom-indexer/rust/Cargo.toml new file mode 100644 index 0000000000000..5605e2cc8eefd --- /dev/null +++ b/examples/custom-indexer/rust/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "custom-indexer" +version = "0.1.0" +edition = "2021" + +[dependencies] +async-trait = "0.1.81" +tokio = { version = "1.38.0", features = ["full"]} +sui_types = { git = "https://github.com/mystenlabs/sui", package = "sui-types"} +sui_data_ingestion_core = { git = "https://github.com/mystenlabs/sui", package = "sui-data-ingestion-core"} +anyhow = "1.0.86" + +[workspace] + +[[bin]] +name = "custom-indexer" +path = "main.rs" diff --git a/examples/custom-indexer/rust/README.md b/examples/custom-indexer/rust/README.md new file mode 100644 index 0000000000000..0c4b45bac7a21 --- /dev/null +++ b/examples/custom-indexer/rust/README.md @@ -0,0 +1,18 @@ +# Sui Custom Indexer Example +This is a complimentary example to the Sui Custom Indexer documentation. +It demonstrates how to create a custom indexer for the Sui search engine. +See the [Sui Custom Indexer documentation](https://docs.sui.io/guides/developer/advanced/custom-indexer) for more information. + +## Prerequisites +- Rust + +## How to install +Once you have Rust installed, you can build the custom indexer by running the following command: +```bash +cargo build +``` + +## How to run +```bash +cargo run main.rs +``` diff --git a/examples/custom-indexer/rust/main.rs b/examples/custom-indexer/rust/main.rs new file mode 100644 index 0000000000000..4c55fcb960772 --- /dev/null +++ b/examples/custom-indexer/rust/main.rs @@ -0,0 +1,32 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use anyhow::Result; +use async_trait::async_trait; +use sui_types::full_checkpoint_content::CheckpointData; +use sui_data_ingestion_core::{Worker, setup_single_workflow}; + +struct CustomWorker; + +#[async_trait] +impl Worker for CustomWorker { + async fn process_checkpoint(&self, checkpoint: CheckpointData) -> Result<()> { + // custom processing logic + // print out the checkpoint number + println!("Processing checkpoint: {}", checkpoint.checkpoint_summary.to_string()); + Ok(()) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + let (executor, term_sender) = setup_single_workflow( + CustomWorker, + "https://checkpoints.testnet.sui.io".to_string(), + 0, /* initial checkpoint number */ + 5, /* concurrency */ + None, /* extra reader options */ + ).await?; + executor.await?; + Ok(()) +} From ce374dff6cc0d246245a95d853b5edd3eb27c942 Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:05:33 -0700 Subject: [PATCH 130/163] Ignore RUSTSEC-2024-0358 (#18779) ## Description This specific vulnerability does not seem to impact Sui. Upgrading the affect package involves upgrading dependencies which will take more time. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- deny.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deny.toml b/deny.toml index ad56c381bf314..372fba7ae9b05 100644 --- a/deny.toml +++ b/deny.toml @@ -63,6 +63,9 @@ ignore = [ "RUSTSEC-2023-0052", # we don't do RSA signing on Sui (only verifying for zklogin) "RUSTSEC-2023-0071", + # Sui does not use object_store with authentication. + # Upgrade to object_store >= 10.2 to fix. + "RUSTSEC-2024-0358", # A few dependencies use unpatched rustls. "RUSTSEC-2024-0336", ] From e95007c54f534ce375abc0aac7cc02551f496f00 Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:03:26 -0700 Subject: [PATCH 131/163] Integrate consensus Parameters into NodeConfig (#18767) ## Description This allows setting consensus Parameters via NodeConfig. Also, do some minor cleanups. But the bulk of the cleanup will happen when we stop supporting Narwhal. ## Test plan CI. Private testnet. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- Cargo.lock | 1 + crates/sui-config/Cargo.toml | 1 + crates/sui-config/src/node.rs | 17 +- .../consensus_manager/mysticeti_manager.rs | 9 +- crates/sui-swarm-config/src/genesis_config.rs | 2 - .../src/node_config_builder.rs | 3 +- .../sui-swarm-config/tests/snapshot_tests.rs | 1 - ...ests__network_config_snapshot_matches.snap | 218 ++++++++++++++++-- 8 files changed, 220 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e143a6eba94a..1c065e98c3fef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12381,6 +12381,7 @@ dependencies = [ "anyhow", "bcs", "clap", + "consensus-config", "csv", "dirs 4.0.0", "fastcrypto", diff --git a/crates/sui-config/Cargo.toml b/crates/sui-config/Cargo.toml index d5e3a5ac85984..87f5ab16a33ad 100644 --- a/crates/sui-config/Cargo.toml +++ b/crates/sui-config/Cargo.toml @@ -24,6 +24,7 @@ clap.workspace = true object_store.workspace = true reqwest.workspace = true +consensus-config.workspace = true narwhal-config.workspace = true sui-keys.workspace = true sui-protocol-config.workspace = true diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index 5a97e42dd0b7c..8f5b48c985491 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -7,7 +7,8 @@ use crate::p2p::P2pConfig; use crate::transaction_deny_config::TransactionDenyConfig; use crate::Config; use anyhow::Result; -use narwhal_config::Parameters as ConsensusParameters; +use consensus_config::Parameters as ConsensusParameters; +use narwhal_config::Parameters as NarwhalParameters; use once_cell::sync::OnceCell; use rand::rngs::OsRng; use serde::{Deserialize, Serialize}; @@ -406,13 +407,9 @@ pub enum ConsensusProtocol { #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "kebab-case")] pub struct ConsensusConfig { - pub address: Multiaddr, + // Base consensus DB path for all epochs. pub db_path: PathBuf, - /// Optional alternative address preferentially used by a primary to talk to its own worker. - /// For example, this could be used to connect to co-located workers over a private LAN address. - pub internal_worker_address: Option, - /// Maximum number of pending transactions to submit to consensus, including those /// in submission wait. /// Assuming 10_000 txn tps * 10 sec consensus latency = 100_000 inflight consensus txns, @@ -428,7 +425,11 @@ pub struct ConsensusConfig { /// on consensus latency estimates. pub submit_delay_step_override_millis: Option, - pub narwhal_config: ConsensusParameters, + // Deprecated: Narwhal specific configs. + pub address: Multiaddr, + pub narwhal_config: NarwhalParameters, + + pub parameters: ConsensusParameters, } impl ConsensusConfig { @@ -449,7 +450,7 @@ impl ConsensusConfig { .map(Duration::from_millis) } - pub fn narwhal_config(&self) -> &ConsensusParameters { + pub fn narwhal_config(&self) -> &NarwhalParameters { &self.narwhal_config } } diff --git a/crates/sui-core/src/consensus_manager/mysticeti_manager.rs b/crates/sui-core/src/consensus_manager/mysticeti_manager.rs index 6debc2c4ad033..c501bbf6094b6 100644 --- a/crates/sui-core/src/consensus_manager/mysticeti_manager.rs +++ b/crates/sui-core/src/consensus_manager/mysticeti_manager.rs @@ -72,7 +72,6 @@ impl MysticetiManager { } } - #[allow(unused)] fn get_store_path(&self, epoch: EpochId) -> PathBuf { let mut store_path = self.storage_base_path.clone(); store_path.push(format!("{}", epoch)); @@ -100,7 +99,7 @@ impl MysticetiManager { impl ConsensusManagerTrait for MysticetiManager { async fn start( &self, - _config: &NodeConfig, + config: &NodeConfig, epoch_store: Arc, consensus_handler_initializer: ConsensusHandlerInitializer, tx_validator: SuiTxValidator, @@ -122,10 +121,12 @@ impl ConsensusManagerTrait for MysticetiManager { return; }; - // TODO(mysticeti): Fill in the other fields + let consensus_config = config + .consensus_config() + .expect("consensus_config should exist"); let parameters = Parameters { db_path: Some(self.get_store_path(epoch)), - ..Default::default() + ..consensus_config.parameters.clone() }; let own_protocol_key = self.protocol_keypair.public(); diff --git a/crates/sui-swarm-config/src/genesis_config.rs b/crates/sui-swarm-config/src/genesis_config.rs index d1b55c33f1d41..8752a5b53307d 100644 --- a/crates/sui-swarm-config/src/genesis_config.rs +++ b/crates/sui-swarm-config/src/genesis_config.rs @@ -49,7 +49,6 @@ pub struct ValidatorGenesisConfig { pub narwhal_primary_address: Multiaddr, pub narwhal_worker_address: Multiaddr, pub consensus_address: Multiaddr, - pub consensus_internal_worker_address: Option, #[serde(default = "default_stake")] pub stake: u64, pub name: Option, @@ -207,7 +206,6 @@ impl ValidatorGenesisConfigBuilder { narwhal_primary_address, narwhal_worker_address, consensus_address, - consensus_internal_worker_address: None, stake: sui_types::governance::VALIDATOR_LOW_STAKE_THRESHOLD_MIST, name: None, } diff --git a/crates/sui-swarm-config/src/node_config_builder.rs b/crates/sui-swarm-config/src/node_config_builder.rs index 59293909d7217..5ae24ec616cda 100644 --- a/crates/sui-swarm-config/src/node_config_builder.rs +++ b/crates/sui-swarm-config/src/node_config_builder.rs @@ -131,12 +131,10 @@ impl ValidatorConfigBuilder { let network_address = validator.network_address; let consensus_address = validator.consensus_address; let consensus_db_path = config_directory.join(CONSENSUS_DB_NAME).join(key_path); - let internal_worker_address = validator.consensus_internal_worker_address; let localhost = local_ip_utils::localhost_for_testing(); let consensus_config = ConsensusConfig { address: consensus_address, db_path: consensus_db_path, - internal_worker_address, max_pending_transactions: None, max_submit_position: self.max_submit_position, submit_delay_step_override_millis: self.submit_delay_step_override_millis, @@ -154,6 +152,7 @@ impl ValidatorConfigBuilder { }, ..Default::default() }, + parameters: Default::default(), }; let p2p_config = P2pConfig { diff --git a/crates/sui-swarm-config/tests/snapshot_tests.rs b/crates/sui-swarm-config/tests/snapshot_tests.rs index eae93cdbf2cc1..bf05e350826a6 100644 --- a/crates/sui-swarm-config/tests/snapshot_tests.rs +++ b/crates/sui-swarm-config/tests/snapshot_tests.rs @@ -133,7 +133,6 @@ fn network_config_snapshot_matches() { if let Some(consensus_config) = validator_config.consensus_config.as_mut() { consensus_config.address = Multiaddr::empty(); consensus_config.db_path = PathBuf::from("/tmp/foo/"); - consensus_config.internal_worker_address = Some(Multiaddr::empty()); consensus_config .narwhal_config .prometheus_metrics 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 9614b93cb74b0..dac34a5429bf9 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 @@ -18,12 +18,11 @@ validator_configs: metrics-address: "0.0.0.0:1" admin-interface-port: 8888 consensus-config: - address: "" db-path: /tmp/foo/ - internal-worker-address: "" max-pending-transactions: ~ max-submit-position: ~ submit-delay-step-override-millis: ~ + address: "" narwhal-config: header_num_of_batches_threshold: 32 max_header_num_of_batches: 1000 @@ -44,6 +43,34 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ + parameters: + db_path: ~ + leader_timeout: + secs: 0 + nanos: 250000000 + min_round_delay: + secs: 0 + nanos: 50000000 + max_forward_time_drift: + secs: 0 + nanos: 500000000 + max_blocks_per_fetch: 1000 + dag_state_cached_rounds: 500 + commit_sync_parallel_fetches: 20 + commit_sync_batch_size: 100 + commit_sync_batches_ahead: 200 + anemo: + excessive_message_size: 8388608 + tonic: + keepalive_interval: + secs: 5 + nanos: 0 + connection_buffer_size: 33554432 + excessive_message_size: 16777216 + message_size_limit: 67108864 + sync_last_proposed_block_timeout: + secs: 0 + nanos: 0 enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -156,12 +183,11 @@ validator_configs: metrics-address: "0.0.0.0:1" admin-interface-port: 8888 consensus-config: - address: "" db-path: /tmp/foo/ - internal-worker-address: "" max-pending-transactions: ~ max-submit-position: ~ submit-delay-step-override-millis: ~ + address: "" narwhal-config: header_num_of_batches_threshold: 32 max_header_num_of_batches: 1000 @@ -182,6 +208,34 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ + parameters: + db_path: ~ + leader_timeout: + secs: 0 + nanos: 250000000 + min_round_delay: + secs: 0 + nanos: 50000000 + max_forward_time_drift: + secs: 0 + nanos: 500000000 + max_blocks_per_fetch: 1000 + dag_state_cached_rounds: 500 + commit_sync_parallel_fetches: 20 + commit_sync_batch_size: 100 + commit_sync_batches_ahead: 200 + anemo: + excessive_message_size: 8388608 + tonic: + keepalive_interval: + secs: 5 + nanos: 0 + connection_buffer_size: 33554432 + excessive_message_size: 16777216 + message_size_limit: 67108864 + sync_last_proposed_block_timeout: + secs: 0 + nanos: 0 enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -294,12 +348,11 @@ validator_configs: metrics-address: "0.0.0.0:1" admin-interface-port: 8888 consensus-config: - address: "" db-path: /tmp/foo/ - internal-worker-address: "" max-pending-transactions: ~ max-submit-position: ~ submit-delay-step-override-millis: ~ + address: "" narwhal-config: header_num_of_batches_threshold: 32 max_header_num_of_batches: 1000 @@ -320,6 +373,34 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ + parameters: + db_path: ~ + leader_timeout: + secs: 0 + nanos: 250000000 + min_round_delay: + secs: 0 + nanos: 50000000 + max_forward_time_drift: + secs: 0 + nanos: 500000000 + max_blocks_per_fetch: 1000 + dag_state_cached_rounds: 500 + commit_sync_parallel_fetches: 20 + commit_sync_batch_size: 100 + commit_sync_batches_ahead: 200 + anemo: + excessive_message_size: 8388608 + tonic: + keepalive_interval: + secs: 5 + nanos: 0 + connection_buffer_size: 33554432 + excessive_message_size: 16777216 + message_size_limit: 67108864 + sync_last_proposed_block_timeout: + secs: 0 + nanos: 0 enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -432,12 +513,11 @@ validator_configs: metrics-address: "0.0.0.0:1" admin-interface-port: 8888 consensus-config: - address: "" db-path: /tmp/foo/ - internal-worker-address: "" max-pending-transactions: ~ max-submit-position: ~ submit-delay-step-override-millis: ~ + address: "" narwhal-config: header_num_of_batches_threshold: 32 max_header_num_of_batches: 1000 @@ -458,6 +538,34 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ + parameters: + db_path: ~ + leader_timeout: + secs: 0 + nanos: 250000000 + min_round_delay: + secs: 0 + nanos: 50000000 + max_forward_time_drift: + secs: 0 + nanos: 500000000 + max_blocks_per_fetch: 1000 + dag_state_cached_rounds: 500 + commit_sync_parallel_fetches: 20 + commit_sync_batch_size: 100 + commit_sync_batches_ahead: 200 + anemo: + excessive_message_size: 8388608 + tonic: + keepalive_interval: + secs: 5 + nanos: 0 + connection_buffer_size: 33554432 + excessive_message_size: 16777216 + message_size_limit: 67108864 + sync_last_proposed_block_timeout: + secs: 0 + nanos: 0 enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -570,12 +678,11 @@ validator_configs: metrics-address: "0.0.0.0:1" admin-interface-port: 8888 consensus-config: - address: "" db-path: /tmp/foo/ - internal-worker-address: "" max-pending-transactions: ~ max-submit-position: ~ submit-delay-step-override-millis: ~ + address: "" narwhal-config: header_num_of_batches_threshold: 32 max_header_num_of_batches: 1000 @@ -596,6 +703,34 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ + parameters: + db_path: ~ + leader_timeout: + secs: 0 + nanos: 250000000 + min_round_delay: + secs: 0 + nanos: 50000000 + max_forward_time_drift: + secs: 0 + nanos: 500000000 + max_blocks_per_fetch: 1000 + dag_state_cached_rounds: 500 + commit_sync_parallel_fetches: 20 + commit_sync_batch_size: 100 + commit_sync_batches_ahead: 200 + anemo: + excessive_message_size: 8388608 + tonic: + keepalive_interval: + secs: 5 + nanos: 0 + connection_buffer_size: 33554432 + excessive_message_size: 16777216 + message_size_limit: 67108864 + sync_last_proposed_block_timeout: + secs: 0 + nanos: 0 enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -708,12 +843,11 @@ validator_configs: metrics-address: "0.0.0.0:1" admin-interface-port: 8888 consensus-config: - address: "" db-path: /tmp/foo/ - internal-worker-address: "" max-pending-transactions: ~ max-submit-position: ~ submit-delay-step-override-millis: ~ + address: "" narwhal-config: header_num_of_batches_threshold: 32 max_header_num_of_batches: 1000 @@ -734,6 +868,34 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ + parameters: + db_path: ~ + leader_timeout: + secs: 0 + nanos: 250000000 + min_round_delay: + secs: 0 + nanos: 50000000 + max_forward_time_drift: + secs: 0 + nanos: 500000000 + max_blocks_per_fetch: 1000 + dag_state_cached_rounds: 500 + commit_sync_parallel_fetches: 20 + commit_sync_batch_size: 100 + commit_sync_batches_ahead: 200 + anemo: + excessive_message_size: 8388608 + tonic: + keepalive_interval: + secs: 5 + nanos: 0 + connection_buffer_size: 33554432 + excessive_message_size: 16777216 + message_size_limit: 67108864 + sync_last_proposed_block_timeout: + secs: 0 + nanos: 0 enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -846,12 +1008,11 @@ validator_configs: metrics-address: "0.0.0.0:1" admin-interface-port: 8888 consensus-config: - address: "" db-path: /tmp/foo/ - internal-worker-address: "" max-pending-transactions: ~ max-submit-position: ~ submit-delay-step-override-millis: ~ + address: "" narwhal-config: header_num_of_batches_threshold: 32 max_header_num_of_batches: 1000 @@ -872,6 +1033,34 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ + parameters: + db_path: ~ + leader_timeout: + secs: 0 + nanos: 250000000 + min_round_delay: + secs: 0 + nanos: 50000000 + max_forward_time_drift: + secs: 0 + nanos: 500000000 + max_blocks_per_fetch: 1000 + dag_state_cached_rounds: 500 + commit_sync_parallel_fetches: 20 + commit_sync_batch_size: 100 + commit_sync_batches_ahead: 200 + anemo: + excessive_message_size: 8388608 + tonic: + keepalive_interval: + secs: 5 + nanos: 0 + connection_buffer_size: 33554432 + excessive_message_size: 16777216 + message_size_limit: 67108864 + sync_last_proposed_block_timeout: + secs: 0 + nanos: 0 enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -976,4 +1165,3 @@ account_keys: - mfPjCoE6SX0Sl84MnmNS/LS+tfPpkn7I8tziuk2g0WM= - 5RWlYF22jS9i76zLl8jP2D3D8GC5ht+IP1dWUBGZxi8= genesis: "[fake genesis]" - From 25d2f3087a3797184d141929a4cf3dfcb244604f Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Tue, 23 Jul 2024 23:48:37 -0700 Subject: [PATCH 132/163] Customize statis initialize move dir in simtest (#18752) ## Description So that other projects can choose their own move package for this static initialization. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-proc-macros/src/lib.rs | 3 +-- scripts/simtest/cargo-simtest | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/sui-proc-macros/src/lib.rs b/crates/sui-proc-macros/src/lib.rs index ab0fca56a7f46..4cc49ce52e229 100644 --- a/crates/sui-proc-macros/src/lib.rs +++ b/crates/sui-proc-macros/src/lib.rs @@ -57,8 +57,7 @@ pub fn init_static_initializers(_args: TokenStream, item: TokenStream) -> TokenS use sui_simulator::move_package::package_hooks::register_package_hooks; register_package_hooks(Box::new(SuiPackageHooks {})); - let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.extend(["..", "..", "examples", "move", "basics"]); + let mut path = PathBuf::from(env!("SIMTEST_STATIC_INIT_MOVE")); let mut build_config = BuildConfig::default(); build_config.config.install_dir = Some(TempDir::new().unwrap().into_path()); diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index a93af53753134..57614f76405fe 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -96,6 +96,11 @@ fi # Must supply a new temp dir - the test is deterministic and can't choose one randomly itself. export TMPDIR=$(mktemp -d) +# Set the example move package for the simtest static initializer +# https://github.com/MystenLabs/sui/blob/7bc276d534c6c758ac2cfefe96431c2b1318ca01/crates/sui-proc-macros/src/lib.rs#L52 +root_dir=$(git rev-parse --show-toplevel) +export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" + cargo ${CARGO_COMMAND[@]} \ --config "build.rustflags = [$RUST_FLAGS]" \ "${cargo_patch_args[@]}" \ From d4fa9125f483dee93cb625d2c4529998e855b750 Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Wed, 24 Jul 2024 11:30:55 -0400 Subject: [PATCH 133/163] Enable random beacon on mainnet (#18756) ## Description Enables the native randomness (random beacon) feature on sui mainnet. ## Test plan Extensive manual and automated testing. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [x] Protocol: Enables the native randomness (random beacon) feature on sui mainnet. - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-protocol-config/src/lib.rs | 7 +++++++ .../sui_protocol_config__test__Mainnet_version_53.snap | 4 ++++ .../sui_protocol_config__test__Testnet_version_53.snap | 4 ++-- .../snapshots/sui_protocol_config__test__version_53.snap | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 0a630e7a87b44..f0963eaa44696 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -164,6 +164,7 @@ const MAX_PROTOCOL_VERSION: u64 = 53; // Version 53: Add feature flag to decide whether to attempt to finalize bridge committee // Enable consensus commit prologue V3 on testnet. // Turn on shared object congestion control in testnet. +// Enable random beacon on mainnet. #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -2536,6 +2537,12 @@ impl ProtocolConfig { cfg.feature_flags.per_object_congestion_control_mode = PerObjectCongestionControlMode::TotalTxCount; } + + // Enable random beacon on mainnet. + cfg.feature_flags.random_beacon = true; + cfg.random_beacon_reduction_lower_bound = Some(1000); + cfg.random_beacon_dkg_timeout_round = Some(3000); + cfg.random_beacon_min_round_interval_ms = Some(500); } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap index 2761b97f0f926..13d777f60d287 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap @@ -32,6 +32,7 @@ feature_flags: simple_conservation_checks: true loaded_child_object_format_type: true receive_objects: true + random_beacon: true enable_effects_v2: true narwhal_certificate_v2: true verify_legacy_zklogin_address: true @@ -273,6 +274,9 @@ consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 +random_beacon_reduction_lower_bound: 1000 +random_beacon_dkg_timeout_round: 3000 +random_beacon_min_round_interval_ms: 500 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap index 0419b3548b467..ec96505d6cf65 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap @@ -277,9 +277,9 @@ 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: 1600 +random_beacon_reduction_lower_bound: 1000 random_beacon_dkg_timeout_round: 3000 -random_beacon_min_round_interval_ms: 200 +random_beacon_min_round_interval_ms: 500 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap index 095c918715c91..8514174952bab 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap @@ -286,9 +286,9 @@ 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: 1600 +random_beacon_reduction_lower_bound: 1000 random_beacon_dkg_timeout_round: 3000 -random_beacon_min_round_interval_ms: 200 +random_beacon_min_round_interval_ms: 500 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 From 51b3d50a06b55fb8cacbcfd000fcda8549cdf7d6 Mon Sep 17 00:00:00 2001 From: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:01:06 -0600 Subject: [PATCH 134/163] [docs] Updates to wallet standard (#18765) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: Alex Tsiliris --- docs/content/standards/wallet-standard.mdx | 211 ++++++++++++++++----- 1 file changed, 164 insertions(+), 47 deletions(-) diff --git a/docs/content/standards/wallet-standard.mdx b/docs/content/standards/wallet-standard.mdx index 0f2f6d2ab6565..6ea35087b588a 100644 --- a/docs/content/standards/wallet-standard.mdx +++ b/docs/content/standards/wallet-standard.mdx @@ -1,18 +1,19 @@ --- title: Wallet Standard -description: The Wallet Standard defines how wallets can automatically be discovered and interacted with from dApps. +description: The Wallet standard defines how wallets can automatically be discovered and interacted with from dApps. --- -Browser extension wallets built for Sui are defined using the -[Wallet Standard](https://github.com/wallet-standard/wallet-standard/). This is a cross-chain -standard that defines how wallets can automatically be discovered and interacted with from dApps. +Browser extension wallets built for Sui use the [Wallet standard](https://github.com/wallet-standard/wallet-standard/). This is a cross-chain standard that defines how dApps can automatically discover and interact with wallets. -If you are building a wallet, we publish a helper library `@mysten/wallet-standard` which provides -types and utilities that make it simple to get started. +If you are building a wallet, the helper library `@mysten/wallet-standard` provides types and utilities to help get started. + +## Working with wallets + +The Wallet standard includes features to help build wallets. ### Creating a wallet interface -You need to create a class that represents your wallet. You can use the `Wallet` interface from +Create a class that represents your wallet. Use the `Wallet` interface from `@mysten/wallet-standard` to help ensure your class adheres to the standard. ```tsx @@ -41,25 +42,23 @@ class YourWallet implements Wallet { Features are standard methods consumers can use to interact with a wallet. To be listed in the Sui wallet adapter, you must implement the following features in your wallet: -- `standard:connect` - Used to initiate a connection to the wallet. -- `standard:events` - Used to listen for changes that happen within the wallet, such as accounts +- `standard:connect` - Use to initiate a connection to the wallet. +- `standard:events` - Use to listen for changes that happen within the wallet, such as accounts being added or removed. -- `sui:signPersonalMessage` - Used to prompt the user to sign a personal message, and return the - message signature back to the dApp. This can be used to verify the user’s public key. -- `sui:signTransaction` - Used to prompt the user to sign a transaction, and return the serialized +- `sui:signPersonalMessage` - Use to prompt the user to sign a personal message and return the + message signature back to the dApp. Use this to verify the user’s public key. +- `sui:signTransaction` - Use to prompt the user to sign a transaction and return the serialized transaction and signature back to the dApp. This method does not submit the transaction for execution. -- `sui:signAndExecuteTransaction` - Used to prompt the user to sign a transaction, then submit it +- `sui:signAndExecuteTransaction` - Use to prompt the user to sign a transaction, then submit it for execution to the blockchain. -- `sui:reportTransactionEffects` - Used to report the effects of a transaction executed in the dApp - to the wallet. this allows the wallet to update it's internal state to reflect the changes made by - the transaction. -- `sui:signTransactionBlock` - The previous version of `sui:signTransaction`. It should still be +- `sui:reportTransactionEffects` - Use to report the effects of a transaction executed in the dApp + to the wallet. This allows the wallet to update its internal state to reflect the changes the transaction makes. +- `sui:signTransactionBlock` - The previous version of `sui:signTransaction`. Still implemented for compatibility with dApps that have not updated to the new feature. -- `sui:signAndExecuteTransactionBlock` - The previous version of `sui:signAndExecuteTransaction`. It - should still be implemented for compatibility with dApps that have not updated to the new feature. +- `sui:signAndExecuteTransactionBlock` - The previous version of `sui:signAndExecuteTransaction`. Still implemented for compatibility with dApps that have not updated to the new feature. -You can implement these features in your wallet class under the `features` property: +Implement these features in your wallet class under the `features` property: ```tsx import { @@ -137,7 +136,7 @@ The last requirement of the wallet interface is to expose an `accounts` interfac expose all of the accounts that a connected dApp has access to. It can be empty prior to initiating a connection through the `standard:connect` feature. -The accounts can use the `ReadonlyWalletAccount` class to easily construct an account matching the +The accounts use the `ReadonlyWalletAccount` class to construct an account matching the required interface. ```tsx @@ -169,8 +168,8 @@ class YourWallet implements Wallet { ### Registering in the window -Once you have a compatible interface for your wallet, you register it using the `registerWallet` -function. +After you have a compatible interface for your wallet, use the `registerWallet` +function to register it. ```tsx import { registerWallet } from '@mysten/wallet-standard'; @@ -178,37 +177,155 @@ import { registerWallet } from '@mysten/wallet-standard'; registerWallet(new YourWallet()); ``` -### Best practices for efficient Transaction Execution +### Best practices for efficient transaction execution -The wallet standard has recently been updated to reflect changes being implemented across the Sui -ecosystem. With the migration the new GraphQL API the previous `sui:signAndExecuteTransactionBlock` -feature will become harder to maintain, and has been closely tied to the JSON RPC options and data -structures. +The Wallet standard has been updated from its original design to better support changes in the Sui ecosystem. For example, the GraphQL service was introduced after Mainnet launched. The `sui:signAndExecuteTransactionBlock` feature is closely tied to the JSON RPC options and data structures, so its continued maintenance becomes increasingly difficult as the GraphQL service becomes more ubiquitous. -The new `sui:signAndExecuteTransaction` feature will be easier to implement for wallet builders -regardless of which API they are using to execute transactions. This simplicity comes at the expense -of flexibility in what is returned from the `sui:signAndExecuteTransaction` feature. +Consequently, the Wallet standard introduced the `sui:signAndExecuteTransaction` feature. The features of this method are more useful, regardless of which API you use to execute transactions. This usefulness comes at the expense +of flexibility in what `sui:signAndExecuteTransaction` returns. -The solution to this problem is to use the `sui:signTransaction` feature to sign transactions, and -leave transaction execution up to the dApp, allowing it to query for additional data during -execution, using whichever API the dapp is using. This is consistent with the default we have used -in `@mysten/dapp-kit` for the `useSignAndExecuteTransaction` hook, and enables dApps to take -advantage of read-after-write consistency when interacting with the full-node based JSON RPC API. +To solve this problem, use the `sui:signTransaction` feature to sign transactions, and +leave transaction execution to the dApp. The dApp can query for additional data during +execution using whichever API it chooses. This is consistent with the default `@mysten/dapp-kit` uses for the `useSignAndExecuteTransaction` hook, and enables dApps to take +advantage of read-after-write consistency when interacting with the Full-node based JSON RPC. -The downside of this strategy has been that wallets end up using different RPC nodes than the dApp, -and may not have indexed the previous transaction when executing multiple transactions in rapid -succession. This leads to building transactions using stale data, that will fail when executed. +The downside of this strategy is that wallets often use different RPC nodes than the dApp, +and might not have indexed the previous transaction when executing multiple transactions in rapid +succession. This leads to building transactions using stale data that fail upon execution. -To mitigate this, wallets can use the `sui:reportTransactionEffects` feature so that apps can report +To mitigate this, wallets can use the `sui:reportTransactionEffects` feature so that dApps can report the effects of transactions to the wallet. Transaction effects contain the updated versions and -digests of any objects used or created in a transaction. By caching these values, wallets can build +digests of any objects that a transaction uses or creates. By caching these values, wallets can build transactions without needing to resolve the most recent versions through an API call. -The `@mysten/sui/transaction` SDK exports the `SerialTransactionExecutor` class, which can be used -to build Transaction using an object cache, and has a method to update it's internal cache using the +The `@mysten/sui/transaction` SDK exports the `SerialTransactionExecutor` class, which you can use +to build transactions using an object cache. The class has a method to update its internal cache using the effects of a transaction. -Using the combination of `sui:signTransaction` and `sui:reportTransactionEffects` dApps can use -whichever API they prefer to execute transactions, querying for whatever data the API exposes -for use in the dapp, and by reporting the effects of the transaction to the wallet, the wallet -should be able to execute transactions without running into issues caused by lagging indexer. +Using the combination of `sui:signTransaction` and `sui:reportTransactionEffects`, dApps can use +either API to execute transactions and query for any data the API exposes. The dApp can then report the effects of the transaction to the wallet, and the wallet can then execute transactions without running into issues caused by a lagging indexer. + +## Managing wallets + +The Wallet standard includes features to help your apps interact with wallets. + +### Wallet data + +To query the installed wallets in a user's browser, use the `get` function of `getWallets`. + +```tsx +import { getWallets } from "@mysten/wallet-standard"; + +const availableWallets = getWallets().get(); +``` + +The return from this call (`availableWallets` in the previous code) is an array of `Wallet` types. + +Use the `Wallet.icon` and `Wallet.name` attributes to display the wallet details on your web page. + +The `Wallet.accounts` is an array of `WalletAccount`s. Each `WalletAccount` type has `address` and `publicKey` properties, which are most useful during development. This data fills and caches after connection. + +### Features + +Both the `Wallet` type and the `WalletAccount` type have a property called `features`. The main wallet functionality is found here. The mandatory features that wallets must implement are listed in the previous code. + +Many wallets choose to omit some non-mandatory features or add some custom features, so be sure to check the relevant wallet documentation if you intend to integrate a specific wallet. + +### Connecting a wallet + +Connecting in the context of a wallet refers to a user that joins the web site for the first time and has to choose the wallet and addresses to use. + +The feature that provides this functionality is called `standard:connect`. To connect using this feature, make the following call: + +```tsx +wallet.features['standard:connect'].connect() // connect call +``` + +This call results in the wallet opening a pop-up dialog for the user to continue the connection process. + +### Disconnecting a wallet + +Similar to the connecting feature, the Wallet standard also includes `standard:disconnect`. The following example calls this feature: + +```tsx +wallet.features['standard:disconnect'].disconnect(); +``` + +### Transactions - suggested approach + +Upon wallet connection, your app has the necessary information to execute transactions, such as address and method. + +Construct the transaction separately with the `@mysten/sui` library and then sign it with the private key of the user. Use the `sui:signTransaction` feature to achieve this: + +```tsx +wallet.features[sui:signTransaction].singTransaction(, ); +``` + +Similar to connections, this process opens a pop-up dialog for the user to either accept or decline the transaction. Upon accepting, the function returns an object in the form `{bytes: String, signature: Uint8Array}`. The `bytes` value is the `b64` encoding of the transaction and the `signature` value is the transaction signature. + +To execute the transaction, use `SuiClient` from `@mysten/sui`: + +```tsx +const client: SuiClient +client.executeTransactionBlock({ + transactionBlock: bytes, + signature: signature, + options: {} +}) +``` + +Your app then sends the transaction effects back to the wallet, which reports results to the user. The wallet expects the effects to be `b64` encoded. + +```tsx +wallet.features['sui:reportTransactionEffects'].reportTransactionEffects( + effects: Array.isArray(transactionResponse.effects) ? toB64( + Uint8Array.from(transactionResponse.effects) : transactionResponse.effects, + account: wallet.accounts[0], // for example + chain: wallet.chains[0] + ) +``` + +### Transactions - abbreviated approach + +Many wallets abstract the above flow into one feature: `sui:signAndExecuteTransaction`. The required arguments for this feature are the raw transaction and the options with the desired information to be included in the response: + +- `showEffects`: Include the transaction effects. +- `showEvents`: Include the transaction events. +- `showObjectChanges`: Include all the objects that were deleted, created, or mutated. +- `showBalanceChanges`: Include any coin transfer that took place. +- `showInput`: Include the transaction's input. +- `showRawInput`: Same as `showInput` but the format is raw. + +### Events wallets emit + +The wallet emits events on certain user actions that apps can listen to. These events allow your app to be responsive to user actions on their wallets. + +The wallet standard only defines the change event that can apply to chains, features, or accounts. + +- `chains`: A change event on the chains means the user switched the wallet's active network, such as from Devnet to Testnet. +- `features`: The user added or removed permission for your app to access certain wallet features. +- `accounts`: The user added or removed an account (address) to interact with your app. + +To subscribe your apps to events with the following call: + +```tsx +const unsubscribe = wallet.features['standard:events'].on ('change', callback); +``` + +This call returns a function that can be called to unsubscribe from listening to the events. + +The callback is the handler that contains the logic to perform when the event fires. The input to the callback function is an object with the following type: + +```tsx +{ + accounts: WalletAccount[], + chains: IdentifierArray, + features: IdentifierRecord +} +``` + +These values are all arrays containing the new or changed items. Consequently, every event populates only one array in most cases, the rest are empty. + +### Implementation example + +Mysten Labs offers a bare bones scaffold for React-based applications called `@mysten/dapp-kit`. See the [dApp Kit documentation](https://sdk.mystenlabs.com/dapp-kit) for more informqtion. From 9d2292ead2e6a3ecbb27efc134a7b40373ce2985 Mon Sep 17 00:00:00 2001 From: Damir Shamanaev Date: Wed, 24 Jul 2024 19:48:52 +0200 Subject: [PATCH 135/163] [framework] vector macros wave 2 (#18702) --- .../sui-framework/docs/move-stdlib/vector.md | 18 +-- .../packages/move-stdlib/sources/vector.move | 114 ++++++++++++++++-- .../move-stdlib/tests/vector_tests.move | 108 +++++++++++++++++ .../packages/sui-framework/Move.lock | 4 +- 4 files changed, 223 insertions(+), 21 deletions(-) diff --git a/crates/sui-framework/docs/move-stdlib/vector.md b/crates/sui-framework/docs/move-stdlib/vector.md index e10f32dc407ee..d3f55f7b737fa 100644 --- a/crates/sui-framework/docs/move-stdlib/vector.md +++ b/crates/sui-framework/docs/move-stdlib/vector.md @@ -61,7 +61,7 @@ Create an empty vector. Implementation -
native public fun empty<Element>(): vector<Element>;
+
public native fun empty<Element>(): vector<Element>;
 
@@ -84,7 +84,7 @@ Return the length of the vector. Implementation -
native public fun length<Element>(v: &vector<Element>): u64;
+
public native fun length<Element>(v: &vector<Element>): u64;
 
@@ -108,7 +108,7 @@ Aborts if i is out of bounds. Implementation -
native public fun borrow<Element>(v: &vector<Element>, i: u64): ∈
+
public native fun borrow<Element>(v: &vector<Element>, i: u64): ∈
 
@@ -131,7 +131,7 @@ Add element e to the end of the vector v. Implementation -
native public fun push_back<Element>(v: &mut vector<Element>, e: Element);
+
public native fun push_back<Element>(v: &mut vector<Element>, e: Element);
 
@@ -155,7 +155,7 @@ Aborts if i is out of bounds. Implementation -
native public fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element;
+
public native fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element;
 
@@ -179,7 +179,7 @@ Aborts if v is empty. Implementation -
native public fun pop_back<Element>(v: &mut vector<Element>): Element;
+
public native fun pop_back<Element>(v: &mut vector<Element>): Element;
 
@@ -203,7 +203,7 @@ Aborts if v is not empty. Implementation -
native public fun destroy_empty<Element>(v: vector<Element>);
+
public native fun destroy_empty<Element>(v: vector<Element>);
 
@@ -227,7 +227,7 @@ Aborts if i or j is out of bounds. Implementation -
native public fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64);
+
public native fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64);
 
@@ -282,7 +282,7 @@ Reverses the order of the elements in the vector v in place. if (len == 0) return (); let mut front_index = 0; - let mut back_index = len -1; + let mut back_index = len - 1; while (front_index < back_index) { v.swap(front_index, back_index); front_index = front_index + 1; diff --git a/crates/sui-framework/packages/move-stdlib/sources/vector.move b/crates/sui-framework/packages/move-stdlib/sources/vector.move index 92936616a084a..cd98ed0ae7955 100644 --- a/crates/sui-framework/packages/move-stdlib/sources/vector.move +++ b/crates/sui-framework/packages/move-stdlib/sources/vector.move @@ -5,7 +5,6 @@ /// A variable-sized container that can hold any type. Indexing is 0-based, and /// vectors are growable. This module has many native functions. module std::vector { - /// Allows calling `.to_string()` on a vector of `u8` to get a utf8 `String`. public use fun std::string::utf8 as vector.to_string; @@ -25,42 +24,42 @@ module std::vector { #[bytecode_instruction] /// Create an empty vector. - native public fun empty(): vector; + public native fun empty(): vector; #[bytecode_instruction] /// Return the length of the vector. - native public fun length(v: &vector): u64; + public native fun length(v: &vector): u64; #[syntax(index)] #[bytecode_instruction] /// Acquire an immutable reference to the `i`th element of the vector `v`. /// Aborts if `i` is out of bounds. - native public fun borrow(v: &vector, i: u64): ∈ + public native fun borrow(v: &vector, i: u64): ∈ #[bytecode_instruction] /// Add element `e` to the end of the vector `v`. - native public fun push_back(v: &mut vector, e: Element); + public native fun push_back(v: &mut vector, e: Element); #[syntax(index)] #[bytecode_instruction] /// Return a mutable reference to the `i`th element in the vector `v`. /// Aborts if `i` is out of bounds. - native public fun borrow_mut(v: &mut vector, i: u64): &mut Element; + public native fun borrow_mut(v: &mut vector, i: u64): &mut Element; #[bytecode_instruction] /// Pop an element from the end of vector `v`. /// Aborts if `v` is empty. - native public fun pop_back(v: &mut vector): Element; + public native fun pop_back(v: &mut vector): Element; #[bytecode_instruction] /// Destroy the vector `v`. /// Aborts if `v` is not empty. - native public fun destroy_empty(v: vector); + public native fun destroy_empty(v: vector); #[bytecode_instruction] /// Swaps the elements at the `i`th and `j`th indices in the vector `v`. /// Aborts if `i` or `j` is out of bounds. - native public fun swap(v: &mut vector, i: u64, j: u64); + public native fun swap(v: &mut vector, i: u64, j: u64); /// Return an vector of size one containing element `e`. public fun singleton(e: Element): vector { @@ -75,7 +74,7 @@ module std::vector { if (len == 0) return (); let mut front_index = 0; - let mut back_index = len -1; + let mut back_index = len - 1; while (front_index < back_index) { v.swap(front_index, back_index); front_index = front_index + 1; @@ -161,6 +160,14 @@ module std::vector { // === Macros === + /// Create a vector of length `n` by calling the function `f` on each index. + public macro fun tabulate<$T>($n: u64, $f: |u64| -> $T): vector<$T> { + let mut v = vector[]; + let n = $n; + n.do!(|i| v.push_back($f(i))); + v + } + /// Destroy the vector `v` by calling `f` on each element and then destroying the vector. /// Does not preserve the order of elements in the vector (starts from the end of the vector). public macro fun destroy<$T>($v: vector<$T>, $f: |$T|) { @@ -239,6 +246,14 @@ module std::vector { } } + /// Count how many elements in the vector `v` satisfy the predicate `f`. + public macro fun count<$T>($v: &vector<$T>, $f: |&$T| -> bool): u64 { + let v = $v; + let mut count = 0; + v.do_ref!(|e| if ($f(e)) count = count + 1); + count + } + /// Reduce the vector `v` to a single value by applying the function `f` to each element. /// Similar to `fold_left` in Rust and `reduce` in Python and JavaScript. public macro fun fold<$T, $Acc>($v: vector<$T>, $init: $Acc, $f: |$Acc, $T| -> $Acc): $Acc { @@ -267,4 +282,83 @@ module std::vector { true } } + + /// Destroys two vectors `v1` and `v2` by calling `f` to each pair of elements. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_do<$T1, $T2>($v1: vector<$T1>, $v2: vector<$T2>, $f: |$T1, $T2|) { + let v1 = $v1; + let mut v2 = $v2; + v2.reverse(); + let len = v1.length(); + assert!(len == v2.length()); + v1.do!(|el1| $f(el1, v2.pop_back())); + } + + /// Destroys two vectors `v1` and `v2` by calling `f` to each pair of elements. + /// Aborts if the vectors are not of the same length. + /// Starts from the end of the vectors. + public macro fun zip_do_reverse<$T1, $T2>($v1: vector<$T1>, $v2: vector<$T2>, $f: |$T1, $T2|) { + let v1 = $v1; + let mut v2 = $v2; + let len = v1.length(); + assert!(len == v2.length()); + v1.destroy!(|el1| $f(el1, v2.pop_back())); + } + + /// Iterate through `v1` and `v2` and apply the function `f` to references of each pair of + /// elements. The vectors are not modified. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_do_ref<$T1, $T2>($v1: &vector<$T1>, $v2: &vector<$T2>, $f: |&$T1, &$T2|) { + let v1 = $v1; + let v2 = $v2; + let len = v1.length(); + assert!(len == v2.length()); + len.do!(|i| $f(&v1[i], &v2[i])); + } + + /// Iterate through `v1` and `v2` and apply the function `f` to mutable references of each pair + /// of elements. The vectors may be modified. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_do_mut<$T1, $T2>( + $v1: &mut vector<$T1>, + $v2: &mut vector<$T2>, + $f: |&mut $T1, &mut $T2|, + ) { + let v1 = $v1; + let v2 = $v2; + let len = v1.length(); + assert!(len == v2.length()); + len.do!(|i| $f(&mut v1[i], &mut v2[i])); + } + + /// Destroys two vectors `v1` and `v2` by applying the function `f` to each pair of elements. + /// The returned values are collected into a new vector. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_map<$T1, $T2, $U>( + $v1: vector<$T1>, + $v2: vector<$T2>, + $f: |$T1, $T2| -> $U, + ): vector<$U> { + let mut r = vector[]; + zip_do!($v1, $v2, |el1, el2| r.push_back($f(el1, el2))); + r + } + + /// Iterate through `v1` and `v2` and apply the function `f` to references of each pair of + /// elements. The returned values are collected into a new vector. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_map_ref<$T1, $T2, $U>( + $v1: &vector<$T1>, + $v2: &vector<$T2>, + $f: |&$T1, &$T2| -> $U, + ): vector<$U> { + let mut r = vector[]; + zip_do_ref!($v1, $v2, |el1, el2| r.push_back($f(el1, el2))); + r + } } diff --git a/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move b/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move index 5ce37113f8031..2bb76d6310017 100644 --- a/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move +++ b/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move @@ -592,6 +592,25 @@ module std::vector_tests { assert!(acc == 100); } + #[test] + fun test_count_macro() { + assert!(vector[].count!(|e| *e == 2) == 0); + assert!(vector[0, 1, 2, 3].count!(|e| *e == 2) == 1); + assert!(vector[0, 1, 2, 3].count!(|e| *e % 2 == 0) == vector[0, 2].length()); + } + + #[test] + fun test_tabulate_macro() { + let v = vector::tabulate!(10, |i| i); + assert!(v == vector[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); + + let v = vector::tabulate!(5, |i| 10 - i); + assert!(v == vector[10, 9, 8, 7, 6]); + + let v = vector::tabulate!(0, |i| i); + assert!(v == vector[]); + } + #[test] fun test_do_macro() { vector[].do!(|_| assert!(false)); // should never run @@ -678,4 +697,93 @@ module std::vector_tests { assert!(vector[0, 1, 2, 3].all!(|e| *e < 4)); assert!(!vector[0, 1, 2, 3].all!(|e| *e < 3)); } + + #[test, expected_failure] + fun zip_do_macro_fail() { + let v1 = vector[1u64]; + let v2 = vector[4u64, 5]; + let mut res = vector[]; + v1.zip_do!(v2, |a, b| res.push_back(a + b)); + } + + #[test] + fun zip_do_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + let mut res = vector[]; + v1.zip_do!(v2, |a, b| res.push_back(a + b)); + assert!(res == vector[5, 7, 9]); + } + + #[test, expected_failure] + fun zip_do_reverse_macro_fail() { + let v1 = vector[1u64]; + let v2 = vector[4u64, 5]; + let mut res = vector[]; + v2.zip_do_reverse!(v1, |a, b| res.push_back(a + b)); + } + + #[test] + fun zip_do_reverse_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + let mut res = vector[]; + v2.zip_do_reverse!(v1, |a, b| res.push_back(a + b)); + assert!(res == vector[9, 7, 5]); + } + + #[test, expected_failure] + fun zip_do_ref_macro_fail() { + let v1 = vector[1u64]; + let v2 = vector[4u64, 5]; + let mut res = vector[]; + v2.zip_do_ref!(&v1, |a, b| res.push_back(*a + *b)); + } + + #[test] + fun zip_do_ref_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + let mut res = vector[]; + v1.zip_do_ref!(&v2, |a, b| res.push_back(*a + *b)); + assert!(res == vector[5, 7, 9]); + } + + #[test, expected_failure] + fun zip_do_mut_macro_fail() { + let mut v1 = vector[1u64]; + let mut v2 = vector[4u64, 5]; + v1.zip_do_mut!(&mut v2, |a, b| { + let c = *a; + *a = *b; + *b = c; + }); + } + + #[test] + fun zip_do_mut_macro() { + let mut v1 = vector[1u64, 2, 3]; + let mut v2 = vector[4u64, 5, 6]; + v1.zip_do_mut!(&mut v2, |a, b| { + let c = *a; + *a = *b; + *b = c; + }); + assert!(v1 == vector[4, 5, 6]); + assert!(v2 == vector[1, 2, 3]); + } + + #[test] + fun zip_map_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + assert!(v1.zip_map!(v2, |a, b| a + b) == vector[5, 7, 9]); + } + + #[test] + fun zip_map_ref_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + assert!(v2.zip_map_ref!(&v1, |a, b| *a + *b) == vector[5, 7, 9]); + } } diff --git a/crates/sui-framework/packages/sui-framework/Move.lock b/crates/sui-framework/packages/sui-framework/Move.lock index e38ac909eb150..018511436eb41 100644 --- a/crates/sui-framework/packages/sui-framework/Move.lock +++ b/crates/sui-framework/packages/sui-framework/Move.lock @@ -14,6 +14,6 @@ name = "MoveStdlib" source = { local = "../move-stdlib" } [move.toolchain-version] -compiler-version = "1.22.0" -edition = "legacy" +compiler-version = "1.30.0" +edition = "2024.beta" flavor = "sui" From ed7987c3ec308b4380632fe1552ee95692eb2e1e Mon Sep 17 00:00:00 2001 From: ronny-mysten <118224482+ronny-mysten@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:05:29 -0600 Subject: [PATCH 136/163] [docs] Retrieving edits (#18783) ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../developer/advanced/custom-indexer.mdx | 29 +++++++++++++++---- .../snippets/custom-indexer-source.mdx | 6 ---- .../src/plugins/inject-code/injectLoader.js | 3 ++ 3 files changed, 27 insertions(+), 11 deletions(-) delete mode 100644 docs/content/snippets/custom-indexer-source.mdx diff --git a/docs/content/guides/developer/advanced/custom-indexer.mdx b/docs/content/guides/developer/advanced/custom-indexer.mdx index 5b0c81bed335e..eb325e53a2825 100644 --- a/docs/content/guides/developer/advanced/custom-indexer.mdx +++ b/docs/content/guides/developer/advanced/custom-indexer.mdx @@ -20,7 +20,11 @@ trait Worker: Send + Sync { In this example, the `CheckpointData` struct represents full checkpoint content. The struct contains checkpoint summary and contents, as well as detailed information about each individual transaction. The individual transaction data includes events and input/output objects. The full definition for this content is in the [full_checkpoint_content.rs](https://github.com/MystenLabs/sui/blob/releases/sui-graphql-rpc-v2024.1.0-release/crates/sui-types/src/full_checkpoint_content.rs) file of the `sui-types` crate. -{@include: ../../../snippets//custom-indexer-source.mdx} +:::tip + +See the [Source code for an implementation](#source-code) section for a complete code example. + +::: ## Checkpoint stream sources @@ -158,9 +162,24 @@ The data ingestion executor can run multiple workflows simultaneously. For each The concurrency parameter specifies how many threads the workflow uses. Having a concurrency value greater than 1 is helpful when tasks are idempotent and can be processed in parallel and out of order. The executor only updates the progress/watermark to a certain checkpoint when all preceding checkpoints are processed. -{@include: ../../../snippets//custom-indexer-source.mdx} +## Source code for an implementation {#source-code} + +Find the following source code in the [Sui repo](https://github.com/mystenlabs/sui/tree/main/examples/custom-indexer/rust). + +### Manifest + +Code for the cargo.toml manifest file for the custom indexer. + +{@inject: examples/custom-indexer/rust/cargo.toml} + +### Rust source + +Code for the main.rs file that creates the custom indexer. + +{@inject: examples/custom-indexer/rust/main.rs} + +## Related links -Find more examples of custom ingestion pipelines in the Sui repository: -* Sui data ingestion daemon that runs internal [pipelines](https://github.com/MystenLabs/sui/tree/main/crates/sui-data-ingestion/src/). -* Sui Name Service's custom [indexer](https://github.com/MystenLabs/sui/tree/main/crates/suins-indexer/src). +- [Sui internal example](https://github.com/MystenLabs/sui/tree/main/crates/sui-data-ingestion/src/): Sui data ingestion daemon that runs internal pipelines. +- [Production example](https://github.com/MystenLabs/sui/tree/main/crates/suins-indexer/src): Sui Name Service custom indexer. diff --git a/docs/content/snippets/custom-indexer-source.mdx b/docs/content/snippets/custom-indexer-source.mdx deleted file mode 100644 index df33e594019cb..0000000000000 --- a/docs/content/snippets/custom-indexer-source.mdx +++ /dev/null @@ -1,6 +0,0 @@ -:::info - -You can view the [complete source code for this example](https://github.com/mystenlabs/sui/tree/main/examples/custom-indexer/rust) in the Sui repository. - -::: - diff --git a/docs/site/src/plugins/inject-code/injectLoader.js b/docs/site/src/plugins/inject-code/injectLoader.js index a94a354569706..704a80e22133b 100644 --- a/docs/site/src/plugins/inject-code/injectLoader.js +++ b/docs/site/src/plugins/inject-code/injectLoader.js @@ -51,6 +51,9 @@ const addCodeInject = function (source) { case "tsx": language = "ts"; break; + case "rs": + language = "rust"; + break; default: language = fileExt; } From 21aeeae879548b5a6974021d178b91548aada216 Mon Sep 17 00:00:00 2001 From: Tom Cat <48447545+tx-tomcat@users.noreply.github.com> Date: Thu, 25 Jul 2024 01:52:45 +0700 Subject: [PATCH 137/163] [Linter] Refactor: Optimize Linter Configuration and Visitor Generation (#18755) ## Description Function Updates: Updated the known_filters function to use the LinterDiagnosticCategory::Style enum variant. Simplified the linter_visitors function by combining the None and Default cases into a single match arm, reducing redundancy. Naming Consistency: Ensured consistent naming conventions throughout the code. Removed Unused Code: Eliminated any unused code or imports to improve code cleanliness. ## Test plan Existing linter unit tests --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../move-compiler/src/linters/constant_naming.rs | 4 ++-- .../move/crates/move-compiler/src/linters/mod.rs | 11 +++-------- .../tests/linter/incorrect_constant_naming.exp | 4 ++-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/external-crates/move/crates/move-compiler/src/linters/constant_naming.rs b/external-crates/move/crates/move-compiler/src/linters/constant_naming.rs index 99525fd275760..7c8e3e6407e90 100644 --- a/external-crates/move/crates/move-compiler/src/linters/constant_naming.rs +++ b/external-crates/move/crates/move-compiler/src/linters/constant_naming.rs @@ -19,13 +19,13 @@ use crate::{ }, }; -use super::{LinterDiagCategory, CONSTANT_NAMING_DIAG_CODE, LINT_WARNING_PREFIX}; +use super::{LinterDiagnosticCategory, CONSTANT_NAMING_DIAG_CODE, LINT_WARNING_PREFIX}; /// Diagnostic information for constant naming violations. const CONSTANT_NAMING_DIAG: DiagnosticInfo = custom( LINT_WARNING_PREFIX, Severity::Warning, - LinterDiagCategory::Style as u8, + LinterDiagnosticCategory::Style as u8, CONSTANT_NAMING_DIAG_CODE, "constant should follow naming convention", ); diff --git a/external-crates/move/crates/move-compiler/src/linters/mod.rs b/external-crates/move/crates/move-compiler/src/linters/mod.rs index 0baa1323936c1..01ab4d3c2902f 100644 --- a/external-crates/move/crates/move-compiler/src/linters/mod.rs +++ b/external-crates/move/crates/move-compiler/src/linters/mod.rs @@ -8,6 +8,7 @@ use crate::{ linters::constant_naming::ConstantNamingVisitor, typing::visitor::TypingVisitor, }; pub mod constant_naming; + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum LintLevel { // No linters @@ -32,19 +33,14 @@ pub enum LinterDiagnosticCategory { pub const ALLOW_ATTR_CATEGORY: &str = "lint"; pub const LINT_WARNING_PREFIX: &str = "Lint "; pub const CONSTANT_NAMING_FILTER_NAME: &str = "constant_naming"; - pub const CONSTANT_NAMING_DIAG_CODE: u8 = 1; -pub enum LinterDiagCategory { - Style, -} - pub fn known_filters() -> (Option, Vec) { ( Some(ALLOW_ATTR_CATEGORY.into()), vec![WarningFilter::code( Some(LINT_WARNING_PREFIX), - LinterDiagCategory::Style as u8, + LinterDiagnosticCategory::Style as u8, CONSTANT_NAMING_DIAG_CODE, Some(CONSTANT_NAMING_FILTER_NAME), )], @@ -53,8 +49,7 @@ pub fn known_filters() -> (Option, Vec) { pub fn linter_visitors(level: LintLevel) -> Vec { match level { - LintLevel::None => vec![], - LintLevel::Default => vec![], + LintLevel::None | LintLevel::Default => vec![], LintLevel::All => { vec![constant_naming::ConstantNamingVisitor::visitor( ConstantNamingVisitor, diff --git a/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.exp b/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.exp index 763e36f065ba3..944dd5bdad57f 100644 --- a/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.exp +++ b/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.exp @@ -1,4 +1,4 @@ -warning[Lint W00001]: constant should follow naming convention +warning[Lint W04001]: constant should follow naming convention ┌─ tests/linter/incorrect_constant_naming.move:3:5 │ 3 │ const Another_BadName: u64 = 42; // Should trigger a warning @@ -6,7 +6,7 @@ warning[Lint W00001]: constant should follow naming convention │ = This warning can be suppressed with '#[allow(lint(constant_naming))]' applied to the 'module' or module member ('const', 'fun', or 'struct') -warning[Lint W00001]: constant should follow naming convention +warning[Lint W04001]: constant should follow naming convention ┌─ tests/linter/incorrect_constant_naming.move:4:5 │ 4 │ const JSON_Max_Size: u64 = 1048576; From 5d2506cb2886c9a11879447db04f068654d3e85d Mon Sep 17 00:00:00 2001 From: Tim Zakian <2895723+tzakian@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:26:37 -0700 Subject: [PATCH 138/163] [sui-tool] Add support for config objects to the sui-tool replay command (#18743) ## Description This adds support for (manually) supplying the config objects to use when replaying a transaction. These must be provided for both state dumps and network-based replays. We will refuse to replay a transaction that has a deny-list related error (global pause, or address denial) unless configs are supplied. We will insert the latest version of the deny-list though if you don't supply it and we can see you will need it (due to a deny-list error). In this case we just pick the most recent version of the deny list as the version doesn't matter, and this will always not be pruned. This is only plumbed into the `sui-tool` replay command as I would prefer to not expose this ugly of an interface to the CLI, and instead support this in the future there once we have a better solution for getting these objects (e.g., with graphql). But happy to add it in if we feel it's necessary. ## Test plan Tested it on devnet: You can try it out on any transaction from here: https://explorer.polymedia.app/address/0xb685a6c1516b640646bc534239e5522482cc11af4e15a4cf7054b7314bb2a8d3?network=devnet ``` # global pause replay sui-tool replay --rpc https://rpc.devnet.sui.io:443 tx --tx-digest 9mXi3JSKYg9UeQbpq2YGgqByua6efn4cQUqgVyFFLmy4 --config-objects 0xb7ff3d164ce1490466b56ae1743796016f318e0afd62ab84168fdc2ba5a881fe 10 0x7cd46c8fb69f11bae382be7984cec1063dfa8a2de826fcc92f9e28a2b17cd8e3 13 0x2379389dd2b0fa44c1cbeb93c737f96674e7c352add67ec902eb58512e41334c 12 ## Address denial replay sui-tool replay --rpc https://rpc.devnet.sui.io:443 tx --tx-digest Af84RAY1Pf6GaAG9qXhHvTbcSGt7HM8E3zeGhWV5FUdt --config-objects 0xb7ff3d164ce1490466b56ae1743796016f318e0afd62ab84168fdc2ba5a881fe 10 0x7cd46c8fb69f11bae382be7984cec1063dfa8a2de826fcc92f9e28a2b17cd8e3 13 0x2379389dd2b0fa44c1cbeb93c737f96674e7c352add67ec902eb58512e41334c 12 ``` --- Cargo.lock | 1 + crates/sui-replay/Cargo.toml | 1 + crates/sui-replay/src/batch_replay.rs | 1 + crates/sui-replay/src/fuzz.rs | 1 + crates/sui-replay/src/lib.rs | 41 ++++++++++ crates/sui-replay/src/replay.rs | 85 ++++++++++++++++++++- crates/sui-replay/src/tests.rs | 2 + crates/sui-replay/src/types.rs | 2 + crates/sui/src/client_commands.rs | 2 + crates/sui/src/unit_tests/profiler_tests.rs | 1 + 10 files changed, 136 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1c065e98c3fef..13385e1bc6582 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13690,6 +13690,7 @@ dependencies = [ "parking_lot 0.12.1", "prometheus", "rand 0.8.5", + "regex", "serde", "serde_json", "serde_with 3.8.1", diff --git a/crates/sui-replay/Cargo.toml b/crates/sui-replay/Cargo.toml index 5f4dde147f0cf..0bc6e2e33eb39 100644 --- a/crates/sui-replay/Cargo.toml +++ b/crates/sui-replay/Cargo.toml @@ -36,6 +36,7 @@ move-core-types.workspace = true tokio.workspace = true tokio-util.workspace = true tabled.workspace = true +regex.workspace = true shared-crypto.workspace = true sui-config.workspace = true diff --git a/crates/sui-replay/src/batch_replay.rs b/crates/sui-replay/src/batch_replay.rs index 4f4b58c3ddc50..16a0181ea8c40 100644 --- a/crates/sui-replay/src/batch_replay.rs +++ b/crates/sui-replay/src/batch_replay.rs @@ -186,6 +186,7 @@ async fn execute_transaction( None, None, None, + None, ) .await; match result { diff --git a/crates/sui-replay/src/fuzz.rs b/crates/sui-replay/src/fuzz.rs index 84654fde863c2..19e71814c612f 100644 --- a/crates/sui-replay/src/fuzz.rs +++ b/crates/sui-replay/src/fuzz.rs @@ -75,6 +75,7 @@ impl ReplayFuzzer { None, None, None, + None, ) .await?; diff --git a/crates/sui-replay/src/lib.rs b/crates/sui-replay/src/lib.rs index edbc5e8be1f46..4d139661dd794 100644 --- a/crates/sui-replay/src/lib.rs +++ b/crates/sui-replay/src/lib.rs @@ -8,6 +8,8 @@ use fuzz::ReplayFuzzer; use fuzz::ReplayFuzzerConfig; use fuzz_mutations::base_fuzzers; use std::cmp::max; +use sui_types::base_types::ObjectID; +use sui_types::base_types::SequenceNumber; use sui_types::digests::get_mainnet_chain_identifier; use sui_types::digests::get_testnet_chain_identifier; use sui_types::message_envelope::Message; @@ -81,6 +83,11 @@ pub enum ReplayToolCommand { /// Optional output filepath for the profile generated by this run, if not specified defaults to `gas_profile_{tx_digest}_{unix_timestamp}.json in the working directory. #[arg(long, short, allow_hyphen_values = true)] profile_output: Option, + /// Required config objects and versions of the config objects to use if replaying a + /// transaction that utilizes the config object for regulated coin types and that has been + /// denied. + #[arg(long, num_args = 2..)] + config_objects: Option>, }, /// Replay transaction @@ -96,6 +103,11 @@ pub enum ReplayToolCommand { /// Optional protocol version to use, if not specified defaults to the one originally used for the transaction. #[arg(long, short, allow_hyphen_values = true)] protocol_version: Option, + /// Required config objects and versions of the config objects to use if replaying a + /// transaction that utilizes the config object for regulated coin types and that has been + /// denied. + #[arg(long, num_args = 2..)] + config_objects: Option>, }, /// Replay transactions listed in a file @@ -224,6 +236,7 @@ pub async fn execute_replay_command( None, None, None, + None, ) .await?; @@ -342,6 +355,7 @@ pub async fn execute_replay_command( executor_version, protocol_version, profile_output, + config_objects, } => { let output_path = profile_output.or(Some(get_default_output_filepath())); @@ -355,6 +369,7 @@ pub async fn execute_replay_command( executor_version, protocol_version, output_path, + parse_configs_versions(config_objects), ) .await?; @@ -367,6 +382,7 @@ pub async fn execute_replay_command( show_effects, executor_version, protocol_version, + config_objects, } => { let tx_digest = TransactionDigest::from_str(&tx_digest)?; info!("Executing tx: {}", tx_digest); @@ -378,6 +394,7 @@ pub async fn execute_replay_command( executor_version, protocol_version, None, + parse_configs_versions(config_objects), ) .await?; @@ -565,3 +582,27 @@ pub(crate) fn chain_from_chain_id(chain: &str) -> Chain { Chain::Unknown } } + +fn parse_configs_versions( + configs_and_versions: Option>, +) -> Option> { + let Some(configs_and_versions) = configs_and_versions else { + return None; + }; + assert!(configs_and_versions.len() % 2 == 0, "Invalid number of arguments for configs and version -- you must supply a version for each config"); + Some( + configs_and_versions + .chunks_exact(2) + .map(|chunk| { + let object_id = + ObjectID::from_str(&chunk[0]).expect("Invalid object id for config"); + let object_version = SequenceNumber::from_u64( + chunk[1] + .parse::() + .expect("Invalid object version for config"), + ); + (object_id, object_version) + }) + .collect(), + ) +} diff --git a/crates/sui-replay/src/replay.rs b/crates/sui-replay/src/replay.rs index d2f916aa5979f..8ccbf693d98f6 100644 --- a/crates/sui-replay/src/replay.rs +++ b/crates/sui-replay/src/replay.rs @@ -33,13 +33,16 @@ use sui_config::node::ExpensiveSafetyCheckConfig; use sui_core::authority::NodeStateDump; use sui_execution::Executor; use sui_framework::BuiltInFramework; -use sui_json_rpc_types::{SuiTransactionBlockEffects, SuiTransactionBlockEffectsAPI}; +use sui_json_rpc_types::{ + SuiExecutionStatus, SuiTransactionBlockEffects, SuiTransactionBlockEffectsAPI, +}; use sui_protocol_config::{Chain, ProtocolConfig}; use sui_sdk::{SuiClient, SuiClientBuilder}; use sui_types::in_memory_storage::InMemoryStorage; use sui_types::message_envelope::Message; use sui_types::storage::{get_module, PackageObject}; use sui_types::transaction::TransactionKind::ProgrammableTransaction; +use sui_types::SUI_DENY_LIST_OBJECT_ID; use sui_types::{ base_types::{ObjectID, ObjectRef, SequenceNumber, VersionNumber}, committee::EpochId, @@ -239,6 +242,7 @@ pub struct LocalExec { // Whether or not to enable the gas profiler, the PathBuf contains either a user specified // filepath or the default current directory and name format for the profile output pub enable_profiler: Option, + pub config_and_versions: Option>, // Retry policies due to RPC errors pub num_retries_for_timeout: u32, pub sleep_period_for_timeout: std::time::Duration, @@ -322,6 +326,7 @@ impl LocalExec { executor_version: Option, protocol_version: Option, enable_profiler: Option, + config_and_versions: Option>, ) -> Result { info!("Using RPC URL: {}", rpc_url); LocalExec::new_from_fn_url(&rpc_url) @@ -335,6 +340,7 @@ impl LocalExec { executor_version, protocol_version, enable_profiler, + config_and_versions, ) .await } @@ -384,6 +390,7 @@ impl LocalExec { executor_version: None, protocol_version: None, enable_profiler: None, + config_and_versions: None, }) } @@ -426,6 +433,7 @@ impl LocalExec { executor_version: None, protocol_version: None, enable_profiler: None, + config_and_versions: None, }) } @@ -666,6 +674,7 @@ impl LocalExec { None, None, None, + None, ) .await .map(|q| q.check_effects()) @@ -995,10 +1004,12 @@ impl LocalExec { executor_version: Option, protocol_version: Option, enable_profiler: Option, + config_and_versions: Option>, ) -> Result { self.executor_version = executor_version; self.protocol_version = protocol_version; self.enable_profiler = enable_profiler; + self.config_and_versions = config_and_versions; if use_authority { self.certificate_execute(tx_digest, expensive_safety_check_config.clone()) .await @@ -1419,6 +1430,33 @@ impl LocalExec { .await } + fn add_config_objects_if_needed( + &self, + status: &SuiExecutionStatus, + ) -> Vec<(ObjectID, SequenceNumber)> { + match parse_effect_error_for_denied_coins(status) { + Some(coin_type) => { + let Some(mut config_id_and_version) = self.config_and_versions.clone() else { + panic!("Need to specify the config object ID and version for '{coin_type}' in order to replay this transaction"); + }; + // NB: the version of the deny list object doesn't matter + if !config_id_and_version + .iter() + .any(|(id, _)| id == &SUI_DENY_LIST_OBJECT_ID) + { + let deny_list_oid_version = self.download_latest_object(&SUI_DENY_LIST_OBJECT_ID) + .ok() + .flatten() + .expect("Unable to download the deny list object for a transaction that requires it") + .version(); + config_id_and_version.push((SUI_DENY_LIST_OBJECT_ID, deny_list_oid_version)); + } + config_id_and_version + } + None => vec![], + } + } + async fn resolve_tx_components( &self, tx_digest: &TransactionDigest, @@ -1431,6 +1469,8 @@ impl LocalExec { }; let SuiTransactionBlockEffects::V1(effects) = tx_info.clone().effects.unwrap(); + let config_objects = self.add_config_objects_if_needed(effects.status()); + let raw_tx_bytes = tx_info.clone().raw_transaction; let orig_tx: SenderSignedData = bcs::from_bytes(&raw_tx_bytes).unwrap(); let input_objs = orig_tx @@ -1491,6 +1531,7 @@ impl LocalExec { dependencies: effects.dependencies().to_vec(), effects: SuiTransactionBlockEffects::V1(effects), receiving_objs, + config_objects, // Find the protocol version for this epoch // This assumes we already initialized the protocol version table `protocol_version_epoch_table` protocol_version: self.get_protocol_config(epoch_id, chain).await?.version, @@ -1518,6 +1559,8 @@ impl LocalExec { let orig_tx = dp.node_state_dump.sender_signed_data.clone(); let effects = dp.node_state_dump.computed_effects.clone(); let effects = SuiTransactionBlockEffects::try_from(effects).unwrap(); + // Config objects don't show up in the node state dump so they need to be provided. + let config_objects = self.add_config_objects_if_needed(effects.status()); // Fetch full transaction content //let tx_info = self.fetcher.get_transaction(tx_digest).await?; @@ -1577,6 +1620,7 @@ impl LocalExec { dependencies: effects.dependencies().to_vec(), effects, receiving_objs, + config_objects, protocol_version: protocol_config.version, tx_digest: *tx_digest, epoch_start_timestamp, @@ -1760,6 +1804,10 @@ impl LocalExec { self.multi_download_and_store(&tx_info.receiving_objs) .await?; + // Fetch specified config objects if any + self.multi_download_and_store(&tx_info.config_objects) + .await?; + // Prep the object runtime for dynamic fields // Download the child objects accessed at the version right before the execution of this TX let loaded_child_refs = self.fetch_loaded_child_refs(&tx_info.tx_digest).await?; @@ -2128,3 +2176,38 @@ pub fn get_executor( sui_execution::executor(&protocol_config, silent, enable_profiler) .expect("Creating an executor should not fail here") } + +fn parse_effect_error_for_denied_coins(status: &SuiExecutionStatus) -> Option { + let SuiExecutionStatus::Failure { error } = status else { + return None; + }; + parse_denied_error_string(error) +} + +fn parse_denied_error_string(error: &str) -> Option { + let regulated_regex = regex::Regex::new( + r#"CoinTypeGlobalPause.*?"(.*?)"|AddressDeniedForCoin.*coin_type:.*?"(.*?)""#, + ) + .unwrap(); + + let caps = regulated_regex.captures(error)?; + Some(caps.get(1).or(caps.get(2))?.as_str().to_string()) +} + +#[cfg(test)] +mod tests { + use super::parse_denied_error_string; + #[test] + fn test_regex_regulated_coin_errors() { + let test_bank = vec![ + "CoinTypeGlobalPause { coin_type: \"39a572c071784c280ee8ee8c683477e059d1381abc4366f9a58ffac3f350a254::rcoin::RCOIN\" }", + "AddressDeniedForCoin { address: B, coin_type: \"39a572c071784c280ee8ee8c683477e059d1381abc4366f9a58ffac3f350a254::rcoin::RCOIN\" }" + ]; + let expected_string = + "39a572c071784c280ee8ee8c683477e059d1381abc4366f9a58ffac3f350a254::rcoin::RCOIN"; + + for test in &test_bank { + assert!(parse_denied_error_string(test).unwrap() == expected_string); + } + } +} diff --git a/crates/sui-replay/src/tests.rs b/crates/sui-replay/src/tests.rs index 23f1833bcad19..6fee613d0cb48 100644 --- a/crates/sui-replay/src/tests.rs +++ b/crates/sui-replay/src/tests.rs @@ -148,6 +148,7 @@ async fn execute_replay(url: &str, tx: &TransactionDigest) -> Result<(), ReplayE None, None, None, + None, ) .await? .check_effects()?; @@ -163,6 +164,7 @@ async fn execute_replay(url: &str, tx: &TransactionDigest) -> Result<(), ReplayE None, None, None, + None, ) .await? .check_effects()?; diff --git a/crates/sui-replay/src/types.rs b/crates/sui-replay/src/types.rs index d89718292b22a..952ceab09a70a 100644 --- a/crates/sui-replay/src/types.rs +++ b/crates/sui-replay/src/types.rs @@ -50,6 +50,8 @@ pub struct OnChainTransactionInfo { pub dependencies: Vec, #[serde(skip)] pub receiving_objs: Vec<(ObjectID, SequenceNumber)>, + #[serde(skip)] + pub config_objects: Vec<(ObjectID, SequenceNumber)>, // TODO: There are two problems with this being a json-rpc type: // 1. The json-rpc type is not a perfect mirror with TransactionEffects since v2. We lost the // ability to replay effects v2 specific forks. We need to fix this asap. Unfortunately at the moment diff --git a/crates/sui/src/client_commands.rs b/crates/sui/src/client_commands.rs index 789be6eb0cc9a..71804621752c2 100644 --- a/crates/sui/src/client_commands.rs +++ b/crates/sui/src/client_commands.rs @@ -684,6 +684,7 @@ impl SuiClientCommands { executor_version: None, protocol_version: None, profile_output, + config_objects: None, }; let rpc = context.config.get_active_env()?.rpc.clone(); let _command_result = @@ -704,6 +705,7 @@ impl SuiClientCommands { show_effects: true, executor_version, protocol_version, + config_objects: None, }; let rpc = context.config.get_active_env()?.rpc.clone(); diff --git a/crates/sui/src/unit_tests/profiler_tests.rs b/crates/sui/src/unit_tests/profiler_tests.rs index 0ff4facc41dfe..c4fcbaa094d94 100644 --- a/crates/sui/src/unit_tests/profiler_tests.rs +++ b/crates/sui/src/unit_tests/profiler_tests.rs @@ -50,6 +50,7 @@ async fn test_profiler() { executor_version: None, protocol_version: None, profile_output: Some(profile_output), + config_objects: None, }; let command_result = From 5935eabf0e499c4d3d3bae4463a4ba1938db3cf4 Mon Sep 17 00:00:00 2001 From: Mark Logan <103447440+mystenmark@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:37:31 -0700 Subject: [PATCH 139/163] Transaction must be written before executed_effects_digests (#18785) This fixes a very unlikely race where: - notify_read_executed_effects is called - the effects are available and are returned immediately - transaction itself has not yet been written to pending_transaction_writes - reader thread tries to read the tx and asserts that it exists --- crates/sui-core/src/execution_cache/writeback_cache.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/sui-core/src/execution_cache/writeback_cache.rs b/crates/sui-core/src/execution_cache/writeback_cache.rs index 13e1078cb9f12..845747eeca6ba 100644 --- a/crates/sui-core/src/execution_cache/writeback_cache.rs +++ b/crates/sui-core/src/execution_cache/writeback_cache.rs @@ -804,6 +804,11 @@ impl WritebackCache { let tx_digest = *transaction.digest(); let effects_digest = effects.digest(); + self.metrics.record_cache_write("transaction_block"); + self.dirty + .pending_transaction_writes + .insert(tx_digest, tx_outputs.clone()); + // insert transaction effects before executed_effects_digests so that there // are never dangling entries in executed_effects_digests self.metrics.record_cache_write("transaction_effects"); @@ -831,11 +836,6 @@ impl WritebackCache { .executed_effects_digests .insert(tx_digest, effects_digest); - self.metrics.record_cache_write("transaction_block"); - self.dirty - .pending_transaction_writes - .insert(tx_digest, tx_outputs); - self.executed_effects_digests_notify_read .notify(&tx_digest, &effects_digest); From 5849d3f65c04d6c512b159e9839b70876a16ebdd Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:15:16 -0700 Subject: [PATCH 140/163] [Consensus] make config optional (#18784) ## Description 1. Make consensus parameters optional in node config, since it has not been populated before. 2. Make consensus_config::Parameters::db_path non optional. It is always set from the node config after integration with Sui. If empty path causes problem, it needs to be detected from Sui or within consensus. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- consensus/config/src/parameters.rs | 9 +- .../parameters_test__parameters.snap | 2 - consensus/core/src/authority_node.rs | 13 +- consensus/core/src/context.rs | 2 +- crates/sui-config/src/node.rs | 2 +- .../consensus_manager/mysticeti_manager.rs | 4 +- ...ests__network_config_snapshot_matches.snap | 203 +----------------- 7 files changed, 19 insertions(+), 216 deletions(-) diff --git a/consensus/config/src/parameters.rs b/consensus/config/src/parameters.rs index 46eb809b9263b..4b3a85906c19a 100644 --- a/consensus/config/src/parameters.rs +++ b/consensus/config/src/parameters.rs @@ -14,9 +14,10 @@ use serde::{Deserialize, Serialize}; /// should not need to specify any field, except db_path. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Parameters { - /// The database path. - /// Required. - pub db_path: Option, + /// Path to consensus DB for this epoch. Required when initializing consensus. + /// This is calculated based on user configuration for base directory. + #[serde(skip)] + pub db_path: PathBuf, /// Time to wait for parent round leader before sealing a block. #[serde(default = "Parameters::default_leader_timeout")] @@ -143,7 +144,7 @@ impl Parameters { impl Default for Parameters { fn default() -> Self { Self { - db_path: None, + db_path: PathBuf::default(), leader_timeout: Parameters::default_leader_timeout(), min_round_delay: Parameters::default_min_round_delay(), max_forward_time_drift: Parameters::default_max_forward_time_drift(), diff --git a/consensus/config/tests/snapshots/parameters_test__parameters.snap b/consensus/config/tests/snapshots/parameters_test__parameters.snap index 094e39364a10e..b764571ffe0a2 100644 --- a/consensus/config/tests/snapshots/parameters_test__parameters.snap +++ b/consensus/config/tests/snapshots/parameters_test__parameters.snap @@ -2,7 +2,6 @@ source: consensus/config/tests/parameters_test.rs expression: parameters --- -db_path: ~ leader_timeout: secs: 0 nanos: 250000000 @@ -29,4 +28,3 @@ tonic: sync_last_proposed_block_timeout: secs: 0 nanos: 0 - diff --git a/consensus/core/src/authority_node.rs b/consensus/core/src/authority_node.rs index d30ff3cadec11..06e57b10c0846 100644 --- a/consensus/core/src/authority_node.rs +++ b/consensus/core/src/authority_node.rs @@ -182,14 +182,7 @@ where )) }; - let store_path = context - .parameters - .db_path - .as_ref() - .expect("DB path is not set") - .as_path() - .to_str() - .unwrap(); + let store_path = context.parameters.db_path.as_path().to_str().unwrap(); let store = Arc::new(RocksDBStore::new(store_path)); let dag_state = Arc::new(RwLock::new(DagState::new(context.clone(), store.clone()))); @@ -375,7 +368,7 @@ mod tests { let temp_dir = TempDir::new().unwrap(); let parameters = Parameters { - db_path: Some(temp_dir.into_path()), + db_path: temp_dir.into_path(), ..Default::default() }; let txn_verifier = NoopTransactionVerifier {}; @@ -672,7 +665,7 @@ mod tests { // Cache less blocks to exercise commit sync. let parameters = Parameters { - db_path: Some(db_dir.path().to_path_buf()), + db_path: db_dir.path().to_path_buf(), dag_state_cached_rounds: 5, commit_sync_parallel_fetches: 3, commit_sync_batch_size: 3, diff --git a/consensus/core/src/context.rs b/consensus/core/src/context.rs index 84ed3989c9cdf..64467cf72ca73 100644 --- a/consensus/core/src/context.rs +++ b/consensus/core/src/context.rs @@ -67,7 +67,7 @@ impl Context { AuthorityIndex::new_for_test(0), committee, Parameters { - db_path: Some(temp_dir.into_path()), + db_path: temp_dir.into_path(), ..Default::default() }, ProtocolConfig::get_for_max_version_UNSAFE(), diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index 8f5b48c985491..c6db0d850d424 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -429,7 +429,7 @@ pub struct ConsensusConfig { pub address: Multiaddr, pub narwhal_config: NarwhalParameters, - pub parameters: ConsensusParameters, + pub parameters: Option, } impl ConsensusConfig { diff --git a/crates/sui-core/src/consensus_manager/mysticeti_manager.rs b/crates/sui-core/src/consensus_manager/mysticeti_manager.rs index c501bbf6094b6..8bc6df769166e 100644 --- a/crates/sui-core/src/consensus_manager/mysticeti_manager.rs +++ b/crates/sui-core/src/consensus_manager/mysticeti_manager.rs @@ -125,8 +125,8 @@ impl ConsensusManagerTrait for MysticetiManager { .consensus_config() .expect("consensus_config should exist"); let parameters = Parameters { - db_path: Some(self.get_store_path(epoch)), - ..consensus_config.parameters.clone() + db_path: self.get_store_path(epoch), + ..consensus_config.parameters.clone().unwrap_or_default() }; let own_protocol_key = self.protocol_keypair.public(); 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 dac34a5429bf9..b2519d82910dd 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 @@ -43,34 +43,7 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - parameters: - db_path: ~ - leader_timeout: - secs: 0 - nanos: 250000000 - min_round_delay: - secs: 0 - nanos: 50000000 - max_forward_time_drift: - secs: 0 - nanos: 500000000 - max_blocks_per_fetch: 1000 - dag_state_cached_rounds: 500 - commit_sync_parallel_fetches: 20 - commit_sync_batch_size: 100 - commit_sync_batches_ahead: 200 - anemo: - excessive_message_size: 8388608 - tonic: - keepalive_interval: - secs: 5 - nanos: 0 - connection_buffer_size: 33554432 - excessive_message_size: 16777216 - message_size_limit: 67108864 - sync_last_proposed_block_timeout: - secs: 0 - nanos: 0 + parameters: ~ enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -208,34 +181,7 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - parameters: - db_path: ~ - leader_timeout: - secs: 0 - nanos: 250000000 - min_round_delay: - secs: 0 - nanos: 50000000 - max_forward_time_drift: - secs: 0 - nanos: 500000000 - max_blocks_per_fetch: 1000 - dag_state_cached_rounds: 500 - commit_sync_parallel_fetches: 20 - commit_sync_batch_size: 100 - commit_sync_batches_ahead: 200 - anemo: - excessive_message_size: 8388608 - tonic: - keepalive_interval: - secs: 5 - nanos: 0 - connection_buffer_size: 33554432 - excessive_message_size: 16777216 - message_size_limit: 67108864 - sync_last_proposed_block_timeout: - secs: 0 - nanos: 0 + parameters: ~ enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -373,34 +319,7 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - parameters: - db_path: ~ - leader_timeout: - secs: 0 - nanos: 250000000 - min_round_delay: - secs: 0 - nanos: 50000000 - max_forward_time_drift: - secs: 0 - nanos: 500000000 - max_blocks_per_fetch: 1000 - dag_state_cached_rounds: 500 - commit_sync_parallel_fetches: 20 - commit_sync_batch_size: 100 - commit_sync_batches_ahead: 200 - anemo: - excessive_message_size: 8388608 - tonic: - keepalive_interval: - secs: 5 - nanos: 0 - connection_buffer_size: 33554432 - excessive_message_size: 16777216 - message_size_limit: 67108864 - sync_last_proposed_block_timeout: - secs: 0 - nanos: 0 + parameters: ~ enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -538,34 +457,7 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - parameters: - db_path: ~ - leader_timeout: - secs: 0 - nanos: 250000000 - min_round_delay: - secs: 0 - nanos: 50000000 - max_forward_time_drift: - secs: 0 - nanos: 500000000 - max_blocks_per_fetch: 1000 - dag_state_cached_rounds: 500 - commit_sync_parallel_fetches: 20 - commit_sync_batch_size: 100 - commit_sync_batches_ahead: 200 - anemo: - excessive_message_size: 8388608 - tonic: - keepalive_interval: - secs: 5 - nanos: 0 - connection_buffer_size: 33554432 - excessive_message_size: 16777216 - message_size_limit: 67108864 - sync_last_proposed_block_timeout: - secs: 0 - nanos: 0 + parameters: ~ enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -703,34 +595,7 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - parameters: - db_path: ~ - leader_timeout: - secs: 0 - nanos: 250000000 - min_round_delay: - secs: 0 - nanos: 50000000 - max_forward_time_drift: - secs: 0 - nanos: 500000000 - max_blocks_per_fetch: 1000 - dag_state_cached_rounds: 500 - commit_sync_parallel_fetches: 20 - commit_sync_batch_size: 100 - commit_sync_batches_ahead: 200 - anemo: - excessive_message_size: 8388608 - tonic: - keepalive_interval: - secs: 5 - nanos: 0 - connection_buffer_size: 33554432 - excessive_message_size: 16777216 - message_size_limit: 67108864 - sync_last_proposed_block_timeout: - secs: 0 - nanos: 0 + parameters: ~ enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -868,34 +733,7 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - parameters: - db_path: ~ - leader_timeout: - secs: 0 - nanos: 250000000 - min_round_delay: - secs: 0 - nanos: 50000000 - max_forward_time_drift: - secs: 0 - nanos: 500000000 - max_blocks_per_fetch: 1000 - dag_state_cached_rounds: 500 - commit_sync_parallel_fetches: 20 - commit_sync_batch_size: 100 - commit_sync_batches_ahead: 200 - anemo: - excessive_message_size: 8388608 - tonic: - keepalive_interval: - secs: 5 - nanos: 0 - connection_buffer_size: 33554432 - excessive_message_size: 16777216 - message_size_limit: 67108864 - sync_last_proposed_block_timeout: - secs: 0 - nanos: 0 + parameters: ~ enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ @@ -1033,34 +871,7 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - parameters: - db_path: ~ - leader_timeout: - secs: 0 - nanos: 250000000 - min_round_delay: - secs: 0 - nanos: 50000000 - max_forward_time_drift: - secs: 0 - nanos: 500000000 - max_blocks_per_fetch: 1000 - dag_state_cached_rounds: 500 - commit_sync_parallel_fetches: 20 - commit_sync_batch_size: 100 - commit_sync_batches_ahead: 200 - anemo: - excessive_message_size: 8388608 - tonic: - keepalive_interval: - secs: 5 - nanos: 0 - connection_buffer_size: 33554432 - excessive_message_size: 16777216 - message_size_limit: 67108864 - sync_last_proposed_block_timeout: - secs: 0 - nanos: 0 + parameters: ~ enable-index-processing: true jsonrpc-server-type: ~ grpc-load-shed: ~ From dd56ccb447bf84fec2b5aca530acd550d13c2168 Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:40:18 -0700 Subject: [PATCH 141/163] [bridge] store bridge authority aggregator in ArcSwap (#18780) ## Description As title. In follow up PRs, we will introduce monitoring component to swap the aggregator when there are changes to committee members (e.g. url change) ## Test plan existing tests. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-bridge/src/action_executor.rs | 22 ++++++++++++++-------- crates/sui-bridge/src/node.rs | 7 +++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/crates/sui-bridge/src/action_executor.rs b/crates/sui-bridge/src/action_executor.rs index e1835feb27709..ea53a7e02ad8f 100644 --- a/crates/sui-bridge/src/action_executor.rs +++ b/crates/sui-bridge/src/action_executor.rs @@ -71,7 +71,7 @@ pub trait BridgeActionExecutorTrait { pub struct BridgeActionExecutor { sui_client: Arc>, - bridge_auth_agg: Arc, + bridge_auth_agg: Arc>, key: SuiKeyPair, sui_address: SuiAddress, gas_object_id: ObjectID, @@ -102,7 +102,7 @@ where { pub async fn new( sui_client: Arc>, - bridge_auth_agg: Arc, + bridge_auth_agg: Arc>, store: Arc, key: SuiKeyPair, sui_address: SuiAddress, @@ -189,7 +189,7 @@ where async fn run_signature_aggregation_loop( sui_client: Arc>, - auth_agg: Arc, + auth_agg: Arc>, store: Arc, signing_queue_sender: mysten_metrics::metered_channel::Sender, mut signing_queue_receiver: mysten_metrics::metered_channel::Receiver< @@ -230,7 +230,7 @@ where #[instrument(level = "error", skip_all, fields(action_key=?action.0.key(), attempt_times=?action.1))] async fn handle_signing_task( semaphore: &Arc, - auth_agg: &Arc, + auth_agg: &Arc>, signing_queue_sender: &mysten_metrics::metered_channel::Sender< BridgeActionExecutionWrapper, >, @@ -320,7 +320,7 @@ where async fn request_signatures( semaphore: Arc, sui_client: Arc>, - auth_agg: Arc, + auth_agg: Arc>, action: BridgeActionExecutionWrapper, store: Arc, signing_queue_sender: mysten_metrics::metered_channel::Sender, @@ -353,7 +353,11 @@ where { return; } - match auth_agg.request_committee_signatures(action.clone()).await { + match auth_agg + .load() + .request_committee_signatures(action.clone()) + .await + { Ok(certificate) => { info!("Sending certificate to execution"); execution_queue_sender @@ -946,7 +950,7 @@ mod tests { action.clone() ); - // Let authorities to sign the action too. Now we are above the threshold + // Let authorities sign the action too. Now we are above the threshold let sig_from_2 = mock_bridge_authority_sigs( vec![&mock2], &action, @@ -1298,7 +1302,9 @@ mod tests { let committee = BridgeCommittee::new(authorities).unwrap(); - let agg = Arc::new(BridgeAuthorityAggregator::new(Arc::new(committee))); + let agg = Arc::new(ArcSwap::new(Arc::new(BridgeAuthorityAggregator::new( + Arc::new(committee), + )))); let metrics = Arc::new(BridgeMetrics::new(®istry)); let sui_token_type_tags = sui_client.get_token_id_map().await.unwrap(); let (token_type_tags_tx, token_type_tags_rx) = diff --git a/crates/sui-bridge/src/node.rs b/crates/sui-bridge/src/node.rs index 0fffe9291235c..6614941e9b0fc 100644 --- a/crates/sui-bridge/src/node.rs +++ b/crates/sui-bridge/src/node.rs @@ -13,6 +13,7 @@ use crate::{ storage::BridgeOrchestratorTables, sui_syncer::SuiSyncer, }; +use arc_swap::ArcSwap; use ethers::types::Address as EthAddress; use std::{ collections::HashMap, @@ -104,13 +105,15 @@ async fn start_client_components( .await .expect("Failed to get committee"), ); - let bridge_auth_agg = BridgeAuthorityAggregator::new(committee); + let bridge_auth_agg = Arc::new(ArcSwap::from(Arc::new(BridgeAuthorityAggregator::new( + committee, + )))); let sui_token_type_tags = sui_client.get_token_id_map().await.unwrap(); let (token_type_tags_tx, token_type_tags_rx) = tokio::sync::watch::channel(sui_token_type_tags); let bridge_action_executor = BridgeActionExecutor::new( sui_client.clone(), - Arc::new(bridge_auth_agg), + bridge_auth_agg, store.clone(), client_config.key, client_config.sui_address, From 37109ef173af4580e5cad5a5ee88ded68ec8fed9 Mon Sep 17 00:00:00 2001 From: Tim Zakian <2895723+tzakian@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:54:32 -0700 Subject: [PATCH 142/163] [sui-execution] First step towards allowing versioning move-vm-types (#18775) ## Description First step towards moving `move-vm-types` to being execution versioned. ## Test plan Existing CI tests. --- crates/sui-core/src/authority.rs | 4 +- crates/sui-core/src/rest_index.rs | 4 +- .../sui-json-rpc-types/src/sui_transaction.rs | 2 +- .../src/displays/transaction_displays.rs | 2 +- crates/sui-types/src/execution.rs | 319 +----------------- .../{type_resolver.rs => layout_resolver.rs} | 7 +- crates/sui-types/src/lib.rs | 3 +- crates/sui-types/src/object.rs | 2 +- .../sui-adapter/src/execution_engine.rs | 2 +- .../latest/sui-adapter}/src/execution_mode.rs | 16 +- .../latest/sui-adapter/src/execution_value.rs | 303 +++++++++++++++++ sui-execution/latest/sui-adapter/src/lib.rs | 3 + .../src/programmable_transactions/context.rs | 20 +- .../programmable_transactions/execution.rs | 12 +- .../programmable_transactions/linkage_view.rs | 2 +- .../latest/sui-adapter/src/temporary_store.rs | 2 +- .../sui-adapter/src/type_layout_resolver.rs | 2 +- .../latest/sui-adapter/src/type_resolver.rs | 10 + sui-execution/src/executor.rs | 5 +- sui-execution/src/latest.rs | 6 +- sui-execution/src/v0.rs | 6 +- sui-execution/src/v1.rs | 6 +- sui-execution/src/v2.rs | 6 +- .../v0/sui-adapter/src/execution_engine.rs | 2 +- .../v0/sui-adapter/src/execution_mode.rs | 280 +++++++++++++++ .../v0/sui-adapter/src/execution_value.rs | 303 +++++++++++++++++ sui-execution/v0/sui-adapter/src/lib.rs | 3 + .../src/programmable_transactions/context.rs | 15 +- .../programmable_transactions/execution.rs | 12 +- .../programmable_transactions/linkage_view.rs | 2 +- .../v0/sui-adapter/src/temporary_store.rs | 2 +- .../sui-adapter/src/type_layout_resolver.rs | 2 +- .../v0/sui-adapter/src/type_resolver.rs | 10 + .../v1/sui-adapter/src/execution_engine.rs | 2 +- .../v1/sui-adapter/src/execution_mode.rs | 280 +++++++++++++++ .../v1/sui-adapter/src/execution_value.rs | 303 +++++++++++++++++ sui-execution/v1/sui-adapter/src/lib.rs | 3 + .../src/programmable_transactions/context.rs | 20 +- .../programmable_transactions/execution.rs | 12 +- .../programmable_transactions/linkage_view.rs | 2 +- .../v1/sui-adapter/src/temporary_store.rs | 2 +- .../sui-adapter/src/type_layout_resolver.rs | 2 +- .../v1/sui-adapter/src/type_resolver.rs | 10 + .../v2/sui-adapter/src/execution_engine.rs | 2 +- .../v2/sui-adapter/src/execution_mode.rs | 280 +++++++++++++++ .../v2/sui-adapter/src/execution_value.rs | 303 +++++++++++++++++ sui-execution/v2/sui-adapter/src/lib.rs | 3 + .../src/programmable_transactions/context.rs | 20 +- .../programmable_transactions/execution.rs | 12 +- .../programmable_transactions/linkage_view.rs | 2 +- .../v2/sui-adapter/src/temporary_store.rs | 2 +- .../sui-adapter/src/type_layout_resolver.rs | 2 +- .../v2/sui-adapter/src/type_resolver.rs | 10 + 53 files changed, 2218 insertions(+), 429 deletions(-) rename crates/sui-types/src/{type_resolver.rs => layout_resolver.rs} (87%) rename {crates/sui-types => sui-execution/latest/sui-adapter}/src/execution_mode.rs (95%) create mode 100644 sui-execution/latest/sui-adapter/src/execution_value.rs create mode 100644 sui-execution/latest/sui-adapter/src/type_resolver.rs create mode 100644 sui-execution/v0/sui-adapter/src/execution_mode.rs create mode 100644 sui-execution/v0/sui-adapter/src/execution_value.rs create mode 100644 sui-execution/v0/sui-adapter/src/type_resolver.rs create mode 100644 sui-execution/v1/sui-adapter/src/execution_mode.rs create mode 100644 sui-execution/v1/sui-adapter/src/execution_value.rs create mode 100644 sui-execution/v1/sui-adapter/src/type_resolver.rs create mode 100644 sui-execution/v2/sui-adapter/src/execution_mode.rs create mode 100644 sui-execution/v2/sui-adapter/src/execution_value.rs create mode 100644 sui-execution/v2/sui-adapter/src/type_resolver.rs diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 87ad0ae676e34..c6ec89b460ff7 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -47,9 +47,9 @@ use sui_config::NodeConfig; use sui_types::crypto::RandomnessRound; use sui_types::execution_status::ExecutionStatus; use sui_types::inner_temporary_store::PackageStoreWithFallback; +use sui_types::layout_resolver::into_struct_layout; +use sui_types::layout_resolver::LayoutResolver; use sui_types::messages_consensus::{AuthorityCapabilitiesV1, AuthorityCapabilitiesV2}; -use sui_types::type_resolver::into_struct_layout; -use sui_types::type_resolver::LayoutResolver; use tap::{TapFallible, TapOptional}; use tokio::sync::mpsc::unbounded_channel; use tokio::sync::{mpsc, oneshot, RwLock}; diff --git a/crates/sui-core/src/rest_index.rs b/crates/sui-core/src/rest_index.rs index e26e199c3e6c5..6c804e71e7d81 100644 --- a/crates/sui-core/src/rest_index.rs +++ b/crates/sui-core/src/rest_index.rs @@ -22,6 +22,7 @@ use sui_types::base_types::SequenceNumber; use sui_types::base_types::SuiAddress; use sui_types::digests::TransactionDigest; use sui_types::dynamic_field::{DynamicFieldInfo, DynamicFieldType}; +use sui_types::layout_resolver::LayoutResolver; use sui_types::messages_checkpoint::CheckpointContents; use sui_types::object::Object; use sui_types::object::Owner; @@ -29,7 +30,6 @@ use sui_types::storage::error::Error as StorageError; use sui_types::storage::BackingPackageStore; use sui_types::storage::DynamicFieldIndexInfo; use sui_types::storage::DynamicFieldKey; -use sui_types::type_resolver::LayoutResolver; use tracing::{debug, info}; use typed_store::rocks::{DBMap, MetricConf}; use typed_store::traits::Map; @@ -670,7 +670,7 @@ fn try_create_dynamic_field_info( } let (name_value, dynamic_field_type, object_id) = { - let layout = sui_types::type_resolver::into_struct_layout( + let layout = sui_types::layout_resolver::into_struct_layout( resolver .get_annotated_layout(&move_object.type_().clone().into()) .map_err(StorageError::custom)?, diff --git a/crates/sui-json-rpc-types/src/sui_transaction.rs b/crates/sui-json-rpc-types/src/sui_transaction.rs index 89e59ca8fe365..eff57a51290cc 100644 --- a/crates/sui-json-rpc-types/src/sui_transaction.rs +++ b/crates/sui-json-rpc-types/src/sui_transaction.rs @@ -34,6 +34,7 @@ use sui_types::effects::{TransactionEffects, TransactionEffectsAPI, TransactionE use sui_types::error::{ExecutionError, SuiError, SuiResult}; use sui_types::execution_status::ExecutionStatus; use sui_types::gas::GasCostSummary; +use sui_types::layout_resolver::{get_layout_from_struct_tag, LayoutResolver}; use sui_types::messages_checkpoint::CheckpointSequenceNumber; use sui_types::messages_consensus::ConsensusDeterminedVersionAssignments; use sui_types::object::Owner; @@ -50,7 +51,6 @@ use sui_types::transaction::{ InputObjectKind, ObjectArg, ProgrammableMoveCall, ProgrammableTransaction, SenderSignedData, TransactionData, TransactionDataAPI, TransactionKind, }; -use sui_types::type_resolver::{get_layout_from_struct_tag, LayoutResolver}; use sui_types::SUI_FRAMEWORK_ADDRESS; use crate::balance_changes::BalanceChange; diff --git a/crates/sui-replay/src/displays/transaction_displays.rs b/crates/sui-replay/src/displays/transaction_displays.rs index 845e797fb4fe5..cd292c2449242 100644 --- a/crates/sui-replay/src/displays/transaction_displays.rs +++ b/crates/sui-replay/src/displays/transaction_displays.rs @@ -8,7 +8,7 @@ use move_core_types::language_storage::TypeTag; use std::fmt::{Display, Formatter}; use std::sync::Arc; use sui_execution::Executor; -use sui_types::execution_mode::ExecutionResult; +use sui_types::execution::ExecutionResult; use sui_types::object::bounded_visitor::BoundedVisitor; use sui_types::transaction::CallArg::Pure; use sui_types::transaction::{ diff --git a/crates/sui-types/src/execution.rs b/crates/sui-types/src/execution.rs index 3b2d386c86d31..c4bcf7ba293b8 100644 --- a/crates/sui-types/src/execution.rs +++ b/crates/sui-types/src/execution.rs @@ -2,28 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{ - base_types::{ObjectID, ObjectRef, SequenceNumber, SuiAddress}, - coin::Coin, + base_types::{ObjectID, ObjectRef, SequenceNumber}, digests::{ObjectDigest, TransactionDigest}, - error::{ExecutionError, ExecutionErrorKind, SuiError}, event::Event, - execution_status::CommandArgumentError, is_system_package, object::{Data, Object, Owner}, - storage::{BackingPackageStore, ChildObjectResolver, ObjectChange, StorageView}, - transfer::Receiving, + storage::{BackingPackageStore, ObjectChange}, + transaction::Argument, }; -use move_binary_format::file_format::AbilitySet; -use move_core_types::{identifier::IdentStr, resolver::ResourceResolver}; -use move_vm_types::loaded_data::runtime_types::Type; +use move_core_types::language_storage::TypeTag; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, BTreeSet, HashSet}; -pub trait SuiResolver: ResourceResolver + BackingPackageStore { - fn as_backing_package_store(&self) -> &dyn BackingPackageStore; -} - /// A type containing all of the information needed to work with a deleted shared object in /// execution and when committing the execution effects of the transaction. This holds: /// 0. The object ID of the deleted shared object. @@ -43,34 +34,13 @@ pub enum SharedInput { Cancelled((ObjectID, SequenceNumber)), } -impl SuiResolver for T -where - T: ResourceResolver, - T: BackingPackageStore, -{ - fn as_backing_package_store(&self) -> &dyn BackingPackageStore { - self - } -} - -/// Interface with the store necessary to execute a programmable transaction -pub trait ExecutionState: StorageView + SuiResolver { - fn as_sui_resolver(&self) -> &dyn SuiResolver; - fn as_child_resolver(&self) -> &dyn ChildObjectResolver; -} - -impl ExecutionState for T -where - T: StorageView, - T: SuiResolver, -{ - fn as_sui_resolver(&self) -> &dyn SuiResolver { - self - } - - fn as_child_resolver(&self) -> &dyn ChildObjectResolver { - self - } +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] +pub struct DynamicallyLoadedObjectMetadata { + pub version: SequenceNumber, + pub digest: ObjectDigest, + pub owner: Owner, + pub storage_rebate: u64, + pub previous_transaction: TransactionDigest, } /// View of the store necessary to produce the layouts of types. @@ -108,6 +78,11 @@ pub struct ExecutionResultsV2 { pub user_events: Vec, } +pub type ExecutionResult = ( + /* mutable_reference_outputs */ Vec<(Argument, Vec, TypeTag)>, + /* return_values */ Vec<(Vec, TypeTag)>, +); + impl ExecutionResultsV2 { pub fn drop_writes(&mut self) { self.written_objects.clear(); @@ -195,268 +170,6 @@ impl ExecutionResultsV2 { } } -#[derive(Clone, Debug)] -pub enum InputObjectMetadata { - Receiving { - id: ObjectID, - version: SequenceNumber, - }, - InputObject { - id: ObjectID, - is_mutable_input: bool, - owner: Owner, - version: SequenceNumber, - }, -} - -#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] -pub struct DynamicallyLoadedObjectMetadata { - pub version: SequenceNumber, - pub digest: ObjectDigest, - pub owner: Owner, - pub storage_rebate: u64, - pub previous_transaction: TransactionDigest, -} - -#[derive(Clone, Debug)] -pub struct InputValue { - /// Used to remember the object ID and owner even if the value is taken - pub object_metadata: Option, - pub inner: ResultValue, -} - -#[derive(Clone, Debug)] -pub struct ResultValue { - /// This is used primarily for values that have `copy` but not `drop` as they must have been - /// copied after the last borrow, otherwise we cannot consider the last "copy" to be instead - /// a "move" of the value. - pub last_usage_kind: Option, - pub value: Option, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum UsageKind { - BorrowImm, - BorrowMut, - ByValue, -} - -#[derive(Debug, Clone)] -pub enum Value { - Object(ObjectValue), - Raw(RawValueType, Vec), - Receiving(ObjectID, SequenceNumber, Option), -} - -#[derive(Debug, Clone)] -pub struct ObjectValue { - pub type_: Type, - pub has_public_transfer: bool, - // true if it has been used in a public, non-entry Move call - // In other words, false if all usages have been with non-Move commands or - // entry Move functions - pub used_in_non_entry_move_call: bool, - pub contents: ObjectContents, -} - -#[derive(Debug, Clone)] -pub enum ObjectContents { - Coin(Coin), - Raw(Vec), -} - -#[derive(Debug, Clone)] -pub enum RawValueType { - Any, - Loaded { - ty: Type, - abilities: AbilitySet, - used_in_non_entry_move_call: bool, - }, -} - -#[derive(Clone, Copy)] -pub enum CommandKind<'a> { - MoveCall { - package: ObjectID, - module: &'a IdentStr, - function: &'a IdentStr, - }, - MakeMoveVec, - TransferObjects, - SplitCoins, - MergeCoins, - Publish, - Upgrade, -} - -impl InputObjectMetadata { - pub fn id(&self) -> ObjectID { - match self { - InputObjectMetadata::Receiving { id, .. } => *id, - InputObjectMetadata::InputObject { id, .. } => *id, - } - } - - pub fn version(&self) -> SequenceNumber { - match self { - InputObjectMetadata::Receiving { version, .. } => *version, - InputObjectMetadata::InputObject { version, .. } => *version, - } - } -} - -impl InputValue { - pub fn new_object(object_metadata: InputObjectMetadata, value: ObjectValue) -> Self { - InputValue { - object_metadata: Some(object_metadata), - inner: ResultValue::new(Value::Object(value)), - } - } - - pub fn new_raw(ty: RawValueType, value: Vec) -> Self { - InputValue { - object_metadata: None, - inner: ResultValue::new(Value::Raw(ty, value)), - } - } - - pub fn new_receiving_object(id: ObjectID, version: SequenceNumber) -> Self { - InputValue { - object_metadata: Some(InputObjectMetadata::Receiving { id, version }), - inner: ResultValue::new(Value::Receiving(id, version, None)), - } - } -} - -impl ResultValue { - pub fn new(value: Value) -> Self { - Self { - last_usage_kind: None, - value: Some(value), - } - } -} - -impl Value { - pub fn is_copyable(&self) -> bool { - match self { - Value::Object(_) => false, - Value::Raw(RawValueType::Any, _) => true, - Value::Raw(RawValueType::Loaded { abilities, .. }, _) => abilities.has_copy(), - Value::Receiving(_, _, _) => false, - } - } - - pub fn write_bcs_bytes(&self, buf: &mut Vec) { - match self { - Value::Object(obj_value) => obj_value.write_bcs_bytes(buf), - Value::Raw(_, bytes) => buf.extend(bytes), - Value::Receiving(id, version, _) => { - buf.extend(Receiving::new(*id, *version).to_bcs_bytes()) - } - } - } - - pub fn was_used_in_non_entry_move_call(&self) -> bool { - match self { - Value::Object(obj) => obj.used_in_non_entry_move_call, - // Any is only used for Pure inputs, and if it was used by &mut it would have switched - // to Loaded - Value::Raw(RawValueType::Any, _) => false, - Value::Raw( - RawValueType::Loaded { - used_in_non_entry_move_call, - .. - }, - _, - ) => *used_in_non_entry_move_call, - // Only thing you can do with a `Receiving` is consume it, so once it's used it - // can't be used again. - Value::Receiving(_, _, _) => false, - } - } -} - -impl ObjectValue { - /// # Safety - /// We must have the Type is the coin type, but we are unable to check it at this spot - pub unsafe fn coin(type_: Type, coin: Coin) -> Self { - Self { - type_, - has_public_transfer: true, - used_in_non_entry_move_call: false, - contents: ObjectContents::Coin(coin), - } - } - - pub fn ensure_public_transfer_eligible(&self) -> Result<(), ExecutionError> { - if !self.has_public_transfer { - return Err(ExecutionErrorKind::InvalidTransferObject.into()); - } - Ok(()) - } - - pub fn write_bcs_bytes(&self, buf: &mut Vec) { - match &self.contents { - ObjectContents::Raw(bytes) => buf.extend(bytes), - ObjectContents::Coin(coin) => buf.extend(coin.to_bcs_bytes()), - } - } -} - -pub trait TryFromValue: Sized { - fn try_from_value(value: Value) -> Result; -} - -impl TryFromValue for Value { - fn try_from_value(value: Value) -> Result { - Ok(value) - } -} - -impl TryFromValue for ObjectValue { - fn try_from_value(value: Value) -> Result { - match value { - Value::Object(o) => Ok(o), - Value::Raw(RawValueType::Any, _) => Err(CommandArgumentError::TypeMismatch), - Value::Raw(RawValueType::Loaded { .. }, _) => Err(CommandArgumentError::TypeMismatch), - Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), - } - } -} - -impl TryFromValue for SuiAddress { - fn try_from_value(value: Value) -> Result { - try_from_value_prim(&value, Type::Address) - } -} - -impl TryFromValue for u64 { - fn try_from_value(value: Value) -> Result { - try_from_value_prim(&value, Type::U64) - } -} - -fn try_from_value_prim<'a, T: Deserialize<'a>>( - value: &'a Value, - expected_ty: Type, -) -> Result { - match value { - Value::Object(_) => Err(CommandArgumentError::TypeMismatch), - Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), - Value::Raw(RawValueType::Any, bytes) => { - bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) - } - Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { - if ty != &expected_ty { - return Err(CommandArgumentError::TypeMismatch); - } - bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) - } - } -} - /// If a transaction digest shows up in this list, when executing such transaction, /// we will always return `ExecutionError::CertificateDenied` without executing it (but still do /// gas smashing). Because this list is not gated by protocol version, there are a few important diff --git a/crates/sui-types/src/type_resolver.rs b/crates/sui-types/src/layout_resolver.rs similarity index 87% rename from crates/sui-types/src/type_resolver.rs rename to crates/sui-types/src/layout_resolver.rs index 8e7db70c0e3ff..372e0fd86eb14 100644 --- a/crates/sui-types/src/type_resolver.rs +++ b/crates/sui-types/src/layout_resolver.rs @@ -1,13 +1,12 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::error::{ExecutionError, SuiError}; +use crate::error::SuiError; use move_bytecode_utils::{layout::TypeLayoutBuilder, module_cache::GetModule}; use move_core_types::{ annotated_value as A, language_storage::{StructTag, TypeTag}, }; -use move_vm_types::loaded_data::runtime_types::Type; pub trait LayoutResolver { fn get_annotated_layout( @@ -16,10 +15,6 @@ pub trait LayoutResolver { ) -> Result; } -pub trait TypeTagResolver { - fn get_type_tag(&self, type_: &Type) -> Result; -} - pub fn get_layout_from_struct_tag( struct_tag: StructTag, resolver: &impl GetModule, diff --git a/crates/sui-types/src/lib.rs b/crates/sui-types/src/lib.rs index 48541658aa146..2c029c52cead5 100644 --- a/crates/sui-types/src/lib.rs +++ b/crates/sui-types/src/lib.rs @@ -48,7 +48,6 @@ pub mod event; pub mod executable_transaction; pub mod execution; pub mod execution_config_utils; -pub mod execution_mode; pub mod execution_status; pub mod full_checkpoint_content; pub mod gas; @@ -58,6 +57,7 @@ pub mod governance; pub mod id; pub mod in_memory_storage; pub mod inner_temporary_store; +pub mod layout_resolver; pub mod message_envelope; pub mod messages_checkpoint; pub mod messages_consensus; @@ -83,7 +83,6 @@ pub mod supported_protocol_versions; pub mod traffic_control; pub mod transaction; pub mod transfer; -pub mod type_resolver; pub mod versioned; pub mod zk_login_authenticator; pub mod zk_login_util; diff --git a/crates/sui-types/src/object.rs b/crates/sui-types/src/object.rs index 35a2fdde64839..97f0f7a7e2c7b 100644 --- a/crates/sui-types/src/object.rs +++ b/crates/sui-types/src/object.rs @@ -25,8 +25,8 @@ use crate::error::{ExecutionError, ExecutionErrorKind, UserInputError, UserInput use crate::error::{SuiError, SuiResult}; use crate::gas_coin::GAS; use crate::is_system_package; +use crate::layout_resolver::LayoutResolver; use crate::move_package::MovePackage; -use crate::type_resolver::LayoutResolver; use crate::{ base_types::{ ObjectDigest, ObjectID, ObjectRef, SequenceNumber, SuiAddress, TransactionDigest, diff --git a/sui-execution/latest/sui-adapter/src/execution_engine.rs b/sui-execution/latest/sui-adapter/src/execution_engine.rs index 31ec7305439aa..60035e6806f60 100644 --- a/sui-execution/latest/sui-adapter/src/execution_engine.rs +++ b/sui-execution/latest/sui-adapter/src/execution_engine.rs @@ -6,6 +6,7 @@ pub use checked::*; #[sui_macros::with_checked_arithmetic] mod checked { + use crate::execution_mode::{self, ExecutionMode}; use move_binary_format::CompiledModule; use move_vm_runtime::move_vm::MoveVM; use std::{collections::HashSet, sync::Arc}; @@ -13,7 +14,6 @@ mod checked { BALANCE_CREATE_REWARDS_FUNCTION_NAME, BALANCE_DESTROY_REBATES_FUNCTION_NAME, BALANCE_MODULE_NAME, }; - use sui_types::execution_mode::{self, ExecutionMode}; use sui_types::gas_coin::GAS; use sui_types::messages_checkpoint::CheckpointTimestamp; use sui_types::metrics::LimitsMetrics; diff --git a/crates/sui-types/src/execution_mode.rs b/sui-execution/latest/sui-adapter/src/execution_mode.rs similarity index 95% rename from crates/sui-types/src/execution_mode.rs rename to sui-execution/latest/sui-adapter/src/execution_mode.rs index c93ca7591f5bc..1941c806007c5 100644 --- a/crates/sui-types/src/execution_mode.rs +++ b/sui-execution/latest/sui-adapter/src/execution_mode.rs @@ -1,14 +1,11 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +use crate::execution_value::{RawValueType, Value}; +use crate::type_resolver::TypeTagResolver; use move_core_types::language_storage::TypeTag; - -use crate::{ - error::ExecutionError, - execution::{RawValueType, Value}, - transaction::Argument, - transfer::Receiving, - type_resolver::TypeTagResolver, +use sui_types::{ + error::ExecutionError, execution::ExecutionResult, transaction::Argument, transfer::Receiving, }; pub type TransactionIndex = usize; @@ -201,11 +198,6 @@ impl ExecutionMode for System { /// BCS bytes! pub struct DevInspect; -pub type ExecutionResult = ( - /* mutable_reference_outputs */ Vec<(Argument, Vec, TypeTag)>, - /* return_values */ Vec<(Vec, TypeTag)>, -); - impl ExecutionMode for DevInspect { type ArgumentUpdates = Vec<(Argument, Vec, TypeTag)>; type ExecutionResults = Vec; diff --git a/sui-execution/latest/sui-adapter/src/execution_value.rs b/sui-execution/latest/sui-adapter/src/execution_value.rs new file mode 100644 index 0000000000000..eac050b7f25a8 --- /dev/null +++ b/sui-execution/latest/sui-adapter/src/execution_value.rs @@ -0,0 +1,303 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_binary_format::file_format::AbilitySet; +use move_core_types::{identifier::IdentStr, resolver::ResourceResolver}; +use move_vm_types::loaded_data::runtime_types::Type; +use serde::Deserialize; +use sui_types::{ + base_types::{ObjectID, SequenceNumber, SuiAddress}, + coin::Coin, + error::{ExecutionError, ExecutionErrorKind, SuiError}, + execution_status::CommandArgumentError, + object::Owner, + storage::{BackingPackageStore, ChildObjectResolver, StorageView}, + transfer::Receiving, +}; + +pub trait SuiResolver: ResourceResolver + BackingPackageStore { + fn as_backing_package_store(&self) -> &dyn BackingPackageStore; +} + +impl SuiResolver for T +where + T: ResourceResolver, + T: BackingPackageStore, +{ + fn as_backing_package_store(&self) -> &dyn BackingPackageStore { + self + } +} + +/// Interface with the store necessary to execute a programmable transaction +pub trait ExecutionState: StorageView + SuiResolver { + fn as_sui_resolver(&self) -> &dyn SuiResolver; + fn as_child_resolver(&self) -> &dyn ChildObjectResolver; +} + +impl ExecutionState for T +where + T: StorageView, + T: SuiResolver, +{ + fn as_sui_resolver(&self) -> &dyn SuiResolver { + self + } + + fn as_child_resolver(&self) -> &dyn ChildObjectResolver { + self + } +} + +#[derive(Clone, Debug)] +pub enum InputObjectMetadata { + Receiving { + id: ObjectID, + version: SequenceNumber, + }, + InputObject { + id: ObjectID, + is_mutable_input: bool, + owner: Owner, + version: SequenceNumber, + }, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum UsageKind { + BorrowImm, + BorrowMut, + ByValue, +} + +#[derive(Clone, Copy)] +pub enum CommandKind<'a> { + MoveCall { + package: ObjectID, + module: &'a IdentStr, + function: &'a IdentStr, + }, + MakeMoveVec, + TransferObjects, + SplitCoins, + MergeCoins, + Publish, + Upgrade, +} + +#[derive(Clone, Debug)] +pub struct InputValue { + /// Used to remember the object ID and owner even if the value is taken + pub object_metadata: Option, + pub inner: ResultValue, +} + +#[derive(Clone, Debug)] +pub struct ResultValue { + /// This is used primarily for values that have `copy` but not `drop` as they must have been + /// copied after the last borrow, otherwise we cannot consider the last "copy" to be instead + /// a "move" of the value. + pub last_usage_kind: Option, + pub value: Option, +} + +#[derive(Debug, Clone)] +pub enum Value { + Object(ObjectValue), + Raw(RawValueType, Vec), + Receiving(ObjectID, SequenceNumber, Option), +} + +#[derive(Debug, Clone)] +pub struct ObjectValue { + pub type_: Type, + pub has_public_transfer: bool, + // true if it has been used in a public, non-entry Move call + // In other words, false if all usages have been with non-Move commands or + // entry Move functions + pub used_in_non_entry_move_call: bool, + pub contents: ObjectContents, +} + +#[derive(Debug, Clone)] +pub enum ObjectContents { + Coin(Coin), + Raw(Vec), +} + +#[derive(Debug, Clone)] +pub enum RawValueType { + Any, + Loaded { + ty: Type, + abilities: AbilitySet, + used_in_non_entry_move_call: bool, + }, +} + +impl InputObjectMetadata { + pub fn id(&self) -> ObjectID { + match self { + InputObjectMetadata::Receiving { id, .. } => *id, + InputObjectMetadata::InputObject { id, .. } => *id, + } + } + + pub fn version(&self) -> SequenceNumber { + match self { + InputObjectMetadata::Receiving { version, .. } => *version, + InputObjectMetadata::InputObject { version, .. } => *version, + } + } +} + +impl InputValue { + pub fn new_object(object_metadata: InputObjectMetadata, value: ObjectValue) -> Self { + InputValue { + object_metadata: Some(object_metadata), + inner: ResultValue::new(Value::Object(value)), + } + } + + pub fn new_raw(ty: RawValueType, value: Vec) -> Self { + InputValue { + object_metadata: None, + inner: ResultValue::new(Value::Raw(ty, value)), + } + } + + pub fn new_receiving_object(id: ObjectID, version: SequenceNumber) -> Self { + InputValue { + object_metadata: Some(InputObjectMetadata::Receiving { id, version }), + inner: ResultValue::new(Value::Receiving(id, version, None)), + } + } +} + +impl ResultValue { + pub fn new(value: Value) -> Self { + Self { + last_usage_kind: None, + value: Some(value), + } + } +} + +impl Value { + pub fn is_copyable(&self) -> bool { + match self { + Value::Object(_) => false, + Value::Raw(RawValueType::Any, _) => true, + Value::Raw(RawValueType::Loaded { abilities, .. }, _) => abilities.has_copy(), + Value::Receiving(_, _, _) => false, + } + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match self { + Value::Object(obj_value) => obj_value.write_bcs_bytes(buf), + Value::Raw(_, bytes) => buf.extend(bytes), + Value::Receiving(id, version, _) => { + buf.extend(Receiving::new(*id, *version).to_bcs_bytes()) + } + } + } + + pub fn was_used_in_non_entry_move_call(&self) -> bool { + match self { + Value::Object(obj) => obj.used_in_non_entry_move_call, + // Any is only used for Pure inputs, and if it was used by &mut it would have switched + // to Loaded + Value::Raw(RawValueType::Any, _) => false, + Value::Raw( + RawValueType::Loaded { + used_in_non_entry_move_call, + .. + }, + _, + ) => *used_in_non_entry_move_call, + // Only thing you can do with a `Receiving` is consume it, so once it's used it + // can't be used again. + Value::Receiving(_, _, _) => false, + } + } +} + +impl ObjectValue { + /// # Safety + /// We must have the Type is the coin type, but we are unable to check it at this spot + pub unsafe fn coin(type_: Type, coin: Coin) -> Self { + Self { + type_, + has_public_transfer: true, + used_in_non_entry_move_call: false, + contents: ObjectContents::Coin(coin), + } + } + + pub fn ensure_public_transfer_eligible(&self) -> Result<(), ExecutionError> { + if !self.has_public_transfer { + return Err(ExecutionErrorKind::InvalidTransferObject.into()); + } + Ok(()) + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match &self.contents { + ObjectContents::Raw(bytes) => buf.extend(bytes), + ObjectContents::Coin(coin) => buf.extend(coin.to_bcs_bytes()), + } + } +} + +pub trait TryFromValue: Sized { + fn try_from_value(value: Value) -> Result; +} + +impl TryFromValue for Value { + fn try_from_value(value: Value) -> Result { + Ok(value) + } +} + +impl TryFromValue for ObjectValue { + fn try_from_value(value: Value) -> Result { + match value { + Value::Object(o) => Ok(o), + Value::Raw(RawValueType::Any, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Loaded { .. }, _) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + } + } +} + +impl TryFromValue for SuiAddress { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::Address) + } +} + +impl TryFromValue for u64 { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::U64) + } +} + +fn try_from_value_prim<'a, T: Deserialize<'a>>( + value: &'a Value, + expected_ty: Type, +) -> Result { + match value { + Value::Object(_) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Any, bytes) => { + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { + if ty != &expected_ty { + return Err(CommandArgumentError::TypeMismatch); + } + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + } +} diff --git a/sui-execution/latest/sui-adapter/src/lib.rs b/sui-execution/latest/sui-adapter/src/lib.rs index 0c61b9e902522..51651cb5bc339 100644 --- a/sui-execution/latest/sui-adapter/src/lib.rs +++ b/sui-execution/latest/sui-adapter/src/lib.rs @@ -7,7 +7,10 @@ extern crate sui_types; pub mod adapter; pub mod error; pub mod execution_engine; +pub mod execution_mode; +pub mod execution_value; pub mod gas_charger; pub mod programmable_transactions; pub mod temporary_store; pub mod type_layout_resolver; +pub mod type_resolver; diff --git a/sui-execution/latest/sui-adapter/src/programmable_transactions/context.rs b/sui-execution/latest/sui-adapter/src/programmable_transactions/context.rs index ae6638a18eba5..0b8d483463a45 100644 --- a/sui-execution/latest/sui-adapter/src/programmable_transactions/context.rs +++ b/sui-execution/latest/sui-adapter/src/programmable_transactions/context.rs @@ -14,8 +14,15 @@ mod checked { use crate::adapter::new_native_extensions; use crate::error::convert_vm_error; + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{CommandKind, ObjectContents, TryFromValue, Value}; + use crate::execution_value::{ + ExecutionState, InputObjectMetadata, InputValue, ObjectValue, RawValueType, ResultValue, + UsageKind, + }; use crate::gas_charger::GasCharger; use crate::programmable_transactions::linkage_view::LinkageView; + use crate::type_resolver::TypeTagResolver; use move_binary_format::{ errors::{Location, PartialVMError, PartialVMResult, VMError, VMResult}, file_format::{CodeOffset, FunctionDefinitionIndex, TypeParameterIndex}, @@ -47,23 +54,14 @@ mod checked { coin::Coin, error::{ExecutionError, ExecutionErrorKind}, event::Event, - execution::{ - ExecutionResultsV2, ExecutionState, InputObjectMetadata, InputValue, ObjectValue, - RawValueType, ResultValue, UsageKind, - }, + execution::ExecutionResultsV2, metrics::LimitsMetrics, move_package::MovePackage, object::{Data, MoveObject, Object, ObjectInner, Owner}, storage::BackingPackageStore, transaction::{Argument, CallArg, ObjectArg}, - type_resolver::TypeTagResolver, - }; - use sui_types::{ - error::command_argument_error, - execution::{CommandKind, ObjectContents, TryFromValue, Value}, - execution_mode::ExecutionMode, - execution_status::CommandArgumentError, }; + use sui_types::{error::command_argument_error, execution_status::CommandArgumentError}; use tracing::instrument; /// Maintains all runtime state specific to programmable transactions diff --git a/sui-execution/latest/sui-adapter/src/programmable_transactions/execution.rs b/sui-execution/latest/sui-adapter/src/programmable_transactions/execution.rs index 438a29ed53654..383318a741689 100644 --- a/sui-execution/latest/sui-adapter/src/programmable_transactions/execution.rs +++ b/sui-execution/latest/sui-adapter/src/programmable_transactions/execution.rs @@ -5,6 +5,10 @@ pub use checked::*; #[sui_macros::with_checked_arithmetic] mod checked { + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{ + CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, + }; use crate::gas_charger::GasCharger; use move_binary_format::{ compatibility::{Compatibility, InclusionCheck}, @@ -33,6 +37,7 @@ mod checked { use sui_move_natives::object_runtime::ObjectRuntime; use sui_protocol_config::ProtocolConfig; use sui_types::execution_config_utils::to_binary_config; + use sui_types::execution_status::{CommandArgumentError, PackageUpgradeError}; use sui_types::storage::{get_package_objects, PackageObject}; use sui_types::{ base_types::{ @@ -41,9 +46,6 @@ mod checked { }, coin::Coin, error::{command_argument_error, ExecutionError, ExecutionErrorKind}, - execution::{ - CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, - }, id::{RESOLVED_SUI_ID, UID}, metrics::LimitsMetrics, move_package::{ @@ -54,10 +56,6 @@ mod checked { transfer::RESOLVED_RECEIVING_STRUCT, SUI_FRAMEWORK_ADDRESS, }; - use sui_types::{ - execution_mode::ExecutionMode, - execution_status::{CommandArgumentError, PackageUpgradeError}, - }; use sui_verifier::{ private_generics::{EVENT_MODULE, PRIVATE_TRANSFER_FUNCTIONS, TRANSFER_MODULE}, INIT_FN_NAME, diff --git a/sui-execution/latest/sui-adapter/src/programmable_transactions/linkage_view.rs b/sui-execution/latest/sui-adapter/src/programmable_transactions/linkage_view.rs index 4e1ad3e4118e5..0cb68ec52b970 100644 --- a/sui-execution/latest/sui-adapter/src/programmable_transactions/linkage_view.rs +++ b/sui-execution/latest/sui-adapter/src/programmable_transactions/linkage_view.rs @@ -7,6 +7,7 @@ use std::{ str::FromStr, }; +use crate::execution_value::SuiResolver; use move_core_types::{ account_address::AccountAddress, identifier::{IdentStr, Identifier}, @@ -17,7 +18,6 @@ use sui_types::storage::{get_module, PackageObject}; use sui_types::{ base_types::ObjectID, error::{ExecutionError, SuiError, SuiResult}, - execution::SuiResolver, move_package::{MovePackage, TypeOrigin, UpgradeInfo}, storage::BackingPackageStore, }; diff --git a/sui-execution/latest/sui-adapter/src/temporary_store.rs b/sui-execution/latest/sui-adapter/src/temporary_store.rs index 067a74f571b2b..0a6589291d87d 100644 --- a/sui-execution/latest/sui-adapter/src/temporary_store.rs +++ b/sui-execution/latest/sui-adapter/src/temporary_store.rs @@ -19,9 +19,9 @@ use sui_types::execution::{ use sui_types::execution_config_utils::to_binary_config; use sui_types::execution_status::ExecutionStatus; use sui_types::inner_temporary_store::InnerTemporaryStore; +use sui_types::layout_resolver::LayoutResolver; use sui_types::storage::{BackingStore, DenyListResult, PackageObject}; use sui_types::sui_system_state::{get_sui_system_state_wrapper, AdvanceEpochParams}; -use sui_types::type_resolver::LayoutResolver; use sui_types::{ base_types::{ObjectID, ObjectRef, SequenceNumber, SuiAddress, TransactionDigest}, effects::EffectsObjectChange, diff --git a/sui-execution/latest/sui-adapter/src/type_layout_resolver.rs b/sui-execution/latest/sui-adapter/src/type_layout_resolver.rs index f82ae922963ac..03c9aa8013808 100644 --- a/sui-execution/latest/sui-adapter/src/type_layout_resolver.rs +++ b/sui-execution/latest/sui-adapter/src/type_layout_resolver.rs @@ -12,7 +12,7 @@ use sui_types::base_types::ObjectID; use sui_types::error::SuiResult; use sui_types::execution::TypeLayoutStore; use sui_types::storage::{BackingPackageStore, PackageObject}; -use sui_types::{error::SuiError, type_resolver::LayoutResolver}; +use sui_types::{error::SuiError, layout_resolver::LayoutResolver}; /// Retrieve a `MoveStructLayout` from a `Type`. /// Invocation into the `Session` to leverage the `LinkageView` implementation diff --git a/sui-execution/latest/sui-adapter/src/type_resolver.rs b/sui-execution/latest/sui-adapter/src/type_resolver.rs new file mode 100644 index 0000000000000..c9227aa01b382 --- /dev/null +++ b/sui-execution/latest/sui-adapter/src/type_resolver.rs @@ -0,0 +1,10 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_core_types::language_storage::TypeTag; +use move_vm_types::loaded_data::runtime_types::Type; +use sui_types::error::ExecutionError; + +pub trait TypeTagResolver { + fn get_type_tag(&self, type_: &Type) -> Result; +} diff --git a/sui-execution/src/executor.rs b/sui-execution/src/executor.rs index 4fb6d80e0ed29..62b0628012c07 100644 --- a/sui-execution/src/executor.rs +++ b/sui-execution/src/executor.rs @@ -10,13 +10,12 @@ use sui_types::{ digests::TransactionDigest, effects::TransactionEffects, error::ExecutionError, - execution::TypeLayoutStore, - execution_mode::ExecutionResult, + execution::{ExecutionResult, TypeLayoutStore}, gas::SuiGasStatus, inner_temporary_store::InnerTemporaryStore, + layout_resolver::LayoutResolver, metrics::LimitsMetrics, transaction::{CheckedInputObjects, ProgrammableTransaction, TransactionKind}, - type_resolver::LayoutResolver, }; /// Abstracts over access to the VM across versions of the execution layer. diff --git a/sui-execution/src/latest.rs b/sui-execution/src/latest.rs index 11412b88ddb02..a9f165624b928 100644 --- a/sui-execution/src/latest.rs +++ b/sui-execution/src/latest.rs @@ -13,13 +13,12 @@ use sui_types::{ digests::TransactionDigest, effects::TransactionEffects, error::{ExecutionError, SuiError, SuiResult}, - execution::TypeLayoutStore, - execution_mode::{self, ExecutionResult}, + execution::{ExecutionResult, TypeLayoutStore}, gas::SuiGasStatus, inner_temporary_store::InnerTemporaryStore, + layout_resolver::LayoutResolver, metrics::{BytecodeVerifierMetrics, LimitsMetrics}, transaction::{CheckedInputObjects, ProgrammableTransaction, TransactionKind}, - type_resolver::LayoutResolver, }; use move_bytecode_verifier_meter::Meter; @@ -35,6 +34,7 @@ use sui_verifier_latest::meter::SuiVerifierMeter; use crate::executor; use crate::verifier; +use sui_adapter_latest::execution_mode; pub(crate) struct Executor(Arc); diff --git a/sui-execution/src/v0.rs b/sui-execution/src/v0.rs index 135f4496042e1..dd01e5f0dce65 100644 --- a/sui-execution/src/v0.rs +++ b/sui-execution/src/v0.rs @@ -13,13 +13,12 @@ use sui_types::{ digests::TransactionDigest, effects::TransactionEffects, error::{ExecutionError, SuiError, SuiResult}, - execution::TypeLayoutStore, - execution_mode::{self, ExecutionResult}, + execution::{ExecutionResult, TypeLayoutStore}, gas::SuiGasStatus, inner_temporary_store::InnerTemporaryStore, + layout_resolver::LayoutResolver, metrics::{BytecodeVerifierMetrics, LimitsMetrics}, transaction::{CheckedInputObjects, ProgrammableTransaction, TransactionKind}, - type_resolver::LayoutResolver, }; use move_bytecode_verifier_meter::Meter; @@ -28,6 +27,7 @@ use sui_adapter_v0::adapter::{new_move_vm, run_metered_move_bytecode_verifier}; use sui_adapter_v0::execution_engine::{ execute_genesis_state_update, execute_transaction_to_effects, }; +use sui_adapter_v0::execution_mode; use sui_adapter_v0::type_layout_resolver::TypeLayoutResolver; use sui_move_natives_v0::all_natives; use sui_types::storage::BackingStore; diff --git a/sui-execution/src/v1.rs b/sui-execution/src/v1.rs index 4e00029a3235e..4f6c15f0c7e6b 100644 --- a/sui-execution/src/v1.rs +++ b/sui-execution/src/v1.rs @@ -13,13 +13,12 @@ use sui_types::{ digests::TransactionDigest, effects::TransactionEffects, error::{ExecutionError, SuiError, SuiResult}, - execution::TypeLayoutStore, - execution_mode::{self, ExecutionResult}, + execution::{ExecutionResult, TypeLayoutStore}, gas::SuiGasStatus, inner_temporary_store::InnerTemporaryStore, + layout_resolver::LayoutResolver, metrics::{BytecodeVerifierMetrics, LimitsMetrics}, transaction::{CheckedInputObjects, ProgrammableTransaction, TransactionKind}, - type_resolver::LayoutResolver, }; use move_bytecode_verifier_meter::Meter; @@ -35,6 +34,7 @@ use sui_verifier_v1::meter::SuiVerifierMeter; use crate::executor; use crate::verifier; +use sui_adapter_v1::execution_mode; pub(crate) struct Executor(Arc); diff --git a/sui-execution/src/v2.rs b/sui-execution/src/v2.rs index 15c3c4484d757..98c978bfe038d 100644 --- a/sui-execution/src/v2.rs +++ b/sui-execution/src/v2.rs @@ -13,13 +13,12 @@ use sui_types::{ digests::TransactionDigest, effects::TransactionEffects, error::{ExecutionError, SuiError, SuiResult}, - execution::TypeLayoutStore, - execution_mode::{self, ExecutionResult}, + execution::{ExecutionResult, TypeLayoutStore}, gas::SuiGasStatus, inner_temporary_store::InnerTemporaryStore, + layout_resolver::LayoutResolver, metrics::{BytecodeVerifierMetrics, LimitsMetrics}, transaction::{CheckedInputObjects, ProgrammableTransaction, TransactionKind}, - type_resolver::LayoutResolver, }; use move_bytecode_verifier_meter::Meter; @@ -28,6 +27,7 @@ use sui_adapter_v2::adapter::{new_move_vm, run_metered_move_bytecode_verifier}; use sui_adapter_v2::execution_engine::{ execute_genesis_state_update, execute_transaction_to_effects, }; +use sui_adapter_v2::execution_mode; use sui_adapter_v2::type_layout_resolver::TypeLayoutResolver; use sui_move_natives_v2::all_natives; use sui_types::storage::BackingStore; diff --git a/sui-execution/v0/sui-adapter/src/execution_engine.rs b/sui-execution/v0/sui-adapter/src/execution_engine.rs index 452622ec986fc..2b92e97887350 100644 --- a/sui-execution/v0/sui-adapter/src/execution_engine.rs +++ b/sui-execution/v0/sui-adapter/src/execution_engine.rs @@ -5,6 +5,7 @@ pub use checked::*; #[sui_macros::with_checked_arithmetic] mod checked { + use crate::execution_mode::{self, ExecutionMode}; use crate::gas_charger::GasCharger; use crate::programmable_transactions; use crate::temporary_store::TemporaryStore; @@ -23,7 +24,6 @@ mod checked { use sui_types::error::{ExecutionError, ExecutionErrorKind}; use sui_types::execution::is_certificate_denied; use sui_types::execution_config_utils::to_binary_config; - use sui_types::execution_mode::{self, ExecutionMode}; use sui_types::execution_status::ExecutionStatus; use sui_types::gas::GasCostSummary; use sui_types::gas::SuiGasStatus; diff --git a/sui-execution/v0/sui-adapter/src/execution_mode.rs b/sui-execution/v0/sui-adapter/src/execution_mode.rs new file mode 100644 index 0000000000000..1941c806007c5 --- /dev/null +++ b/sui-execution/v0/sui-adapter/src/execution_mode.rs @@ -0,0 +1,280 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::execution_value::{RawValueType, Value}; +use crate::type_resolver::TypeTagResolver; +use move_core_types::language_storage::TypeTag; +use sui_types::{ + error::ExecutionError, execution::ExecutionResult, transaction::Argument, transfer::Receiving, +}; + +pub type TransactionIndex = usize; + +pub trait ExecutionMode { + /// All updates to a Arguments used in that Command + type ArgumentUpdates; + /// the gathered results from batched executions + type ExecutionResults; + + /// Controls the calling of arbitrary Move functions + fn allow_arbitrary_function_calls() -> bool; + + /// Controls the ability to instantiate any Move function parameter with a Pure call arg. + /// In other words, you can instantiate any struct or object or other value with its BCS byte + fn allow_arbitrary_values() -> bool; + + /// Do not perform conservation checks after execution. + fn skip_conservation_checks() -> bool; + + /// If not set, the package ID should be calculated like an object and an + /// UpgradeCap is produced + fn packages_are_predefined() -> bool; + + fn empty_arguments() -> Self::ArgumentUpdates; + + fn empty_results() -> Self::ExecutionResults; + + fn add_argument_update( + resolver: &impl TypeTagResolver, + acc: &mut Self::ArgumentUpdates, + arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError>; + + fn finish_command( + resolver: &impl TypeTagResolver, + acc: &mut Self::ExecutionResults, + argument_updates: Self::ArgumentUpdates, + command_result: &[Value], + ) -> Result<(), ExecutionError>; +} + +#[derive(Copy, Clone)] +pub struct Normal; + +impl ExecutionMode for Normal { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + false + } + + fn allow_arbitrary_values() -> bool { + false + } + + fn skip_conservation_checks() -> bool { + false + } + + fn packages_are_predefined() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +#[derive(Copy, Clone)] +pub struct Genesis; + +impl ExecutionMode for Genesis { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + true + } + + fn allow_arbitrary_values() -> bool { + true + } + + fn packages_are_predefined() -> bool { + true + } + + fn skip_conservation_checks() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +#[derive(Copy, Clone)] +pub struct System; + +/// Execution mode for executing a system transaction, including the epoch change +/// transaction and the consensus commit prologue. In this mode, we allow calls to +/// any function bypassing visibility. +impl ExecutionMode for System { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + // allows bypassing visibility for system calls + true + } + + fn allow_arbitrary_values() -> bool { + // For AuthenticatorStateUpdate, we need to be able to pass in a vector of + // JWKs, so we need to allow arbitrary values. + true + } + + fn skip_conservation_checks() -> bool { + false + } + + fn packages_are_predefined() -> bool { + true + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +/// WARNING! Using this mode will bypass all normal checks around Move entry functions! This +/// includes the various rules for function arguments, meaning any object can be created just from +/// BCS bytes! +pub struct DevInspect; + +impl ExecutionMode for DevInspect { + type ArgumentUpdates = Vec<(Argument, Vec, TypeTag)>; + type ExecutionResults = Vec; + + fn allow_arbitrary_function_calls() -> bool { + SKIP_ALL_CHECKS + } + + fn allow_arbitrary_values() -> bool { + SKIP_ALL_CHECKS + } + + fn skip_conservation_checks() -> bool { + SKIP_ALL_CHECKS + } + + fn packages_are_predefined() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates { + vec![] + } + + fn empty_results() -> Self::ExecutionResults { + vec![] + } + + fn add_argument_update( + resolver: &impl TypeTagResolver, + acc: &mut Self::ArgumentUpdates, + arg: Argument, + new_value: &Value, + ) -> Result<(), ExecutionError> { + let (bytes, type_tag) = value_to_bytes_and_tag(resolver, new_value)?; + acc.push((arg, bytes, type_tag)); + Ok(()) + } + + fn finish_command( + resolver: &impl TypeTagResolver, + acc: &mut Self::ExecutionResults, + argument_updates: Self::ArgumentUpdates, + command_result: &[Value], + ) -> Result<(), ExecutionError> { + let command_bytes = command_result + .iter() + .map(|value| value_to_bytes_and_tag(resolver, value)) + .collect::>()?; + acc.push((argument_updates, command_bytes)); + Ok(()) + } +} + +fn value_to_bytes_and_tag( + resolver: &impl TypeTagResolver, + value: &Value, +) -> Result<(Vec, TypeTag), ExecutionError> { + let (type_tag, bytes) = match value { + Value::Object(obj) => { + let tag = resolver.get_type_tag(&obj.type_)?; + let mut bytes = vec![]; + obj.write_bcs_bytes(&mut bytes); + (tag, bytes) + } + Value::Raw(RawValueType::Any, bytes) => { + // this case shouldn't happen + (TypeTag::Vector(Box::new(TypeTag::U8)), bytes.clone()) + } + Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { + let tag = resolver.get_type_tag(ty)?; + (tag, bytes.clone()) + } + Value::Receiving(id, seqno, _) => ( + Receiving::type_tag(), + Receiving::new(*id, *seqno).to_bcs_bytes(), + ), + }; + Ok((bytes, type_tag)) +} diff --git a/sui-execution/v0/sui-adapter/src/execution_value.rs b/sui-execution/v0/sui-adapter/src/execution_value.rs new file mode 100644 index 0000000000000..eac050b7f25a8 --- /dev/null +++ b/sui-execution/v0/sui-adapter/src/execution_value.rs @@ -0,0 +1,303 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_binary_format::file_format::AbilitySet; +use move_core_types::{identifier::IdentStr, resolver::ResourceResolver}; +use move_vm_types::loaded_data::runtime_types::Type; +use serde::Deserialize; +use sui_types::{ + base_types::{ObjectID, SequenceNumber, SuiAddress}, + coin::Coin, + error::{ExecutionError, ExecutionErrorKind, SuiError}, + execution_status::CommandArgumentError, + object::Owner, + storage::{BackingPackageStore, ChildObjectResolver, StorageView}, + transfer::Receiving, +}; + +pub trait SuiResolver: ResourceResolver + BackingPackageStore { + fn as_backing_package_store(&self) -> &dyn BackingPackageStore; +} + +impl SuiResolver for T +where + T: ResourceResolver, + T: BackingPackageStore, +{ + fn as_backing_package_store(&self) -> &dyn BackingPackageStore { + self + } +} + +/// Interface with the store necessary to execute a programmable transaction +pub trait ExecutionState: StorageView + SuiResolver { + fn as_sui_resolver(&self) -> &dyn SuiResolver; + fn as_child_resolver(&self) -> &dyn ChildObjectResolver; +} + +impl ExecutionState for T +where + T: StorageView, + T: SuiResolver, +{ + fn as_sui_resolver(&self) -> &dyn SuiResolver { + self + } + + fn as_child_resolver(&self) -> &dyn ChildObjectResolver { + self + } +} + +#[derive(Clone, Debug)] +pub enum InputObjectMetadata { + Receiving { + id: ObjectID, + version: SequenceNumber, + }, + InputObject { + id: ObjectID, + is_mutable_input: bool, + owner: Owner, + version: SequenceNumber, + }, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum UsageKind { + BorrowImm, + BorrowMut, + ByValue, +} + +#[derive(Clone, Copy)] +pub enum CommandKind<'a> { + MoveCall { + package: ObjectID, + module: &'a IdentStr, + function: &'a IdentStr, + }, + MakeMoveVec, + TransferObjects, + SplitCoins, + MergeCoins, + Publish, + Upgrade, +} + +#[derive(Clone, Debug)] +pub struct InputValue { + /// Used to remember the object ID and owner even if the value is taken + pub object_metadata: Option, + pub inner: ResultValue, +} + +#[derive(Clone, Debug)] +pub struct ResultValue { + /// This is used primarily for values that have `copy` but not `drop` as they must have been + /// copied after the last borrow, otherwise we cannot consider the last "copy" to be instead + /// a "move" of the value. + pub last_usage_kind: Option, + pub value: Option, +} + +#[derive(Debug, Clone)] +pub enum Value { + Object(ObjectValue), + Raw(RawValueType, Vec), + Receiving(ObjectID, SequenceNumber, Option), +} + +#[derive(Debug, Clone)] +pub struct ObjectValue { + pub type_: Type, + pub has_public_transfer: bool, + // true if it has been used in a public, non-entry Move call + // In other words, false if all usages have been with non-Move commands or + // entry Move functions + pub used_in_non_entry_move_call: bool, + pub contents: ObjectContents, +} + +#[derive(Debug, Clone)] +pub enum ObjectContents { + Coin(Coin), + Raw(Vec), +} + +#[derive(Debug, Clone)] +pub enum RawValueType { + Any, + Loaded { + ty: Type, + abilities: AbilitySet, + used_in_non_entry_move_call: bool, + }, +} + +impl InputObjectMetadata { + pub fn id(&self) -> ObjectID { + match self { + InputObjectMetadata::Receiving { id, .. } => *id, + InputObjectMetadata::InputObject { id, .. } => *id, + } + } + + pub fn version(&self) -> SequenceNumber { + match self { + InputObjectMetadata::Receiving { version, .. } => *version, + InputObjectMetadata::InputObject { version, .. } => *version, + } + } +} + +impl InputValue { + pub fn new_object(object_metadata: InputObjectMetadata, value: ObjectValue) -> Self { + InputValue { + object_metadata: Some(object_metadata), + inner: ResultValue::new(Value::Object(value)), + } + } + + pub fn new_raw(ty: RawValueType, value: Vec) -> Self { + InputValue { + object_metadata: None, + inner: ResultValue::new(Value::Raw(ty, value)), + } + } + + pub fn new_receiving_object(id: ObjectID, version: SequenceNumber) -> Self { + InputValue { + object_metadata: Some(InputObjectMetadata::Receiving { id, version }), + inner: ResultValue::new(Value::Receiving(id, version, None)), + } + } +} + +impl ResultValue { + pub fn new(value: Value) -> Self { + Self { + last_usage_kind: None, + value: Some(value), + } + } +} + +impl Value { + pub fn is_copyable(&self) -> bool { + match self { + Value::Object(_) => false, + Value::Raw(RawValueType::Any, _) => true, + Value::Raw(RawValueType::Loaded { abilities, .. }, _) => abilities.has_copy(), + Value::Receiving(_, _, _) => false, + } + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match self { + Value::Object(obj_value) => obj_value.write_bcs_bytes(buf), + Value::Raw(_, bytes) => buf.extend(bytes), + Value::Receiving(id, version, _) => { + buf.extend(Receiving::new(*id, *version).to_bcs_bytes()) + } + } + } + + pub fn was_used_in_non_entry_move_call(&self) -> bool { + match self { + Value::Object(obj) => obj.used_in_non_entry_move_call, + // Any is only used for Pure inputs, and if it was used by &mut it would have switched + // to Loaded + Value::Raw(RawValueType::Any, _) => false, + Value::Raw( + RawValueType::Loaded { + used_in_non_entry_move_call, + .. + }, + _, + ) => *used_in_non_entry_move_call, + // Only thing you can do with a `Receiving` is consume it, so once it's used it + // can't be used again. + Value::Receiving(_, _, _) => false, + } + } +} + +impl ObjectValue { + /// # Safety + /// We must have the Type is the coin type, but we are unable to check it at this spot + pub unsafe fn coin(type_: Type, coin: Coin) -> Self { + Self { + type_, + has_public_transfer: true, + used_in_non_entry_move_call: false, + contents: ObjectContents::Coin(coin), + } + } + + pub fn ensure_public_transfer_eligible(&self) -> Result<(), ExecutionError> { + if !self.has_public_transfer { + return Err(ExecutionErrorKind::InvalidTransferObject.into()); + } + Ok(()) + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match &self.contents { + ObjectContents::Raw(bytes) => buf.extend(bytes), + ObjectContents::Coin(coin) => buf.extend(coin.to_bcs_bytes()), + } + } +} + +pub trait TryFromValue: Sized { + fn try_from_value(value: Value) -> Result; +} + +impl TryFromValue for Value { + fn try_from_value(value: Value) -> Result { + Ok(value) + } +} + +impl TryFromValue for ObjectValue { + fn try_from_value(value: Value) -> Result { + match value { + Value::Object(o) => Ok(o), + Value::Raw(RawValueType::Any, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Loaded { .. }, _) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + } + } +} + +impl TryFromValue for SuiAddress { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::Address) + } +} + +impl TryFromValue for u64 { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::U64) + } +} + +fn try_from_value_prim<'a, T: Deserialize<'a>>( + value: &'a Value, + expected_ty: Type, +) -> Result { + match value { + Value::Object(_) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Any, bytes) => { + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { + if ty != &expected_ty { + return Err(CommandArgumentError::TypeMismatch); + } + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + } +} diff --git a/sui-execution/v0/sui-adapter/src/lib.rs b/sui-execution/v0/sui-adapter/src/lib.rs index 0c61b9e902522..51651cb5bc339 100644 --- a/sui-execution/v0/sui-adapter/src/lib.rs +++ b/sui-execution/v0/sui-adapter/src/lib.rs @@ -7,7 +7,10 @@ extern crate sui_types; pub mod adapter; pub mod error; pub mod execution_engine; +pub mod execution_mode; +pub mod execution_value; pub mod gas_charger; pub mod programmable_transactions; pub mod temporary_store; pub mod type_layout_resolver; +pub mod type_resolver; diff --git a/sui-execution/v0/sui-adapter/src/programmable_transactions/context.rs b/sui-execution/v0/sui-adapter/src/programmable_transactions/context.rs index 4f429752a1fb6..1e7f02c9babb2 100644 --- a/sui-execution/v0/sui-adapter/src/programmable_transactions/context.rs +++ b/sui-execution/v0/sui-adapter/src/programmable_transactions/context.rs @@ -13,8 +13,14 @@ mod checked { use crate::adapter::{missing_unwrapped_msg, new_native_extensions}; use crate::error::convert_vm_error; + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{ + CommandKind, ExecutionState, InputObjectMetadata, InputValue, ObjectContents, ObjectValue, + RawValueType, ResultValue, TryFromValue, UsageKind, Value, + }; use crate::gas_charger::GasCharger; use crate::programmable_transactions::linkage_view::{LinkageInfo, LinkageView, SavedLinkage}; + use crate::type_resolver::TypeTagResolver; use move_binary_format::{ errors::{Location, VMError, VMResult}, file_format::{CodeOffset, FunctionDefinitionIndex, TypeParameterIndex}, @@ -30,6 +36,7 @@ mod checked { self, get_all_uids, max_event_error, ObjectRuntime, RuntimeResults, }; use sui_protocol_config::ProtocolConfig; + use sui_types::execution_status::CommandArgumentError; use sui_types::storage::PackageObject; use sui_types::{ balance::Balance, @@ -37,11 +44,7 @@ mod checked { coin::Coin, error::{command_argument_error, ExecutionError, ExecutionErrorKind}, event::Event, - execution::{ - CommandKind, ExecutionResults, ExecutionResultsV1, ExecutionState, InputObjectMetadata, - InputValue, ObjectContents, ObjectValue, RawValueType, ResultValue, TryFromValue, - UsageKind, Value, - }, + execution::{ExecutionResults, ExecutionResultsV1}, metrics::LimitsMetrics, move_package::MovePackage, object::{Data, MoveObject, Object, ObjectInner, Owner}, @@ -50,9 +53,7 @@ mod checked { ObjectChange, WriteKind, }, transaction::{Argument, CallArg, ObjectArg}, - type_resolver::TypeTagResolver, }; - use sui_types::{execution_mode::ExecutionMode, execution_status::CommandArgumentError}; /// Maintains all runtime state specific to programmable transactions pub struct ExecutionContext<'vm, 'state, 'a> { diff --git a/sui-execution/v0/sui-adapter/src/programmable_transactions/execution.rs b/sui-execution/v0/sui-adapter/src/programmable_transactions/execution.rs index 8aca988daedcf..53a094079a11b 100644 --- a/sui-execution/v0/sui-adapter/src/programmable_transactions/execution.rs +++ b/sui-execution/v0/sui-adapter/src/programmable_transactions/execution.rs @@ -12,6 +12,10 @@ mod checked { sync::Arc, }; + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{ + CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, + }; use crate::gas_charger::GasCharger; use move_binary_format::{ compatibility::{Compatibility, InclusionCheck}, @@ -35,6 +39,7 @@ mod checked { use sui_move_natives::object_runtime::ObjectRuntime; use sui_protocol_config::ProtocolConfig; use sui_types::execution_config_utils::to_binary_config; + use sui_types::execution_status::{CommandArgumentError, PackageUpgradeError}; use sui_types::storage::{get_package_objects, PackageObject}; use sui_types::{ base_types::{ @@ -43,9 +48,6 @@ mod checked { }, coin::Coin, error::{command_argument_error, ExecutionError, ExecutionErrorKind}, - execution::{ - CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, - }, id::{RESOLVED_SUI_ID, UID}, metrics::LimitsMetrics, move_package::{ @@ -55,10 +57,6 @@ mod checked { transaction::{Argument, Command, ProgrammableMoveCall, ProgrammableTransaction}, Identifier, SUI_FRAMEWORK_ADDRESS, }; - use sui_types::{ - execution_mode::ExecutionMode, - execution_status::{CommandArgumentError, PackageUpgradeError}, - }; use sui_verifier::{ private_generics::{EVENT_MODULE, PRIVATE_TRANSFER_FUNCTIONS, TRANSFER_MODULE}, INIT_FN_NAME, diff --git a/sui-execution/v0/sui-adapter/src/programmable_transactions/linkage_view.rs b/sui-execution/v0/sui-adapter/src/programmable_transactions/linkage_view.rs index 148fd6a88d80d..ef78f2b7e995d 100644 --- a/sui-execution/v0/sui-adapter/src/programmable_transactions/linkage_view.rs +++ b/sui-execution/v0/sui-adapter/src/programmable_transactions/linkage_view.rs @@ -7,6 +7,7 @@ use std::{ str::FromStr, }; +use crate::execution_value::SuiResolver; use move_core_types::{ account_address::AccountAddress, identifier::{IdentStr, Identifier}, @@ -17,7 +18,6 @@ use sui_types::storage::{get_module, PackageObject}; use sui_types::{ base_types::ObjectID, error::{ExecutionError, SuiError, SuiResult}, - execution::SuiResolver, move_package::{MovePackage, TypeOrigin, UpgradeInfo}, storage::BackingPackageStore, }; diff --git a/sui-execution/v0/sui-adapter/src/temporary_store.rs b/sui-execution/v0/sui-adapter/src/temporary_store.rs index 482db4be2beb4..22c8ec7ade4f6 100644 --- a/sui-execution/v0/sui-adapter/src/temporary_store.rs +++ b/sui-execution/v0/sui-adapter/src/temporary_store.rs @@ -14,9 +14,9 @@ use sui_types::execution::{DynamicallyLoadedObjectMetadata, ExecutionResults, Sh use sui_types::execution_config_utils::to_binary_config; use sui_types::execution_status::ExecutionStatus; use sui_types::inner_temporary_store::InnerTemporaryStore; +use sui_types::layout_resolver::LayoutResolver; use sui_types::storage::{BackingStore, DeleteKindWithOldVersion, DenyListResult, PackageObject}; use sui_types::sui_system_state::{get_sui_system_state_wrapper, AdvanceEpochParams}; -use sui_types::type_resolver::LayoutResolver; use sui_types::{ base_types::{ ObjectDigest, ObjectID, ObjectRef, SequenceNumber, SuiAddress, TransactionDigest, diff --git a/sui-execution/v0/sui-adapter/src/type_layout_resolver.rs b/sui-execution/v0/sui-adapter/src/type_layout_resolver.rs index 425fc3939a42f..fb41db391dc2a 100644 --- a/sui-execution/v0/sui-adapter/src/type_layout_resolver.rs +++ b/sui-execution/v0/sui-adapter/src/type_layout_resolver.rs @@ -15,7 +15,7 @@ use sui_types::base_types::ObjectID; use sui_types::error::SuiResult; use sui_types::execution::TypeLayoutStore; use sui_types::storage::{BackingPackageStore, PackageObject}; -use sui_types::{error::SuiError, type_resolver::LayoutResolver}; +use sui_types::{error::SuiError, layout_resolver::LayoutResolver}; /// Retrieve a `MoveStructLayout` from a `Type`. /// Invocation into the `Session` to leverage the `LinkageView` implementation diff --git a/sui-execution/v0/sui-adapter/src/type_resolver.rs b/sui-execution/v0/sui-adapter/src/type_resolver.rs new file mode 100644 index 0000000000000..c9227aa01b382 --- /dev/null +++ b/sui-execution/v0/sui-adapter/src/type_resolver.rs @@ -0,0 +1,10 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_core_types::language_storage::TypeTag; +use move_vm_types::loaded_data::runtime_types::Type; +use sui_types::error::ExecutionError; + +pub trait TypeTagResolver { + fn get_type_tag(&self, type_: &Type) -> Result; +} diff --git a/sui-execution/v1/sui-adapter/src/execution_engine.rs b/sui-execution/v1/sui-adapter/src/execution_engine.rs index 67cf1c7cc533f..6e47cd4bd1358 100644 --- a/sui-execution/v1/sui-adapter/src/execution_engine.rs +++ b/sui-execution/v1/sui-adapter/src/execution_engine.rs @@ -6,6 +6,7 @@ pub use checked::*; #[sui_macros::with_checked_arithmetic] mod checked { + use crate::execution_mode::{self, ExecutionMode}; use move_binary_format::CompiledModule; use move_vm_runtime::move_vm::MoveVM; use std::{collections::HashSet, sync::Arc}; @@ -14,7 +15,6 @@ mod checked { BALANCE_MODULE_NAME, }; use sui_types::base_types::SequenceNumber; - use sui_types::execution_mode::{self, ExecutionMode}; use sui_types::gas_coin::GAS; use sui_types::messages_checkpoint::CheckpointTimestamp; use sui_types::metrics::LimitsMetrics; diff --git a/sui-execution/v1/sui-adapter/src/execution_mode.rs b/sui-execution/v1/sui-adapter/src/execution_mode.rs new file mode 100644 index 0000000000000..1941c806007c5 --- /dev/null +++ b/sui-execution/v1/sui-adapter/src/execution_mode.rs @@ -0,0 +1,280 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::execution_value::{RawValueType, Value}; +use crate::type_resolver::TypeTagResolver; +use move_core_types::language_storage::TypeTag; +use sui_types::{ + error::ExecutionError, execution::ExecutionResult, transaction::Argument, transfer::Receiving, +}; + +pub type TransactionIndex = usize; + +pub trait ExecutionMode { + /// All updates to a Arguments used in that Command + type ArgumentUpdates; + /// the gathered results from batched executions + type ExecutionResults; + + /// Controls the calling of arbitrary Move functions + fn allow_arbitrary_function_calls() -> bool; + + /// Controls the ability to instantiate any Move function parameter with a Pure call arg. + /// In other words, you can instantiate any struct or object or other value with its BCS byte + fn allow_arbitrary_values() -> bool; + + /// Do not perform conservation checks after execution. + fn skip_conservation_checks() -> bool; + + /// If not set, the package ID should be calculated like an object and an + /// UpgradeCap is produced + fn packages_are_predefined() -> bool; + + fn empty_arguments() -> Self::ArgumentUpdates; + + fn empty_results() -> Self::ExecutionResults; + + fn add_argument_update( + resolver: &impl TypeTagResolver, + acc: &mut Self::ArgumentUpdates, + arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError>; + + fn finish_command( + resolver: &impl TypeTagResolver, + acc: &mut Self::ExecutionResults, + argument_updates: Self::ArgumentUpdates, + command_result: &[Value], + ) -> Result<(), ExecutionError>; +} + +#[derive(Copy, Clone)] +pub struct Normal; + +impl ExecutionMode for Normal { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + false + } + + fn allow_arbitrary_values() -> bool { + false + } + + fn skip_conservation_checks() -> bool { + false + } + + fn packages_are_predefined() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +#[derive(Copy, Clone)] +pub struct Genesis; + +impl ExecutionMode for Genesis { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + true + } + + fn allow_arbitrary_values() -> bool { + true + } + + fn packages_are_predefined() -> bool { + true + } + + fn skip_conservation_checks() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +#[derive(Copy, Clone)] +pub struct System; + +/// Execution mode for executing a system transaction, including the epoch change +/// transaction and the consensus commit prologue. In this mode, we allow calls to +/// any function bypassing visibility. +impl ExecutionMode for System { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + // allows bypassing visibility for system calls + true + } + + fn allow_arbitrary_values() -> bool { + // For AuthenticatorStateUpdate, we need to be able to pass in a vector of + // JWKs, so we need to allow arbitrary values. + true + } + + fn skip_conservation_checks() -> bool { + false + } + + fn packages_are_predefined() -> bool { + true + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +/// WARNING! Using this mode will bypass all normal checks around Move entry functions! This +/// includes the various rules for function arguments, meaning any object can be created just from +/// BCS bytes! +pub struct DevInspect; + +impl ExecutionMode for DevInspect { + type ArgumentUpdates = Vec<(Argument, Vec, TypeTag)>; + type ExecutionResults = Vec; + + fn allow_arbitrary_function_calls() -> bool { + SKIP_ALL_CHECKS + } + + fn allow_arbitrary_values() -> bool { + SKIP_ALL_CHECKS + } + + fn skip_conservation_checks() -> bool { + SKIP_ALL_CHECKS + } + + fn packages_are_predefined() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates { + vec![] + } + + fn empty_results() -> Self::ExecutionResults { + vec![] + } + + fn add_argument_update( + resolver: &impl TypeTagResolver, + acc: &mut Self::ArgumentUpdates, + arg: Argument, + new_value: &Value, + ) -> Result<(), ExecutionError> { + let (bytes, type_tag) = value_to_bytes_and_tag(resolver, new_value)?; + acc.push((arg, bytes, type_tag)); + Ok(()) + } + + fn finish_command( + resolver: &impl TypeTagResolver, + acc: &mut Self::ExecutionResults, + argument_updates: Self::ArgumentUpdates, + command_result: &[Value], + ) -> Result<(), ExecutionError> { + let command_bytes = command_result + .iter() + .map(|value| value_to_bytes_and_tag(resolver, value)) + .collect::>()?; + acc.push((argument_updates, command_bytes)); + Ok(()) + } +} + +fn value_to_bytes_and_tag( + resolver: &impl TypeTagResolver, + value: &Value, +) -> Result<(Vec, TypeTag), ExecutionError> { + let (type_tag, bytes) = match value { + Value::Object(obj) => { + let tag = resolver.get_type_tag(&obj.type_)?; + let mut bytes = vec![]; + obj.write_bcs_bytes(&mut bytes); + (tag, bytes) + } + Value::Raw(RawValueType::Any, bytes) => { + // this case shouldn't happen + (TypeTag::Vector(Box::new(TypeTag::U8)), bytes.clone()) + } + Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { + let tag = resolver.get_type_tag(ty)?; + (tag, bytes.clone()) + } + Value::Receiving(id, seqno, _) => ( + Receiving::type_tag(), + Receiving::new(*id, *seqno).to_bcs_bytes(), + ), + }; + Ok((bytes, type_tag)) +} diff --git a/sui-execution/v1/sui-adapter/src/execution_value.rs b/sui-execution/v1/sui-adapter/src/execution_value.rs new file mode 100644 index 0000000000000..eac050b7f25a8 --- /dev/null +++ b/sui-execution/v1/sui-adapter/src/execution_value.rs @@ -0,0 +1,303 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_binary_format::file_format::AbilitySet; +use move_core_types::{identifier::IdentStr, resolver::ResourceResolver}; +use move_vm_types::loaded_data::runtime_types::Type; +use serde::Deserialize; +use sui_types::{ + base_types::{ObjectID, SequenceNumber, SuiAddress}, + coin::Coin, + error::{ExecutionError, ExecutionErrorKind, SuiError}, + execution_status::CommandArgumentError, + object::Owner, + storage::{BackingPackageStore, ChildObjectResolver, StorageView}, + transfer::Receiving, +}; + +pub trait SuiResolver: ResourceResolver + BackingPackageStore { + fn as_backing_package_store(&self) -> &dyn BackingPackageStore; +} + +impl SuiResolver for T +where + T: ResourceResolver, + T: BackingPackageStore, +{ + fn as_backing_package_store(&self) -> &dyn BackingPackageStore { + self + } +} + +/// Interface with the store necessary to execute a programmable transaction +pub trait ExecutionState: StorageView + SuiResolver { + fn as_sui_resolver(&self) -> &dyn SuiResolver; + fn as_child_resolver(&self) -> &dyn ChildObjectResolver; +} + +impl ExecutionState for T +where + T: StorageView, + T: SuiResolver, +{ + fn as_sui_resolver(&self) -> &dyn SuiResolver { + self + } + + fn as_child_resolver(&self) -> &dyn ChildObjectResolver { + self + } +} + +#[derive(Clone, Debug)] +pub enum InputObjectMetadata { + Receiving { + id: ObjectID, + version: SequenceNumber, + }, + InputObject { + id: ObjectID, + is_mutable_input: bool, + owner: Owner, + version: SequenceNumber, + }, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum UsageKind { + BorrowImm, + BorrowMut, + ByValue, +} + +#[derive(Clone, Copy)] +pub enum CommandKind<'a> { + MoveCall { + package: ObjectID, + module: &'a IdentStr, + function: &'a IdentStr, + }, + MakeMoveVec, + TransferObjects, + SplitCoins, + MergeCoins, + Publish, + Upgrade, +} + +#[derive(Clone, Debug)] +pub struct InputValue { + /// Used to remember the object ID and owner even if the value is taken + pub object_metadata: Option, + pub inner: ResultValue, +} + +#[derive(Clone, Debug)] +pub struct ResultValue { + /// This is used primarily for values that have `copy` but not `drop` as they must have been + /// copied after the last borrow, otherwise we cannot consider the last "copy" to be instead + /// a "move" of the value. + pub last_usage_kind: Option, + pub value: Option, +} + +#[derive(Debug, Clone)] +pub enum Value { + Object(ObjectValue), + Raw(RawValueType, Vec), + Receiving(ObjectID, SequenceNumber, Option), +} + +#[derive(Debug, Clone)] +pub struct ObjectValue { + pub type_: Type, + pub has_public_transfer: bool, + // true if it has been used in a public, non-entry Move call + // In other words, false if all usages have been with non-Move commands or + // entry Move functions + pub used_in_non_entry_move_call: bool, + pub contents: ObjectContents, +} + +#[derive(Debug, Clone)] +pub enum ObjectContents { + Coin(Coin), + Raw(Vec), +} + +#[derive(Debug, Clone)] +pub enum RawValueType { + Any, + Loaded { + ty: Type, + abilities: AbilitySet, + used_in_non_entry_move_call: bool, + }, +} + +impl InputObjectMetadata { + pub fn id(&self) -> ObjectID { + match self { + InputObjectMetadata::Receiving { id, .. } => *id, + InputObjectMetadata::InputObject { id, .. } => *id, + } + } + + pub fn version(&self) -> SequenceNumber { + match self { + InputObjectMetadata::Receiving { version, .. } => *version, + InputObjectMetadata::InputObject { version, .. } => *version, + } + } +} + +impl InputValue { + pub fn new_object(object_metadata: InputObjectMetadata, value: ObjectValue) -> Self { + InputValue { + object_metadata: Some(object_metadata), + inner: ResultValue::new(Value::Object(value)), + } + } + + pub fn new_raw(ty: RawValueType, value: Vec) -> Self { + InputValue { + object_metadata: None, + inner: ResultValue::new(Value::Raw(ty, value)), + } + } + + pub fn new_receiving_object(id: ObjectID, version: SequenceNumber) -> Self { + InputValue { + object_metadata: Some(InputObjectMetadata::Receiving { id, version }), + inner: ResultValue::new(Value::Receiving(id, version, None)), + } + } +} + +impl ResultValue { + pub fn new(value: Value) -> Self { + Self { + last_usage_kind: None, + value: Some(value), + } + } +} + +impl Value { + pub fn is_copyable(&self) -> bool { + match self { + Value::Object(_) => false, + Value::Raw(RawValueType::Any, _) => true, + Value::Raw(RawValueType::Loaded { abilities, .. }, _) => abilities.has_copy(), + Value::Receiving(_, _, _) => false, + } + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match self { + Value::Object(obj_value) => obj_value.write_bcs_bytes(buf), + Value::Raw(_, bytes) => buf.extend(bytes), + Value::Receiving(id, version, _) => { + buf.extend(Receiving::new(*id, *version).to_bcs_bytes()) + } + } + } + + pub fn was_used_in_non_entry_move_call(&self) -> bool { + match self { + Value::Object(obj) => obj.used_in_non_entry_move_call, + // Any is only used for Pure inputs, and if it was used by &mut it would have switched + // to Loaded + Value::Raw(RawValueType::Any, _) => false, + Value::Raw( + RawValueType::Loaded { + used_in_non_entry_move_call, + .. + }, + _, + ) => *used_in_non_entry_move_call, + // Only thing you can do with a `Receiving` is consume it, so once it's used it + // can't be used again. + Value::Receiving(_, _, _) => false, + } + } +} + +impl ObjectValue { + /// # Safety + /// We must have the Type is the coin type, but we are unable to check it at this spot + pub unsafe fn coin(type_: Type, coin: Coin) -> Self { + Self { + type_, + has_public_transfer: true, + used_in_non_entry_move_call: false, + contents: ObjectContents::Coin(coin), + } + } + + pub fn ensure_public_transfer_eligible(&self) -> Result<(), ExecutionError> { + if !self.has_public_transfer { + return Err(ExecutionErrorKind::InvalidTransferObject.into()); + } + Ok(()) + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match &self.contents { + ObjectContents::Raw(bytes) => buf.extend(bytes), + ObjectContents::Coin(coin) => buf.extend(coin.to_bcs_bytes()), + } + } +} + +pub trait TryFromValue: Sized { + fn try_from_value(value: Value) -> Result; +} + +impl TryFromValue for Value { + fn try_from_value(value: Value) -> Result { + Ok(value) + } +} + +impl TryFromValue for ObjectValue { + fn try_from_value(value: Value) -> Result { + match value { + Value::Object(o) => Ok(o), + Value::Raw(RawValueType::Any, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Loaded { .. }, _) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + } + } +} + +impl TryFromValue for SuiAddress { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::Address) + } +} + +impl TryFromValue for u64 { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::U64) + } +} + +fn try_from_value_prim<'a, T: Deserialize<'a>>( + value: &'a Value, + expected_ty: Type, +) -> Result { + match value { + Value::Object(_) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Any, bytes) => { + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { + if ty != &expected_ty { + return Err(CommandArgumentError::TypeMismatch); + } + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + } +} diff --git a/sui-execution/v1/sui-adapter/src/lib.rs b/sui-execution/v1/sui-adapter/src/lib.rs index 0c61b9e902522..51651cb5bc339 100644 --- a/sui-execution/v1/sui-adapter/src/lib.rs +++ b/sui-execution/v1/sui-adapter/src/lib.rs @@ -7,7 +7,10 @@ extern crate sui_types; pub mod adapter; pub mod error; pub mod execution_engine; +pub mod execution_mode; +pub mod execution_value; pub mod gas_charger; pub mod programmable_transactions; pub mod temporary_store; pub mod type_layout_resolver; +pub mod type_resolver; diff --git a/sui-execution/v1/sui-adapter/src/programmable_transactions/context.rs b/sui-execution/v1/sui-adapter/src/programmable_transactions/context.rs index 6f8cdab360495..434d7a68d7fbd 100644 --- a/sui-execution/v1/sui-adapter/src/programmable_transactions/context.rs +++ b/sui-execution/v1/sui-adapter/src/programmable_transactions/context.rs @@ -13,8 +13,15 @@ mod checked { use crate::adapter::new_native_extensions; use crate::error::convert_vm_error; + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{CommandKind, ObjectContents, TryFromValue, Value}; + use crate::execution_value::{ + ExecutionState, InputObjectMetadata, InputValue, ObjectValue, RawValueType, ResultValue, + UsageKind, + }; use crate::gas_charger::GasCharger; use crate::programmable_transactions::linkage_view::LinkageView; + use crate::type_resolver::TypeTagResolver; use move_binary_format::{ errors::{Location, PartialVMError, PartialVMResult, VMError, VMResult}, file_format::{CodeOffset, FunctionDefinitionIndex, TypeParameterIndex}, @@ -46,23 +53,14 @@ mod checked { coin::Coin, error::{ExecutionError, ExecutionErrorKind}, event::Event, - execution::{ - ExecutionResultsV2, ExecutionState, InputObjectMetadata, InputValue, ObjectValue, - RawValueType, ResultValue, UsageKind, - }, + execution::ExecutionResultsV2, metrics::LimitsMetrics, move_package::MovePackage, object::{Data, MoveObject, Object, ObjectInner, Owner}, storage::BackingPackageStore, transaction::{Argument, CallArg, ObjectArg}, - type_resolver::TypeTagResolver, - }; - use sui_types::{ - error::command_argument_error, - execution::{CommandKind, ObjectContents, TryFromValue, Value}, - execution_mode::ExecutionMode, - execution_status::CommandArgumentError, }; + use sui_types::{error::command_argument_error, execution_status::CommandArgumentError}; use tracing::instrument; /// Maintains all runtime state specific to programmable transactions diff --git a/sui-execution/v1/sui-adapter/src/programmable_transactions/execution.rs b/sui-execution/v1/sui-adapter/src/programmable_transactions/execution.rs index 2b3b43b8ac807..6a1ac2958c190 100644 --- a/sui-execution/v1/sui-adapter/src/programmable_transactions/execution.rs +++ b/sui-execution/v1/sui-adapter/src/programmable_transactions/execution.rs @@ -5,6 +5,10 @@ pub use checked::*; #[sui_macros::with_checked_arithmetic] mod checked { + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{ + CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, + }; use crate::gas_charger::GasCharger; use move_binary_format::{ compatibility::{Compatibility, InclusionCheck}, @@ -33,6 +37,7 @@ mod checked { use sui_move_natives::object_runtime::ObjectRuntime; use sui_protocol_config::ProtocolConfig; use sui_types::execution_config_utils::to_binary_config; + use sui_types::execution_status::{CommandArgumentError, PackageUpgradeError}; use sui_types::storage::{get_package_objects, PackageObject}; use sui_types::{ base_types::{ @@ -41,9 +46,6 @@ mod checked { }, coin::Coin, error::{command_argument_error, ExecutionError, ExecutionErrorKind}, - execution::{ - CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, - }, id::{RESOLVED_SUI_ID, UID}, metrics::LimitsMetrics, move_package::{ @@ -54,10 +56,6 @@ mod checked { transfer::RESOLVED_RECEIVING_STRUCT, SUI_FRAMEWORK_ADDRESS, }; - use sui_types::{ - execution_mode::ExecutionMode, - execution_status::{CommandArgumentError, PackageUpgradeError}, - }; use sui_verifier::{ private_generics::{EVENT_MODULE, PRIVATE_TRANSFER_FUNCTIONS, TRANSFER_MODULE}, INIT_FN_NAME, diff --git a/sui-execution/v1/sui-adapter/src/programmable_transactions/linkage_view.rs b/sui-execution/v1/sui-adapter/src/programmable_transactions/linkage_view.rs index 4e1ad3e4118e5..0cb68ec52b970 100644 --- a/sui-execution/v1/sui-adapter/src/programmable_transactions/linkage_view.rs +++ b/sui-execution/v1/sui-adapter/src/programmable_transactions/linkage_view.rs @@ -7,6 +7,7 @@ use std::{ str::FromStr, }; +use crate::execution_value::SuiResolver; use move_core_types::{ account_address::AccountAddress, identifier::{IdentStr, Identifier}, @@ -17,7 +18,6 @@ use sui_types::storage::{get_module, PackageObject}; use sui_types::{ base_types::ObjectID, error::{ExecutionError, SuiError, SuiResult}, - execution::SuiResolver, move_package::{MovePackage, TypeOrigin, UpgradeInfo}, storage::BackingPackageStore, }; diff --git a/sui-execution/v1/sui-adapter/src/temporary_store.rs b/sui-execution/v1/sui-adapter/src/temporary_store.rs index ca3981206ff22..f9c7f52451394 100644 --- a/sui-execution/v1/sui-adapter/src/temporary_store.rs +++ b/sui-execution/v1/sui-adapter/src/temporary_store.rs @@ -18,9 +18,9 @@ use sui_types::execution::{ use sui_types::execution_config_utils::to_binary_config; use sui_types::execution_status::ExecutionStatus; use sui_types::inner_temporary_store::InnerTemporaryStore; +use sui_types::layout_resolver::LayoutResolver; use sui_types::storage::{BackingStore, DenyListResult, PackageObject}; use sui_types::sui_system_state::{get_sui_system_state_wrapper, AdvanceEpochParams}; -use sui_types::type_resolver::LayoutResolver; use sui_types::{ base_types::{ObjectID, ObjectRef, SequenceNumber, SuiAddress, TransactionDigest}, effects::EffectsObjectChange, diff --git a/sui-execution/v1/sui-adapter/src/type_layout_resolver.rs b/sui-execution/v1/sui-adapter/src/type_layout_resolver.rs index e2457ae66f98b..99d494f61134c 100644 --- a/sui-execution/v1/sui-adapter/src/type_layout_resolver.rs +++ b/sui-execution/v1/sui-adapter/src/type_layout_resolver.rs @@ -12,7 +12,7 @@ use sui_types::base_types::ObjectID; use sui_types::error::SuiResult; use sui_types::execution::TypeLayoutStore; use sui_types::storage::{BackingPackageStore, PackageObject}; -use sui_types::{error::SuiError, type_resolver::LayoutResolver}; +use sui_types::{error::SuiError, layout_resolver::LayoutResolver}; /// Retrieve a `MoveStructLayout` from a `Type`. /// Invocation into the `Session` to leverage the `LinkageView` implementation diff --git a/sui-execution/v1/sui-adapter/src/type_resolver.rs b/sui-execution/v1/sui-adapter/src/type_resolver.rs new file mode 100644 index 0000000000000..c9227aa01b382 --- /dev/null +++ b/sui-execution/v1/sui-adapter/src/type_resolver.rs @@ -0,0 +1,10 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_core_types::language_storage::TypeTag; +use move_vm_types::loaded_data::runtime_types::Type; +use sui_types::error::ExecutionError; + +pub trait TypeTagResolver { + fn get_type_tag(&self, type_: &Type) -> Result; +} diff --git a/sui-execution/v2/sui-adapter/src/execution_engine.rs b/sui-execution/v2/sui-adapter/src/execution_engine.rs index 2be1454ba0a26..8a5c18ece19b3 100644 --- a/sui-execution/v2/sui-adapter/src/execution_engine.rs +++ b/sui-execution/v2/sui-adapter/src/execution_engine.rs @@ -6,6 +6,7 @@ pub use checked::*; #[sui_macros::with_checked_arithmetic] mod checked { + use crate::execution_mode::{self, ExecutionMode}; use move_binary_format::CompiledModule; use move_vm_runtime::move_vm::MoveVM; use std::{collections::HashSet, sync::Arc}; @@ -14,7 +15,6 @@ mod checked { BALANCE_MODULE_NAME, }; use sui_types::base_types::SequenceNumber; - use sui_types::execution_mode::{self, ExecutionMode}; use sui_types::gas_coin::GAS; use sui_types::messages_checkpoint::CheckpointTimestamp; use sui_types::metrics::LimitsMetrics; diff --git a/sui-execution/v2/sui-adapter/src/execution_mode.rs b/sui-execution/v2/sui-adapter/src/execution_mode.rs new file mode 100644 index 0000000000000..1941c806007c5 --- /dev/null +++ b/sui-execution/v2/sui-adapter/src/execution_mode.rs @@ -0,0 +1,280 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::execution_value::{RawValueType, Value}; +use crate::type_resolver::TypeTagResolver; +use move_core_types::language_storage::TypeTag; +use sui_types::{ + error::ExecutionError, execution::ExecutionResult, transaction::Argument, transfer::Receiving, +}; + +pub type TransactionIndex = usize; + +pub trait ExecutionMode { + /// All updates to a Arguments used in that Command + type ArgumentUpdates; + /// the gathered results from batched executions + type ExecutionResults; + + /// Controls the calling of arbitrary Move functions + fn allow_arbitrary_function_calls() -> bool; + + /// Controls the ability to instantiate any Move function parameter with a Pure call arg. + /// In other words, you can instantiate any struct or object or other value with its BCS byte + fn allow_arbitrary_values() -> bool; + + /// Do not perform conservation checks after execution. + fn skip_conservation_checks() -> bool; + + /// If not set, the package ID should be calculated like an object and an + /// UpgradeCap is produced + fn packages_are_predefined() -> bool; + + fn empty_arguments() -> Self::ArgumentUpdates; + + fn empty_results() -> Self::ExecutionResults; + + fn add_argument_update( + resolver: &impl TypeTagResolver, + acc: &mut Self::ArgumentUpdates, + arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError>; + + fn finish_command( + resolver: &impl TypeTagResolver, + acc: &mut Self::ExecutionResults, + argument_updates: Self::ArgumentUpdates, + command_result: &[Value], + ) -> Result<(), ExecutionError>; +} + +#[derive(Copy, Clone)] +pub struct Normal; + +impl ExecutionMode for Normal { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + false + } + + fn allow_arbitrary_values() -> bool { + false + } + + fn skip_conservation_checks() -> bool { + false + } + + fn packages_are_predefined() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +#[derive(Copy, Clone)] +pub struct Genesis; + +impl ExecutionMode for Genesis { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + true + } + + fn allow_arbitrary_values() -> bool { + true + } + + fn packages_are_predefined() -> bool { + true + } + + fn skip_conservation_checks() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +#[derive(Copy, Clone)] +pub struct System; + +/// Execution mode for executing a system transaction, including the epoch change +/// transaction and the consensus commit prologue. In this mode, we allow calls to +/// any function bypassing visibility. +impl ExecutionMode for System { + type ArgumentUpdates = (); + type ExecutionResults = (); + + fn allow_arbitrary_function_calls() -> bool { + // allows bypassing visibility for system calls + true + } + + fn allow_arbitrary_values() -> bool { + // For AuthenticatorStateUpdate, we need to be able to pass in a vector of + // JWKs, so we need to allow arbitrary values. + true + } + + fn skip_conservation_checks() -> bool { + false + } + + fn packages_are_predefined() -> bool { + true + } + + fn empty_arguments() -> Self::ArgumentUpdates {} + + fn empty_results() -> Self::ExecutionResults {} + + fn add_argument_update( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ArgumentUpdates, + _arg: Argument, + _new_value: &Value, + ) -> Result<(), ExecutionError> { + Ok(()) + } + + fn finish_command( + _resolver: &impl TypeTagResolver, + _acc: &mut Self::ExecutionResults, + _argument_updates: Self::ArgumentUpdates, + _command_result: &[Value], + ) -> Result<(), ExecutionError> { + Ok(()) + } +} + +/// WARNING! Using this mode will bypass all normal checks around Move entry functions! This +/// includes the various rules for function arguments, meaning any object can be created just from +/// BCS bytes! +pub struct DevInspect; + +impl ExecutionMode for DevInspect { + type ArgumentUpdates = Vec<(Argument, Vec, TypeTag)>; + type ExecutionResults = Vec; + + fn allow_arbitrary_function_calls() -> bool { + SKIP_ALL_CHECKS + } + + fn allow_arbitrary_values() -> bool { + SKIP_ALL_CHECKS + } + + fn skip_conservation_checks() -> bool { + SKIP_ALL_CHECKS + } + + fn packages_are_predefined() -> bool { + false + } + + fn empty_arguments() -> Self::ArgumentUpdates { + vec![] + } + + fn empty_results() -> Self::ExecutionResults { + vec![] + } + + fn add_argument_update( + resolver: &impl TypeTagResolver, + acc: &mut Self::ArgumentUpdates, + arg: Argument, + new_value: &Value, + ) -> Result<(), ExecutionError> { + let (bytes, type_tag) = value_to_bytes_and_tag(resolver, new_value)?; + acc.push((arg, bytes, type_tag)); + Ok(()) + } + + fn finish_command( + resolver: &impl TypeTagResolver, + acc: &mut Self::ExecutionResults, + argument_updates: Self::ArgumentUpdates, + command_result: &[Value], + ) -> Result<(), ExecutionError> { + let command_bytes = command_result + .iter() + .map(|value| value_to_bytes_and_tag(resolver, value)) + .collect::>()?; + acc.push((argument_updates, command_bytes)); + Ok(()) + } +} + +fn value_to_bytes_and_tag( + resolver: &impl TypeTagResolver, + value: &Value, +) -> Result<(Vec, TypeTag), ExecutionError> { + let (type_tag, bytes) = match value { + Value::Object(obj) => { + let tag = resolver.get_type_tag(&obj.type_)?; + let mut bytes = vec![]; + obj.write_bcs_bytes(&mut bytes); + (tag, bytes) + } + Value::Raw(RawValueType::Any, bytes) => { + // this case shouldn't happen + (TypeTag::Vector(Box::new(TypeTag::U8)), bytes.clone()) + } + Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { + let tag = resolver.get_type_tag(ty)?; + (tag, bytes.clone()) + } + Value::Receiving(id, seqno, _) => ( + Receiving::type_tag(), + Receiving::new(*id, *seqno).to_bcs_bytes(), + ), + }; + Ok((bytes, type_tag)) +} diff --git a/sui-execution/v2/sui-adapter/src/execution_value.rs b/sui-execution/v2/sui-adapter/src/execution_value.rs new file mode 100644 index 0000000000000..eac050b7f25a8 --- /dev/null +++ b/sui-execution/v2/sui-adapter/src/execution_value.rs @@ -0,0 +1,303 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_binary_format::file_format::AbilitySet; +use move_core_types::{identifier::IdentStr, resolver::ResourceResolver}; +use move_vm_types::loaded_data::runtime_types::Type; +use serde::Deserialize; +use sui_types::{ + base_types::{ObjectID, SequenceNumber, SuiAddress}, + coin::Coin, + error::{ExecutionError, ExecutionErrorKind, SuiError}, + execution_status::CommandArgumentError, + object::Owner, + storage::{BackingPackageStore, ChildObjectResolver, StorageView}, + transfer::Receiving, +}; + +pub trait SuiResolver: ResourceResolver + BackingPackageStore { + fn as_backing_package_store(&self) -> &dyn BackingPackageStore; +} + +impl SuiResolver for T +where + T: ResourceResolver, + T: BackingPackageStore, +{ + fn as_backing_package_store(&self) -> &dyn BackingPackageStore { + self + } +} + +/// Interface with the store necessary to execute a programmable transaction +pub trait ExecutionState: StorageView + SuiResolver { + fn as_sui_resolver(&self) -> &dyn SuiResolver; + fn as_child_resolver(&self) -> &dyn ChildObjectResolver; +} + +impl ExecutionState for T +where + T: StorageView, + T: SuiResolver, +{ + fn as_sui_resolver(&self) -> &dyn SuiResolver { + self + } + + fn as_child_resolver(&self) -> &dyn ChildObjectResolver { + self + } +} + +#[derive(Clone, Debug)] +pub enum InputObjectMetadata { + Receiving { + id: ObjectID, + version: SequenceNumber, + }, + InputObject { + id: ObjectID, + is_mutable_input: bool, + owner: Owner, + version: SequenceNumber, + }, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum UsageKind { + BorrowImm, + BorrowMut, + ByValue, +} + +#[derive(Clone, Copy)] +pub enum CommandKind<'a> { + MoveCall { + package: ObjectID, + module: &'a IdentStr, + function: &'a IdentStr, + }, + MakeMoveVec, + TransferObjects, + SplitCoins, + MergeCoins, + Publish, + Upgrade, +} + +#[derive(Clone, Debug)] +pub struct InputValue { + /// Used to remember the object ID and owner even if the value is taken + pub object_metadata: Option, + pub inner: ResultValue, +} + +#[derive(Clone, Debug)] +pub struct ResultValue { + /// This is used primarily for values that have `copy` but not `drop` as they must have been + /// copied after the last borrow, otherwise we cannot consider the last "copy" to be instead + /// a "move" of the value. + pub last_usage_kind: Option, + pub value: Option, +} + +#[derive(Debug, Clone)] +pub enum Value { + Object(ObjectValue), + Raw(RawValueType, Vec), + Receiving(ObjectID, SequenceNumber, Option), +} + +#[derive(Debug, Clone)] +pub struct ObjectValue { + pub type_: Type, + pub has_public_transfer: bool, + // true if it has been used in a public, non-entry Move call + // In other words, false if all usages have been with non-Move commands or + // entry Move functions + pub used_in_non_entry_move_call: bool, + pub contents: ObjectContents, +} + +#[derive(Debug, Clone)] +pub enum ObjectContents { + Coin(Coin), + Raw(Vec), +} + +#[derive(Debug, Clone)] +pub enum RawValueType { + Any, + Loaded { + ty: Type, + abilities: AbilitySet, + used_in_non_entry_move_call: bool, + }, +} + +impl InputObjectMetadata { + pub fn id(&self) -> ObjectID { + match self { + InputObjectMetadata::Receiving { id, .. } => *id, + InputObjectMetadata::InputObject { id, .. } => *id, + } + } + + pub fn version(&self) -> SequenceNumber { + match self { + InputObjectMetadata::Receiving { version, .. } => *version, + InputObjectMetadata::InputObject { version, .. } => *version, + } + } +} + +impl InputValue { + pub fn new_object(object_metadata: InputObjectMetadata, value: ObjectValue) -> Self { + InputValue { + object_metadata: Some(object_metadata), + inner: ResultValue::new(Value::Object(value)), + } + } + + pub fn new_raw(ty: RawValueType, value: Vec) -> Self { + InputValue { + object_metadata: None, + inner: ResultValue::new(Value::Raw(ty, value)), + } + } + + pub fn new_receiving_object(id: ObjectID, version: SequenceNumber) -> Self { + InputValue { + object_metadata: Some(InputObjectMetadata::Receiving { id, version }), + inner: ResultValue::new(Value::Receiving(id, version, None)), + } + } +} + +impl ResultValue { + pub fn new(value: Value) -> Self { + Self { + last_usage_kind: None, + value: Some(value), + } + } +} + +impl Value { + pub fn is_copyable(&self) -> bool { + match self { + Value::Object(_) => false, + Value::Raw(RawValueType::Any, _) => true, + Value::Raw(RawValueType::Loaded { abilities, .. }, _) => abilities.has_copy(), + Value::Receiving(_, _, _) => false, + } + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match self { + Value::Object(obj_value) => obj_value.write_bcs_bytes(buf), + Value::Raw(_, bytes) => buf.extend(bytes), + Value::Receiving(id, version, _) => { + buf.extend(Receiving::new(*id, *version).to_bcs_bytes()) + } + } + } + + pub fn was_used_in_non_entry_move_call(&self) -> bool { + match self { + Value::Object(obj) => obj.used_in_non_entry_move_call, + // Any is only used for Pure inputs, and if it was used by &mut it would have switched + // to Loaded + Value::Raw(RawValueType::Any, _) => false, + Value::Raw( + RawValueType::Loaded { + used_in_non_entry_move_call, + .. + }, + _, + ) => *used_in_non_entry_move_call, + // Only thing you can do with a `Receiving` is consume it, so once it's used it + // can't be used again. + Value::Receiving(_, _, _) => false, + } + } +} + +impl ObjectValue { + /// # Safety + /// We must have the Type is the coin type, but we are unable to check it at this spot + pub unsafe fn coin(type_: Type, coin: Coin) -> Self { + Self { + type_, + has_public_transfer: true, + used_in_non_entry_move_call: false, + contents: ObjectContents::Coin(coin), + } + } + + pub fn ensure_public_transfer_eligible(&self) -> Result<(), ExecutionError> { + if !self.has_public_transfer { + return Err(ExecutionErrorKind::InvalidTransferObject.into()); + } + Ok(()) + } + + pub fn write_bcs_bytes(&self, buf: &mut Vec) { + match &self.contents { + ObjectContents::Raw(bytes) => buf.extend(bytes), + ObjectContents::Coin(coin) => buf.extend(coin.to_bcs_bytes()), + } + } +} + +pub trait TryFromValue: Sized { + fn try_from_value(value: Value) -> Result; +} + +impl TryFromValue for Value { + fn try_from_value(value: Value) -> Result { + Ok(value) + } +} + +impl TryFromValue for ObjectValue { + fn try_from_value(value: Value) -> Result { + match value { + Value::Object(o) => Ok(o), + Value::Raw(RawValueType::Any, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Loaded { .. }, _) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + } + } +} + +impl TryFromValue for SuiAddress { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::Address) + } +} + +impl TryFromValue for u64 { + fn try_from_value(value: Value) -> Result { + try_from_value_prim(&value, Type::U64) + } +} + +fn try_from_value_prim<'a, T: Deserialize<'a>>( + value: &'a Value, + expected_ty: Type, +) -> Result { + match value { + Value::Object(_) => Err(CommandArgumentError::TypeMismatch), + Value::Receiving(_, _, _) => Err(CommandArgumentError::TypeMismatch), + Value::Raw(RawValueType::Any, bytes) => { + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + Value::Raw(RawValueType::Loaded { ty, .. }, bytes) => { + if ty != &expected_ty { + return Err(CommandArgumentError::TypeMismatch); + } + bcs::from_bytes(bytes).map_err(|_| CommandArgumentError::InvalidBCSBytes) + } + } +} diff --git a/sui-execution/v2/sui-adapter/src/lib.rs b/sui-execution/v2/sui-adapter/src/lib.rs index 0c61b9e902522..51651cb5bc339 100644 --- a/sui-execution/v2/sui-adapter/src/lib.rs +++ b/sui-execution/v2/sui-adapter/src/lib.rs @@ -7,7 +7,10 @@ extern crate sui_types; pub mod adapter; pub mod error; pub mod execution_engine; +pub mod execution_mode; +pub mod execution_value; pub mod gas_charger; pub mod programmable_transactions; pub mod temporary_store; pub mod type_layout_resolver; +pub mod type_resolver; diff --git a/sui-execution/v2/sui-adapter/src/programmable_transactions/context.rs b/sui-execution/v2/sui-adapter/src/programmable_transactions/context.rs index f0f390b61a9e5..c749d0eb8b078 100644 --- a/sui-execution/v2/sui-adapter/src/programmable_transactions/context.rs +++ b/sui-execution/v2/sui-adapter/src/programmable_transactions/context.rs @@ -14,8 +14,15 @@ mod checked { use crate::adapter::new_native_extensions; use crate::error::convert_vm_error; + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{CommandKind, ObjectContents, TryFromValue, Value}; + use crate::execution_value::{ + ExecutionState, InputObjectMetadata, InputValue, ObjectValue, RawValueType, ResultValue, + UsageKind, + }; use crate::gas_charger::GasCharger; use crate::programmable_transactions::linkage_view::LinkageView; + use crate::type_resolver::TypeTagResolver; use move_binary_format::{ errors::{Location, PartialVMError, PartialVMResult, VMError, VMResult}, file_format::{CodeOffset, FunctionDefinitionIndex, TypeParameterIndex}, @@ -47,23 +54,14 @@ mod checked { coin::Coin, error::{ExecutionError, ExecutionErrorKind}, event::Event, - execution::{ - ExecutionResultsV2, ExecutionState, InputObjectMetadata, InputValue, ObjectValue, - RawValueType, ResultValue, UsageKind, - }, + execution::ExecutionResultsV2, metrics::LimitsMetrics, move_package::MovePackage, object::{Data, MoveObject, Object, ObjectInner, Owner}, storage::BackingPackageStore, transaction::{Argument, CallArg, ObjectArg}, - type_resolver::TypeTagResolver, - }; - use sui_types::{ - error::command_argument_error, - execution::{CommandKind, ObjectContents, TryFromValue, Value}, - execution_mode::ExecutionMode, - execution_status::CommandArgumentError, }; + use sui_types::{error::command_argument_error, execution_status::CommandArgumentError}; use tracing::instrument; /// Maintains all runtime state specific to programmable transactions diff --git a/sui-execution/v2/sui-adapter/src/programmable_transactions/execution.rs b/sui-execution/v2/sui-adapter/src/programmable_transactions/execution.rs index 8d9c3234111b8..2d57428e333c8 100644 --- a/sui-execution/v2/sui-adapter/src/programmable_transactions/execution.rs +++ b/sui-execution/v2/sui-adapter/src/programmable_transactions/execution.rs @@ -5,6 +5,10 @@ pub use checked::*; #[sui_macros::with_checked_arithmetic] mod checked { + use crate::execution_mode::ExecutionMode; + use crate::execution_value::{ + CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, + }; use crate::gas_charger::GasCharger; use move_binary_format::{ compatibility::{Compatibility, InclusionCheck}, @@ -33,6 +37,7 @@ mod checked { use sui_move_natives::object_runtime::ObjectRuntime; use sui_protocol_config::ProtocolConfig; use sui_types::execution_config_utils::to_binary_config; + use sui_types::execution_status::{CommandArgumentError, PackageUpgradeError}; use sui_types::storage::{get_package_objects, PackageObject}; use sui_types::{ base_types::{ @@ -41,9 +46,6 @@ mod checked { }, coin::Coin, error::{command_argument_error, ExecutionError, ExecutionErrorKind}, - execution::{ - CommandKind, ExecutionState, ObjectContents, ObjectValue, RawValueType, Value, - }, id::{RESOLVED_SUI_ID, UID}, metrics::LimitsMetrics, move_package::{ @@ -54,10 +56,6 @@ mod checked { transfer::RESOLVED_RECEIVING_STRUCT, SUI_FRAMEWORK_ADDRESS, }; - use sui_types::{ - execution_mode::ExecutionMode, - execution_status::{CommandArgumentError, PackageUpgradeError}, - }; use sui_verifier::{ private_generics::{EVENT_MODULE, PRIVATE_TRANSFER_FUNCTIONS, TRANSFER_MODULE}, INIT_FN_NAME, diff --git a/sui-execution/v2/sui-adapter/src/programmable_transactions/linkage_view.rs b/sui-execution/v2/sui-adapter/src/programmable_transactions/linkage_view.rs index 1b7b2cbe39a65..fa05fb6fbf699 100644 --- a/sui-execution/v2/sui-adapter/src/programmable_transactions/linkage_view.rs +++ b/sui-execution/v2/sui-adapter/src/programmable_transactions/linkage_view.rs @@ -7,6 +7,7 @@ use std::{ str::FromStr, }; +use crate::execution_value::SuiResolver; use move_core_types::{ account_address::AccountAddress, identifier::{IdentStr, Identifier}, @@ -17,7 +18,6 @@ use sui_types::storage::{get_module, PackageObject}; use sui_types::{ base_types::ObjectID, error::{ExecutionError, SuiError, SuiResult}, - execution::SuiResolver, move_package::{MovePackage, TypeOrigin, UpgradeInfo}, storage::BackingPackageStore, }; diff --git a/sui-execution/v2/sui-adapter/src/temporary_store.rs b/sui-execution/v2/sui-adapter/src/temporary_store.rs index bfe30af5ca203..4629a4303cbdc 100644 --- a/sui-execution/v2/sui-adapter/src/temporary_store.rs +++ b/sui-execution/v2/sui-adapter/src/temporary_store.rs @@ -18,9 +18,9 @@ use sui_types::execution::{ use sui_types::execution_config_utils::to_binary_config; use sui_types::execution_status::ExecutionStatus; use sui_types::inner_temporary_store::InnerTemporaryStore; +use sui_types::layout_resolver::LayoutResolver; use sui_types::storage::{BackingStore, DenyListResult, PackageObject}; use sui_types::sui_system_state::{get_sui_system_state_wrapper, AdvanceEpochParams}; -use sui_types::type_resolver::LayoutResolver; use sui_types::{ base_types::{ObjectID, ObjectRef, SequenceNumber, SuiAddress, TransactionDigest}, effects::EffectsObjectChange, diff --git a/sui-execution/v2/sui-adapter/src/type_layout_resolver.rs b/sui-execution/v2/sui-adapter/src/type_layout_resolver.rs index e2457ae66f98b..99d494f61134c 100644 --- a/sui-execution/v2/sui-adapter/src/type_layout_resolver.rs +++ b/sui-execution/v2/sui-adapter/src/type_layout_resolver.rs @@ -12,7 +12,7 @@ use sui_types::base_types::ObjectID; use sui_types::error::SuiResult; use sui_types::execution::TypeLayoutStore; use sui_types::storage::{BackingPackageStore, PackageObject}; -use sui_types::{error::SuiError, type_resolver::LayoutResolver}; +use sui_types::{error::SuiError, layout_resolver::LayoutResolver}; /// Retrieve a `MoveStructLayout` from a `Type`. /// Invocation into the `Session` to leverage the `LinkageView` implementation diff --git a/sui-execution/v2/sui-adapter/src/type_resolver.rs b/sui-execution/v2/sui-adapter/src/type_resolver.rs new file mode 100644 index 0000000000000..c9227aa01b382 --- /dev/null +++ b/sui-execution/v2/sui-adapter/src/type_resolver.rs @@ -0,0 +1,10 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use move_core_types::language_storage::TypeTag; +use move_vm_types::loaded_data::runtime_types::Type; +use sui_types::error::ExecutionError; + +pub trait TypeTagResolver { + fn get_type_tag(&self, type_: &Type) -> Result; +} From edac0d98153c6a0f6ebcbcd65024f71de698e37d Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Wed, 24 Jul 2024 17:28:20 -0400 Subject: [PATCH 143/163] Revert "Enable random beacon on mainnet" (#18788) Reverts MystenLabs/sui#18756 --- crates/sui-protocol-config/src/lib.rs | 7 ------- .../sui_protocol_config__test__Mainnet_version_53.snap | 4 ---- .../sui_protocol_config__test__Testnet_version_53.snap | 4 ++-- .../snapshots/sui_protocol_config__test__version_53.snap | 4 ++-- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index f0963eaa44696..0a630e7a87b44 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -164,7 +164,6 @@ const MAX_PROTOCOL_VERSION: u64 = 53; // Version 53: Add feature flag to decide whether to attempt to finalize bridge committee // Enable consensus commit prologue V3 on testnet. // Turn on shared object congestion control in testnet. -// Enable random beacon on mainnet. #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -2537,12 +2536,6 @@ impl ProtocolConfig { cfg.feature_flags.per_object_congestion_control_mode = PerObjectCongestionControlMode::TotalTxCount; } - - // Enable random beacon on mainnet. - cfg.feature_flags.random_beacon = true; - cfg.random_beacon_reduction_lower_bound = Some(1000); - cfg.random_beacon_dkg_timeout_round = Some(3000); - cfg.random_beacon_min_round_interval_ms = Some(500); } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap index 13d777f60d287..2761b97f0f926 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap @@ -32,7 +32,6 @@ feature_flags: simple_conservation_checks: true loaded_child_object_format_type: true receive_objects: true - random_beacon: true enable_effects_v2: true narwhal_certificate_v2: true verify_legacy_zklogin_address: true @@ -274,9 +273,6 @@ consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 -random_beacon_reduction_lower_bound: 1000 -random_beacon_dkg_timeout_round: 3000 -random_beacon_min_round_interval_ms: 500 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap index ec96505d6cf65..0419b3548b467 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap @@ -277,9 +277,9 @@ consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 -random_beacon_reduction_lower_bound: 1000 +random_beacon_reduction_lower_bound: 1600 random_beacon_dkg_timeout_round: 3000 -random_beacon_min_round_interval_ms: 500 +random_beacon_min_round_interval_ms: 200 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap index 8514174952bab..095c918715c91 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap @@ -286,9 +286,9 @@ consensus_bad_nodes_stake_threshold: 20 max_jwk_votes_per_validator_per_epoch: 240 max_age_of_jwk_in_epochs: 1 random_beacon_reduction_allowed_delta: 800 -random_beacon_reduction_lower_bound: 1000 +random_beacon_reduction_lower_bound: 1600 random_beacon_dkg_timeout_round: 3000 -random_beacon_min_round_interval_ms: 500 +random_beacon_min_round_interval_ms: 200 random_beacon_dkg_version: 1 consensus_max_transaction_size_bytes: 262144 consensus_max_transactions_in_block_bytes: 6291456 From c7de614e83d27ec916b72c62ba2fd0200813bb57 Mon Sep 17 00:00:00 2001 From: William Smith Date: Wed, 24 Jul 2024 18:39:41 -0400 Subject: [PATCH 144/163] [StateAccumulator] Remove v2 disable functionality from node config (#18786) ## Description Before removing v1, we need to ensure that no one has v2 force disabled, as it would otherwise lead to a fork during upgrade due to forcing v2 to be enabled mid-epoch. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-config/src/node.rs | 2 ++ .../snapshot_tests__network_config_snapshot_matches.snap | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index c6db0d850d424..80ae3dd0a6fb1 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -186,6 +186,8 @@ pub struct NodeConfig { #[serde(default)] pub execution_cache: ExecutionCacheConfig, + // step 1 in removing the old state accumulator + #[serde(skip)] #[serde(default = "bool_true")] pub state_accumulator_v2: bool, 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 b2519d82910dd..61811145ed2a6 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 @@ -138,7 +138,6 @@ validator_configs: max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 execution-cache: passthrough-cache - state-accumulator-v2: true enable-soft-bundle: true enable-validator-tx-finalizer: true - protocol-key-pair: @@ -276,7 +275,6 @@ validator_configs: max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 execution-cache: passthrough-cache - state-accumulator-v2: true enable-soft-bundle: true enable-validator-tx-finalizer: true - protocol-key-pair: @@ -414,7 +412,6 @@ validator_configs: max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 execution-cache: passthrough-cache - state-accumulator-v2: true enable-soft-bundle: true enable-validator-tx-finalizer: true - protocol-key-pair: @@ -552,7 +549,6 @@ validator_configs: max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 execution-cache: passthrough-cache - state-accumulator-v2: true enable-soft-bundle: true enable-validator-tx-finalizer: true - protocol-key-pair: @@ -690,7 +686,6 @@ validator_configs: max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 execution-cache: passthrough-cache - state-accumulator-v2: true enable-soft-bundle: true enable-validator-tx-finalizer: true - protocol-key-pair: @@ -828,7 +823,6 @@ validator_configs: max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 execution-cache: passthrough-cache - state-accumulator-v2: true enable-soft-bundle: true enable-validator-tx-finalizer: true - protocol-key-pair: @@ -966,7 +960,6 @@ validator_configs: max-transaction-manager-queue-length: 100000 max-transaction-manager-per-object-queue-length: 100 execution-cache: passthrough-cache - state-accumulator-v2: true enable-soft-bundle: true enable-validator-tx-finalizer: true account_keys: @@ -976,3 +969,4 @@ account_keys: - mfPjCoE6SX0Sl84MnmNS/LS+tfPpkn7I8tziuk2g0WM= - 5RWlYF22jS9i76zLl8jP2D3D8GC5ht+IP1dWUBGZxi8= genesis: "[fake genesis]" + From c345bc340666cc4fd0dceed72128df2bae3ec409 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 25 Jul 2024 08:45:50 -0500 Subject: [PATCH 145/163] chore: update msim --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- scripts/simtest/cargo-simtest | 4 ++-- scripts/simtest/config-patch | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13385e1bc6582..bd6f1b9432ab9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7380,7 +7380,7 @@ dependencies = [ [[package]] name = "msim" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=594c417e3716fc909b71a0a8ffd01ee5b25bf4b0#594c417e3716fc909b71a0a8ffd01ee5b25bf4b0" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=291cebe772727338f474a020e094b4ecb7ba1fe9#291cebe772727338f474a020e094b4ecb7ba1fe9" dependencies = [ "ahash 0.7.6", "async-task", @@ -7409,7 +7409,7 @@ dependencies = [ [[package]] name = "msim-macros" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=594c417e3716fc909b71a0a8ffd01ee5b25bf4b0#594c417e3716fc909b71a0a8ffd01ee5b25bf4b0" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=291cebe772727338f474a020e094b4ecb7ba1fe9#291cebe772727338f474a020e094b4ecb7ba1fe9" dependencies = [ "darling 0.14.2", "proc-macro2 1.0.78", diff --git a/Cargo.toml b/Cargo.toml index 60fe7f0ab17be..3d36fc9cd1de0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -376,8 +376,8 @@ moka = { version = "0.12", default-features = false, features = [ "atomic64", ] } more-asserts = "0.3.1" -msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "594c417e3716fc909b71a0a8ffd01ee5b25bf4b0", package = "msim" } -msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "594c417e3716fc909b71a0a8ffd01ee5b25bf4b0", package = "msim-macros" } +msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9", package = "msim" } +msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9", package = "msim-macros" } multiaddr = "0.17.0" nexlint = { git = "https://github.com/nextest-rs/nexlint.git", rev = "94da5c787636dad779c340affa65219134d127f5" } nexlint-lints = { git = "https://github.com/nextest-rs/nexlint.git", rev = "94da5c787636dad779c340affa65219134d127f5" } diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index 57614f76405fe..836f5c71e6e0b 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -54,9 +54,9 @@ if [ -n "$LOCAL_MSIM_PATH" ]; then else cargo_patch_args=( --config 'patch.crates-io.tokio.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.tokio.rev = "594c417e3716fc909b71a0a8ffd01ee5b25bf4b0"' + --config 'patch.crates-io.tokio.rev = "291cebe772727338f474a020e094b4ecb7ba1fe9"' --config 'patch.crates-io.futures-timer.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.futures-timer.rev = "594c417e3716fc909b71a0a8ffd01ee5b25bf4b0"' + --config 'patch.crates-io.futures-timer.rev = "291cebe772727338f474a020e094b4ecb7ba1fe9"' ) fi diff --git a/scripts/simtest/config-patch b/scripts/simtest/config-patch index faca5103c55d1..97e158ea047a3 100644 --- a/scripts/simtest/config-patch +++ b/scripts/simtest/config-patch @@ -18,5 +18,5 @@ index c0829bc1b6..4007f97d66 100644 include_dir = "0.7.3" + +[patch.crates-io] -+tokio = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "594c417e3716fc909b71a0a8ffd01ee5b25bf4b0" } -+futures-timer = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "594c417e3716fc909b71a0a8ffd01ee5b25bf4b0" } ++tokio = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9" } ++futures-timer = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9" } From 3aa1f2eb98587d3e299b1561a0b2a324822dce82 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 25 Jul 2024 08:47:27 -0500 Subject: [PATCH 146/163] mysten-network: remove unused uds support --- crates/mysten-network/src/client.rs | 49 +------------------------- crates/mysten-network/src/multiaddr.rs | 18 ---------- crates/mysten-network/src/server.rs | 24 ------------- 3 files changed, 1 insertion(+), 90 deletions(-) diff --git a/crates/mysten-network/src/client.rs b/crates/mysten-network/src/client.rs index 1d7a1fafed231..3a213b2edc1dc 100644 --- a/crates/mysten-network/src/client.rs +++ b/crates/mysten-network/src/client.rs @@ -52,13 +52,6 @@ fn endpoint_from_multiaddr(addr: &Multiaddr) -> Result { let uri = format!("{http_or_https}://{socket_addr}"); MyEndpoint::try_from_uri(uri)? } - // Protocol::Memory(_) => todo!(), - #[cfg(unix)] - Protocol::Unix(_) => { - let (path, http_or_https) = crate::multiaddr::parse_unix(addr)?; - let uri = format!("{http_or_https}://localhost"); - MyEndpoint::try_from_uri(uri)?.with_uds_connector(path.as_ref().into()) - } unsupported => return Err(eyre!("unsupported protocol {unsupported}")), }; @@ -67,17 +60,11 @@ fn endpoint_from_multiaddr(addr: &Multiaddr) -> Result { struct MyEndpoint { endpoint: Endpoint, - #[cfg(unix)] - uds_connector: Option, } impl MyEndpoint { fn new(endpoint: Endpoint) -> Self { - Self { - endpoint, - #[cfg(unix)] - uds_connector: None, - } + Self { endpoint } } fn try_from_uri(uri: String) -> Result { @@ -88,50 +75,16 @@ impl MyEndpoint { Ok(Self::new(endpoint)) } - #[cfg(unix)] - fn with_uds_connector(self, path: std::path::PathBuf) -> Self { - Self { - endpoint: self.endpoint, - uds_connector: Some(path), - } - } - fn apply_config(mut self, config: &Config) -> Self { self.endpoint = apply_config_to_endpoint(config, self.endpoint); self } fn connect_lazy(self) -> Channel { - #[cfg(unix)] - if let Some(path) = self.uds_connector { - return self - .endpoint - .connect_with_connector_lazy(tower::service_fn(move |_: Uri| { - let path = path.clone(); - - // Connect to a Uds socket - tokio::net::UnixStream::connect(path) - })); - } - self.endpoint.connect_lazy() } async fn connect(self) -> Result { - #[cfg(unix)] - if let Some(path) = self.uds_connector { - return self - .endpoint - .connect_with_connector(tower::service_fn(move |_: Uri| { - let path = path.clone(); - - // Connect to a Uds socket - tokio::net::UnixStream::connect(path) - })) - .await - .map_err(Into::into); - } - self.endpoint.connect().await.map_err(Into::into) } } diff --git a/crates/mysten-network/src/multiaddr.rs b/crates/mysten-network/src/multiaddr.rs index 3137ee6a25222..181ec0deb0031 100644 --- a/crates/mysten-network/src/multiaddr.rs +++ b/crates/mysten-network/src/multiaddr.rs @@ -340,24 +340,6 @@ pub(crate) fn parse_ip6(address: &Multiaddr) -> Result<(SocketAddr, &'static str Ok((socket_addr, http_or_https)) } -// Parse a full /unix/-/{http,https} address -#[cfg(unix)] -pub(crate) fn parse_unix(address: &Multiaddr) -> Result<(Cow<'_, str>, &'static str)> { - let mut iter = address.iter(); - - let path = match iter - .next() - .ok_or_else(|| eyre!("unexpected end of multiaddr"))? - { - Protocol::Unix(path) => path, - other => return Err(eyre!("expected unix found {other}")), - }; - let http_or_https = parse_http_https(&mut iter)?; - parse_end(&mut iter)?; - - Ok((path, http_or_https)) -} - #[cfg(test)] mod test { use super::Multiaddr; diff --git a/crates/mysten-network/src/server.rs b/crates/mysten-network/src/server.rs index bbeb4d63d33c3..0a0d4ac70a7bc 100644 --- a/crates/mysten-network/src/server.rs +++ b/crates/mysten-network/src/server.rs @@ -193,19 +193,6 @@ impl ServerBuilder { ); (local_addr, server) } - // Protocol::Memory(_) => todo!(), - #[cfg(unix)] - Protocol::Unix(_) => { - let (path, _http_or_https) = crate::multiaddr::parse_unix(addr)?; - let uds = tokio::net::UnixListener::bind(path.as_ref())?; - let uds_stream = tokio_stream::wrappers::UnixListenerStream::new(uds); - let local_addr = addr.to_owned(); - let server = Box::pin( - self.router - .serve_with_incoming_shutdown(uds_stream, rx_cancellation), - ); - (local_addr, server) - } unsupported => return Err(eyre!("unsupported protocol {unsupported}")), }; @@ -456,17 +443,6 @@ mod test { let address: Multiaddr = "/ip6/::1/tcp/0/http".parse().unwrap(); test_multiaddr(address).await; } - - #[cfg(unix)] - #[tokio::test] - async fn unix() { - // Note that this only works when constructing a multiaddr by hand and not via the - // human-readable format - let path = "unix-domain-socket"; - let address = Multiaddr::new_internal(multiaddr::multiaddr!(Unix(path), Http)); - test_multiaddr(address).await; - std::fs::remove_file(path).unwrap(); - } } #[derive(Clone)] From 4092dbd56827a1d4419fbee31672a3dfbe9d9c91 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 25 Jul 2024 09:10:59 -0500 Subject: [PATCH 147/163] chore: update reqwest to 0.12 --- Cargo.lock | 952 ++++++++++++------ Cargo.toml | 21 +- crates/sui-analytics-indexer/Cargo.toml | 6 +- .../src/workers/archival.rs | 4 +- crates/sui-data-ingestion/src/workers/blob.rs | 4 +- crates/sui-graphql-rpc-client/src/lib.rs | 2 +- crates/sui-graphql-rpc-client/src/response.rs | 13 +- .../src/simple_client.rs | 9 +- crates/sui-graphql-rpc/src/server/builder.rs | 4 +- crates/sui-graphql-rpc/tests/e2e_tests.rs | 2 +- crates/sui-metric-checker/src/lib.rs | 6 +- crates/sui-node/src/metrics.rs | 3 +- crates/sui-oracle/Cargo.toml | 2 +- crates/sui-proxy/src/lib.rs | 6 +- crates/sui-rest-api/src/response.rs | 3 +- crates/sui-sdk/src/lib.rs | 3 +- crates/sui-security-watchdog/Cargo.toml | 4 +- .../sui-source-validation-service/Cargo.toml | 2 +- .../sui-storage/src/http_key_value_store.rs | 51 +- .../sui-storage/src/object_store/http/mod.rs | 2 + crates/sui-storage/src/object_store/mod.rs | 10 +- crates/sui-storage/src/object_store/util.rs | 6 +- crates/sui/src/client_commands.rs | 2 +- crates/suiop-cli/src/cli/lib/oauth/mod.rs | 2 +- 24 files changed, 706 insertions(+), 413 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd6f1b9432ab9..8ca737b463380 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,12 +169,12 @@ dependencies = [ "ed25519 1.5.3", "futures", "hex", - "http", + "http 0.2.9", "matchit 0.5.0", "pin-project-lite", "pkcs8 0.9.0", - "quinn", - "quinn-proto", + "quinn 0.10.1", + "quinn-proto 0.10.5", "rand 0.8.5", "rcgen", "ring 0.16.20", @@ -556,9 +556,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "arrow" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa285343fba4d829d49985bdc541e3789cf6000ed0e84be7c039438df4a4e78c" +checksum = "6127ea5e585a12ec9f742232442828ebaf264dfa5eefdd71282376c599562b77" dependencies = [ "arrow-arith", "arrow-array", @@ -577,9 +577,9 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "753abd0a5290c1bcade7c6623a556f7d1659c5f4148b140b5b63ce7bd1a45705" +checksum = "7add7f39210b7d726e2a8efc0083e7bf06e8f2d15bdb4896b564dce4410fbf5d" dependencies = [ "arrow-array", "arrow-buffer", @@ -592,9 +592,9 @@ dependencies = [ [[package]] name = "arrow-array" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d390feeb7f21b78ec997a4081a025baef1e2e0d6069e181939b61864c9779609" +checksum = "81c16ec702d3898c2f5cfdc148443c6cd7dbe5bac28399859eb0a3d38f072827" dependencies = [ "ahash 0.8.2", "arrow-buffer", @@ -608,9 +608,9 @@ dependencies = [ [[package]] name = "arrow-buffer" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69615b061701bcdffbc62756bc7e85c827d5290b472b580c972ebbbf690f5aa4" +checksum = "cae6970bab043c4fbc10aee1660ceb5b306d0c42c8cc5f6ae564efcd9759b663" dependencies = [ "bytes", "half 2.3.1", @@ -619,27 +619,29 @@ dependencies = [ [[package]] name = "arrow-cast" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e448e5dd2f4113bf5b74a1f26531708f5edcacc77335b7066f9398f4bcf4cdef" +checksum = "1c7ef44f26ef4f8edc392a048324ed5d757ad09135eff6d5509e6450d39e0398" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "arrow-select", - "base64 0.21.2", + "atoi", + "base64 0.22.1", "chrono", "half 2.3.1", "lexical-core", "num", + "ryu", ] [[package]] name = "arrow-csv" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46af72211f0712612f5b18325530b9ad1bfbdc87290d5fbfd32a7da128983781" +checksum = "5f843490bd258c5182b66e888161bb6f198f49f3792f7c7f98198b924ae0f564" dependencies = [ "arrow-array", "arrow-buffer", @@ -656,9 +658,9 @@ dependencies = [ [[package]] name = "arrow-data" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67d644b91a162f3ad3135ce1184d0a31c28b816a581e08f29e8e9277a574c64e" +checksum = "a769666ffac256dd301006faca1ca553d0ae7cffcf4cd07095f73f95eb226514" dependencies = [ "arrow-buffer", "arrow-schema", @@ -668,9 +670,9 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03dea5e79b48de6c2e04f03f62b0afea7105be7b77d134f6c5414868feefb80d" +checksum = "dbf9c3fb57390a1af0b7bb3b5558c1ee1f63905f3eccf49ae7676a8d1e6e5a72" dependencies = [ "arrow-array", "arrow-buffer", @@ -682,9 +684,9 @@ dependencies = [ [[package]] name = "arrow-json" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8950719280397a47d37ac01492e3506a8a724b3fb81001900b866637a829ee0f" +checksum = "654e7f3724176b66ddfacba31af397c48e106fbe4d281c8144e7d237df5acfd7" dependencies = [ "arrow-array", "arrow-buffer", @@ -702,9 +704,9 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed9630979034077982d8e74a942b7ac228f33dd93a93b615b4d02ad60c260be" +checksum = "e8008370e624e8e3c68174faaf793540287106cfda8ad1da862fdc53d8e096b4" dependencies = [ "arrow-array", "arrow-buffer", @@ -717,9 +719,9 @@ dependencies = [ [[package]] name = "arrow-row" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "007035e17ae09c4e8993e4cb8b5b96edf0afb927cd38e2dff27189b274d83dcf" +checksum = "ca5e3a6b7fda8d9fe03f3b18a2d946354ea7f3c8e4076dbdb502ad50d9d44824" dependencies = [ "ahash 0.8.2", "arrow-array", @@ -732,15 +734,15 @@ dependencies = [ [[package]] name = "arrow-schema" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ff3e9c01f7cd169379d269f926892d0e622a704960350d09d331be3ec9e0029" +checksum = "dab1c12b40e29d9f3b699e0203c2a73ba558444c05e388a4377208f8f9c97eee" [[package]] name = "arrow-select" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce20973c1912de6514348e064829e50947e35977bb9d7fb637dc99ea9ffd78c" +checksum = "e80159088ffe8c48965cb9b1a7c968b2729f29f37363df7eca177fc3281fe7c3" dependencies = [ "ahash 0.8.2", "arrow-array", @@ -752,15 +754,16 @@ dependencies = [ [[package]] name = "arrow-string" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f3b37f2aeece31a2636d1b037dabb69ef590e03bdc7eb68519b51ec86932a7" +checksum = "0fd04a6ea7de183648edbcb7a6dd925bbd04c210895f6384c780e27a9b54afcd" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "arrow-select", + "memchr", "num", "regex", "regex-syntax 0.8.2", @@ -831,7 +834,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" dependencies = [ - "brotli", + "brotli 3.3.4", "flate2", "futures-core", "memchr", @@ -872,7 +875,7 @@ dependencies = [ "futures-timer", "futures-util", "handlebars", - "http", + "http 0.2.9", "indexmap 2.2.6", "lru 0.7.8", "mime", @@ -1039,6 +1042,21 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atomic_float" version = "0.1.0" @@ -1108,8 +1126,8 @@ dependencies = [ "bytes", "fastrand 2.0.0", "hex", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "ring 0.16.20", "time", "tokio", @@ -1143,8 +1161,8 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http", - "http-body", + "http 0.2.9", + "http-body 0.4.5", "lazy_static", "percent-encoding", "pin-project-lite", @@ -1167,7 +1185,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "fastrand 2.0.0", - "http", + "http 0.2.9", "percent-encoding", "tracing", "uuid 1.2.2", @@ -1192,7 +1210,7 @@ dependencies = [ "aws-types", "bytes", "fastrand 2.0.0", - "http", + "http 0.2.9", "regex", "tokio-stream", "tracing", @@ -1218,7 +1236,7 @@ dependencies = [ "aws-smithy-xml", "aws-types", "fastrand 2.0.0", - "http", + "http 0.2.9", "regex", "tokio-stream", "tracing", @@ -1246,8 +1264,8 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", - "http", - "http-body", + "http 0.2.9", + "http-body 0.4.5", "once_cell", "percent-encoding", "regex", @@ -1274,7 +1292,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http", + "http 0.2.9", "regex", "tokio-stream", "tracing", @@ -1299,7 +1317,7 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "http", + "http 0.2.9", "regex", "tracing", ] @@ -1316,7 +1334,7 @@ dependencies = [ "form_urlencoded", "hex", "hmac 0.12.1", - "http", + "http 0.2.9", "once_cell", "percent-encoding", "regex", @@ -1349,9 +1367,9 @@ dependencies = [ "crc32c", "crc32fast", "hex", - "http", - "http-body", - "md-5 0.10.5", + "http 0.2.9", + "http-body 0.4.5", + "md-5 0.10.6", "pin-project-lite", "sha1", "sha2 0.10.6", @@ -1370,9 +1388,9 @@ dependencies = [ "aws-smithy-types", "bytes", "fastrand 2.0.0", - "http", - "http-body", - "hyper", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "hyper-rustls 0.24.0", "lazy_static", "pin-project-lite", @@ -1404,9 +1422,9 @@ dependencies = [ "bytes", "bytes-utils", "futures-core", - "http", - "http-body", - "hyper", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "once_cell", "percent-encoding", "pin-project-lite", @@ -1425,8 +1443,8 @@ dependencies = [ "aws-smithy-http", "aws-smithy-types", "bytes", - "http", - "http-body", + "http 0.2.9", + "http-body 0.4.5", "pin-project-lite", "tower", "tracing", @@ -1464,8 +1482,8 @@ dependencies = [ "aws-smithy-types", "bytes", "fastrand 2.0.0", - "http", - "http-body", + "http 0.2.9", + "http-body 0.4.5", "once_cell", "pin-project-lite", "pin-utils", @@ -1483,7 +1501,7 @@ dependencies = [ "aws-smithy-http", "aws-smithy-types", "bytes", - "http", + "http 0.2.9", "tokio", "tracing", ] @@ -1522,7 +1540,7 @@ dependencies = [ "aws-smithy-client", "aws-smithy-http", "aws-smithy-types", - "http", + "http 0.2.9", "rustc_version", "tracing", ] @@ -1540,9 +1558,9 @@ dependencies = [ "bytes", "futures-util", "headers", - "http", - "http-body", - "hyper", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "itoa", "matchit 0.7.0", "memchr", @@ -1555,7 +1573,7 @@ dependencies = [ "serde_path_to_error", "serde_urlencoded", "sha1", - "sync_wrapper", + "sync_wrapper 0.1.2", "tokio", "tokio-tungstenite", "tower", @@ -1572,8 +1590,8 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 0.2.9", + "http-body 0.4.5", "mime", "rustversion", "tower-layer", @@ -1589,7 +1607,7 @@ dependencies = [ "axum", "bytes", "futures-util", - "http", + "http 0.2.9", "mime", "pin-project-lite", "tokio", @@ -1608,12 +1626,12 @@ dependencies = [ "arc-swap", "bytes", "futures-util", - "http", - "http-body", - "hyper", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "pin-project-lite", "rustls 0.21.12", - "rustls-pemfile", + "rustls-pemfile 1.0.2", "tokio", "tokio-rustls 0.24.0", "tower-service", @@ -2052,7 +2070,18 @@ checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", - "brotli-decompressor", + "brotli-decompressor 2.3.2", +] + +[[package]] +name = "brotli" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor 4.0.1", ] [[package]] @@ -2065,6 +2094,16 @@ dependencies = [ "alloc-stdlib", ] +[[package]] +name = "brotli-decompressor" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bs58" version = "0.4.0" @@ -2317,9 +2356,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -2327,7 +2366,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.0", + "windows-targets 0.52.0", ] [[package]] @@ -2617,8 +2656,8 @@ dependencies = [ "enum_dispatch", "fastcrypto", "futures", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "hyper-rustls 0.24.0", "itertools 0.10.5", "mockall", @@ -2629,7 +2668,7 @@ dependencies = [ "parking_lot 0.12.1", "prometheus", "prost 0.12.3", - "quinn-proto", + "quinn-proto 0.10.5", "rand 0.8.5", "rstest", "rustls 0.21.12", @@ -2752,8 +2791,8 @@ dependencies = [ "chrono", "flate2", "futures-util", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "hyperlocal", "log", "mime", @@ -3696,8 +3735,8 @@ dependencies = [ "containers-api", "docker-api-stubs", "futures-util", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "log", "paste", "serde", @@ -3931,6 +3970,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", +] + [[package]] name = "enum-compat-util" version = "0.1.0" @@ -4172,7 +4223,7 @@ dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", "regex", - "reqwest", + "reqwest 0.11.20", "serde", "serde_json", "syn 1.0.107", @@ -4237,7 +4288,7 @@ checksum = "8920b59cf81e357df2c8102d6a9dc81c2d68f7409543ff3b6868851ecf007807" dependencies = [ "ethers-core", "getrandom 0.2.9", - "reqwest", + "reqwest 0.11.20", "semver 1.0.16", "serde", "serde_json", @@ -4262,7 +4313,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.20", "serde", "serde_json", "thiserror", @@ -4290,11 +4341,11 @@ dependencies = [ "getrandom 0.2.9", "hashers", "hex", - "http", + "http 0.2.9", "instant", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.20", "serde", "serde_json", "thiserror", @@ -4382,7 +4433,7 @@ dependencies = [ [[package]] name = "fastcrypto" version = "0.1.8" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=5f2c63266a065996d53f98156f0412782b468597#5f2c63266a065996d53f98156f0412782b468597" dependencies = [ "aes", "aes-gcm", @@ -4436,7 +4487,7 @@ dependencies = [ [[package]] name = "fastcrypto-derive" version = "0.1.3" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=5f2c63266a065996d53f98156f0412782b468597#5f2c63266a065996d53f98156f0412782b468597" dependencies = [ "quote 1.0.35", "syn 1.0.107", @@ -4445,7 +4496,7 @@ dependencies = [ [[package]] name = "fastcrypto-tbls" version = "0.1.0" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=5f2c63266a065996d53f98156f0412782b468597#5f2c63266a065996d53f98156f0412782b468597" dependencies = [ "bcs", "digest 0.10.7", @@ -4464,7 +4515,7 @@ dependencies = [ [[package]] name = "fastcrypto-vdf" version = "0.1.0" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=5f2c63266a065996d53f98156f0412782b468597#5f2c63266a065996d53f98156f0412782b468597" dependencies = [ "bcs", "fastcrypto", @@ -4481,7 +4532,7 @@ dependencies = [ [[package]] name = "fastcrypto-zkp" version = "0.1.3" -source = "git+https://github.com/MystenLabs/fastcrypto?rev=a3d5b18b7ca9370e099a7dbb25aca276af580608#a3d5b18b7ca9370e099a7dbb25aca276af580608" +source = "git+https://github.com/MystenLabs/fastcrypto?rev=5f2c63266a065996d53f98156f0412782b468597#5f2c63266a065996d53f98156f0412782b468597" dependencies = [ "ark-bls12-381", "ark-bn254", @@ -4503,7 +4554,7 @@ dependencies = [ "num-bigint 0.4.4", "once_cell", "regex", - "reqwest", + "reqwest 0.12.5", "schemars", "serde", "serde_json", @@ -4664,9 +4715,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flatbuffers" -version = "23.5.26" +version = "24.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dac53e22462d78c16d64a1cd22371b54cc3fe94aa15e7886a2fa6e5d1ab8640" +checksum = "8add37afff2d4ffa83bc748a70b4b1370984f6980768554182424ef71447c35f" dependencies = [ "bitflags 1.3.2", "rustc_version", @@ -4699,9 +4750,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -4881,10 +4932,10 @@ dependencies = [ "async-stream", "async-trait", "dyn-clone", - "hyper", + "hyper 0.14.26", "hyper-rustls 0.24.0", "log", - "reqwest", + "reqwest 0.11.20", "serde", "serde_json", "thiserror", @@ -5103,7 +5154,26 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.9", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", "indexmap 2.2.6", "slab", "tokio", @@ -5231,7 +5301,7 @@ dependencies = [ "bitflags 1.3.2", "bytes", "headers-core", - "http", + "http 0.2.9", "httpdate", "mime", "sha1", @@ -5243,7 +5313,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.9", ] [[package]] @@ -5348,6 +5418,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.5" @@ -5355,7 +5436,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http", + "http 0.2.9", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -5393,9 +5497,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.26", + "http 0.2.9", + "http-body 0.4.5", "httparse", "httpdate", "itoa", @@ -5407,17 +5511,37 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "log", "rustls 0.20.7", - "rustls-native-certs", + "rustls-native-certs 0.6.2", "tokio", "tokio-rustls 0.23.4", "webpki-roots 0.22.6", @@ -5429,28 +5553,67 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.2", "tokio", "tokio-rustls 0.24.0", "webpki-roots 0.23.1", ] +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "rustls 0.23.12", + "rustls-native-certs 0.7.1", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", + "webpki-roots 0.26.3", +] + [[package]] name = "hyper-timeout" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper", + "hyper 0.14.26", "pin-project-lite", "tokio", "tokio-io-timeout", ] +[[package]] +name = "hyper-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2 0.5.6", + "tokio", + "tower", + "tower-service", + "tracing", +] + [[package]] name = "hyperlocal" version = "0.8.0" @@ -5459,7 +5622,7 @@ checksum = "0fafdf7b2b2de7c9784f76e02c0935e65a8117ec3b768644379983ab333ac98c" dependencies = [ "futures-util", "hex", - "hyper", + "hyper 0.14.26", "pin-project", "tokio", ] @@ -5494,16 +5657,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -5828,6 +5981,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.5" @@ -5920,11 +6082,11 @@ version = "0.16.2" source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" dependencies = [ "futures-util", - "http", + "http 0.2.9", "jsonrpsee-core", "jsonrpsee-types", "pin-project", - "rustls-native-certs", + "rustls-native-certs 0.6.2", "soketto", "thiserror", "tokio", @@ -5948,7 +6110,7 @@ dependencies = [ "futures-timer", "futures-util", "globset", - "hyper", + "hyper 0.14.26", "jsonrpsee-types", "parking_lot 0.12.1", "rand 0.8.5", @@ -5967,7 +6129,7 @@ version = "0.16.2" source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" dependencies = [ "async-trait", - "hyper", + "hyper 0.14.26", "hyper-rustls 0.23.2", "jsonrpsee-core", "jsonrpsee-types", @@ -5998,8 +6160,8 @@ source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcd dependencies = [ "futures-channel", "futures-util", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "jsonrpsee-core", "jsonrpsee-types", "serde", @@ -6030,7 +6192,7 @@ name = "jsonrpsee-ws-client" version = "0.16.2" source = "git+https://github.com/wlmyng/jsonrpsee.git?rev=b1b300784795f6a64d0fcdf8f03081a9bc38bde8#b1b300784795f6a64d0fcdf8f03081a9bc38bde8" dependencies = [ - "http", + "http 0.2.9", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -6435,10 +6597,11 @@ dependencies = [ [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest 0.10.7", ] @@ -6450,9 +6613,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -7426,7 +7589,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http", + "http 0.2.9", "httparse", "log", "memchr", @@ -7542,7 +7705,7 @@ dependencies = [ "bytes", "eyre", "futures", - "http", + "http 0.2.9", "multiaddr", "pin-project-lite", "serde", @@ -7710,7 +7873,7 @@ dependencies = [ "narwhal-types", "parking_lot 0.12.1", "prometheus", - "quinn-proto", + "quinn-proto 0.10.5", "rand 0.8.5", "sui-macros", "tokio", @@ -7746,7 +7909,7 @@ dependencies = [ "pretty_assertions", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "serde-reflection", "serde_yaml 0.8.26", "sui-keys", @@ -7800,7 +7963,7 @@ dependencies = [ "prometheus", "proptest", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "sui-macros", "sui-protocol-config", "tap", @@ -7943,7 +8106,7 @@ dependencies = [ "narwhal-types", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "sui-protocol-config", "tap", "telemetry-subscribers", @@ -8381,54 +8544,26 @@ dependencies = [ [[package]] name = "object_store" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d359e231e5451f4f9fa889d56e3ce34f8724f1a61db2107739359717cf2bbf08" -dependencies = [ - "async-trait", - "base64 0.21.2", - "bytes", - "chrono", - "futures", - "humantime", - "hyper", - "itertools 0.10.5", - "parking_lot 0.12.1", - "percent-encoding", - "quick-xml 0.28.2", - "rand 0.8.5", - "reqwest", - "ring 0.16.20", - "rustls-pemfile", - "serde", - "serde_json", - "snafu", - "tokio", - "tracing", - "url", - "walkdir", -] - -[[package]] -name = "object_store" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d139f545f64630e2e3688fd9f81c470888ab01edeb72d13b4e86c566f1130000" +checksum = "e6da452820c715ce78221e8202ccc599b4a52f3e1eb3eedb487b680c81a8e3f3" dependencies = [ "async-trait", - "base64 0.21.2", + "base64 0.22.1", "bytes", "chrono", "futures", "humantime", - "hyper", - "itertools 0.12.0", + "hyper 1.4.1", + "itertools 0.13.0", + "md-5 0.10.6", "parking_lot 0.12.1", "percent-encoding", - "quick-xml 0.31.0", + "quick-xml", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "ring 0.17.3", + "rustls-pemfile 2.1.2", "serde", "serde_json", "snafu", @@ -8449,9 +8584,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -8546,7 +8681,7 @@ checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" dependencies = [ "async-trait", "futures-core", - "http", + "http 0.2.9", "opentelemetry-proto", "opentelemetry-semantic-conventions", "opentelemetry_api 0.20.0", @@ -8871,9 +9006,9 @@ dependencies = [ [[package]] name = "parquet" -version = "50.0.0" +version = "52.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547b92ebf0c1177e3892f44c8f79757ee62e678d564a9834189725f2c5b7a750" +checksum = "0f22ba0d95db56dde8685e3fadcb915cdaadda31ab8abbe3ff7f0ad1ef333267" dependencies = [ "ahash 0.8.2", "arrow-array", @@ -8883,8 +9018,8 @@ dependencies = [ "arrow-ipc", "arrow-schema", "arrow-select", - "base64 0.21.2", - "brotli", + "base64 0.22.1", + "brotli 6.0.0", "bytes", "chrono", "flate2", @@ -8899,6 +9034,7 @@ dependencies = [ "thrift", "twox-hash", "zstd 0.13.0", + "zstd-sys", ] [[package]] @@ -8923,7 +9059,7 @@ checksum = "f14d42b14749cc7927add34a9932b3b3cc5349a633384850baa67183061439dd" dependencies = [ "ciborium", "coset", - "idna 0.5.0", + "idna", "passkey-authenticator", "passkey-types", "public-suffix", @@ -9052,9 +9188,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -9546,13 +9682,14 @@ dependencies = [ [[package]] name = "prometheus-http-query" -version = "0.6.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7970fd6e91b5cb87e9a093657572a896d133879ced7752d2c7635beae29eaba0" +checksum = "0fcebfa99f03ae51220778316b37d24981e36322c82c24848f48c5bd0f64cbdb" dependencies = [ - "reqwest", + "enum-as-inner", + "mime", + "reqwest 0.12.5", "serde", - "serde_json", "time", "url", ] @@ -9751,37 +9888,44 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" dependencies = [ "memchr", "serde", ] [[package]] -name = "quick-xml" -version = "0.31.0" +name = "quinn" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "21252f1c0fc131f1b69182db8f34837e8a69737b8251dff75636a9be0518c324" dependencies = [ - "memchr", - "serde", + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto 0.10.5", + "quinn-udp 0.4.0", + "rustc-hash", + "rustls 0.21.12", + "thiserror", + "tokio", + "tracing", ] [[package]] name = "quinn" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21252f1c0fc131f1b69182db8f34837e8a69737b8251dff75636a9be0518c324" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", - "futures-io", "pin-project-lite", - "quinn-proto", - "quinn-udp", + "quinn-proto 0.11.3", + "quinn-udp 0.5.4", "rustc-hash", - "rustls 0.21.12", + "rustls 0.23.12", "thiserror", "tokio", "tracing", @@ -9804,6 +9948,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.17.3", + "rustc-hash", + "rustls 0.23.12", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + [[package]] name = "quinn-udp" version = "0.4.0" @@ -9817,6 +9978,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.6", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "0.6.13" @@ -10131,33 +10304,76 @@ version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "async-compression 0.4.6", "base64 0.21.2", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.26", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "hyper-rustls 0.24.0", "ipnet", "js-sys", "log", "mime", - "mime_guess", "once_cell", "percent-encoding", "pin-project-lite", "rustls 0.21.12", - "rustls-native-certs", - "rustls-pemfile", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-rustls 0.24.0", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.2", + "winreg 0.50.0", +] + +[[package]] +name = "reqwest" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +dependencies = [ + "async-compression 0.4.6", + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls 0.27.2", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn 0.11.2", + "rustls 0.23.12", + "rustls-native-certs 0.7.1", + "rustls-pemfile 2.1.2", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tokio-rustls 0.26.0", "tokio-util 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "tower-service", "url", @@ -10165,43 +10381,42 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.25.2", - "winreg", + "webpki-roots 0.26.3", + "winreg 0.52.0", ] [[package]] name = "reqwest-middleware" -version = "0.2.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a3e86aa6053e59030e7ce2d2a3b258dd08fc2d337d52f73f6cb480f5858690" +checksum = "39346a33ddfe6be00cbc17a34ce996818b97b230b87229f10114693becca1268" dependencies = [ "anyhow", "async-trait", - "http", - "reqwest", + "http 1.1.0", + "reqwest 0.12.5", "serde", - "task-local-extensions", "thiserror", + "tower-service", ] [[package]] name = "reqwest-retry" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af20b65c2ee9746cc575acb6bd28a05ffc0d15e25c992a8f4462d8686aacb4f" +checksum = "40f342894422862af74c50e1e9601cf0931accc9c6981e5eb413c46603b616b5" dependencies = [ "anyhow", "async-trait", "chrono", "futures", "getrandom 0.2.9", - "http", - "hyper", + "http 1.1.0", + "hyper 1.4.1", "parking_lot 0.11.2", - "reqwest", + "reqwest 0.12.5", "reqwest-middleware", "retry-policies", - "task-local-extensions", "tokio", "tracing", "wasm-timer", @@ -10209,9 +10424,9 @@ dependencies = [ [[package]] name = "retry-policies" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17dd00bff1d737c40dbcd47d4375281bf4c17933f9eef0a185fc7bacca23ecbd" +checksum = "493b4243e32d6eedd29f9a398896e35c6943a123b55eec97dcaee98310d25810" dependencies = [ "anyhow", "chrono", @@ -10409,8 +10624,8 @@ dependencies = [ "bytes", "crc32fast", "futures", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "hyper-rustls 0.23.2", "lazy_static", "log", @@ -10433,7 +10648,7 @@ dependencies = [ "chrono", "dirs-next", "futures", - "hyper", + "hyper 0.14.26", "serde", "serde_json", "shlex", @@ -10468,8 +10683,8 @@ dependencies = [ "futures", "hex", "hmac 0.11.0", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "log", "md-5 0.9.1", "percent-encoding", @@ -10673,6 +10888,20 @@ dependencies = [ "sct", ] +[[package]] +name = "rustls" +version = "0.23.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +dependencies = [ + "once_cell", + "ring 0.17.3", + "rustls-pki-types", + "rustls-webpki 0.102.6", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.2" @@ -10680,7 +10909,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.2", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -10694,6 +10936,22 @@ dependencies = [ "base64 0.21.2", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.100.3" @@ -10714,6 +10972,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +dependencies = [ + "ring 0.17.3", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.11" @@ -10769,9 +11038,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -11586,25 +11855,27 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snowflake-api" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e20db2ea77690628e34db7a6f63f539557195afbbc3cd349a8cbe293e1fffc" +checksum = "1c7f29746a86845a74953b3728029b378c9bac2fb15c2defd54a8177cabcc452" dependencies = [ "arrow", "async-trait", - "base64 0.21.2", + "base64 0.22.1", "bytes", "futures", + "glob", "log", - "object_store 0.9.0", + "object_store", "regex", - "reqwest", + "reqwest 0.12.5", "reqwest-middleware", "reqwest-retry", "serde", "serde_json", "snowflake-jwt", "thiserror", + "tokio", "url", "uuid 1.2.2", ] @@ -11653,7 +11924,7 @@ dependencies = [ "base64 0.13.1", "bytes", "futures", - "http", + "http 0.2.9", "httparse", "log", "rand 0.8.5", @@ -11845,7 +12116,7 @@ dependencies = [ "fastcrypto-zkp", "fs_extra", "futures", - "http", + "http 0.2.9", "im", "inquire", "insta", @@ -11865,7 +12136,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "regex", - "reqwest", + "reqwest 0.12.5", "rusoto_core", "rusoto_kms", "rustyline", @@ -12059,7 +12330,7 @@ dependencies = [ "move-core-types", "mysten-metrics", "num_enum 0.6.1", - "object_store 0.7.0", + "object_store", "parquet", "prometheus", "rocksdb", @@ -12115,7 +12386,7 @@ dependencies = [ "move-core-types", "move-package", "num_enum 0.6.1", - "object_store 0.7.0", + "object_store", "prometheus", "rand 0.8.5", "serde", @@ -12161,7 +12432,7 @@ dependencies = [ "narwhal-config", "prettytable-rs", "prometheus-parse", - "reqwest", + "reqwest 0.12.5", "russh", "russh-keys", "serde", @@ -12251,7 +12522,7 @@ dependencies = [ "once_cell", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "rocksdb", "serde", "serde_json", @@ -12286,7 +12557,7 @@ dependencies = [ "fastcrypto", "futures", "move-core-types", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "serde_with 3.8.1", @@ -12349,7 +12620,7 @@ dependencies = [ "move-core-types", "prometheus", "regex", - "reqwest", + "reqwest 0.12.5", "serde_json", "shared-crypto", "sui-config", @@ -12387,11 +12658,11 @@ dependencies = [ "fastcrypto", "insta", "narwhal-config", - "object_store 0.7.0", + "object_store", "once_cell", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "serde", "serde_with 3.8.1", "serde_yaml 0.8.26", @@ -12457,7 +12728,7 @@ dependencies = [ "nonempty", "num-bigint 0.4.4", "num_cpus", - "object_store 0.7.0", + "object_store", "once_cell", "parking_lot 0.12.1", "pprof", @@ -12465,7 +12736,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "rayon", - "reqwest", + "reqwest 0.12.5", "roaring", "rocksdb", "rstest", @@ -12551,7 +12822,7 @@ dependencies = [ "futures", "mysten-metrics", "notify", - "object_store 0.7.0", + "object_store", "prometheus", "rand 0.8.5", "serde", @@ -12579,7 +12850,7 @@ dependencies = [ "futures", "mysten-metrics", "notify", - "object_store 0.7.0", + "object_store", "prometheus", "rand 0.8.5", "serde", @@ -12724,7 +12995,7 @@ dependencies = [ "clap", "eyre", "futures", - "http", + "http 0.2.9", "mysten-metrics", "parking_lot 0.12.1", "prometheus", @@ -12875,8 +13146,8 @@ dependencies = [ "fastcrypto-zkp", "futures", "hex", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "im", "insta", "itertools 0.10.5", @@ -12893,7 +13164,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "regex", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "serde_with 3.8.1", @@ -12936,8 +13207,8 @@ version = "0.1.0" dependencies = [ "async-graphql", "axum", - "hyper", - "reqwest", + "hyper 0.14.26", + "reqwest 0.12.5", "serde_json", "sui-graphql-rpc-headers", "thiserror", @@ -13044,7 +13315,7 @@ dependencies = [ "eyre", "fastcrypto", "futures", - "hyper", + "hyper 0.14.26", "indexmap 2.2.6", "itertools 0.10.5", "jsonrpsee", @@ -13109,13 +13380,13 @@ dependencies = [ "anyhow", "async-trait", "bcs", - "hyper", + "hyper 0.14.26", "jsonrpsee", "move-core-types", "move-package", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "sui-config", "sui-core", "sui-json", @@ -13233,7 +13504,7 @@ dependencies = [ "humantime", "once_cell", "prometheus-http-query", - "reqwest", + "reqwest 0.12.5", "serde", "serde_yaml 0.9.21", "strum_macros 0.24.3", @@ -13462,7 +13733,7 @@ dependencies = [ "narwhal-network", "narwhal-worker", "prometheus", - "reqwest", + "reqwest 0.12.5", "serde", "snap", "sui-archival", @@ -13539,7 +13810,7 @@ dependencies = [ "once_cell", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "shared-crypto", @@ -13576,7 +13847,7 @@ dependencies = [ "async-trait", "bcs", "eyre", - "hyper", + "hyper 0.14.26", "insta", "lru 0.10.0", "move-binary-format", @@ -13640,8 +13911,8 @@ dependencies = [ "const-str", "fastcrypto", "hex", - "http-body", - "hyper", + "http-body 0.4.5", + "hyper 0.14.26", "ipnetwork", "itertools 0.10.5", "mime", @@ -13653,9 +13924,9 @@ dependencies = [ "prost-build", "protobuf", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "rustls 0.21.12", - "rustls-pemfile", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_with 3.8.1", @@ -13680,7 +13951,7 @@ dependencies = [ "bcs", "clap", "futures", - "http", + "http 0.2.9", "jsonrpsee", "lru 0.10.0", "move-binary-format", @@ -13734,7 +14005,7 @@ dependencies = [ "openapiv3", "prometheus", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "schemars", "serde", "serde_json", @@ -13761,12 +14032,12 @@ dependencies = [ "eyre", "fastcrypto", "futures", - "hyper", + "hyper 0.14.26", "move-core-types", "mysten-metrics", "once_cell", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "shared-crypto", @@ -13857,7 +14128,7 @@ dependencies = [ "jsonrpsee", "move-core-types", "rand 0.8.5", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "serde_with 3.8.1", @@ -13888,7 +14159,7 @@ dependencies = [ "lexical-util", "mysten-metrics", "prometheus", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "snowflake-api", @@ -13969,7 +14240,7 @@ dependencies = [ "indicatif", "integer-encoding", "num_enum 0.6.1", - "object_store 0.7.0", + "object_store", "prometheus", "serde", "serde_json", @@ -14025,7 +14296,7 @@ dependencies = [ "clap", "expect-test", "fs_extra", - "hyper", + "hyper 0.14.26", "jsonrpsee", "move-compiler", "move-core-types", @@ -14033,7 +14304,7 @@ dependencies = [ "move-symbol-pool", "mysten-metrics", "prometheus", - "reqwest", + "reqwest 0.12.5", "serde", "sui", "sui-json-rpc-types", @@ -14069,7 +14340,7 @@ dependencies = [ "eyre", "fastcrypto", "futures", - "hyper", + "hyper 0.14.26", "hyper-rustls 0.24.0", "indicatif", "integer-encoding", @@ -14081,13 +14352,13 @@ dependencies = [ "mysten-metrics", "num_cpus", "num_enum 0.6.1", - "object_store 0.7.0", + "object_store", "once_cell", "parking_lot 0.12.1", "percent-encoding", "pretty_assertions", "prometheus", - "reqwest", + "reqwest 0.12.5", "rocksdb", "serde", "serde_json", @@ -14194,7 +14465,7 @@ dependencies = [ name = "sui-telemetry" version = "0.1.0" dependencies = [ - "reqwest", + "reqwest 0.12.5", "serde", "sui-core", "tracing", @@ -14229,7 +14500,7 @@ dependencies = [ "pkcs8 0.9.0", "rand 0.8.5", "rcgen", - "reqwest", + "reqwest 0.12.5", "rustls 0.21.12", "rustls-webpki 0.101.7", "tokio", @@ -14261,7 +14532,7 @@ dependencies = [ "narwhal-storage", "narwhal-types", "num_cpus", - "object_store 0.7.0", + "object_store", "prometheus", "rocksdb", "ron", @@ -14545,7 +14816,7 @@ dependencies = [ "mysten-metrics", "mysten-service", "notify", - "object_store 0.7.0", + "object_store", "prometheus", "rand 0.8.5", "serde", @@ -14581,7 +14852,7 @@ dependencies = [ "prettytable-rs", "rand 0.8.5", "regex", - "reqwest", + "reqwest 0.12.5", "semver 1.0.16", "serde", "serde_json", @@ -14680,6 +14951,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -14782,15 +15059,6 @@ dependencies = [ "target-lexicon", ] -[[package]] -name = "task-local-extensions" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8" -dependencies = [ - "pin-utils", -] - [[package]] name = "telemetry-subscribers" version = "0.2.0" @@ -15200,6 +15468,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.12", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -15345,10 +15624,10 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.26", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "hyper-timeout", "percent-encoding", "pin-project", @@ -15372,10 +15651,10 @@ dependencies = [ "axum", "base64 0.21.2", "bytes", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.26", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "hyper-timeout", "percent-encoding", "pin-project", @@ -15399,10 +15678,10 @@ dependencies = [ "axum", "base64 0.21.2", "bytes", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.26", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.26", "hyper-timeout", "percent-encoding", "pin-project", @@ -15487,8 +15766,8 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http", - "http-body", + "http 0.2.9", + "http-body 0.4.5", "http-range-header", "httpdate", "iri-string", @@ -15719,7 +15998,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.9", "httparse", "log", "rand 0.8.5", @@ -15978,12 +16257,12 @@ dependencies = [ [[package]] name = "url" -version = "2.3.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna", "percent-encoding", "serde", ] @@ -16178,9 +16457,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -16219,9 +16498,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", @@ -16247,9 +16526,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -16289,6 +16568,15 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "webpki-roots" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "which" version = "4.3.0" @@ -16589,6 +16877,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -16711,14 +17009,14 @@ dependencies = [ "async-trait", "base64 0.13.1", "futures", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.26", "hyper-rustls 0.24.0", "itertools 0.10.5", "log", "percent-encoding", "rustls 0.21.12", - "rustls-pemfile", + "rustls-pemfile 1.0.2", "seahash", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 3d36fc9cd1de0..6d46fb2c803e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -237,7 +237,8 @@ opt-level = 1 # Dependencies that should be kept in sync through the whole workspace [workspace.dependencies] anyhow = "1.0.71" -arrow-array = "50.0.0" +arrow = "52" +arrow-array = "52" arc-swap = { version = "1.5.1", features = ["serde"] } assert_cmd = "2.0.6" async-graphql = "6.0.7" @@ -387,18 +388,18 @@ ntest = "0.9.0" num-bigint = "0.4.4" num_cpus = "1.15.0" num_enum = "0.6.1" -object_store = { version = "0.7", features = ["aws", "gcp", "azure", "http"] } +object_store = { version = "0.10", features = ["aws", "gcp", "azure", "http"] } once_cell = "1.18.0" ouroboros = "0.17" parking_lot = "0.12.1" -parquet = "50.0.0" +parquet = "52" pkcs8 = { version = "0.9.0", features = ["std"] } pprof = { version = "0.11.0", features = ["cpp", "frame-pointer"] } pretty_assertions = "1.3.0" prettytable-rs = "0.10.0" proc-macro2 = "1.0.47" prometheus = "0.13.3" -prometheus-http-query = { version = "0.6.6", default_features = false, features = [ +prometheus-http-query = { version = "0.8", default_features = false, features = [ "rustls-tls", ] } prometheus-parse = { git = "https://github.com/asonnino/prometheus-parser.git", rev = "75334db" } @@ -414,7 +415,7 @@ rand = "0.8.5" rayon = "1.5.3" rcgen = "0.9.2" regex = "1.7.1" -reqwest = { version = "0.11.20", default_features = false, features = [ +reqwest = { version = "0.12", default_features = false, features = [ "blocking", "json", "rustls-tls", @@ -465,6 +466,7 @@ similar = "2.4.0" slip10_ed25519 = "0.1.3" smallvec = "1.10.0" snap = "1.1.0" +snowflake-api = "0.9.0" static_assertions = "1.1.0" strum = { version = "0.24", features = ["derive"] } strum_macros = "0.24.3" @@ -506,7 +508,6 @@ tower-http = { version = "0.3.4", features = [ "set-header", "propagate-header", ] } -# tower-http = { version="0.4", features = ["trace"] } tower-layer = "0.3.2" twox-hash = "1.6.3" tracing = "0.1.37" @@ -565,10 +566,10 @@ move-abstract-interpreter = { path = "external-crates/move/crates/move-abstract- move-abstract-stack = { path = "external-crates/move/crates/move-abstract-stack" } move-analyzer = { path = "external-crates/move/crates/move-analyzer" } -fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608" } -fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608" } -fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608", package = "fastcrypto-zkp" } -fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a3d5b18b7ca9370e099a7dbb25aca276af580608", features = ["experimental"] } +fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" } +fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" } +fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", package = "fastcrypto-zkp" } +fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", features = ["experimental"] } passkey-types = { version = "0.2.0" } passkey-client = { version = "0.2.0" } passkey-authenticator = { version = "0.2.0" } diff --git a/crates/sui-analytics-indexer/Cargo.toml b/crates/sui-analytics-indexer/Cargo.toml index 64f0442575c9b..af30cd0811d6b 100644 --- a/crates/sui-analytics-indexer/Cargo.toml +++ b/crates/sui-analytics-indexer/Cargo.toml @@ -52,10 +52,10 @@ move-bytecode-utils.workspace = true sui-json-rpc-types.workspace = true sui-package-resolver.workspace = true simulacrum.workspace = true -arrow = { version = "50.0.0"} +arrow.workspace = true gcp-bigquery-client = "0.18.0" -snowflake-api = { version = "0.7.0" } -tap = { version = "1.0.1", features = [] } +snowflake-api.workspace = true +tap.workspace = true [dev-dependencies] diff --git a/crates/sui-data-ingestion/src/workers/archival.rs b/crates/sui-data-ingestion/src/workers/archival.rs index faf1fe76d5aec..a2692b6c3b4d6 100644 --- a/crates/sui-data-ingestion/src/workers/archival.rs +++ b/crates/sui-data-ingestion/src/workers/archival.rs @@ -118,7 +118,7 @@ impl ArchivalWorker { let bytes = finalize_manifest(manifest)?; self.remote_store - .put(&Path::from("MANIFEST"), bytes) + .put(&Path::from("MANIFEST"), bytes.into()) .await?; Ok(()) } @@ -133,7 +133,7 @@ impl ArchivalWorker { let mut cursor = Cursor::new(buffer); compress(&mut cursor, &mut compressed_buffer)?; self.remote_store - .put(&location, Bytes::from(compressed_buffer.clone())) + .put(&location, Bytes::from(compressed_buffer.clone()).into()) .await?; Ok(Bytes::from(compressed_buffer)) } diff --git a/crates/sui-data-ingestion/src/workers/blob.rs b/crates/sui-data-ingestion/src/workers/blob.rs index 24a1b546fee0b..f7367a8cf9b1e 100644 --- a/crates/sui-data-ingestion/src/workers/blob.rs +++ b/crates/sui-data-ingestion/src/workers/blob.rs @@ -38,7 +38,9 @@ impl Worker for BlobWorker { "{}.chk", checkpoint.checkpoint_summary.sequence_number )); - self.remote_store.put(&location, Bytes::from(bytes)).await?; + self.remote_store + .put(&location, Bytes::from(bytes).into()) + .await?; Ok(()) } } diff --git a/crates/sui-graphql-rpc-client/src/lib.rs b/crates/sui-graphql-rpc-client/src/lib.rs index d1615bb8a91b6..ad15df92712f7 100644 --- a/crates/sui-graphql-rpc-client/src/lib.rs +++ b/crates/sui-graphql-rpc-client/src/lib.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use async_graphql::Value; -use hyper::header::ToStrError; +use reqwest::header::ToStrError; use serde_json::Number; pub mod response; diff --git a/crates/sui-graphql-rpc-client/src/response.rs b/crates/sui-graphql-rpc-client/src/response.rs index 870c0d21f9dc1..807861111d967 100644 --- a/crates/sui-graphql-rpc-client/src/response.rs +++ b/crates/sui-graphql-rpc-client/src/response.rs @@ -3,8 +3,7 @@ use super::ClientError; use async_graphql::{Response, ServerError, Value}; -use axum::http::HeaderName; -use hyper::HeaderMap; +use reqwest::header::{HeaderMap, HeaderName}; use reqwest::Response as ReqwestResponse; use serde_json::json; use std::{collections::BTreeMap, net::SocketAddr}; @@ -14,8 +13,8 @@ use sui_graphql_rpc_headers::VERSION_HEADER; pub struct GraphqlResponse { headers: HeaderMap, remote_address: Option, - http_version: hyper::Version, - status: hyper::StatusCode, + http_version: reqwest::Version, + status: reqwest::StatusCode, full_response: Response, } @@ -39,7 +38,7 @@ impl GraphqlResponse { pub fn graphql_version(&self) -> Result { Ok(self .headers - .get(&VERSION_HEADER) + .get(VERSION_HEADER.as_str()) .ok_or(ClientError::ServiceVersionHeaderNotFound)? .to_str() .map_err(|e| ClientError::ServiceVersionHeaderValueInvalidString { error: e })? @@ -58,11 +57,11 @@ impl GraphqlResponse { serde_json::to_string_pretty(&self.full_response).unwrap() } - pub fn http_status(&self) -> hyper::StatusCode { + pub fn http_status(&self) -> reqwest::StatusCode { self.status } - pub fn http_version(&self) -> hyper::Version { + pub fn http_version(&self) -> reqwest::Version { self.http_version } diff --git a/crates/sui-graphql-rpc-client/src/simple_client.rs b/crates/sui-graphql-rpc-client/src/simple_client.rs index 3fcfc9117334b..6f7d2054e5f8e 100644 --- a/crates/sui-graphql-rpc-client/src/simple_client.rs +++ b/crates/sui-graphql-rpc-client/src/simple_client.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use crate::ClientError; -use axum::http::HeaderValue; -use hyper::header; +use reqwest::header; +use reqwest::header::HeaderValue; use reqwest::Response; use serde_json::Value; use std::collections::BTreeMap; @@ -52,7 +52,10 @@ impl SimpleClient { mut headers: Vec<(header::HeaderName, header::HeaderValue)>, ) -> Result { if get_usage { - headers.push((LIMITS_HEADER.clone(), HeaderValue::from_static("true"))); + headers.push(( + LIMITS_HEADER.clone().as_str().try_into().unwrap(), + HeaderValue::from_static("true"), + )); } GraphqlResponse::from_resp(self.execute_impl(query, variables, headers, false).await?).await } diff --git a/crates/sui-graphql-rpc/src/server/builder.rs b/crates/sui-graphql-rpc/src/server/builder.rs index b0afb65b57cd5..51fd2ada86411 100644 --- a/crates/sui-graphql-rpc/src/server/builder.rs +++ b/crates/sui-graphql-rpc/src/server/builder.rs @@ -1076,10 +1076,10 @@ pub mod tests { server_builder.build_schema(); let resp = reqwest::get(&url).await.unwrap(); - assert_eq!(resp.status(), StatusCode::OK); + assert_eq!(resp.status(), reqwest::StatusCode::OK); let url_with_param = format!("{}?max_checkpoint_lag_ms=1", url); let resp = reqwest::get(&url_with_param).await.unwrap(); - assert_eq!(resp.status(), StatusCode::GATEWAY_TIMEOUT); + assert_eq!(resp.status(), reqwest::StatusCode::GATEWAY_TIMEOUT); } } diff --git a/crates/sui-graphql-rpc/tests/e2e_tests.rs b/crates/sui-graphql-rpc/tests/e2e_tests.rs index b0c43867b68b2..ddb28fd7bf876 100644 --- a/crates/sui-graphql-rpc/tests/e2e_tests.rs +++ b/crates/sui-graphql-rpc/tests/e2e_tests.rs @@ -160,7 +160,7 @@ mod tests { .unwrap(); assert_eq!(res.http_status().as_u16(), 200); - assert_eq!(res.http_version(), hyper::Version::HTTP_11); + assert_eq!(res.http_version(), reqwest::Version::HTTP_11); assert!(res.graphql_version().unwrap().len() >= 5); assert!(res.errors().is_empty()); diff --git a/crates/sui-metric-checker/src/lib.rs b/crates/sui-metric-checker/src/lib.rs index d397870662085..b21296b589128 100644 --- a/crates/sui-metric-checker/src/lib.rs +++ b/crates/sui-metric-checker/src/lib.rs @@ -133,9 +133,9 @@ pub fn fails_threshold_condition( } fn unix_seconds_to_timestamp_string(unix_seconds: i64) -> String { - let datetime = NaiveDateTime::from_timestamp_opt(unix_seconds, 0); - let timestamp: DateTime = DateTime::from_naive_utc_and_offset(datetime.unwrap(), Utc); - timestamp.to_string() + DateTime::from_timestamp(unix_seconds, 0) + .unwrap() + .to_string() } #[cfg(test)] diff --git a/crates/sui-node/src/metrics.rs b/crates/sui-node/src/metrics.rs index bf51e21e089a3..7ea4b781b81a9 100644 --- a/crates/sui-node/src/metrics.rs +++ b/crates/sui-node/src/metrics.rs @@ -1,6 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use axum::http::header; use mysten_network::metrics::MetricsCallbackProvider; use prometheus::{ register_histogram_vec_with_registry, register_int_counter_vec_with_registry, @@ -105,7 +104,7 @@ pub fn start_metrics_push_task(config: &sui_config::NodeConfig, registry: Regist .client() .post(url.to_owned()) .header(reqwest::header::CONTENT_ENCODING, "snappy") - .header(header::CONTENT_TYPE, PROTOBUF_FORMAT) + .header(reqwest::header::CONTENT_TYPE, PROTOBUF_FORMAT) .body(compressed) .send() .await?; diff --git a/crates/sui-oracle/Cargo.toml b/crates/sui-oracle/Cargo.toml index 2be3fc99b2b31..4c616fa80ee74 100644 --- a/crates/sui-oracle/Cargo.toml +++ b/crates/sui-oracle/Cargo.toml @@ -13,7 +13,7 @@ prometheus = "0.13.3" tokio = { workspace = true, features = ["full"] } tracing = "0.1.36" once_cell.workspace = true -reqwest = { version = "0.11.13", default_features = false, features = ["blocking", "json", "rustls-tls"] } +reqwest.workspace = true serde = { version = "1.0.144", features = ["derive", "rc"] } serde_json = { version = "1.0.1" } jsonpath_lib = "0.3.0" diff --git a/crates/sui-proxy/src/lib.rs b/crates/sui-proxy/src/lib.rs index d32e8e6740c0d..c858b4568ef2d 100644 --- a/crates/sui-proxy/src/lib.rs +++ b/crates/sui-proxy/src/lib.rs @@ -40,7 +40,7 @@ mod tests { use crate::prom_to_mimir::tests::*; use crate::{admin::CertKeyPair, config::RemoteWriteConfig, peers::SuiNodeProvider}; - use axum::http::{header, StatusCode}; + use axum::http::StatusCode; use axum::routing::post; use axum::Router; use multiaddr::Multiaddr; @@ -170,7 +170,7 @@ mod tests { let res = client .post(&server_url) - .header(header::CONTENT_TYPE, PROTOBUF_FORMAT) + .header(reqwest::header::CONTENT_TYPE, PROTOBUF_FORMAT) .body(buf) .send() .await @@ -178,6 +178,6 @@ mod tests { let status = res.status(); let body = res.text().await.unwrap(); assert_eq!("created", body); - assert_eq!(status, StatusCode::CREATED); + assert_eq!(status, reqwest::StatusCode::CREATED); } } diff --git a/crates/sui-rest-api/src/response.rs b/crates/sui-rest-api/src/response.rs index a3548a762072b..deb57c8dd5dcf 100644 --- a/crates/sui-rest-api/src/response.rs +++ b/crates/sui-rest-api/src/response.rs @@ -3,10 +3,9 @@ use axum::{ extract::State, - http::HeaderMap, + http::{HeaderMap, StatusCode}, response::{IntoResponse, Response}, }; -use reqwest::StatusCode; use crate::{ content_type::ContentType, diff --git a/crates/sui-sdk/src/lib.rs b/crates/sui-sdk/src/lib.rs index 8841fb7d64d27..945a0e0ba5c86 100644 --- a/crates/sui-sdk/src/lib.rs +++ b/crates/sui-sdk/src/lib.rs @@ -222,7 +222,8 @@ impl SuiClientBuilder { let auth = base64::engine::general_purpose::STANDARD .encode(format!("{}:{}", username, password)); headers.insert( - reqwest::header::AUTHORIZATION, + "authorization", + // reqwest::header::AUTHORIZATION, HeaderValue::from_str(&format!("Basic {}", auth)).unwrap(), ); } diff --git a/crates/sui-security-watchdog/Cargo.toml b/crates/sui-security-watchdog/Cargo.toml index 94c4d88433f9c..5cd19eb5f2b9c 100644 --- a/crates/sui-security-watchdog/Cargo.toml +++ b/crates/sui-security-watchdog/Cargo.toml @@ -15,7 +15,7 @@ tokio.workspace = true tracing.workspace = true anyhow.workspace = true chrono.workspace = true -snowflake-api = { version = "0.7.0"} +snowflake-api.workspace = true tokio-cron-scheduler = "0.10.0" clap.workspace = true prometheus.workspace = true @@ -24,4 +24,4 @@ async-trait.workspace = true uuid.workspace = true lexical-util = "0.8.5" reqwest = { workspace = true, features = ["json"] } -env_logger = "0.11.3" \ No newline at end of file +env_logger = "0.11.3" diff --git a/crates/sui-source-validation-service/Cargo.toml b/crates/sui-source-validation-service/Cargo.toml index 67c8040864983..56b3b24c04e8b 100644 --- a/crates/sui-source-validation-service/Cargo.toml +++ b/crates/sui-source-validation-service/Cargo.toml @@ -45,7 +45,7 @@ tower-http.workspace = true [dev-dependencies] expect-test = "1.4.0" fs_extra = "1.3.0" -reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] } +reqwest.workspace = true sui.workspace = true sui-move = { workspace = true, features = ["all"] } diff --git a/crates/sui-storage/src/http_key_value_store.rs b/crates/sui-storage/src/http_key_value_store.rs index 5188c4128e016..9232bdfb1bc50 100644 --- a/crates/sui-storage/src/http_key_value_store.rs +++ b/crates/sui-storage/src/http_key_value_store.rs @@ -4,11 +4,9 @@ use async_trait::async_trait; use bytes::Bytes; use futures::stream::{self, StreamExt}; -use hyper::client::HttpConnector; -use hyper::header::{HeaderValue, CONTENT_LENGTH}; -use hyper::Client; -use hyper::Uri; -use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder}; +use reqwest::header::{HeaderValue, CONTENT_LENGTH}; +use reqwest::Client; +use reqwest::Url; use serde::{Deserialize, Serialize}; use std::str::FromStr; use std::sync::Arc; @@ -28,14 +26,13 @@ use sui_types::{ }; use tap::TapFallible; use tracing::{error, info, instrument, trace, warn}; -use url::Url; use crate::key_value_store::{TransactionKeyValueStore, TransactionKeyValueStoreTrait}; use crate::key_value_store_metrics::KeyValueStoreMetrics; pub struct HttpKVStore { base_url: Url, - client: Arc>>, + client: Client, } pub fn encode_digest>(digest: &T) -> String { @@ -126,15 +123,8 @@ impl HttpKVStore { pub fn new(base_url: &str) -> SuiResult { info!("creating HttpKVStore with base_url: {}", base_url); - let http = HttpsConnectorBuilder::new() - .with_webpki_roots() - .https_or_http() - .enable_http2() - .build(); - let client = Client::builder() - .http2_only(true) - .build::<_, hyper::Body>(http); + let client = Client::builder().http2_prior_knowledge().build().unwrap(); let base_url = if base_url.ends_with('/') { base_url.to_string() @@ -144,19 +134,16 @@ impl HttpKVStore { let base_url = Url::parse(&base_url).into_sui_result()?; - Ok(Self { - base_url, - client: Arc::new(client), - }) + Ok(Self { base_url, client }) } - fn get_url(&self, key: &Key) -> SuiResult { + fn get_url(&self, key: &Key) -> SuiResult { let (digest, item_type) = key_to_path_elements(key)?; let joined = self .base_url .join(&format!("{}/{}", digest, item_type)) .into_sui_result()?; - Uri::from_str(joined.as_str()).into_sui_result() + Url::from_str(joined.as_str()).into_sui_result() } async fn multi_fetch(&self, uris: Vec) -> Vec>> { @@ -165,18 +152,23 @@ impl HttpKVStore { uris_vec .into_iter() .enumerate() - .map(|(_i, uri)| self.fetch(uri)), + .map(|(_i, url)| self.fetch(url)), ); fetches.buffered(uris.len()).collect::>().await } async fn fetch(&self, key: Key) -> SuiResult> { - let uri = self.get_url(&key)?; - trace!("fetching uri: {}", uri); - let resp = self.client.get(uri.clone()).await.into_sui_result()?; + let url = self.get_url(&key)?; + trace!("fetching url: {}", url); + let resp = self + .client + .get(url.clone()) + .send() + .await + .into_sui_result()?; trace!( - "got response {} for uri: {}, len: {:?}", - uri, + "got response {} for url: {}, len: {:?}", + url, resp.status(), resp.headers() .get(CONTENT_LENGTH) @@ -184,10 +176,7 @@ impl HttpKVStore { ); // return None if 400 if resp.status().is_success() { - hyper::body::to_bytes(resp.into_body()) - .await - .map(Some) - .into_sui_result() + resp.bytes().await.map(Some).into_sui_result() } else { Ok(None) } diff --git a/crates/sui-storage/src/object_store/http/mod.rs b/crates/sui-storage/src/object_store/http/mod.rs index dfdd5ad97f084..280e8285e599b 100644 --- a/crates/sui-storage/src/object_store/http/mod.rs +++ b/crates/sui-storage/src/object_store/http/mod.rs @@ -90,6 +90,7 @@ async fn get( range: 0..meta.size, payload: GetResultPayload::Stream(stream), meta, + attributes: object_store::Attributes::new(), }) } @@ -118,6 +119,7 @@ fn header_meta(location: &Path, headers: &HeaderMap) -> Result { last_modified, size: content_length, e_tag: Some(e_tag.to_string()), + version: None, }) } diff --git a/crates/sui-storage/src/object_store/mod.rs b/crates/sui-storage/src/object_store/mod.rs index 60556c1ba7eb5..1ebfa595af66c 100644 --- a/crates/sui-storage/src/object_store/mod.rs +++ b/crates/sui-storage/src/object_store/mod.rs @@ -49,7 +49,7 @@ pub trait ObjectStoreListExt: Send + Sync + 'static { async fn list_objects( &self, src: Option<&Path>, - ) -> object_store::Result>>; + ) -> BoxStream<'_, object_store::Result>; } macro_rules! as_ref_list_ext_impl { @@ -59,7 +59,7 @@ macro_rules! as_ref_list_ext_impl { async fn list_objects( &self, src: Option<&Path>, - ) -> object_store::Result>> { + ) -> BoxStream<'_, object_store::Result> { self.as_ref().list_objects(src).await } } @@ -74,8 +74,8 @@ impl ObjectStoreListExt for Arc { async fn list_objects( &self, src: Option<&Path>, - ) -> object_store::Result>> { - self.list(src).await + ) -> BoxStream<'_, object_store::Result> { + self.list(src) } } @@ -102,7 +102,7 @@ as_ref_put_ext_impl!(Box); #[async_trait] impl ObjectStorePutExt for Arc { async fn put_bytes(&self, src: &Path, bytes: Bytes) -> Result<()> { - self.put(src, bytes).await?; + self.put(src, bytes.into()).await?; Ok(()) } } diff --git a/crates/sui-storage/src/object_store/util.rs b/crates/sui-storage/src/object_store/util.rs index 2954406fb8f3b..b672bf5ae2453 100644 --- a/crates/sui-storage/src/object_store/util.rs +++ b/crates/sui-storage/src/object_store/util.rs @@ -160,7 +160,7 @@ pub async fn copy_recursively Result> { let mut input_paths = vec![]; let mut output_paths = vec![]; - let mut paths = src_store.list_objects(Some(dir)).await?; + let mut paths = src_store.list_objects(Some(dir)).await; while let Some(res) = paths.next().await { if let Ok(object_metadata) = res { input_paths.push(object_metadata.location.clone()); @@ -207,7 +207,7 @@ pub async fn delete_recursively( concurrency: NonZeroUsize, ) -> Result> { let mut paths_to_delete = vec![]; - let mut paths = store.list_objects(Some(path)).await?; + let mut paths = store.list_objects(Some(path)).await; while let Some(res) = paths.next().await { if let Ok(object_metadata) = res { paths_to_delete.push(object_metadata.location); @@ -381,7 +381,7 @@ pub async fn write_snapshot_manifest( epoch_prefix: String, ) -> Result<()> { let mut file_names = vec![]; - let mut paths = store.list_objects(Some(dir)).await?; + let mut paths = store.list_objects(Some(dir)).await; while let Some(res) = paths.next().await { if let Ok(object_metadata) = res { // trim the "epoch_XX/" dir prefix here diff --git a/crates/sui/src/client_commands.rs b/crates/sui/src/client_commands.rs index 71804621752c2..09907f0941ede 100644 --- a/crates/sui/src/client_commands.rs +++ b/crates/sui/src/client_commands.rs @@ -18,7 +18,6 @@ use std::{ }; use anyhow::{anyhow, bail, ensure, Context}; -use axum::http::StatusCode; use bip32::DerivationPath; use clap::*; use colored::Colorize; @@ -26,6 +25,7 @@ use fastcrypto::{ encoding::{Base64, Encoding}, traits::ToFromBytes, }; +use reqwest::StatusCode; use move_binary_format::CompiledModule; use move_bytecode_verifier_meter::Scope; diff --git a/crates/suiop-cli/src/cli/lib/oauth/mod.rs b/crates/suiop-cli/src/cli/lib/oauth/mod.rs index db9c0a109b976..f33908e25c5f6 100644 --- a/crates/suiop-cli/src/cli/lib/oauth/mod.rs +++ b/crates/suiop-cli/src/cli/lib/oauth/mod.rs @@ -6,12 +6,12 @@ mod util; use std::net::SocketAddr; use anyhow::Result; -use axum::http::{HeaderMap, HeaderValue}; use axum::response::IntoResponse; use axum::{extract::Query, routing::get, Router}; use chrono; use dirs; use reqwest; +use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::fs::{self, File}; use std::io::{self, Read, Write}; From 255d868bfbe4776e1e99e59dfd207c50291a8485 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 25 Jul 2024 10:10:42 -0500 Subject: [PATCH 148/163] nextest: extend slow timeout to 5min --- .config/nextest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index 56d8cf0561154..757ed7769622b 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -8,7 +8,7 @@ fail-fast = false # Retry failing tests in order to not block builds on flaky tests retries = 5 # Timeout tests after 4 minutes -slow-timeout = { period = "60s", terminate-after = 4 } +slow-timeout = { period = "60s", terminate-after = 5 } [profile.narwhalnightly] # Print out output for failing tests as soon as they fail, and also at the end From 4e307674cf29944fca10a7b728e0c149e4eaf860 Mon Sep 17 00:00:00 2001 From: mwtian <81660174+mwtian@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:22:37 -0700 Subject: [PATCH 149/163] [Consensus] increase commit syncer fetch timeouts (#18793) ## Description Validators with limited network need larger timeout for the requests to succeed. In future, we will add support for partial results. ## Test plan n/a --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- consensus/core/src/commit_syncer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/core/src/commit_syncer.rs b/consensus/core/src/commit_syncer.rs index d55e123d462aa..6737561786168 100644 --- a/consensus/core/src/commit_syncer.rs +++ b/consensus/core/src/commit_syncer.rs @@ -330,8 +330,8 @@ impl CommitSyncer { fetch_state: Arc>, commit_range: CommitRange, ) -> ConsensusResult<(Vec, Vec)> { - const FETCH_COMMITS_TIMEOUT: Duration = Duration::from_secs(10); - const FETCH_BLOCKS_TIMEOUT: Duration = Duration::from_secs(60); + const FETCH_COMMITS_TIMEOUT: Duration = Duration::from_secs(30); + const FETCH_BLOCKS_TIMEOUT: Duration = Duration::from_secs(120); const FETCH_RETRY_BASE_INTERVAL: Duration = Duration::from_secs(1); const FETCH_RETRY_INTERVAL_LIMIT: u32 = 30; const MAX_RETRY_INTERVAL: Duration = Duration::from_secs(1); From c93dc8381cd572b6217260136e9d39bd4ce5cffa Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Thu, 25 Jul 2024 19:27:53 +0300 Subject: [PATCH 150/163] docs: fix spelling issues (#18799) Fix typos in docs. --- docs/content/concepts/sui-architecture/epochs.mdx | 2 +- docs/content/concepts/sui-architecture/sui-security.mdx | 2 +- .../sui-move-concepts/packages/automated-address-management.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/concepts/sui-architecture/epochs.mdx b/docs/content/concepts/sui-architecture/epochs.mdx index 379807da2fc96..9f11b6c4400c4 100644 --- a/docs/content/concepts/sui-architecture/epochs.mdx +++ b/docs/content/concepts/sui-architecture/epochs.mdx @@ -20,7 +20,7 @@ Reconfiguration is a critical process occurring at the end of each epoch. It inv - **Synchronous moment:** This is the only fully synchronous event in the network, crucial for maintaining consistency. 1. **Distribution of gas rewards** - Computation gas fees are distributed to the validator staking reward pool, from which stakers can withdraw. - - Storage fees are allocated to a storage fund, playing a vital role in the Sui tokenomics, as explaiend in [Tokenomics](../tokenomics.mdx). + - Storage fees are allocated to a storage fund, playing a vital role in the Sui tokenomics, as explained in [Tokenomics](../tokenomics.mdx). 1. **Validator set change** - Any pending staking and unstaking requests during the epoch are finalized and reflected in validators stake distribution. - Any pending validator change requests are also processed, including adding new validators and removing existing validators. This is the sole opportunity for altering the validator set and stake distribution. diff --git a/docs/content/concepts/sui-architecture/sui-security.mdx b/docs/content/concepts/sui-architecture/sui-security.mdx index fd343f7dee278..e788226835844 100644 --- a/docs/content/concepts/sui-architecture/sui-security.mdx +++ b/docs/content/concepts/sui-architecture/sui-security.mdx @@ -35,7 +35,7 @@ A private signature key also corresponds to a public address on the Sui network ### Smart contracts define asset types and their logic {#smart-contracts} -All assets have a type that is defined within a Sui Smart Contract. Sui provides a few system contracts, such as these used to manage the SUI native token, yet also allows anyone to write and submit custom smart contracts. A transaction on an asset type can call operations defined in only the smart contract that defined the asset type, and is constrained by the logic in the contract. +All assets have a type that is defined within a Sui Smart Contract. Sui provides a few system contracts, such as those used to manage the SUI native token, yet also allows anyone to write and submit custom smart contracts. A transaction on an asset type can call operations defined in only the smart contract that defined the asset type, and is constrained by the logic in the contract. For this reason, users are encouraged to operate on their assets using smart contracts they trust, that they or others they trust have audited, and understand the logic they define for operations on their assets. Sui smart contracts are defined as immutable assets to allow third parties to audit them and also prevent their modification to increase assurance. diff --git a/docs/content/concepts/sui-move-concepts/packages/automated-address-management.mdx b/docs/content/concepts/sui-move-concepts/packages/automated-address-management.mdx index a6d0a3e1327f8..212538facaf4e 100644 --- a/docs/content/concepts/sui-move-concepts/packages/automated-address-management.mdx +++ b/docs/content/concepts/sui-move-concepts/packages/automated-address-management.mdx @@ -24,7 +24,7 @@ Previously a `published-at` entry was **mandatory** in the `Move.toml` file, whi --latest-id 'LATEST-ADDRESS' \ --version-number 'VERSION-NUMBER' ``` - - `ORIGINAL-ADDRESS` should be the address your package was first published at. If you never upgraded your package, this the same address as your `published-at` address in the `Move.toml` + - `ORIGINAL-ADDRESS` should be the address your package was first published at. If you never upgraded your package, this is the same address as your `published-at` address in the `Move.toml` - `LATEST-ADDRESS` should be the latest package address. If you never upgraded your package, it is the same as `ORIGINAL-ADDRESS`. If you upgraded your package, this is the same address as your current `published-at` address in the `Move.toml`. - `VERSION-NUMBER` is `1` if you never upgraded your package. Otherwise, it is a number greater than `1` depending on how many times you upgraded your package. In this case, look up the package at `LATEST-ADDRESS` to determine the version number. 1. Delete the `published-at` line in your `Move.toml`. From 2c3c77490029c0ce05180be8e6fcc69fc5b03d9d Mon Sep 17 00:00:00 2001 From: Carry Wang Date: Fri, 26 Jul 2024 00:32:12 +0800 Subject: [PATCH 151/163] [Docs] Update utils.mdx (#18782) ## Description According to the function definition, the Docs description is backwards function `fromB64` receive `base64 string` return `Uint8Array` But in the description of the Docs it is the opposite : >`fromB64`: Serializes a Uint8Array to a base64 string image image ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- sdk/docs/pages/typescript/utils.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/docs/pages/typescript/utils.mdx b/sdk/docs/pages/typescript/utils.mdx index 105abc628f6a6..dc5d3ee155e76 100644 --- a/sdk/docs/pages/typescript/utils.mdx +++ b/sdk/docs/pages/typescript/utils.mdx @@ -43,7 +43,7 @@ case, or exists on chain). The following methods are re-exported to help with converting between commonly used encodings -- `fromHEX`: Serializes a Uint8Array to a hex string -- `toHEX`: Deserializes a hex string to a Uint8Array -- `fromB64`: Serializes a Uint8Array to a base64 string -- `toB64`: Deserializes a base64 string to a Uint8Array +- `fromHEX`: Deserializes a hex string to a Uint8Array +- `toHEX`: Serializes a Uint8Array to a hex string +- `fromB64`: Deserializes a base64 string to a Uint8Array +- `toB64`: Serializes a Uint8Array to a base64 string From aa291ae4b71d765beea93d2200ebcaabf35194ad Mon Sep 17 00:00:00 2001 From: Andrew Schran Date: Thu, 25 Jul 2024 14:13:46 -0400 Subject: [PATCH 152/163] Skip validator_tx_finalizer_e2e_tests in simtest-run.sh (#18801) Until timeout issues can be debugged. --- scripts/simtest/simtest-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simtest/simtest-run.sh b/scripts/simtest/simtest-run.sh index 013bfe4a9a216..36f22837df2bd 100755 --- a/scripts/simtest/simtest-run.sh +++ b/scripts/simtest/simtest-run.sh @@ -20,7 +20,7 @@ if [ -z "$NUM_CPUS" ]; then fi # filter out some tests that give spurious failures. -TEST_FILTER="(not test(~batch_verification_tests))" +TEST_FILTER="(not (test(~batch_verification_tests) | test(~validator_tx_finalizer_e2e_tests)))" DATE=$(date +%s) SEED="$DATE" From 69a9e6b17dc38a8f054dfc691cd4341243aae161 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 25 Jul 2024 14:39:14 -0500 Subject: [PATCH 153/163] chore: update anemo and quinn (#18800) --- Cargo.lock | 145 ++++++++---------- Cargo.toml | 17 +- .../core/src/network/connection_monitor.rs | 4 +- crates/sui-network/src/state_sync/server.rs | 4 +- narwhal/network/src/connectivity.rs | 4 +- scripts/simtest/cargo-simtest | 4 +- scripts/simtest/config-patch | 4 +- 7 files changed, 84 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ca737b463380..3d2e77e5b25e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,7 +160,7 @@ dependencies = [ [[package]] name = "anemo" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ "anyhow", "async-trait", @@ -169,17 +169,17 @@ dependencies = [ "ed25519 1.5.3", "futures", "hex", - "http 0.2.9", + "http 1.1.0", "matchit 0.5.0", "pin-project-lite", "pkcs8 0.9.0", - "quinn 0.10.1", - "quinn-proto 0.10.5", + "quinn", + "quinn-proto", "rand 0.8.5", - "rcgen", - "ring 0.16.20", - "rustls 0.21.12", - "rustls-webpki 0.101.7", + "rcgen 0.13.1", + "ring 0.17.3", + "rustls 0.23.12", + "rustls-webpki 0.102.6", "serde", "serde_json", "socket2 0.5.6", @@ -208,18 +208,18 @@ dependencies = [ [[package]] name = "anemo-build" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ - "prettyplease 0.1.25", + "prettyplease 0.2.17", "proc-macro2 1.0.78", "quote 1.0.35", - "syn 1.0.107", + "syn 2.0.48", ] [[package]] name = "anemo-cli" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ "anemo", "anemo-tower", @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "anemo-tower" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ "anemo", "bytes", @@ -1855,7 +1855,7 @@ dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.48", ] @@ -2668,7 +2668,7 @@ dependencies = [ "parking_lot 0.12.1", "prometheus", "prost 0.12.3", - "quinn-proto 0.10.5", + "quinn-proto", "rand 0.8.5", "rstest", "rustls 0.21.12", @@ -6114,7 +6114,7 @@ dependencies = [ "jsonrpsee-types", "parking_lot 0.12.1", "rand 0.8.5", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "soketto", @@ -6133,7 +6133,7 @@ dependencies = [ "hyper-rustls 0.23.2", "jsonrpsee-core", "jsonrpsee-types", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "thiserror", @@ -6205,7 +6205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.2", - "pem", + "pem 1.1.0", "ring 0.16.20", "serde", "serde_json", @@ -7543,7 +7543,7 @@ dependencies = [ [[package]] name = "msim" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=291cebe772727338f474a020e094b4ecb7ba1fe9#291cebe772727338f474a020e094b4ecb7ba1fe9" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=220f52a15804a768610ac0ae3b8da7de4a5c4d2b#220f52a15804a768610ac0ae3b8da7de4a5c4d2b" dependencies = [ "ahash 0.7.6", "async-task", @@ -7572,7 +7572,7 @@ dependencies = [ [[package]] name = "msim-macros" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=291cebe772727338f474a020e094b4ecb7ba1fe9#291cebe772727338f474a020e094b4ecb7ba1fe9" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=220f52a15804a768610ac0ae3b8da7de4a5c4d2b#220f52a15804a768610ac0ae3b8da7de4a5c4d2b" dependencies = [ "darling 0.14.2", "proc-macro2 1.0.78", @@ -7873,7 +7873,7 @@ dependencies = [ "narwhal-types", "parking_lot 0.12.1", "prometheus", - "quinn-proto 0.10.5", + "quinn-proto", "rand 0.8.5", "sui-macros", "tokio", @@ -9168,6 +9168,16 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64 0.22.1", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.6.0" @@ -9896,24 +9906,6 @@ dependencies = [ "serde", ] -[[package]] -name = "quinn" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21252f1c0fc131f1b69182db8f34837e8a69737b8251dff75636a9be0518c324" -dependencies = [ - "bytes", - "futures-io", - "pin-project-lite", - "quinn-proto 0.10.5", - "quinn-udp 0.4.0", - "rustc-hash", - "rustls 0.21.12", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "quinn" version = "0.11.2" @@ -9921,43 +9913,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", + "futures-io", "pin-project-lite", - "quinn-proto 0.11.3", - "quinn-udp 0.5.4", - "rustc-hash", + "quinn-proto", + "quinn-udp", + "rustc-hash 1.1.0", "rustls 0.23.12", "thiserror", "tokio", "tracing", ] -[[package]] -name = "quinn-proto" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" -dependencies = [ - "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.12", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - [[package]] name = "quinn-proto" version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +source = "git+https://github.com/quinn-rs/quinn.git?rev=f0fa66f871b80b9d2d7075d76967c649aecc0b77#f0fa66f871b80b9d2d7075d76967c649aecc0b77" dependencies = [ "bytes", "rand 0.8.5", "ring 0.17.3", - "rustc-hash", + "rustc-hash 2.0.0", "rustls 0.23.12", "slab", "thiserror", @@ -9965,19 +9940,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "quinn-udp" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6df19e284d93757a9fb91d63672f7741b129246a669db09d1c0063071debc0c0" -dependencies = [ - "bytes", - "libc", - "socket2 0.5.6", - "tracing", - "windows-sys 0.48.0", -] - [[package]] name = "quinn-udp" version = "0.5.4" @@ -10167,12 +10129,25 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ - "pem", + "pem 1.1.0", "ring 0.16.20", "time", "yasna", ] +[[package]] +name = "rcgen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" +dependencies = [ + "pem 3.0.4", + "ring 0.17.3", + "rustls-pki-types", + "time", + "yasna", +] + [[package]] name = "readonly" version = "0.2.3" @@ -10363,7 +10338,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn 0.11.2", + "quinn", "rustls 0.23.12", "rustls-native-certs 0.7.1", "rustls-pemfile 2.1.2", @@ -10799,6 +10774,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -14499,7 +14480,7 @@ dependencies = [ "fastcrypto", "pkcs8 0.9.0", "rand 0.8.5", - "rcgen", + "rcgen 0.9.3", "reqwest 0.12.5", "rustls 0.21.12", "rustls-webpki 0.101.7", @@ -15328,7 +15309,7 @@ dependencies = [ "once_cell", "pbkdf2 0.11.0", "rand 0.8.5", - "rustc-hash", + "rustc-hash 1.1.0", "sha2 0.10.6", "thiserror", "unicode-normalization", @@ -16015,7 +15996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -16990,9 +16971,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yasna" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ "bit-vec", "num-bigint 0.4.4", diff --git a/Cargo.toml b/Cargo.toml index 6d46fb2c803e0..eae984ca47082 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -377,8 +377,8 @@ moka = { version = "0.12", default-features = false, features = [ "atomic64", ] } more-asserts = "0.3.1" -msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9", package = "msim" } -msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9", package = "msim-macros" } +msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b", package = "msim" } +msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b", package = "msim-macros" } multiaddr = "0.17.0" nexlint = { git = "https://github.com/nextest-rs/nexlint.git", rev = "94da5c787636dad779c340affa65219134d127f5" } nexlint-lints = { git = "https://github.com/nextest-rs/nexlint.git", rev = "94da5c787636dad779c340affa65219134d127f5" } @@ -409,7 +409,7 @@ prost = "0.12.3" prost-build = "0.12.3" protobuf = { version = "2.28", features = ["with-bytes"] } protobuf-src = "1.1.0" -quinn-proto = "^0.10.5" +quinn-proto = "0.11" quote = "1.0.23" rand = "0.8.5" rayon = "1.5.3" @@ -577,10 +577,10 @@ coset = "0.3" p256 = { version = "0.13.2", features = ["ecdsa"] } # anemo dependencies -anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } -anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } -anemo-cli = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } -anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } +anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo-cli = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } # core-types with json format for REST api sui-sdk2 = { package = "sui-sdk", git = "https://github.com/mystenlabs/sui-rust-sdk.git", rev = "9a125ed5764fb5bcc1acb6074064bc8f9ea85b38", features = ["hash", "serde", "schemars"] } @@ -703,3 +703,6 @@ field_names = "0.2.0" semver = "1.0.16" spinners = "4.1.0" include_dir = "0.7.3" + +[patch.crates-io] +quinn-proto = { git = "https://github.com/quinn-rs/quinn.git", rev = "f0fa66f871b80b9d2d7075d76967c649aecc0b77" } diff --git a/consensus/core/src/network/connection_monitor.rs b/consensus/core/src/network/connection_monitor.rs index 2baa3f46044cf..928fc8b41a040 100644 --- a/consensus/core/src/network/connection_monitor.rs +++ b/consensus/core/src/network/connection_monitor.rs @@ -248,11 +248,11 @@ impl AnemoConnectionMonitor { self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, hostname, "transmitted"]) - .set(stats.udp_tx.transmits as i64); + .set(stats.udp_tx.ios as i64); self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, hostname, "received"]) - .set(stats.udp_rx.transmits as i64); + .set(stats.udp_rx.ios as i64); } } diff --git a/crates/sui-network/src/state_sync/server.rs b/crates/sui-network/src/state_sync/server.rs index 03288d04ba1db..f7e24b5a5202f 100644 --- a/crates/sui-network/src/state_sync/server.rs +++ b/crates/sui-network/src/state_sync/server.rs @@ -224,7 +224,9 @@ where struct SemaphoreExtension(OwnedSemaphorePermit); inner.call(req).await.map(move |mut response| { // Insert permit as extension so it's not dropped until the response is sent. - response.extensions_mut().insert(SemaphoreExtension(permit)); + response + .extensions_mut() + .insert(Arc::new(SemaphoreExtension(permit))); response }) }; diff --git a/narwhal/network/src/connectivity.rs b/narwhal/network/src/connectivity.rs index 1304840004c48..dbd9e9526f8bb 100644 --- a/narwhal/network/src/connectivity.rs +++ b/narwhal/network/src/connectivity.rs @@ -243,11 +243,11 @@ impl ConnectionMonitor { self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, "transmitted"]) - .set(stats.udp_tx.transmits as i64); + .set(stats.udp_tx.ios as i64); self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, "received"]) - .set(stats.udp_rx.transmits as i64); + .set(stats.udp_rx.ios as i64); } } diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index 836f5c71e6e0b..2c591c251d653 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -54,9 +54,9 @@ if [ -n "$LOCAL_MSIM_PATH" ]; then else cargo_patch_args=( --config 'patch.crates-io.tokio.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.tokio.rev = "291cebe772727338f474a020e094b4ecb7ba1fe9"' + --config 'patch.crates-io.tokio.rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b"' --config 'patch.crates-io.futures-timer.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.futures-timer.rev = "291cebe772727338f474a020e094b4ecb7ba1fe9"' + --config 'patch.crates-io.futures-timer.rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b"' ) fi diff --git a/scripts/simtest/config-patch b/scripts/simtest/config-patch index 97e158ea047a3..e4dfa3c59b31a 100644 --- a/scripts/simtest/config-patch +++ b/scripts/simtest/config-patch @@ -18,5 +18,5 @@ index c0829bc1b6..4007f97d66 100644 include_dir = "0.7.3" + +[patch.crates-io] -+tokio = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9" } -+futures-timer = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9" } ++tokio = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b" } ++futures-timer = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b" } From a4812b9c5c1a477d845ab692d2f0a87829ef76be Mon Sep 17 00:00:00 2001 From: phoenix <51927076+phoenix-o@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:57:50 -0500 Subject: [PATCH 154/163] [data ingestion] decrease batch size for analytics (#18804) --- crates/sui-analytics-indexer/src/main.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/sui-analytics-indexer/src/main.rs b/crates/sui-analytics-indexer/src/main.rs index 1f09fffc270ef..da0a888802301 100644 --- a/crates/sui-analytics-indexer/src/main.rs +++ b/crates/sui-analytics-indexer/src/main.rs @@ -8,7 +8,7 @@ use sui_analytics_indexer::{ analytics_metrics::AnalyticsMetrics, errors::AnalyticsIndexerError, make_analytics_processor, AnalyticsIndexerConfig, }; -use sui_data_ingestion_core::setup_single_workflow; +use sui_data_ingestion_core::{setup_single_workflow, ReaderOptions}; use tokio::signal; use tracing::info; @@ -37,8 +37,18 @@ async fn main() -> Result<()> { .map_err(|e| AnalyticsIndexerError::GenericError(e.to_string()))?; let watermark = processor.last_committed_checkpoint().unwrap_or_default() + 1; - let (executor, exit_sender) = - setup_single_workflow(processor, remote_store_url, watermark, 1, None).await?; + let reader_options = ReaderOptions { + batch_size: 10, + ..Default::default() + }; + let (executor, exit_sender) = setup_single_workflow( + processor, + remote_store_url, + watermark, + 1, + Some(reader_options), + ) + .await?; tokio::spawn(async { signal::ctrl_c() From d1efa1c976c49db00a47cadd08c1b17d97bdb7fd Mon Sep 17 00:00:00 2001 From: Anastasios Kichidis Date: Thu, 25 Jul 2024 22:29:22 +0100 Subject: [PATCH 155/163] [Consensus] refine logging & small timeout changes (#18795) ## Description * Increase timeout when waiting for consensus to start from `30s -> 60s`. Came across cases where commit recovery was taking a bit longer and might make sense to have a bit more tolerance. * Add more logs in consensus components and switch them to `info` - it's ok since those should be printed once per epoch * Make the consensus protocol choice log a `debug` . The method `get_consensus_protocol_in_epoch` is now being used from `get_max_accumulated_txn_cost_per_object_in_commit` which is called on every sequenced transaction leading to a very spammy log output: Screenshot 2024-07-25 at 11 37 09 ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- consensus/core/src/commit_observer.rs | 5 +++-- consensus/core/src/core.rs | 2 +- consensus/core/src/network/tonic_network.rs | 8 ++++++-- crates/sui-core/src/consensus_manager/mod.rs | 4 ++-- crates/sui-core/src/mysticeti_adapter.rs | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/consensus/core/src/commit_observer.rs b/consensus/core/src/commit_observer.rs index 652eb5af24604..34cf4871234f0 100644 --- a/consensus/core/src/commit_observer.rs +++ b/consensus/core/src/commit_observer.rs @@ -121,7 +121,7 @@ impl CommitObserver { .scan_commits(((last_processed_commit_index + 1)..=CommitIndex::MAX).into()) .expect("Scanning commits should not fail"); - debug!("Recovering commit observer after index {last_processed_commit_index} with last commit {:?} and {} unsent commits", last_commit, unsent_commits.len()); + info!("Recovering commit observer after index {last_processed_commit_index} with last commit {} and {} unsent commits", last_commit.map(|c|c.index()).unwrap_or_default(), unsent_commits.len()); // Resend all the committed subdags to the consensus output channel // for all the commits above the last processed index. @@ -144,6 +144,7 @@ impl CommitObserver { vec![] }; + info!("Sending commit {} during recovery", commit.index()); let committed_sub_dag = load_committed_subdag_from_store(self.store.as_ref(), commit, reputation_scores); self.sender.send(committed_sub_dag).unwrap_or_else(|e| { @@ -156,7 +157,7 @@ impl CommitObserver { last_sent_commit_index += 1; } - debug!( + info!( "Commit observer recovery completed, took {:?}", now.elapsed() ); diff --git a/consensus/core/src/core.rs b/consensus/core/src/core.rs index f58098551d214..f2c59a9a9f447 100644 --- a/consensus/core/src/core.rs +++ b/consensus/core/src/core.rs @@ -204,7 +204,7 @@ impl Core { .unwrap(); } - debug!( + info!( "Core recovery completed with last proposed block {:?}", self.last_proposed_block ); diff --git a/consensus/core/src/network/tonic_network.rs b/consensus/core/src/network/tonic_network.rs index b3a9a7d441f5f..b6c184c069e65 100644 --- a/consensus/core/src/network/tonic_network.rs +++ b/consensus/core/src/network/tonic_network.rs @@ -659,7 +659,7 @@ impl NetworkManager for TonicManager { .with_label_values(&["tonic"]) .set(1); - debug!("Starting tonic service"); + info!("Starting tonic service"); let authority = self.context.committee.authority(self.context.own_index); // Bind to localhost in unit tests since only local networking is needed. @@ -742,10 +742,14 @@ impl NetworkManager for TonicManager { }; } + info!("Binding tonic server to address {:?}", own_address); + // Create TcpListener via TCP socket. let socket = create_socket(&own_address); match socket.bind(own_address) { - Ok(_) => {} + Ok(_) => { + info!("Successfully bound tonic server to address {:?}", own_address) + } Err(e) => { warn!("Error binding to {own_address}: {e:?}"); tokio::time::sleep(Duration::from_secs(1)).await; diff --git a/crates/sui-core/src/consensus_manager/mod.rs b/crates/sui-core/src/consensus_manager/mod.rs index 1ce7606caba84..dd49d2ac768d3 100644 --- a/crates/sui-core/src/consensus_manager/mod.rs +++ b/crates/sui-core/src/consensus_manager/mod.rs @@ -25,7 +25,7 @@ use sui_types::error::SuiResult; use sui_types::messages_consensus::ConsensusTransaction; use tokio::sync::{Mutex, MutexGuard}; use tokio::time::{sleep, timeout}; -use tracing::info; +use tracing::{debug, info}; pub mod mysticeti_manager; pub mod narwhal_manager; @@ -170,7 +170,7 @@ impl ConsensusManager { return protocol; } _ => { - info!("Invalid consensus choice {} in env var. Continue to pick consensus with protocol config", consensus_choice); + debug!("Invalid consensus choice {} in env var. Continue to pick consensus with protocol config", consensus_choice); } }; } diff --git a/crates/sui-core/src/mysticeti_adapter.rs b/crates/sui-core/src/mysticeti_adapter.rs index a913ce74ada41..b3e1f9f8888d9 100644 --- a/crates/sui-core/src/mysticeti_adapter.rs +++ b/crates/sui-core/src/mysticeti_adapter.rs @@ -42,7 +42,7 @@ impl LazyMysticetiClient { // We expect this to get called during the SUI process start. After that at least one // object will have initialised and won't need to call again. - const MYSTICETI_START_TIMEOUT: Duration = Duration::from_secs(30); + const MYSTICETI_START_TIMEOUT: Duration = Duration::from_secs(60); const LOAD_RETRY_TIMEOUT: Duration = Duration::from_millis(100); if let Ok(client) = timeout(MYSTICETI_START_TIMEOUT, async { loop { From ec7527c73816979e3423ee8f38ec57090d1579d4 Mon Sep 17 00:00:00 2001 From: Lu Zhang <8418040+longbowlu@users.noreply.github.com> Date: Thu, 25 Jul 2024 14:34:21 -0700 Subject: [PATCH 156/163] [bridge cli] print data in json and print more data (#18742) ## Description 1. now you can use `--network testnet` to avoid having to provide proxy address 2. add more stuff to print functions, including nonces 3. print everything in json, for easier piped processing See offline nodes: ``` sui-bridge-cli view-sui-bridge --sui-rpc-url https://rpc.testnet.sui.io:443 --ping --hex | jq '.result.committee[] | select(.status == "offline")' ``` See eth nonce: ``` sui-bridge-cli view-eth-bridge --network testnet --eth-rpc-url https://ethereum-sepolia-rpc.publicnode.com ``` See sui nonce: ``` sui-bridge-cli view-sui-bridge --sui-rpc-url https://rpc.testnet.sui.io:443 --ping --hex | jq '.result.nonces' ``` ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-bridge-cli/src/lib.rs | 29 ++-- crates/sui-bridge-cli/src/main.rs | 263 +++++++++++++++++++++++------- crates/sui-bridge/src/types.rs | 2 +- crates/sui-bridge/src/utils.rs | 36 +++- 4 files changed, 262 insertions(+), 68 deletions(-) diff --git a/crates/sui-bridge-cli/src/lib.rs b/crates/sui-bridge-cli/src/lib.rs index 7ae635532094a..3cafe745d4c9b 100644 --- a/crates/sui-bridge-cli/src/lib.rs +++ b/crates/sui-bridge-cli/src/lib.rs @@ -42,6 +42,8 @@ use sui_types::transaction::{ObjectArg, Transaction, TransactionData}; use sui_types::{TypeTag, BRIDGE_PACKAGE_ID}; use tracing::info; +pub const SEPOLIA_BRIDGE_PROXY_ADDR: &str = "0xAE68F87938439afEEDd6552B0E83D2CbC2473623"; + #[derive(Parser)] #[clap(rename_all = "kebab-case")] pub struct Args { @@ -49,6 +51,11 @@ pub struct Args { pub command: BridgeCommand, } +#[derive(ValueEnum, Clone, Debug, PartialEq, Eq)] +pub enum Network { + Testnet, +} + #[derive(Parser)] #[clap(rename_all = "kebab-case")] pub enum BridgeCommand { @@ -88,23 +95,25 @@ pub enum BridgeCommand { #[clap(long = "dry-run")] dry_run: bool, }, - /// Given proxy address of SuiBridge contract, print other contract addresses - #[clap(name = "print-eth-bridge-addresses")] - PrintEthBridgeAddresses { + /// View current status of Eth bridge + #[clap(name = "view-eth-bridge")] + ViewEthBridge { + #[clap(long = "network")] + network: Option, #[clap(long = "bridge-proxy")] - bridge_proxy: EthAddress, + bridge_proxy: Option, #[clap(long = "eth-rpc-url")] eth_rpc_url: String, }, - /// Print current registration info - #[clap(name = "print-bridge-registration-info")] - PrintBridgeRegistrationInfo { + /// View current list of registered validators + #[clap(name = "view-bridge-registration")] + ViewBridgeRegistration { #[clap(long = "sui-rpc-url")] sui_rpc_url: String, }, - /// Print current committee info - #[clap(name = "print-bridge-committee-info")] - PrintBridgeCommitteeInfo { + /// View current status of Sui bridge + #[clap(name = "view-sui-bridge")] + ViewSuiBridge { #[clap(long = "sui-rpc-url")] sui_rpc_url: String, #[clap(long, default_value = "false")] diff --git a/crates/sui-bridge-cli/src/main.rs b/crates/sui-bridge-cli/src/main.rs index b82e783eb675e..9cc8a29015adc 100644 --- a/crates/sui-bridge-cli/src/main.rs +++ b/crates/sui-bridge-cli/src/main.rs @@ -3,11 +3,13 @@ use clap::*; use ethers::providers::Middleware; +use ethers::types::Address as EthAddress; use fastcrypto::encoding::{Encoding, Hex}; use shared_crypto::intent::Intent; use shared_crypto::intent::IntentMessage; use std::collections::HashMap; use std::str::from_utf8; +use std::str::FromStr; use std::sync::Arc; use std::time::Duration; use sui_bridge::client::bridge_authority_aggregator::BridgeAuthorityAggregator; @@ -15,18 +17,20 @@ use sui_bridge::crypto::{BridgeAuthorityPublicKey, BridgeAuthorityPublicKeyBytes use sui_bridge::eth_transaction_builder::build_eth_transaction; use sui_bridge::sui_client::SuiClient; use sui_bridge::sui_transaction_builder::build_sui_transaction; -use sui_bridge::utils::get_eth_contract_addresses; +use sui_bridge::types::BridgeActionType; use sui_bridge::utils::{ examine_key, generate_bridge_authority_key_and_write_to_file, generate_bridge_client_key_and_write_to_file, generate_bridge_node_config_and_write_to_file, }; +use sui_bridge::utils::{get_eth_contracts, EthBridgeContracts}; use sui_bridge_cli::{ make_action, select_contract_address, Args, BridgeCliConfig, BridgeCommand, - LoadedBridgeCliConfig, + LoadedBridgeCliConfig, Network, SEPOLIA_BRIDGE_PROXY_ADDR, }; use sui_config::Config; use sui_sdk::SuiClient as SuiSdkClient; use sui_sdk::SuiClientBuilder; +use sui_types::base_types::SuiAddress; use sui_types::bridge::BridgeChainId; use sui_types::bridge::{MoveTypeCommitteeMember, MoveTypeCommitteeMemberRegistration}; use sui_types::committee::TOTAL_VOTING_POWER; @@ -187,27 +191,88 @@ async fn main() -> anyhow::Result<()> { return Ok(()); } - BridgeCommand::PrintEthBridgeAddresses { + BridgeCommand::ViewEthBridge { + network, bridge_proxy, eth_rpc_url, } => { + let bridge_proxy = match network { + Some(Network::Testnet) => { + Ok(EthAddress::from_str(SEPOLIA_BRIDGE_PROXY_ADDR).unwrap()) + } + None => bridge_proxy.ok_or(anyhow::anyhow!( + "Network or bridge proxy address must be provided" + )), + }?; let provider = Arc::new( ethers::prelude::Provider::::try_from(eth_rpc_url) .unwrap() .interval(std::time::Duration::from_millis(2000)), ); let chain_id = provider.get_chainid().await?; - let (committee_address, limiter_address, vault_address, config_address) = - get_eth_contract_addresses(bridge_proxy, &provider).await?; - println!("Chain ID: {:?}", chain_id); - println!("Committee Proxy Address: {:?}", committee_address); - println!("Limiter Proxy Address: {:?}", limiter_address); - println!("Config Proxy Address: {:?}", config_address); - println!("Vault Address: {:?}", vault_address); + let EthBridgeContracts { + bridge, + committee, + limiter, + vault, + config, + } = get_eth_contracts(bridge_proxy, &provider).await?; + let message_type = BridgeActionType::EvmContractUpgrade as u8; + let bridge_upgrade_next_nonce: u64 = bridge.nonces(message_type).call().await?; + let committee_upgrade_next_nonce: u64 = committee.nonces(message_type).call().await?; + let limiter_upgrade_next_nonce: u64 = limiter.nonces(message_type).call().await?; + let config_upgrade_next_nonce: u64 = config.nonces(message_type).call().await?; + + let token_transfer_next_nonce: u64 = bridge + .nonces(BridgeActionType::TokenTransfer as u8) + .call() + .await?; + let blocklist_update_nonce: u64 = committee + .nonces(BridgeActionType::UpdateCommitteeBlocklist as u8) + .call() + .await?; + let emergency_button_nonce: u64 = bridge + .nonces(BridgeActionType::EmergencyButton as u8) + .call() + .await?; + let limit_update_nonce: u64 = limiter + .nonces(BridgeActionType::LimitUpdate as u8) + .call() + .await?; + let asset_price_update_nonce: u64 = config + .nonces(BridgeActionType::AssetPriceUpdate as u8) + .call() + .await?; + let add_tokens_nonce: u64 = config + .nonces(BridgeActionType::AddTokensOnEvm as u8) + .call() + .await?; + + let print = OutputEthBridge { + chain_id: chain_id.as_u64(), + bridge_proxy: bridge.address(), + committee_proxy: committee.address(), + limiter_proxy: limiter.address(), + config_proxy: config.address(), + vault: vault.address(), + nonces: Nonces { + token_transfer: token_transfer_next_nonce, + blocklist_update: blocklist_update_nonce, + emergency_button: emergency_button_nonce, + limit_update: limit_update_nonce, + asset_price_update: asset_price_update_nonce, + add_evm_tokens: add_tokens_nonce, + contract_upgrade_bridge: bridge_upgrade_next_nonce, + contract_upgrade_committee: committee_upgrade_next_nonce, + contract_upgrade_limiter: limiter_upgrade_next_nonce, + contract_upgrade_config: config_upgrade_next_nonce, + }, + }; + println!("{}", serde_json::to_string_pretty(&print).unwrap()); return Ok(()); } - BridgeCommand::PrintBridgeRegistrationInfo { sui_rpc_url } => { + BridgeCommand::ViewBridgeRegistration { sui_rpc_url } => { let sui_bridge_client = SuiClient::::new(&sui_rpc_url).await?; let bridge_summary = sui_bridge_client .get_bridge_summary() @@ -236,6 +301,7 @@ async fn main() -> anyhow::Result<()> { }) .collect::>(); let mut authorities = vec![]; + let mut output_wrapper = Output::::default(); for (_, member) in move_type_bridge_committee.member_registration { let MoveTypeCommitteeMemberRegistration { sui_address, @@ -243,18 +309,18 @@ async fn main() -> anyhow::Result<()> { http_rest_url, } = member; let Ok(pubkey) = BridgeAuthorityPublicKey::from_bytes(&bridge_pubkey_bytes) else { - println!( + output_wrapper.add_error(format!( "Invalid bridge pubkey for validator {}: {:?}", sui_address, bridge_pubkey_bytes - ); + )); continue; }; let eth_address = BridgeAuthorityPublicKeyBytes::from(&pubkey).to_eth_address(); let Ok(url) = from_utf8(&http_rest_url) else { - println!( + output_wrapper.add_error(format!( "Invalid bridge http url for validator: {}: {:?}", sui_address, http_rest_url - ); + )); continue; }; let url = url.to_string(); @@ -267,25 +333,27 @@ async fn main() -> anyhow::Result<()> { .iter() .map(|(_, _, _, _, _, stake)| **stake) .sum::(); - println!( - "Total registered stake: {}%", - total_stake as f32 / TOTAL_VOTING_POWER as f32 * 100.0 - ); - println!("Name, SuiAddress, EthAddress, Pubkey, URL, Stake"); + let mut output = OutputSuiBridgeRegistration { + total_registered_stake: total_stake as f32 / TOTAL_VOTING_POWER as f32 * 100.0, + ..Default::default() + }; for (name, sui_address, pubkey, eth_address, url, stake) in authorities { - println!( - "{}, {}, {}, {}, {}, {}", - name, + output.committee.push(OutputMember { + name: name.clone(), sui_address, eth_address, - Hex::encode(pubkey.as_bytes()), + pubkey: Hex::encode(pubkey.as_bytes()), url, - stake - ); + stake: *stake, + blocklisted: None, + status: None, + }); } + output_wrapper.inner = output; + println!("{}", serde_json::to_string_pretty(&output_wrapper).unwrap()); } - BridgeCommand::PrintBridgeCommitteeInfo { + BridgeCommand::ViewSuiBridge { sui_rpc_url, hex, ping, @@ -312,6 +380,7 @@ async fn main() -> anyhow::Result<()> { .timeout(Duration::from_secs(10)) .build() .unwrap(); + let mut output_wrapper = Output::::default(); for (_, member) in move_type_bridge_committee.members { let MoveTypeCommitteeMember { sui_address, @@ -321,18 +390,18 @@ async fn main() -> anyhow::Result<()> { blocklisted, } = member; let Ok(pubkey) = BridgeAuthorityPublicKey::from_bytes(&bridge_pubkey_bytes) else { - println!( + output_wrapper.add_error(format!( "Invalid bridge pubkey for validator {}: {:?}", sui_address, bridge_pubkey_bytes - ); + )); continue; }; let eth_address = BridgeAuthorityPublicKeyBytes::from(&pubkey).to_eth_address(); let Ok(url) = from_utf8(&http_rest_url) else { - println!( + output_wrapper.add_error(format!( "Invalid bridge http url for validator: {}: {:?}", sui_address, http_rest_url - ); + )); continue; }; let url = url.to_string(); @@ -356,10 +425,10 @@ async fn main() -> anyhow::Result<()> { .iter() .map(|(_, _, _, _, _, stake, _)| *stake) .sum::(); - println!( - "Total stake (static): {}%", - total_stake as f32 / TOTAL_VOTING_POWER as f32 * 100.0 - ); + let mut output = OutputSuiBridge { + total_stake: total_stake as f32 / TOTAL_VOTING_POWER as f32 * 100.0, + ..Default::default() + }; let ping_tasks_resp = if !ping_tasks.is_empty() { futures::future::join_all(ping_tasks) .await @@ -374,13 +443,6 @@ async fn main() -> anyhow::Result<()> { } else { vec![None; authorities.len()] }; - if ping { - println!( - "Name, SuiAddress, EthAddress, Pubkey, URL, Stake, Blocklisted, PingStatus" - ); - } else { - println!("Name, SuiAddress, EthAddress, Pubkey, URL, Stake, Blocklisted"); - } let mut total_online_stake = 0; for ((name, sui_address, pubkey, eth_address, url, stake, blocklisted), ping_resp) in authorities.into_iter().zip(ping_tasks_resp) @@ -395,30 +457,49 @@ async fn main() -> anyhow::Result<()> { if resp { total_online_stake += stake; } - println!( - "{}, {}, 0x{:x}, {}, {}, {}, {}, {}", - name, + output.committee.push(OutputMember { + name: name.clone(), sui_address, eth_address, pubkey, url, stake, - blocklisted, - if resp { "online" } else { "offline" } - ); + blocklisted: Some(blocklisted), + status: Some(if resp { + "online".to_string() + } else { + "offline".to_string() + }), + }); + } + None => { + output.committee.push(OutputMember { + name: name.clone(), + sui_address, + eth_address, + pubkey, + url, + stake, + blocklisted: Some(blocklisted), + status: None, + }); } - None => println!( - "{}, {}, 0x{:x}, {}, {}, {}, {}", - name, sui_address, eth_address, pubkey, url, stake, blocklisted - ), } } if ping { - println!( - "Total online stake (static): {}%", - total_online_stake as f32 / TOTAL_VOTING_POWER as f32 * 100.0 - ); + output.total_online_stake = + Some(total_online_stake as f32 / TOTAL_VOTING_POWER as f32 * 100.0); } + + // sequence nonces + for (type_, nonce) in bridge_summary.sequence_nums { + output + .nonces + .insert(BridgeActionType::try_from(type_).unwrap(), nonce); + } + + output_wrapper.inner = output; + println!("{}", serde_json::to_string_pretty(&output_wrapper).unwrap()); } BridgeCommand::Client { config_path, cmd } => { let config = BridgeCliConfig::load(config_path).expect("Couldn't load BridgeCliConfig"); @@ -431,3 +512,73 @@ async fn main() -> anyhow::Result<()> { Ok(()) } + +#[derive(serde::Serialize, Default)] +struct OutputEthBridge { + chain_id: u64, + bridge_proxy: EthAddress, + committee_proxy: EthAddress, + limiter_proxy: EthAddress, + config_proxy: EthAddress, + vault: EthAddress, + nonces: Nonces, +} + +#[derive(serde::Serialize, Default)] +struct Nonces { + token_transfer: u64, + blocklist_update: u64, + emergency_button: u64, + limit_update: u64, + asset_price_update: u64, + add_evm_tokens: u64, + contract_upgrade_bridge: u64, + contract_upgrade_committee: u64, + contract_upgrade_limiter: u64, + contract_upgrade_config: u64, +} + +#[derive(serde::Serialize, Default)] +struct Output { + #[serde(skip_serializing_if = "Option::is_none")] + errors: Option>, + inner: P, +} + +impl Output

{ + fn add_error(&mut self, error: String) { + if self.errors.is_none() { + self.errors = Some(vec![]); + } + self.errors.as_mut().unwrap().push(error); + } +} + +#[derive(serde::Serialize, Default)] +struct OutputSuiBridge { + total_stake: f32, + #[serde(skip_serializing_if = "Option::is_none")] + total_online_stake: Option, + committee: Vec, + nonces: HashMap, +} + +#[derive(serde::Serialize)] +struct OutputMember { + name: String, + sui_address: SuiAddress, + eth_address: EthAddress, + pubkey: String, + url: String, + stake: u64, + #[serde(skip_serializing_if = "Option::is_none")] + blocklisted: Option, + #[serde(skip_serializing_if = "Option::is_none")] + status: Option, +} + +#[derive(serde::Serialize, Default)] +struct OutputSuiBridgeRegistration { + total_registered_stake: f32, + committee: Vec, +} diff --git a/crates/sui-bridge/src/types.rs b/crates/sui-bridge/src/types.rs index 0d7c199e8965d..7bdd6bf92586e 100644 --- a/crates/sui-bridge/src/types.rs +++ b/crates/sui-bridge/src/types.rs @@ -169,7 +169,7 @@ impl CommitteeTrait for BridgeCommittee { } } -#[derive(Copy, Clone, PartialEq, Eq)] +#[derive(Serialize, Copy, Clone, PartialEq, Eq, TryFromPrimitive, Hash)] #[repr(u8)] pub enum BridgeActionType { TokenTransfer = 0, diff --git a/crates/sui-bridge/src/utils.rs b/crates/sui-bridge/src/utils.rs index a393da432e069..44b64890ba718 100644 --- a/crates/sui-bridge/src/utils.rs +++ b/crates/sui-bridge/src/utils.rs @@ -1,7 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use crate::abi::{EthBridgeCommittee, EthSuiBridge}; +use crate::abi::{ + EthBridgeCommittee, EthBridgeConfig, EthBridgeLimiter, EthBridgeVault, EthSuiBridge, +}; use crate::config::BridgeNodeConfig; use crate::config::EthConfig; use crate::config::SuiConfig; @@ -44,6 +46,14 @@ use sui_types::BRIDGE_PACKAGE_ID; pub type EthSigner = SignerMiddleware, Wallet>; +pub struct EthBridgeContracts

{ + pub bridge: EthSuiBridge>, + pub committee: EthBridgeCommittee>, + pub limiter: EthBridgeLimiter>, + pub vault: EthBridgeVault>, + pub config: EthBridgeConfig>, +} + /// Generate Bridge Authority key (Secp256k1KeyPair) and write to a file as base64 encoded `privkey`. pub fn generate_bridge_authority_key_and_write_to_file( path: &PathBuf, @@ -109,6 +119,30 @@ pub async fn get_eth_contract_addresses( + bridge_proxy_address: EthAddress, + provider: &Arc>, +) -> anyhow::Result> { + let sui_bridge = EthSuiBridge::new(bridge_proxy_address, provider.clone()); + let committee_address: EthAddress = sui_bridge.committee().call().await?; + let limiter_address: EthAddress = sui_bridge.limiter().call().await?; + let vault_address: EthAddress = sui_bridge.vault().call().await?; + let committee = EthBridgeCommittee::new(committee_address, provider.clone()); + let config_address: EthAddress = committee.config().call().await?; + + let limiter = EthBridgeLimiter::new(limiter_address, provider.clone()); + let vault = EthBridgeVault::new(vault_address, provider.clone()); + let config = EthBridgeConfig::new(config_address, provider.clone()); + Ok(EthBridgeContracts { + bridge: sui_bridge, + committee, + limiter, + vault, + config, + }) +} + /// Read bridge key from a file and print the corresponding information. /// If `is_validator_key` is true, the key must be a Secp256k1 key. pub fn examine_key(path: &PathBuf, is_validator_key: bool) -> Result<(), anyhow::Error> { From e2aab492da818c5960796919850a6768a0ebcd3c Mon Sep 17 00:00:00 2001 From: Cam Swords Date: Thu, 25 Jul 2024 16:49:39 -0700 Subject: [PATCH 157/163] [move][ide] Change parsing / expansion to report IDE suggestions for missing types (#18744) ## Description This modifies the parser to build `UnresolvedError` for types that don't parse, and then uses those during expansion to provide IDE alias information at those locations. ## Test plan New IDE tests, plus everything else still works as expected. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../src/expansion/path_expander.rs | 5 +- .../move-compiler/src/expansion/translate.rs | 18 ++- .../crates/move-compiler/src/parser/syntax.rs | 35 +++-- .../ide_mode/missing_type_suggestions.exp | 68 +++++++++ .../ide_mode/missing_type_suggestions.ide | 0 .../ide_mode/missing_type_suggestions.ide.exp | 142 ++++++++++++++++++ .../ide_mode/missing_type_suggestions.move | 13 ++ .../ide_mode/partial_type_suggestions.exp | 66 ++++++++ .../ide_mode/partial_type_suggestions.ide | 0 .../ide_mode/partial_type_suggestions.ide.exp | 141 +++++++++++++++++ .../ide_mode/partial_type_suggestions.move | 13 ++ 11 files changed, 483 insertions(+), 18 deletions(-) create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.move create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.ide create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.ide.exp create mode 100644 external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.move diff --git a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs index 31bd3a5af940a..d97869a4580c2 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/path_expander.rs @@ -50,9 +50,8 @@ pub enum Access { Module, // Just used for errors } -// This trait describes the commands available to handle alias scopes and expanding name access -// chains. This is used to model both legacy and modern path expansion. - +/// This trait describes the commands available to handle alias scopes and expanding name access +/// chains. This is used to model both legacy and modern path expansion. pub trait PathExpander { // Push a new innermost alias scope fn push_alias_scope( diff --git a/external-crates/move/crates/move-compiler/src/expansion/translate.rs b/external-crates/move/crates/move-compiler/src/expansion/translate.rs index bb3ee58ac946d..7d4230b6cf5cc 100644 --- a/external-crates/move/crates/move-compiler/src/expansion/translate.rs +++ b/external-crates/move/crates/move-compiler/src/expansion/translate.rs @@ -221,6 +221,18 @@ impl<'env, 'map> Context<'env, 'map> { .name_access_chain_to_module_ident(inner_context, chain) } + fn error_ide_autocomplete_suggestion(&mut self, loc: Loc) { + let Context { + path_expander, + defn_context: inner_context, + .. + } = self; + path_expander + .as_mut() + .unwrap() + .ide_autocomplete_suggestion(inner_context, loc) + } + pub fn spec_deprecated(&mut self, loc: Loc, is_error: bool) { let diag = self.spec_deprecated_diag(loc, is_error); self.env().add_diag(diag); @@ -2328,7 +2340,11 @@ fn type_(context: &mut Context, sp!(loc, pt_): P::Type) -> E::Type { let result = type_(context, *result); ET::Fun(args, Box::new(result)) } - PT::UnresolvedError => ET::UnresolvedError, + PT::UnresolvedError => { + // Treat an unresolved error as a leading access + context.error_ide_autocomplete_suggestion(loc); + ET::UnresolvedError + } }; sp(loc, t_) } diff --git a/external-crates/move/crates/move-compiler/src/parser/syntax.rs b/external-crates/move/crates/move-compiler/src/parser/syntax.rs index aec02f56d8f13..2e1f9d21e48ab 100644 --- a/external-crates/move/crates/move-compiler/src/parser/syntax.rs +++ b/external-crates/move/crates/move-compiler/src/parser/syntax.rs @@ -2941,21 +2941,28 @@ fn parse_type_( )); } _ => { - let tn = if whitespace_sensitive_ty_args { - parse_name_access_chain( - context, - /* macros */ false, - /* tyargs */ true, - || "a type name", - )? + if context.at_stop_set() { + context + .env + .add_diag(*unexpected_token_error(context.tokens, "a type name")); + Type_::UnresolvedError } else { - parse_name_access_chain_with_tyarg_whitespace( - context, - /* macros */ false, - || "a type name", - )? - }; - Type_::Apply(Box::new(tn)) + let tn = if whitespace_sensitive_ty_args { + parse_name_access_chain( + context, + /* macros */ false, + /* tyargs */ true, + || "a type name", + )? + } else { + parse_name_access_chain_with_tyarg_whitespace( + context, + /* macros */ false, + || "a type name", + )? + }; + Type_::Apply(Box::new(tn)) + } } }; let end_loc = context.tokens.previous_end_loc(); diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.exp new file mode 100644 index 0000000000000..575a7d1222305 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.exp @@ -0,0 +1,68 @@ +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:16 + │ +7 │ use a::m::{Self, S, A}; + │ ^^^^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:22 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'S'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:25 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'A'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:9:18 + │ +9 │ public fun p(a: + │ ^ Unused parameter 'a'. Consider removing or prefixing with an underscore: '_a' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ + 9 │ public fun p(a: + │ - To match this '(' +10 │ +11 │ public fun q(): + │ ^ Expected ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ +11 │ public fun q(): + │ ^^^^^^ + │ │ + │ Unexpected 'public' + │ Expected a type name + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected a type name + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:14:1 + │ +14 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected '{' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide.exp new file mode 100644 index 0000000000000..2d87fe58ca754 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide.exp @@ -0,0 +1,142 @@ +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:1:1 + │ +1 │ ╭ module a::m { +2 │ │ public struct S { x: T } +3 │ │ public struct A {} +4 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +warning[W09009]: unused struct field + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:2:26 + │ +2 │ public struct S { x: T } + │ ^ The 'x' field of the 'S' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:2:29 + │ +2 │ public struct S { x: T } + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:6:1 + │ + 6 │ ╭ module a::test { + 7 │ │ use a::m::{Self, S, A}; + 8 │ │ + 9 │ │ public fun p(a: +10 │ │ +11 │ │ public fun q(): +12 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:16 + │ +7 │ use a::m::{Self, S, A}; + │ ^^^^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:22 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'S'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:25 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'A'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:9:18 + │ +9 │ public fun p(a: + │ ^ Unused parameter 'a'. Consider removing or prefixing with an underscore: '_a' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ + 9 │ │ public fun p(a: + │ ╰───────────────────^ Possible in-scope names +10 │ +11 │ ╭ public fun q(): + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ + 9 │ public fun p(a: + │ - To match this '(' +10 │ +11 │ public fun q(): + │ ^ Expected ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ +11 │ public fun q(): + │ ^^^^^^ + │ │ + │ Unexpected 'public' + │ Expected a type name + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:16 + │ +11 │ public fun q(): + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected a type name + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:14:1 + │ +14 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected '{' + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.move b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.move new file mode 100644 index 0000000000000..9ac3018bfc162 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.move @@ -0,0 +1,13 @@ +module a::m { + public struct S { x: T } + public struct A {} +} + +module a::test { + use a::m::{Self, S, A}; + + public fun p(a: + + public fun q(): +} + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.exp new file mode 100644 index 0000000000000..e11b3a84f1d49 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.exp @@ -0,0 +1,66 @@ +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:7:16 + │ +7 │ use a::m::{Self, S, A}; + │ ^^^^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03008]: too few type arguments + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 + │ +9 │ public fun p(): vector' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:5 + │ +11 │ public fun q(x: S' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected ',' or ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:14:1 + │ +11 │ public fun q(x: S { x: T } +3 │ │ public struct A {} +4 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:2:29 + │ +2 │ public struct S { x: T } + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:6:1 + │ + 6 │ ╭ module a::test { + 7 │ │ use a::m::{Self, S, A}; + 8 │ │ + 9 │ │ public fun p(): vector a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:7:16 + │ +7 │ use a::m::{Self, S, A}; + │ ^^^^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 + │ +9 │ public fun p(): vector a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E03008]: too few type arguments + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 + │ +9 │ public fun p(): vector' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:5 + │ +11 │ public fun q(x: S a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:23 + │ +11 │ public fun q(x: S a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 + │ +11 │ public fun q(x: S' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected ',' or ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:14:1 + │ +11 │ public fun q(x: S { x: T } + public struct A {} +} + +module a::test { + use a::m::{Self, S, A}; + + public fun p(): vector Date: Thu, 25 Jul 2024 19:31:08 -0700 Subject: [PATCH 158/163] Sui version bump v1.30.0 --- ...00000000000000000000000000000000000000000001 | Bin 0 -> 11210 bytes ...00000000000000000000000000000000000000000002 | Bin 0 -> 66623 bytes ...00000000000000000000000000000000000000000003 | Bin 0 -> 41861 bytes ...0000000000000000000000000000000000000000000b | Bin 0 -> 19848 bytes ...0000000000000000000000000000000000000000dee9 | Bin 0 -> 33346 bytes crates/sui-framework-snapshot/manifest.json | 10 ++++++++++ 6 files changed, 10 insertions(+) create mode 100644 crates/sui-framework-snapshot/bytecode_snapshot/53/0x0000000000000000000000000000000000000000000000000000000000000001 create mode 100644 crates/sui-framework-snapshot/bytecode_snapshot/53/0x0000000000000000000000000000000000000000000000000000000000000002 create mode 100644 crates/sui-framework-snapshot/bytecode_snapshot/53/0x0000000000000000000000000000000000000000000000000000000000000003 create mode 100644 crates/sui-framework-snapshot/bytecode_snapshot/53/0x000000000000000000000000000000000000000000000000000000000000000b create mode 100644 crates/sui-framework-snapshot/bytecode_snapshot/53/0x000000000000000000000000000000000000000000000000000000000000dee9 diff --git a/crates/sui-framework-snapshot/bytecode_snapshot/53/0x0000000000000000000000000000000000000000000000000000000000000001 b/crates/sui-framework-snapshot/bytecode_snapshot/53/0x0000000000000000000000000000000000000000000000000000000000000001 new file mode 100644 index 0000000000000000000000000000000000000000..6aae601648984df646a52a28b178d6962f81f810 GIT binary patch literal 11210 zcmc&)TZ|mpSw7dgoO7zWYr5xZuifqO*x6my_V|{G6~WqTJDcnVRw4w%MXmNsjomOa zJ?ZZ8Wg~&YMN1S#V#z}wN{EO=5FoB1LMwzoc>wW{2cjhsmnV?O11}L065@gI{inKW zdfMZ)*ZZ(F)2B|Id!6(D-}(Ok6l3pr@tL3g?W6x`0~8846H){^3d33w9c{S}E2MJ9 z@gKyD8zFD452I1PbL+tJovPn&Jc8fNW+xZA}$Hl_l zu=9F8=)3K`tx<1x>j72JzJ#TWcVYPM62_r(bqG~z|hj*gko$mS0`Ae56a)Bb{%RJ(a6%r6HwDIAxD~wTuB8=h|=4rdTKIlJQ z@&2un|6-uWbZa)ebT-;(xnJggBQZVbWi0EYsQ5>qXel(7Qjl~DB_u>#BBE+FRZ|iM-tykME^JCrrcoU|OvEsZ*< ztd&^4#41`eFH;9gEKil7@yf=*HWDkXnnyF4RaPQ`mS~yf{A9Vshh(R%YE%;fs%L%V zJSrWy=6qWuCu#+435;7lRES<>m7jvdSwzI*Dr>7HgF!5y0ums&I&KZhvhW5vhm zg;&Kn$8~JQCBgn(mJ&KCV`rlEmis0CP4QS6OA?-lM93sbBqAzJlk~}DOzy2dfi7X$ z-#-z1nPKgxgz9C^4ih6Jzjwj;D2a;WxG|DW`6>y3e|pMAenqfd+1Vik^vT8-C4O~_iUCJ}kEmEC(HgnVCD^|8A5(3*d2T7jpv^)QKe zY^A4_7xv#%OIqv=W4(R*@p_x4JQb;sX_`tzl$5D_vel)%LGE362zsaHM|3h^Yq z$wodL4f+o{`S$MUf%ak4+u6wPclw(F3gm-P1f$z$1Y7ye?a`fRx4+xD1t&zjyEnY! zW5FQb?%&PBL4G$M4D)!{+qu1!kNP`mc(1!_Dd-eMg1hq8_PwEtZc=wGgl3n#}j~Nv2db#CK0P(Yu>?F zHGEl}FpMG}F;-NWB<#F;LQz;%Xo=RAWeHznDPQ9)<#cFR!f%-CMhg_M{AM*iG=Rd| zva6;VKwCH@&a|rpcmW2c{D-O9%xex$u~JMD$J(k zR-g&$mVK`R11KoW`9PZc>KA#ce~rJv!!L?|;n9D|R`BbpX}+#P`-e)nKUUwD$sa`` z{S&x~YHSX=jGkHQp(699xswEfi4T>gIQLQo`xbE%lKU)%uMF@Ilc6p=kjz9BZ$tzk zp(P=QU?UFLLD&QaGOkjB8=FvACsApL8Ib|Sp!wKmkVWu7|3MLhZ2JiLCO=FBZ_j;o{osE36 z3*TJ@K&}L!o&HWWa8$&wHnW(O!XRYw#lpXcA|FBymX;~Y z*64v&n;t&M*1#L+0jf+7Ex)T4PnNFDLXa5OXAUc0KTx>oOB2{;P~OYfmW_bYsYp9WEx`bQ?Yi)o zOJh8PL27tL#)G`fZioUV(?jyALA?YdLKid5LkiLR+z=QB9AwvN=!BV#Sw9%KM`91fg86%G-P`*A!sOeD!qU#M1wi;#em^uVU5^~z>6l4W>QJ_|XBqpPvPIaHrC~}m7q=vc{T`=0NxXWgMI5TzN z7oUwXgo`r>g_?yNh;)I%`aE*ymqd31NU z-s>qk^U?m`M^UYef)21_tA8&atapcbm9hsK=2H#;+%(TJI5ZibBvn9`0l=zp_`#Ks zmLLZQAH5BqI;LimIOk~^jj5n%6jOwS0SF)7HXiQXDq?PO%=AzV*Ng@aaNb14-vttq zj21{(#IQJkK_1}_r0@>1C^q0rmF~ zAO);=45A5Lt~0b69PA1>;xrt?n%Ip37zI{RS7}QfwSn(yWr7OLIR!Qn6kT~BkFe*~ zKoIM^d7XJIj{x*Fc7x&di6TVU1Tu3K+D;GHvun)q%&sW`wPABDP%CyO3sx{S#9s-a zL}ne>!J5YVCh7)ZKGg#CS_?G5j$3upzc~dSn-}53Hey8)xngJxZ|`Dyc^oET+n`oM z0dF^67VsHjZo_5uJmxk?l)=Q<055%=O-<^e?+T|z#DpUNUmd(+9BnX<)Rfxb9){^f zSASu}BW{4bVzqS&Xv|iBeg%Zu#z5NwVX0i5t!WRZOIWVVxEP}gQN|d|)TC=Dz>p&o zm}ps@G69y#SbYs%Bt8BlVX&H#j%Qs!6GNA@dVr=vn=G5*ubg|8Nce{#AonI~moa*4CA1?6@Kc`1&gm-VyD;j7!xTf7zg6aRqujELN4#dl@$ zJ&m(w+WoL!p=wC`9&B@n83iC2zzv!n6vMuPO@g)-9OBZRf^%uyAe6A9xe5vU<7>Uq zC%p+8-|CIP_wua`L$SgxbwJg^{2k__F{rk-`a8E_CU=m8->3HSo%NiK;RhoCW2ZZk zJNZ3{Of$UG+Z=Va^39RngXugf7Wt9kgq2IYu^<=}D=zGeV=9R`Qj%k?XaZoDR^o6H z94my%8f=lvFgsJkt4t?e#N-s0H)`3kI+pPGIy8Gi1q9X|Km!dR42~d6Bw1G>WMiBm zc0*9~5-1gH#aWNXk12;Eu~`qN@sIoVcoT5Op8Na}*BPT1ol zm}F_{Pr{xg>1P1YW%Wb)IiR6YnNpWvAj0mP&$zx)M#YrqFZ*g1$BX+-d_uoU#k1+M zH_)3$Y?&Q87XU$iO&6!)(nHi$T}ZTnnra2#gpv9k6}W#@za^9Z#qQdK|7wO< znCFWSD$f}g3*Es2&%?xI3(ydT?H44Gq^(98R9Db35y51UWVgf?0c>`NM1l-MtL9P! zNewk@ofMK9m?aA}MVq{d&O{ai;zWa(qZG3sq_Wl|hRA36LSw!$riI{#`^*ru42n9Y zgkF6?*Cv_am=zL#^SloPu3&Tf9I@bkB_Y(rB|X7}Lzd$5Ak!NYI$OBMI(wtdwJCB} z@H*qaT=8sgnyfWI*752W@dbW$1ZY=N5e=&>cM3uMZwJ=2(Xj zz(a`LB#Sfqwf6}feUMZPn)n-yOi}Q}6ploKF8VBHe9`=Rxs2oV0COu)BPQz70E7_L zqlX5|nqL2<^W|Z!f@@*J)@BVp4Q%k_Ac+g6KrU8_f+-L#QGIOtg>70qTy1y`6qgi= zHP@u4GchO>ND|8;Pd(<&6UG!?sH=??g-<82xu$>+eEk59Mm(pf7od9{G|yxqC=NSQ z0TK#Z?8EE~+(jXxI)NpUMF@2kSx~ZBPiyASRUEN_280dq?GJQc5S_}3ZWge2Q`br_ z#o$v4@P{cxg4WA1$dy*7^m8DH7zi4MI%GA>AL(0+eh6dgFttSjrAqOu;RjO1h^5e6 zWl9j2DBhoVAT3p1ZmXC^xQDPez#^(ei!Jw|I{=pAPCNf{6cXyo^C z8o76!S=z)knX#b&m_!s94iCJ835ruSR7ow;$d)9-kT!I9EctPd8D6(BtJVKR6h-Mm zIl%AukA&F&1U~EVPy%KEqcFfHF-6tF5{y3aU^oBa?si^I)f74;V~T%4aJNRe#XC-6Oc@Z49k9^v1?lVc>1|M!mavrR?asG}A^HN@oWNk652F z879;f!S4#53%)M+NbtVk1M;I67hY4{>i4(s;y7u-_gM7Bh`(Jp?{AkcQW5%8$=~ti z0Wh?j0L&ZNa0$o>_7D0XixPsr0#k*UM((&d?rLEK&90?zQr99^*YikA!`L~SrmpSk zwyy9wTBc7TJqeAQw@EtRcA3r8vyq$8t4Oz@b&J-fi)}Y!XVm4$HS`Z6-Gt69S(7fc zUBfoiOOb2pSCAfui92HB^hnz^ZBxA#xmo=aNRPtQ9ko$j{* zW5e{BwwtqaYRevng|?volAGgKqoBlrQ|f^^UOupEQ8VOicT9gecE{{7^(!b`@h8d@ z#Jb-g6A+~PP0B5ClX7Jnpzwt;_1s4cf3@-a;x01U7IBcEMvVd7gk39$}w_fgxI@D=s{ph1K8|0Eflusjxn2 zN|CmJPM%EQ%g3=p)VvPbSG_T@`B|VTU^n(=tULP-eN?@H$Blc_=naYuUZjn@2AMJ7 i4=2YVB+y1J{Zsvf2h zy=)39Dx2WKGQ$%=#K&b3K`s|WQB+ji5fl+Y<+`BWr|+^k@Ar?)Jm*w(b@y=J)$e`p zyQjM%BO)UsA|oUI@!!KRuK82bpEIB6{oBx`lxG^sQhBG?>m51nUl?$I$Q+5@ZAJ$9 z{27KKuq@lK+(7YPnSnC7+Hq3nn8j*sY3;)LMs0I*Vg1tL`PyZ_wp87$ES#Tc-K;IG zPtMGqpIE3ZZBXpd+D4&~M`~sH@-=%)7c4(5VfoT0`B}b-Bho`m!u9X{p0TsexCZzba?BWXN0ogl8BAao`2T08uM z1JNC6Kav@tJK@!;lQT0D^SR{u6g#4u`kJ!IenM+O7riP|4nPaeWTqM ze8?V%K5IX2X20&_jDUH|2jtJ|IVpP8;{mX_ifbHD;u@y z)AgKQxp?l*+U4-RjkUGq`_@)2ZfzFtyR^8vvZQm)UR=Mlwb@=-U4NvqaBgB@v9`r^ za$)iER&CQ?T-}_QoGMQ^ix($nrX8KxR;{hZWiHmvEvzraMcd9*E?m%0Hs^ZhHrBQt znV3~8)ize8^eXuv^lE|S*|%%%0==wlT&%2itV^#K)^)cRmN(We#I5zQxOszx`1Xo^ zho;-P^+(S)B_m00t;LU);#IPc^enDo&u*FZUbOLe{CbteB|S(oIO!z4%Jn+10`L$5 zA?y+#Hc**B`SO`fF8~NiC^N{gCX5yhQY2~;6&Pr^p%LSLIQvxM{ zRXXm-@{pghbzPy+qLhma zjLK+;Yy#v=X0kE}zB64p@hSz(d0uO`e`FxK+t;r`WAaV{v6XtVgTM0e{K#Z*4^D zMXuND#^xh^vaQf4@&)Lq%nG|cD~i%vdjF0f9U;D|ZP{&hmvVZByqgaDE63fRG2iS) zpYZ;RGHlb4FR0&^k0cwIVKHTRHNF+IlPPI2IlUlb@L$G(q$8hSxs~$w@Uir6#A<4qkYFe0%%YlEQZrRGQ&Tg`YIa=BPN>;QH9Mtdr`7C?nw?d%b85D%X6Myx zMa?d%*(EhwRkJlUyR7EM)!c-dn^bdCYHnK1&8WFqH8-c`%4%+2%~jOgqMBP$b5%80 zQ*+CzJg&+UsywO6Q>r|z$}_4wtIBh#Tvp|IRj#P=qAD+`a#fXUs=Tb`$JP9Vnx9nj zQ)+%%&CjU$Sv5bW=F4h+Ud>n3{Gys)Qu9?cUsLnTsxq!B6RI+)DpRU5ttvCBGOH?c zs!~>!c~z;X%A%?)sY+EngwY03N z`Z2u4)siHmPb;sy3}^ zGpaVLYICYqR<(ImtEk$dsx7HnRn=;$wyc)N)$)W|o>a?IYI#~M{DwLGVm%W8RE zEmzd?qFP>3%T={pQ_IV&Q@wmuzhKh(=UF-9gc(_p9RVF9fw|VOy~oLA?VJhXqE4En z>61pOY=rSnAWyYN%E^SbzyQNJx@%p54cfc3{ATwG$zJ7BFDLT z;)LAq;r?yIJh&$lsZiPbCcvrMCr)%kwsYe|MT(43mfP%aQ_i#Yc`q`bF#WfvT4vUus0ZW( ztt$#Z)_bQXFOV1Tn-ic~FxZ4$hrGaLv_cPjKZ4RRvjU^@8NQq4fFj!R=AmIaW?tid zAcdyhYiP|f-Hc#}AO;E0ePC+?^vSDKt3v2FmCdD<6>D*6Gl98*#*=hzp%IO-pZK1} z<1+f*CH7na(mDPXmL92WEIe9Sy;O5oYZuRLJz`y`Jmzld=JITCy3U0-?WYJ;hDe;{ z5tI6O-D~}1h_3Ym(hnr}^8-&_=hxU3;zbZ+2kcwyUm)kKf^v)ic@F!fRm>J;@8XV4 z(k@1Nat0HDal&ALIUseR{&*y0=WkNOHi1AepYjn8e^oV116B!IsIShrD6F zJ67hw$4;$*+dsCIsY0AQT3c8Fd007D+uU+$>uXDowCHeQYvlr2l?&?&7dA`F%<@MT z))t=&8nKW}`f#PXxd0ho*{W6DO;C{9MzF;Mjw|-SLQ@F@(9hW= z<;uVbxE93OHa=EI(<0OGl^qQRjb{!3VrB`epC^ zD*M%po&P5Av0LMAL-I+Oubvb3)kbw8c`lj%9h;X{ z7V2-6u9uZ+LGm{*Z*J8t#E;h@chicAr2Wb!w8+KUMotoq{_1-q^{b=_T~OxnHGWK^ zYyM1U;F|Y=D%UOHUblpI-4g!wO4!!*N*I~OMs(e>LSIb$kp2?)2qPn>;{ZS6Avb&j4ju8VEkI4sX5Yx`5QLC;pFaV$)Z!8zzv>g5ve;PPC0t@f2E!9>Y1=SN+m}MKRJ-?Q$>y~XP z4bgy13EU_p+_7zCa!DqzgGy_yNpcgEFRe76cpZ>%9llzFdu;i#RP+zNmv6QTSA=O}G66#~ zS#9-%rl441<(Q{t#!*3PbTsCiB~d~2yf8G68PHdJ$D_rpu;a=W=+xEj2;L=)%`vqz zmI7S_;pZ>Xvzg$Hbv%F-iu5Re!}c@K4?B}dViu`Zux%!BJhMe8T>u~;LlwZ z{e}D2D*K6yoBQpIpZ}wbZA4~|(ao+7T4^(vr8{sFky|hnI>V-Fx@j93+mTDJ?aC!b zQP1eJdC+DGgBRK`5;No#?SQZpMubkN*Fq*MGe5`??#UMjTk;?ft$EM^v&-yYTkkIr zs*okE+Ix7z&ZyN;11*t}DFkg{Thx|qvtdyd-GZBM3%jB&%k!;_5LCk3mQ|6V^E&2% zQ1IUbTjnaa>9+(9#lSELJ=T-su!{I*EU=78LRjQ1PDz6AZ!SqyHBhqNZ>Nb{|Z zUGf$#T-r)e7osls>+;IE1YOyIn51Y*vg$Op;?*7lgV|gtB-iJyY{7}Vyj~0RZMO5} zwOk`A%@sf}wspC4XU0NOOHoh}UE2b9h;ZuxG22lY8_cP8CH`VxT)S9Hk(f0-V(v!m z0<2k}hg`OGppfLPEHA{bVQ;QosO^9bjwVaf1$~w4brFunCf(p6Hsp7^!w##>w>mNg zn5|I~_)+YZ72g&)ffE2mBAcsS%nc+wkkBr|PY=~Rz#)WV4nUD@Jqp;yAO&~;h!H9n zX)!xL3InOG>5etag5{BR81d2&RA+J*CVbfj>eyzn1!jprr+f%1u%k>dr%7DDNX>N7 zu_;3hZW%(=$+O{IY`!f!XANqdc(<2m%PR{N?z|^Ox-KC9_*~1J7ie|3F7dq=K0g zRAHYr`@^RFD`v0rdGkLj@0IqSTmDzPHD z4n#ySXv2)xfp(GS-@rK6iHV~2u!C5=`7RP;xYI< zwzM5*5`zvmg%bCfQ$TNW2u+~=KN zsD0<9%4*oi*p%JEs;r*#fxeoM+Kr}7c8{hVAzFH*wsd}Bb8SNy9WlcLGPZhY9q}hU z-o8hewU~<%)*f450j;AaoA&a`>T3R64c1A$dz%1qZ)I~qz_hipxoJ@_Q}4DbF_60W z62FShTivqGuT-t`TbF~?wMsQ178_C7UW8+4UfgX1h`BV|P{owB7_$%Kaama1s^g1I z1gdpucDno0dX;xx*o7PLRFTK4Y#eF!u0p292H^~(1+R7u1X?K7?R!%&W7L!t$h=ne zuP4b49LaXNBBC?h20(pxp}EB7}kl z+q7U54pCN#Yhg@ffhkmioq192|h za-IfojDL|I_)=upzSG&y{^_4AmDpCiIN}C&;11h2CiN-y7J5ZSnEWw?{0s(wcj0{qhwOr;UR@bbMA(+**A+Z{*BhdbQdr)YFuog)F5!?p&Rrth zB~0(ifHUkv_Hlg|kS59Wt_(dNV935t-$mLXN$%>Td;~rPNqA>Q8~8-A%d=u)-Wc_e z+630|j^q^~dn2>h5kR{~Dy#B-sIdVs0iY{o_6+i-8DT+!!w=dShmQyF9t{kN%AK-E zf6PKq3YjZCPCp->+b|_%^BcJ8(}m<|7~s1;%?@Y`?`?ch`V14jqyA|+hV3B-qz4vx z2UTq6k9RPU!3T=A-R10&{=%ki;-52vgggcvXPbSi6imiPbLEZE9GnwoUl3&&IyZ6~ zgB4{PJ(8U|{xM74LMVcvT!t_ZjBVK7&wL9+ICL;xA1^YcRN&CxD3=L5u3-=bVbQSf z528}!hfyIag&{$)HS6agW3r)tx&tn0V?H{e*Oc;{{vbk!B9wJ(pMz%Pk*IY2XK2;7 zAH7<6J|Z%-Y#2&SJKNLm_9||tZ*xU+4sR;2ZllGNjo4bh;I-s~s&tK@jLKob&8R>l5lPANl1>Q~=iGhV5rc2>=Wd z#J~|S5V^TRIj|?4{n;N7D%A=~l5ZikU_<3Nq5!pGFOg-e%}+HpuGUdbuLK zeO|U0di2$KIp2_+XvqFPlbmdkro*V-&-N&y2%s^?96q@Zb)I4S)fzVcm`Q~Z8T+(I z^vz~AA7&YG=Lx>J8D^TQ$T*8(J`7|MM2si1!Q8PD8GEk~iZH|mX$L_>Oo>oP)`MWX zChY&et25`o++zX9y8Ti!a$afP?|s4ipy~f4?70uIQ-0j?qu;Xr%FMnO-6b1&Xp7MX z<-~rPh&HsG6>cavG6E;fz;Ip7tY`)MCDXHoXW`orFfcGg#V#)@D*=KK(}KG2P{hRg#7G-e;NGqX)g-{jGPP_Qv?PLlErOk*L-{Cr$R z8D8A>D&QJZ1%$2$eCw6in(nP9nGJGRz}ml2wrCg;p4U){gnM# zm3`8+b1(7i{L3IcEnz?NUNk8oD+-KD7L#TzBN9P33-+Pjb6kitC{K+Kg^*zAmIg9_ zEkG@3Smqp+Xqez-B`$QLVMe(;f^jG+VTB35SujieUq_&^BmvicwYg2#Co6!gMd%3v z23#*E2wTldmXEIEOkQDEK>erPnUC2>erI61sTM_G%$X&&>LxUijKFLUjain8IgbE@ zTFg$k+or51xvTcU;}VSpjaKR$mX?%{msWF|KstGzog#T2-m!v_G;6fQ9hTMRlK~@~ zEeOdI%qhYDk{qd+qS6t~GWT^pi%u3i>|J>}o0F&O?>R^%8CitJF_w#9D?W%*G3(he zN^Nn6>I8l8qn$V85#T-J#^VgL44w>e&iIFBjuSdTfmM2+X@9~TasJNyr1Cys|Gwq_ zpnu%`P5)Hz!x=YvZRUww_UAiT!K|sk+%HTlSnmuPRgUTv%%;FDDvh9v#Li}c|98s= zYZq=*r*J2`V1Fa`;w?Jpk+DaTJr=ufuLXZ;Sa#MClv<2_D{mNsR>3fatRk!`$OBka ztv~>)gz}Na##yr3ArvhLi59C9Fky88LoCDtMXSd!b&pi0cLH|QzCDE2-o9QymcveN zd%YQB&z=Fd-|n;foj#}E?Q{FRKCj>J^ZPS>nf{LDB|W-Z!!; zE0>(g$pvIUE&y7&+3DQ23d(VRq-I~= zpvokRx{|D^$s{s6?Zt)4akJ3ziN@X{co6DN zL#ULpvO&krxahbwX+8-n3cwDy9n?F@0N}sq2$y2Q7_Ga^ikS+_Kg`$Fc$qyYm_#Z4kWAt|5t33gX4Xla6u)Qw; zoSbp*gz*4@8CX+e?WliR6TWEU6?p^#Qy}$FbG5)|{cEcBtYp+H9;jD**R?8^oou+d zVqu=huc_ktc2=+ac)jxJYgH~=;z)Dl>5xSM)G3@qTCGNPCwFK zSp72PG%g|EdV0Gqp0ood^q-RFdjo5%hbdsXFHCdlbr0I3&S55pCp{7Ln8_hZFr)p< zIr?7=qbBAOsx*|wjiclYd$m51nQ^FBv%k4ohi3m(YIClv%}#1V z+_qb7ta;u(vhpwmbtPvfl=~JQIX&6O+|z0=v8V9uB=Uz+NHK& z_u5L-Hg=WT;PdSK3PDmEys6##)<$jPFu?@?!&wYqsanDq2CY{nl(PWecFIg{FJr^r zOUlTkF%^0p#?J9W=6*S$?Gy;wMKb+nV?)q%M^7PK)_3ODB!qO^n7@0w(|q# zTTSm>>c^G;3H!MFa_4aHK7hh6I&Sn)=c`usgBg|k5c;?u$tV~-U7`ZbMq-Mh7Y!pL zCG(=D@OC2du503)&EZ*2qa}lHw1knLOMCb^!m1LgphH8q;-8{2n4!V2J7!>n#!-ABz9g*)LcL_xP zA~rPi&l3xg>Oo(G0f+vGf2kS3B0Bj@GpVu5bTdfnFd;=F<%A(lO{qFE1x)7nH*8M?rajFLd*d*e6kfjPUxO$ZQJo0Exdz3BAEcT@n=0L`x1-~s=D3kezCIO zpeCK)R==mb$DPmE{?{@C?oR}-jDmNxm!kjL{~RTlikB=n1bGRf3_(ePVnC3Upfw~Im2xc+ zL5Bhyc0t@2of5R=2=++OjY^KuEDH05!_-qVH(BDe1SAyXZ!GHuKZ3Ktf zTi|T;vSXPU)N^>Xuu~HIh9x`@XB`~TcMkO(q~nG;+XM8UlV=Wg?C%)wIK1b;o`Zw? z2ge5w4;>gfGI=(+glr6QiNofnVBaPMnxA5-Q(QI)xx``f zQ^H7Y6iBL|P1!wU!?D>wWLwaCMO+O#iq7T(>T)`vv*PkF?Wi$*W8RZ;O20=}8rhOYq?qpRmei8&)IqWh<4K_roqVdhXOL{rym%U=C&eVU zG1B?w9F&LB!YdaaO{4TMjnd0BicVA-rPE;L$*`+juk75DzkJM+K%$SdxB{niJaC+<0ROGnQ;pRxMT z-`w)m=XZbQ>&N~v`0UWHekf3t=X|T}>}dA7NonIXpFi}R`@i$e&-w0m{{G`HAHBEs zZRbDrsUIJBfA`OSrt+ab{ZIFuox1CvT3TQG?GJzHo!{+zyM5?;)E#em&p-Z1@Tz^j zGkWCXg{S@M7oYzJUpsz-df(H+>hu5dcb^x&)7tlT=R;rlgBL#i6TdY0;SU7rWA;Z= z#=v!ZloXKN>wo|L_XyNSAf81n_x<>l^xnUI|L?x`U;X)y`)@zxyyG`IzW@FHPxL9pJ>HS;`sby&-*dix>l^;)!)?F( zhmYU=iI=_f>+k*4dp`TQx88l~J-=|v;SaU^;Y+^n?dvz^U;E;HU;LiGd87OFx7_>- zAAeW&%`bdy^tSJO|C4|Cz2EhYe;)eVAAQ^Jz3`2dk9_`U&o_G>c~br32MP!O;$wgK zhdUH-7rP?`i)`Zs@I6&x3#VFjj2C?U zpZ~{aE{(lltMh*A8^7_4pZK+|U%vav5542lr}q3@Z~xD~{vB^MU*xsjyZ3F?58rtC zHP1iufit&$X6eo!IsX@Tys+}6XaDvu-u8pT|MzEp)J+#gpXKUv-Qk#7z@@%?{udFE#xbb4R#*|)v-W%~~N)Yrb@xQl0g^Hu&ojvUGV zT*!03R=ti{w?gRo) zvpDAY7~F6}#IxNVHw|ZFEY(-`yg7 zAEa?;_rRh88>Uy0f`1Qzh4NiSb3>^TIxtgqG&hqTpd{pFq)%AZ@enx(F4G+0D#lOH zCs!K=){~yL46G-8Z5vomX0&af?-pVC=sw}%NGh|X`EsCyw^c8UusKe`s>qZh&9I^) zHXRA1YmsJ8k>fOSK+~lHo}g=4&3CFNb4plD^<-WNH>sX1s68aJZV?qn-L-DjC-)H) z(zT-MZ!X-T21wGhOVgorrd18bIbI`YD1Ib1*(j;u=46{1X->AQz0JuEwU1Y%7e3R+_kvi_a&MF1(uv)_pV<`C% z>$|i6#kO-FwNbc2fRaN_g#L*rgF)qJfr;3cS*Uq2A;m7zVdh5Yx;li|44}K}iAI^} zi%N=_$un8a7PO`idq&uiSpgDI&xM|KT^Cz4m_jJ2XwH#Hr9_;HO&0P}9ha!&Aznq1 zONf2$$7W(WuEo(p0f>>9&VfKUscpm?wp;%FHEbKfx*Pf^iNckasEpKAN5l>Z-6^aV zm$tMX{jS#GC{c+Sx3#wT+*ENY7OncYR$ExCESY`hs*!Ol<`m<@!R_ zp2%5pXj_G-C~wyT3DK}q8lqbKD6_$MiN#T`1RKrLcJk1G%*e z7gn~!Io#^nIozR$_Rv<1FP(njU91_RX0H{y*)Uw|OLDJCU&tA_PFYHeN?{PI)`{|( zIIZ9z3-#|J_DrcZd9fk0Z4vRWX3ykd|0iXHqpKCzM6}u_U+Nvr?m%Dx`Bv2B>@9io z_xLX}j|abIy3uc$li4TPvP7SSr^Rp@{*V4B1i}GC6B7=I$YqmphXnx7O7tOE!io8e z_0Yy@?7b$V-3csQ+E@*=Q-h0}mE~GnBicmRCN?8(Yzt!X$aRM5x@(BFfEASPKD^IF zF%hFVY+p&}Z8;fW*_0i$_miMxPz5ZuG`-~5Z$iFLpF8|l+0GtETJs5 zXA{xg6mJfWSZZF^kD%ZO#t+ri3IW^*z$2?=10~vS=S}9bysw(?H~n{6$K9_0x?h6r z>JK2Ue1-i{mHniva=*=2XhRvNolm88#{?bF(g_QXfas#&yFl1W1$qpE0+Z7+kWLVa zYPkiY7d2M=e@ID`WC(qRfORPb>!w{`fK1fx3B?1UfgT#63Pll76(a7cVvfN@e_ItH zh_k+f;U9@_M3HM2~ zZxBTA5KJbWO3k&NUR!#gw&kbFvpT{Ku(=J=J6a7kc8i3u>!v40Q!CZS!sLpyVar7a zx3;mxd_@OG3f0wT#hyy`3tMuVb#M~P*Hlp?vxy`DHzaEpwO*~>7O-AgT0koB@2EDy zB)1qD*t7EWt>g7ok!%H6A{xgv1d-)Lrj8e|=mhi|1F4=~3g%BE5TGJoj8_5i>>wKa zvx~$Egdty2HUqu0*cwHZ7Uql-z%4!h*oGSH`$3ILhygb`c!HmruxYiyDwC@0i)}4d z=UL;7DrZ=ku-f%oXi0@A{N;xm+;KSWWfH6QW5X}-<$e+oU{ zUqPq+w{bb~M_^K)w!UO$KkV4KUqZLNRdk)PNCl_%P?W3dw~HJP#q~tP-HtWfomj)Y z$S%e`H`Z;>A;Be;4YZ~^3sF+6Qzc6_R&+758GS;_iuxd%mvXp37!q z1^3icp0B6X*ArFudJ0%Z4;#sb(tDBzL|{|6n&vy7)^Z-KEUwnJZ@*dq7@Nm8**?~n z>#iE^c6DQIeY=|b6;|+1UA^7el3q2TXME;s{hIb_mP&+|4}haAEzv747V5JxSzV&$ zF4z$>h))lSrPqKo5G&s5)h3UMxUEUeU1L-YHTM|7O4M@eRczD6tyhw$xyzyhBn!+J zy>@9jeXl{i(uyedf~jfjuW<|EQ=-?N*K19xJ!T+&llhO!Q`X|cSL}VZ7lnSuKs1-` zeHH-Ouxnsa4q9>-x6+ocas@U~{g>);_!vhlS-n4J+P}_T_m}45ruP!-^_Kq=?(yI= zc#HWwPB6aU{)Ux*CnC(q>;+Zq0p}9{qV;YCd(;Mj^hiNuY3CQXp^%jo8GFR}1@2oI z9Zy_fNTP*7!QX`x_rZr)Q0OB`ao^~a;yywq3i@WZ31MjV2ZZ3IvTl{rB60{1-DgOv zwst~Ysjc!Vk6Kc}ZX+yq;wMAtrft=SZZ^IK(Rc8z)*{|!1`0)^)6HdDb9tO&lyXJ4 z!)?#DWZPUM{}I^iQ*e_35}bIK5o*d}QU|-EF;yGOzMe+5f)AD#+Rx9(e@1AXTkl{VNA?{%}WOe^9c9d~d?_K|koMc?p zCk7B@r>n1qRsipbp+W4q8eLRzP1d?2jZ|c-p>eR&Ye(bh#PUYmYwTuA9pB!~nZ|Cu zGp@4S((F1akY?<-GQrI*7P2P0GEjRFs21kGD#8FCHy3u!!>ffAppzu-E<*QcXoCmf zC&Pmp6gsmNDg#lpNnxl+fFN!xG{`IMyn!;2Ml3o?jVA)@XdvXNLyZnTENF!)d}Mo? z8J5EUMOQ3dHPA4jy)Nk_XoC3QKrU{TGXr*Bgo|jUcA)<$s!wrkxU@(dVRVbp0sX^L zm1+jCBE(OIAOq6f2z=5icCr17VES7g15sGmbqqvfVAnB#urr?G7>KgaxB9|-%XjBf z_zkZP@PF7Uf6}yHs`fkYRDY$sS37@W`Cr4l;TJP~!KX9B;ny*7cv0|KJNu_OKljC) zpZ~iYPCLvY5SanvkZ~Af5O|1d9l)m{TK7;B0*E25v^OGv36L2!k`RTxz-Pqp5J!e_ zh&jTT+9(9T)*N-?D-?)MBkxkP*VBJAc>Ac2TAPP(@w(b zI&jdidh_^mJy7J0>_bpazEdo<8NKEnv%S5gv)I|v-P+UElkLuT=DNFjI(kYyVRxZ3 z>W(@)i@{+97{xC}3^}2X1far4i~*}4Oki?yn>|yz9};*g*<>a(5P%#v7y5w=#59{$ z1~ddeND`OlK&~8_s3sm8r7rBkfXOry>RKBCS|PL&hmBmJm_Y6%)YVIkY!R|^kR#>5 zkl`xfCP`CQitUJ-f)VOMf()X%CdF`fDow{J+=e$AxuWU#jpJr9PvZsS4p14DQ-!q1 z`w-WDog7ndR^qlGwnWo?(H*0|?kVj-X{Wy?59)6Vx+_esrz=~PD^bvv3f`QSaWHui zp5KD@M4E60yAt0`+iwamZ^Bm-?@czkV3n(FP_ciGtJ-7s@7xh~bY~kg@+tUdN}YV9 z#HsKpL;f%u(f*XgbyFITU$}X<$*--7fr&1uiQky5i90x)e?YFvi1sumcJ#Km?Vfnu zOlaY@c>mf_+|iEXwmAq%tSS~iuaeji#lW2V~w2v11@Oz=D(Xtw_yF*+#l&!Ko zkBg>x6@iC?->WbO-HWE0bALindr>~f&*HNQgSs%v;Jv^Pf)U&bXF~LVaff|6fD9kR zw{2f~OB1XwzIp{Et~hVBY2 z=_`&Gg>sg@it!&?wh%F7cw&>D^e7W~yc8aVM(knsd$a*ja-R&`5aql5&QY-_2ONm` z;de`?=(HzA#BEd*MKGYTgbzb%3wi4>&|L}b+mm+>P3I1t2iA+am`VvG{LPXa#s>-= zG|Lf9D>|Is&VrygfjeiGb91URX!nM3+$!f$iyJ@^p&dSGFDNl8EFIEY`@Z4$-Kk1G zM%m*v3!;}tMWHijw>a(K5n=~v&rzNBr=ioKJ!>KGk)2+(ru`Z~(OM5&LfB<>m+&1d z`~H5+7>nH?DB{nfMPoHsrWE^-3W?63kXc$NSTs9TCkA|Z@tRo zy~eb0$~bMDF&@O{6*L;{i3y@Gazz6Xb4nvXpu;A@4MaJ%(2AzVj_YM@*gi4i0_@2M zbHY_L?h@kn0SWGw$$yV1`rRkE*u4@wO}^Ltf;&x0vM50Zeld-95BANh+_+WbjJJ!G z#hntnLt?i{EoZX?y&_PY7e(iR0c2+8SU>D1)pJt9qcalTG7U;$PeUWBXIN zd*pJ{(J?NW6Flz+$L|<7!k#mjjD{oT1mS^OsWv<^F-dsSZNvwPeZ~IbNbz9TP;a}{ zW(^kyM*2qjM@B}5Mu$gw4~!q4JX{_ho0^>J8t)t*oZENoz>WKljUL;3Q^)x1_>se7 zhiAs;#>c0QOwEt?95_04^lJTITS8VYLIdH!gFAy@QTRRh z$y?)f3AB|NDyS$gEMutP705mM5lW??wZbUSDX>5Cgy{!s6E#lFho?nm}JV6yYV62 zSWX}ei(PQRRlsSL{r?XTr3KC}AsGID_XC@` z=I?quIZ&c&{;sF{Dvsx_^{Yz)u2M*F#cTb*DX;kh^}FUzgnHNdiHz=AzgR=*>LoD! zxaJQJ8`u2deB)X_!CSBO``nksaQ`W3dF=PY33g6p4k9PSd1LIV@=Cx_kxZ@BVVbiBG3deeoxPgC^_QSX%bSnr$Pj>`%79?#LY7c+X zk%%LpT-}k-%{pNOgIU~b@_Lae}x36h9^ti&%tB-3rDVyDWFoc}jx94iZNi$gJ+But1?Bbgs zi*|Z6L9VIi{cq9!Bp~bajD(N#L{%=pfk2nkaj=k;1G36R2xdN9l+Wd(uAuA0c(YX> z=ZHm}K_TcIwoeCzs2FsG#gpSDnQwU&c;!}MUo<4J9RZH>NT=&{kV#EJzIDkA3w0@L zdsM*WuZx)pM}x&=Mz}wU+8O3B$Q=#Zf_53^?{J>Mf+E4>%{b4&4-pHhEo^6?OJP3h z&UTmEa^2 zfGvIy$tnxrrXV|Hm9_d|Yn!tY(qjmm?pw#xmw`@zzQ&tVh|*2GmYHjOX1pLWk6{Ug zSbPQua>|{uYFnIg7wiYaxQU6ZpMjx;NvKus=Id|I=1fql+@n1MHka1fy-KL|6D4$l z`O-Ll+%td@g-j&TqkxwI&jT$qgeo}lq25!|;<}BG&ZkDFgpX{N`^xt>gY6nYanGz zp$-FM>e<%TCoK$cjynHf|CR0iLFSvG|GRC+-B-2m4?fs_PxvxCtiGn>vwrp;`U|;# z>n|AXXq=uk?=im()tCX}cH`;BGmK{%3kY=J^%$aUZW7Sy;4ux9%+4~Pf8xr;oklM;`;_A+&?7wqdGh=EI9{9Bs{fO^1pqb zgx@hL;j?u7**ZS4{{T7D`wtS%>_0>}spC`o4->yvAJNv;c7*;69+hW@bvPs~nl~Jp zG0b~r4jJmMu`>+qb7l@2_H5x8<9p+=Lxz3x9Rr5bGsenu_S{6*og;W9HJteyc^T)H zNy)i;LgM#}k3nZuj?-~26v%N;+`th#mD>pxj}I8`lEkVv6Vz@Yxh#3-q{t%@tehbE z+>-?7DdP2w6O^aRFxhS`jT`>h7zd8{cbqDKM%*+#035jO&}rk?*bQUzWByoqEHh@0 zMPoOP&5qqOHa%7tyJPN-?z`qE#^%Om##+bjj>b;kaa$st5=UdPOe+$e2}~8aBmyjW z8*!$H>9`lh_jF2*eu2HALyrwg78pQDGU18D7ry}eL!$bo@Is`J4ia5<_#omKIIhtz zhHyOj^8V@K=BjTYFX(SkM}Dp90P9BhUU!sgn%w4p1jpS0);8|)qwN%WyLs9d+;zmh}qnrZJ?3p;ho z87A&IHT!At(#A#2gDNfY4ht8Omq^aL$;a%cgl1p5+?Av^(%#nZ^j`H2?3?W#KYcuY zu3V_BZtisbnJ5C14LfV8g8vVFC}e}Zm8~i9KIWfrxWwkt#!Box zu-S!b7AxzODu*YE=JUnvr;$am*>ybOBT<*Gf5AA>s8Z`vGpeHN?@K~doC1k#UcRun zw%R69eE`wg#>%;si-v!^q);apOUp5Wg{@j>bnz?52GmF{bMq zD<~&&9*A}bJCJe}ubjOxm+=a=qm8eCt)c|_h@|v*vq6>5)&e(r*(cY5AhrBp&xetTgOPTg&BLIGF$c zVLirff}fISVDRZ{{jQ^)&~V^`ra{@yx9UBOjhlF{I^$;^@V&!+W=?Opa7oDS@N@k> zdf`(1A-xZxfJeLt3(4%|9B%Xr^46F!W`aPeF?Y-WKP+gCebgDi<+S#&SacQ7qJA$L zTc99_-!=LyQ4XyV99lmkD$F9{)kWx65}ifzBvH&qig#+CynqAUT%hlAQI3@!05OlR;z43$T|;MP)(wB*EAsZ;Z~{7Z*=#Kw3B zGy)s}vJH~jI9hi1BGcDq0c5Jt<8{Vivxh(2@lrA{yP+jH?V!#Rz>)G))`8K1AHuSC zI@)oD#ZcT93?`9Y^V&x7&a%%di7hPXRsFS5TNHe}(1o!>fZD$pOQN$8xH1f794NuI zxs$iDisK9o>Xlqk8PQg=vpq4l3#CZ7IIuS&ts~;`fIF{wU&T971?ltZ(IQ;tcF> z`5>?h>K{ZDCt9=}?o7D7ZcWXe&_=nt-nv~|=hkmAt>_W@5p>{W>@yC}ZMw4%$lPKw z6i;b`-5Jz3(a~u7!q#X~G_6Gy&uC-br&RQ`HuRmjvbkHe$?r@isT}N|ewfAEF#P4n z0Y0jHr!u}x%O%Wz$wE;!G-s_gtbgk%co2h)l+&h$;)hl7-ZC#T>$YjbU%i;TlD7KQ zaa2e4%HYew<{e>cGC_PM zh*xgc69g5V&{vv>OkY2l8hnPEmC%*-acSH*u7t=u+lsmjYVXA<8$(lJ87lp`(r;iE zZxM)r(F=ruIElt(v;ZA7W&wB{0FO6jJdtZ+C%|OjD9m@6_HUZ|oPRR^#q|EldWZ5~ z=^l4K<=z;)!fOkkz`Xmd-n-rGAK|+BPdNdm-)uJrAi4xh@r$pqMF3xmma!Ppx-~{8 zrpu%{gq<#Kv$b>X3{Lq-?Ln)6-r)dRQay0hxfDa40=h}6U}oilEL|?8kP~8MWpfBD zwmqD-$0aDBFp5D@ORHSETBISrS`UqRx0QG5DMqOP~Cfg!5j); zca}Ozj@{nb)|um|ao_GLb+vbO8g@s!X}3phQ7ei%iTRDtmWgVBsAVPzk;-e)ewv|` z2>_KkS12lx@C)T+@=NnECPLs3XJ1>}aaVjc#g7mZ!G5C!ogw<4Vw$BjLU~lE!PrVK zsa*(ZO`ZY0bup~u6JsH1$iP%VniI7J8|qOP5u-Kip|p9Q&VWLX?>J{JZf#s{vhceb zy?_*7*AcPsgCb};7GsLXxtSc@Mf&&xM_ib76c3B@r}#4*A^SV(#{N_jdn8- z)Op-X#NXmWFg6rSYQMr>P=wl7*bG|hYwJ5s%xvyWDpqc?Ae64s#~26ELeLA9^?yfu z!iKVB0~=|axQkk{UU>xKe>(YM;0>)AqmMmaj*DS67}jxNE$UxthuCs8lSB3+^K^X3 zfj%=6e4xqf@L24(n)6;jO3Ky%{s4tzfS#A^Q)f!t7xd(cCr_2YN(5Jt13J?x#dG1w z(p-$WWKidW8;uQ&#zE{7QY00#e=!%t+b;$Lg4X0&T~xrThslZoki4J3X}I9AxgtAe zxpC6Zphj$ZV2KM>g^?wW>^a6jjfUo}^+93hK=*BbTn6{tK^>Q&74t+Xa*nqrnu%l_%9N=81cG~HT zk63Um8!bdWRSz;d=HBG`)a)DPF;D zdIfkbaxxeG$+Ze49|3+e`#(GT>GmCc#w7_mtwyc-N48aqN~u(24cmQn^Uu}wgZcD^W|M{c3SDd<@~HULe&X2SrqMPq6MoLvDcJTsh5GmB{^wtI9K zPTd@JGke5Y@nBnwXHqobvrAFIoKDq?G6TgEF@6m-N_u6{vSRx3Jp>PD>0od6s`?hm z3_*l4Vom;nX@40};eR(D^}eiL>G)seG}I6J-yXa!GamhF=0$e)*RmyJ1i{LrF=&h% z6UG$mb%V3y#kYdi`~;qZ#ABwxCTU@&>c~;7*lyD{9xDlv4Kh|Z0FfgqBpj6!EcQz< zEo!5)@Y#(S_6E+KB{>G{HV$A%XdIN_2pXlRO_P_AfFocHV+d}%F)TqJ<|Ialg@wU} zX&4w-7^#j1K@9U(`mh;s-G*|eucc>b{_oT%ExT5vQ46OnSL z#p#Vw7_3w$PA1?9iq;=`eKZ0cg=M>s&LdeajJwQzLe+0RQro!Vw9suVx!|F7beXE6 z)|N}6_sbdW>s#3*`QXaZ`Px<<=9K1DEUd4=Ew~)>?22+2Cae-phQAcolM{~Jf z%!(#Guy)<&`k*DRxmncN)!KSGUYq#k)g5=^*UsyqYj9%<=}=Y|;)aTijP#W^;twV~ z$$T15?)i+v*2c=xR-yxz-O^tZWhoiOT#`x(r#IuC)R{Hc;LE^-(X$6_EBz9=dRk8s zFoBItd=CqdyT*?Ncg^2ZW=J$p0MJ}zzEGJTeJWZm76+z|_;x?*N!dE?&RToXcd@g+ zJL0>072a#%Uc@Ou9a>x1fAIeTtqjI!jA~rKEcQcsbn@4gxbaZz5^Ub=qeqK_SR)D! zE@*5kkf7M3nHQ~StjGpjgbRRC{-DMa_H;;vQW=s|GCAOzN=1rV8pLxrhgo1lAlR;; z4r26Ch>-;yh4PSGHh(--X+%KBMeje&hjL%?)o} zz#2;Z`*0i+TT#I-?XwgAKC$qb-5S9=#1jK>6rCDOUqnej)B1g2F0B^Mf)GB-JvEpf z$Y5*1b+OOGCZydF2|iAZlX_^yYL?EUY|y6U>{EsB2|5s%d(({*Njr2-9@?1+0A&VH zMiWZ3fPmwc@rAnGIHQK-{-|~HOHKP@X1nug^H)so4c4D4|Le|i_d{+e_#Jm&_%E&- zecgS7m3=*jJ-!jlDrfd%9?^{j`2aiQ2q+<&fuTJbpr}rq<9bAl1S^aql5lP2I!eUK zGN%ytGNXK>i+=g|RiL;rY)hCy5!;7>BVk_0_sBuiV*Wt57u?v#Hk76ed@vBA3(n3{ z$f1~Sb!K}FYpAW=uuGISoZeP!G2Fgli@_kBPb;*dnDEsN4-su)tHZh22>76cnGPb+iZ4Exd=ia|$ZX-ZY>w<|nlh9v(FWC+`8#OMJY?PYxgObykRPD2AqT`>^rtGF#riPGB-=HUPL`r$5 zS2(4uayge=6Uo`NcUh5lxoC7l7v`QGgTaUN0n$~AT_NI6c;B@RWDGi?UAM2V)>4^P z-^VX~PdqJiBuis;fxRiqZ$vl6?4c&HcO#j+cu^x?nf?f_J5^Eu-uo&(!5X=9O+E5bFc0)ibrXelS7#s{Y9ZkC>=DI zgg7IwWnCU@+i<;?9ESmDZqyJBRVaM5wAAGYW48h>BfC^0M6C_w zpEi68De>Bqm6K9{cdZ&$0fXegHE}AAevlki&a9C@@?p9|AZP$4Kp#Cn(Y+wANjC!s z?F01iq|Ys$=f18*Mef)JI=xsl)2eoRVl%Lmp5uPsESy`egznc{ol!{nRVcEJ&~eF z0hvkH`u$Jhp~i3g#0^p{2Pl3qd{8QpqZI$<`|aUh`+@7Dp8-~{47l2puLhmh(|CZ>u`-SMn;7!?^ z!p~yE``6i@bh0mQE#zL^S}=}dK6nzxHSL_mAoTsDag%Y2al*Jww2t`4**t_C!$XLF z0K!0r_yMFVv8#qGxQ$+zxcH<5er^oTw&3&{T;|Y6IN(N<*XEwc2N@vFbRg`~81wB~ zd9FvFM&7|X!V_r*t!OkdM^S2)E1H-BO^R84*`E^@JO}f{g-(IB7{=*>Fhb^YqDyzA zBpB*cN&LAEOWf=|Ae{2U`{B>1eKtoCS+^eKu65QP00xYV9VVQ)0gz(fe2BPHn8T>o zcG~8T$z^CBLuhC2<{1)hf0xZWckkiI=mVo|kn=}-_ZZ%pVw>Ub?V+kCCJKE8Iu;XyYXh$&JJzJVN(9tv7+24EPp4mekSRe8qfDW7hQ;Trn3pGGOLk`r6 zbRy=P19U*!&~XBD6s}lWN}h?et#mbV26od^+FwJWjOF4=A-$_>VUviFyi{FFc=}Rt z!l}mq5WvYHX;_g9&qFuBzzBdurz=lM{zHW6`yz18`WOKKMREKp9*fx(wH!dq4Mlq@ zg@_uox|Gno6FC(~P(d1qfv65aGkHP~L4AqeT+q#WGg=KyH0FfK!!akoX0+Tb-5DP= z8wQl_x{R&vY#rT1cp=~$2^B-C4Ig=Nc^&;3601kSQpwVGk^<*>$oHfeJ3wq889zg< z+aP;GZL7fq^6rOGawq1EfSTNciARI`G?8B1o`ez9wj(DtU+mbPdpeeE)T;S3|9*~1 zBD3MyVjH7LaAEvk2=W{9hXR!5GWj}A=W-HhsM4gnOyU9~*=)q>apMBd>Xz#A7Oz@c zu5f-*!ZRwRQWwFY({q!z316D`rR`qauE3~MqeELbPTN(DG!H7_e2CmeYZPtpEJrq<1=@16OrWJV-Rwp}?s7ASo|(0UkOa)8v@^EgOk8=l`J{=q+o zpN{;0s7^|Q1=K7BvXA(|lr`)JvwHb}xgGGsl3vO4@q$u{oM~3CG7q4?sY95mIN0v8 zy38)sWp_E~D6=U8g*39Ax-sq^kli-n1=Ue(SQy1YK?jRNLOg)xvf?8g@I`ptU}I)m z4y}2BZ4qlAR2`II8-oxbu#0SpX|es$;=aTo)xHVgY5*I-rkiOHdsL)7_Fi^%IWbUt zW+0~7iwHw&e~9~lQ9N$g&Vl$24P)w~@oNWyg#)!@tLuZA<>lhK#Y_TS6a-i1F>GFV zz&HkT+bZ^>_tB5uhh0X|g!ZzU`7}O7Ib3qVc#*O$wl(mrPIQRz3{9$XUQWTnN1)ay z@$17gVjsz>GaX2ZD1_|4V2?NmnzVfe)V^Rp{HR7hE4n4%ERqk+V#-KxwwE3Wecmc8 z9x{sqx+xfP7U@|lGcWJhfJQhoqbWt4DO4~w8!K)KZ9UX^PCpe3a!>a>}5|$LWC*uZ&f>@tPYss|j za=W}Pfdf+v-O@ z)cToh_OAz8a$g;A^G^;aW752tgW9@{eq+EG0>=|miEqPL!iRFp@Q0IpjpNZV2q+Q5 zi0lRS6S?e&gfN(J%pGYSrN;JR(hE-nhSvhNhae{4q$i78!RIC4MiS5+kG1 zN>%eEiJsKqcfjg0_IDsPJb>9mWE_>~VF`{%FpAcL@$FrdxnImFp4HQ97|)hRZt2;B zl}1mWVVvpdH;h}m1`tyX4pBo#W|*)uGeUUZUTJA&->6}n-9Jk7b{*cazn}5wyPf%E zj@`!LmFhWX@!PK!&2ezceUnp!cijTIYdw62#Gi8$ckNd6pgh|izN?d^diP9O68Fr^ za&h#n$Z5apUK~m~9W(dIMHh5N?&_3;E+4sroCRTdy+`>l2Zu&MDsC{28s0+hsF8Vy zTYlylhY5olPn z-+XlJhT|uLgZ&5k4~>nDP24;)SH5$8Zu0KQduHe6=0MBfjf)#@Xe9Az(Smy&)b2rp zpt(WZT9TO907#D3ZP&NLg2s=Md@#EDEznUE;N#Np5UDt;D~09_ixflAUT#uMw2a+olv&cwOo7BKXBzi)&gG$2B0N|nx$?K4*ThwT! zQ1HUYlt&VVCL=41Oz8@6NY~H;k5{O4NeS+X(U+KTIC!bf`njC0H#Pgvqb83cB&BPD z*ovcUe0>nb6PwNxy_eXVi1xI>OVgqlBOoUfL|Yq(XhRc?XIhMp;K?##HZf_};le-g zW8DjhNF}rtwo(`z)AHB*E#L zxIm~?14-PaqgjdGcWGk@oT^rJ?p#^hJfGF!y@G&%u6j}sXJGbSc-Bui8DaVa_jkd0 zua2{7GX+r5LTsjhD>hv6!?fJofsi(NUQ46sKDR8bu5H$|kh6~ch~dHx1Xb`<`n(M# z-HwJ{%OQsNvQ4qlE1V8nIEmYar3QkFR+g5Khx!s-VK`gTNX+^bWot0i2<~w0v8B~Z zo2aB`NJt-R)wX)9ad-8yzR!5qswqAjNX?im;PJ!L(Uq!mUcOddhdi7Nr5~qPs;zNE zBa+&ng1+0*XuAY)-`0~aFZXRZIw31Topqi;*Io4JmulC>q#fOe1LJ(DmeZmBNYYM{ zO!@1MuFd1@h2@p4&0KO_s9ca23)3VxFz0K;lM;z+9MSKf$9G$fe#`c4S@m8wp4C7OyuN43a!%UxM+MK)x4tPT!1V>Om;fW0;j}Zb8&& z&vyx{?OP%age341lHdx`pq`PA>@Kvz|95BvTpfWp$t~TB6Pfn26Mps>awru?p)?KxXQfp35H_un z;?(9zKTG5kdT#Y7oRl~h4Mp}__BiRj`0s$<2Q%OVgh zo;oYt`+u4{)7ZMww9cRP?z`=4JFydQiIb|-b)3bysZLkLsidk>Yih4B?-QseS|^Ger9nS+FYD;48m zEkt{Hyh@C28<#Umfrl<(^$-XhlbpplQro8pM?M8=SG2ma$dQ^C4XHhmLql_B(0&5< zDWuj?IeZw&lOh7@s%Gv>M&@N%7mw5bz&W_bCiJWe8RJb z@6~F9{IH4pDXA^Fpk7*X!K6OOfx!v(aJ!%(;LoX=+Ob&Y`_ynIp$+ofh6R(l*vFfs zhg|t*T~asEP1UR#&zL?Ff`+>VlvHqOT;WvTj{17yrtX8Hz8=|p^~0|QCsV&Yo4!mL zsI73J-@#)=>^`~|Z=_G)LM1v0EZqS0C^PIr2Sd>Jo;Z~~4+^lNM`;h~TWlu^p!+QL z3^M@h7LtO6`g;ttF#+5bP62CYdyPP)1QfC*0}DCL z1Z~C4u0CWH>&@@A5Dg5w)?$4i8nYIeK|uDFZfN%cH+Zd{6JA4mF61jd01h z&F5)YA^F6KrFISi$Dg@=wDP*GX_J4gPwlBAAN!R4FAvncE9-d!DqwL zX9_cgUn!iae1c>Mp8`z$9mP*Z_3y71uv?VLGd_urYM-~CtAX=j*5E2YWtSjV7x8V)W z1gVfvz##U;isMg%HVx31P}+ma#H4a=l6@^%$fSQhBJP2oPxmfCY zp>l|a2dj19s-;G~G1{&*D&TL%N4ujV;q|b(lR?FT*`NjD_6UFDEBo1<(K*I?csSCEyuar+!B2_qn(x3(EK%)PJ zXV$Ki&!s9rEnCAUv7Ju0#YZvlDWv*Y_;yBpnCf4W$uF(lxF`jotQC{D-QOpmOGJFYA9SGU(e2_dBAF(K{>aWX zw9Q6<5kA<9_mo}$+k;_m{7Ga3WHbg|S#z2H6Je9z_GFp(!wA3&6Qa1S<@ogh$S|tu zghYDOfaH^=siToJSY&UX1Vdvc+P-ILCKFfMgx6U~T~@cvvj*>U)wf_@X1;W0V%>o5 ztsfegv*EYuwg84DsLs)6Tw>OCj)oo3*Mq4ATu~w%w z-r7AnNi4$jXuDOeO^q^yD|rq>KSnv4L%QNDqRF-n%3YFqv3tA?6HzQ5w>-b)Pa=f*yNr^9I%?%ik5f zaC3blvGm%&Mq^VnP-m=uK_51OoHD&uC zOD-N!q~`JoM{uScx?di}**J0~Kr;`Y0-S{%6RY<0c!CMN!<#IvJ^zRpHF!j5@uFx- zcBGYn_39{Bh{sSVBk1h(qzqtgZ-@be_W-BoY;>fm6Flu9L6Pdlvvi9q3T_Ew1Z)28$XbO|Zb_B!$$ zccw1yLWv|}9Ck4oxw2*^jRlw)Uf%W|bET>os+_i+)}P*VjHCVoD}n_v@oO zA0siS78ma=AL&P0g!fjCZRxpNH{Y|Tb7$sb=8b_(9BiPQ4>qt;4mN7mcjUTmJB)y> zl16Ayq#SsEond)t2Q%G&;=&KtfHmrX?}m*@SAoLHaD30kdBx4N@QYezu(uxAj1!TG4%Or~K@f%yv1grs80{%v@KJ87@C* z$_c)&7w8 zF?(4{7slQ=G2L{eO`{PVq{p;Pi$BU&0rW+dv%r*qtdb->W?CmLO?M|N6P6H-=>oy4 zn)JD6ZD1cE6V8azr45g1S+>lM4Zhh`WWeCD|7X_KoHV^FT=+O$trmaI|5))mgWvK? z|BJ5n8M@jJMy2YHlaK5tqyOXAzY8_ud+Bl=e*_S38)z>BViBjoHr)=W27O`sjyIZh zJQZmwb!^RRD0OU&`P_QyIFl6pYTKSyvz}MCE;s7BTv=VNMVFJwqt<9P>Yaw`aEVL` zXfqX8t?Ol5vPNtp%jSgPe^O7Zx}In<=|870{?j|&gZo)6>1QTj{%iEKdWjq{Nkk2e zyWP$ja6+)~Z#WgLI@g0z(YCA$s&iSIT%zyPxfDV4>sbe*wV`Zd^?yFP*od!xQ}Ijw zkNBl`$;SNouu}WA@Q(v2Ka3n`e!@5rI_PYS(o;3N5=p|c9%+dLz>>6cEDKJG5IHQG ztn^0PPme_03JBxFJXnROvsxj{9mxfT9i$d~YRKLIQ7lS_RVEg|A-1=obpYNf5rUAh ze!;r!P#v^)If zY+ss4WII73s+mCw=?xQ7Rm|Xw%e_AKYDBmC?yT(-j@6Jm)dgL3#R_3zR}I37v7--1 zTv0Q%XqKT~J_GZT(wZ_iAy-9Sb8m7fIF0=wd7Jw68!Xiqn|rFw>6u;fps zPHe(> zdWOCPHXCV~M3a&Ri5CXE5OWWF3QeDMbYep#vWB=;0=Nz1&$p5#+Y8S;@k;pir8|;R z%C|N)u3fx$o;#S(v^#E-#Bvo*!b{f20tkYur9jC9hyzLJJ)=4o9?eU z!`k0`$CtnO#HVik>^o2Y)zJfQz4z^w}jUO&Y zG%4f)c}S!Lu`KZ60tQHpdZ>IXi?kv1F0o?aEYY60tYulGJ$|hzqgX@BLcLsw>!lU| zH4S#MGii`f2eDyDLz}H)KH`{4;Cw~055)4s7T~*dMV2p}3)Y)9p+lTRIo8NwYNMIX z&v}qmfX`iW+Hi<4!U8O{kZ~(9JGl7rM21`5nbN z+#~e$>kOn+7Tn+Xl!~(MP_6>xNcB=nDOr67;E}u5MM53!Z6xw?S9A_HZ*N%5gKDd0 z@o{J&XW;o4=U!5{7Ah+vy}kW_x7*}ZD-}BjY7_Kx<{K#R^|kf4tA?tdYo22O%X8d? zG%~4uv_z@kiFDA|BQpUN4WC-ZFJR4AmWQm$z9|2Yw=q7@(lVKSd{BU43e>o|Pzy+k zN*RljQ1V=4a0XMSjuOCYdaSGqWMg)eP3=XVtOZ8EUnQxAu=n^8lfT8&*=lYu)>{z! z&%S!@Ua=#9_e@Vz<^vLmfR~38Ywa5CaDBZ(cT%bgLt2+&`oqcvQ5=gKA#LC*+mv}A9Nzy+rS}m1{T2>1(=wW3VcpX3mIEB_D7~A&?A*6A3`lSq+pPIpLql z33kO~SIRa}PFM&w)@#|?`!F~R85C-zu*(MyCQ3re(0a&?8?>=UgRcwgA(j9-oQeBIS;75;MM0&E}VCMzV_w2tOB>{$u%c;Wx{dD?e13sr_E%ljZuK5n_A*3#*3zX>Sqwup>AO z#2iLfQ?)S$z#<+!!j~}S>66T>*Wt<&B^aCg=?fmTqo`QOmm<=HHLQmJv0G-*DU$|f zvP@pB@iH7>qvbY1C!i(0R+)4qM@Kn2GR9(8mm(A66d9YK$P`3B-qJ29Wrq(+5i9ms z4`v@0UD#oA5Jh`{ZN(4!d%Qw#9t&TwKGh@-2+vS_gpl7-b!OI&N(=iAvfQ_Sk>!bf zO>cJZ^xXX3xxJH}aq_y$l9=>s^e-1};JP-S!oc=!6abEi1(9?C{NNb`seuGcbTDBF zqQB57NYx5Bm2k}x*@k7Kp=DjM5hyM?Pm&NuD8yw(48jrc>*4MJ_Qi6er!^y+U5B;pte zs&bQEbf=77rmCw66k2@zs=0o}-Ot9ww{PCO));I_@E;tM#l4#y)D~*OMFK0YY(PqH zPXtTa@(NUBgN>|6t{!?)?u4U9awi-mZ{huQt{lr1Svi&!feS6YQXdM@Y&|QmO&?}7 zj*YY>b7s21*%7(e;B2dgffZ@c5%HN{dH$SAQz)o^A&NYl`i=URo}KD5_v1q4G*V#S76WGBTn>o1}u(fO`gpiQHz!lN6^%fT|i!`P98j3E-h7q=exk3!ezgU`XC_(-?FA|8LO6O@B|nZ9&_0; z7|7%1PL^42xzsKlqxn%#TT#38ocWAxD`=OVHLtO4`R&qC^A^i~x6IZvob|xJsrM`~ zYf0Od=LKoom%6n>;*l%#1k2h6^#iv){``AZg_?yN8MgUo^gTS+lgGOj^D6^}blK&J zcFVY1eE@G&|9CYx&bw$Gb8zgzK7dBgIYjngU!~o8)`7AI`^xRsQNv{)c@$LH>b$9W z>H7enPA}#&z-U!W@)p>(V#VWUYX#a9ZMWbW5nmL$({Wjwfc8P$#|sFLRik51%~wOU zU%u&VQlHFu5>W63A;~dByjw~|L|J}rhwt&%O_ z@5squYul-NCHa;yZEfK_H#n8!JI|zwoRb)%Yl?PC;Z2EtSH447=e3QyH*Z9;a1EKc z%*R!>rJMyhjW2DnJN#~Ii^a61w}WzwTai&fI$MTF5|4}sIn7|Ls07pGC;_B}SFPgo z)c(L2>sUO?uz~k!__BJ-LBdp(`HrN?;c%65msqf526u>`vatf#iP_Zbj9dxmlV)!x z?qDU`Y7k2zmCE2E^Y>`Bcum)jrif5IG#fI@q2(O0i|F>VyKsAgg`Apc< zzv)M!=!fF<_>+YnEfjyL_6w!b-;JIw{M^{Tul!8+jq10P>hZhAKV7Z=>|D3;-{!jB zCDJ@z^sf*Ju*ZAId&GO*TlX$|U+aAofT#3Zs4!W&WRFhc#a6=}1Obg5nnnY-rbALZ zYII?Yp_4PyXu|PhOAiUTrB@==W5uOc2;siYJ8de_UrJ9=9IY<;p{n$|Xy_NuS#u7lzc7(g08_^O9I-!`x#)L77 zyjQxw9{7EAV$yzJ+O-=gD)RbM(|VmJr>1Rle2;2AXv^*%tKnt$^VD8le|kp8muKf# zK0Xg4iuc<50?W6iv}bdlmK))IC=s-HTZ`jbbQbq>WMWarUtc`H^2No2EGHLr_E#@H z#PZ4TVP4$svqxC&Kf!hU#S<_R_=nGHxq6nX`A^vLx$p$*AL_9Tu6|^{7p{b>xFi;y zr~2pssUf}S17E$w^6Uq-=Od44ee<~1uZ66~M^BPYGXCJBTK}47pJTcC0ge_%UJ|6Y zu=|xK^)vPAYx?QEGVK=&ORr38nh*y4ty`}Q{ z3d_ptk00==^XH}m8qA?^SwAc1p488YH(%4wsW;?Tsa|;VL;Td{pPq)i>ri+`6kab< zdF`S~}5NdEt%KLob}U(0%!d3uiApb>ZCWPhNQC@T-T% zdoLgU(CW$FBTL8Tj?OV7DE_~wgu@28HQTagFgkzZSKzT`=FWHJ3ae&*WRokb+ zuAG~L+@zJvM^=eSFwZsd04j+gc63pR$vq8Sg1fxxq(nps9fkv9Xg|etgLWB;aa4Do zZGzBB*JG{giQE~?$UGvmxb0)|b39~&0?c_BMsjCR9&)bq1bTVy7$jWT#W8d!Wu)DQ z9x$oI?NKGL*0@teSk@M=V=}cHpP3#Q6N{cz3&1DJh{*`a(%mae5EQW&1^bt)p$Zhi z5ZoLQV}nKK6kHj3t*D7R32g_w751xpF^&eVuaD;TaP_93E&+P7ri%_`$Mx(y!R-K~t%NF5?YW1s3UbF~$UlS;BS!Phfl zilR|XaF1e~aMhZuqSN&Zye-F}2Hyk{jTVGS8~p^ITqG0{W~>-r#@&btQDb&j_AUd6 zHSKXYlH6NzRVH|M;Yv_ny>u5Uh=k`XC9_CbED``v%Ct6|95a6P=0`VfRBh>K*BZHX zEa{#6rXyT?9|<)@ss_QZeqPzQTUfLE3)d2UVJu>|Z(woK;k zq}T`p3XbNWoSyjr){7`h&DpeC2efP>Tef8?8c+8b%|XIs2HU~p(EcndAV*A=TqBr@ ze48@hL95}?1SZae46rYteYSDu=JmnGH*DO#SyI54GL8;A9d@L7yARn2oA%;a-=3M<)KuQ z13o#0pV<>ao5Cs=Q-GU75A4nGODnj$aS1AqG#;UU7fSb|6Z`2@ZR#3*mB)sQ9@%Z;zlkM^86 z2Kq$;??GcRu~TMA;6B`4?epz|7o=DaTUR#g8@vQMj+>rK!qZ2{;dycd5U0>y zpkzfP)ha9LTh~(xBHb)E(Ks2lMZlMpkqUDPu!F9rdjeVj4<1rf`@GrVl5h(A<@-^s z%(CUEGzNJNTW}Sik2t_GZ-hz3u>(n-VnYDs;!ei&@uXTM`0xh8zGskDyyrt0cygW`qg=isg+9M z%xbONh^yuPM07I#Ak)0e!~jSFIN2iE`0&7XA0$RGXXwBZmHx6i(*~iQH=b=$P7tB#gkxu6mf*v2%iyYL%sy8 zgHF9KRL?~QaX!0 z2%B~*Ity`$vpn5Of4^A=4eqMVMKcU$n+J@UfrrV}kaz&B1|G2A=^r$2-!m z(G?%U#6>hDA?;RI#obNWr8qM*Huq#79P*Hvh^G*yg*Wvu21Gl~4J%aXkiBCuK781W z3p-u#P>rvFNi}Xn{YQ)gVhQUEU(xUP=&tI7A^lB^5cytAfq;)}y;wT%TX^YDL~hhs z5jjgsW?D)`kXwi-!rm1(VVOADq(52+Q+G6&(P7z-I6s(8H$>+@r;V^!ZXXZk-D-(d z>B|DJvAWN#R#}yHZMBfvWieeRRf{xj+g~0Hq;K1LWi*h!ZR^lTqIG)@0gAE?gMo$L zB}T==pkhS%-(SXe;0K4W51m;Nv~UHB9rn(q!rYd;!(P5qN{KLDa8G(f!R zLUv~O88gLIghK?uFY_%6(#R;B3b%g?^bO%(;+Hgn0}zMi9(O=x91^&s-M=P)mjWsZ zhm-%BxTj->WpGPam4o{-WeM|A0phYra*Xx!XG?4M))99uZL}_3-GGGb8$NpNCP~6U zk4$defs57U_DG~vq`CrO{r5I*H;}k4UQ$LZOBvN1Y#NFs@s&EhvLwMqPT**RSrMXe zaOshB)sAqV?*q)TgJm?`opV#7tCbjaA$T+bZ7@YlJ{ZH?HK2 z<}@eef^p5sT0;r7zyQRfTUwAEo!)Ne&P^)^mP*?X0v-Ser2xBeWgzC={kX*QyJ$9J zTicUecl`b~W&6_xvcoU0_K%p&YWzxbp@W4O+9|62RopS&H literal 0 HcmV?d00001 diff --git a/crates/sui-framework-snapshot/bytecode_snapshot/53/0x0000000000000000000000000000000000000000000000000000000000000003 b/crates/sui-framework-snapshot/bytecode_snapshot/53/0x0000000000000000000000000000000000000000000000000000000000000003 new file mode 100644 index 0000000000000000000000000000000000000000..f5e57b11051a4720bd5f640d5007c4da8d763695 GIT binary patch literal 41861 zcmeIbd2}6Fe&1JhYkBpm>Miv)>>xmZ1Xplpzb2b(?ptr{CY!xC8U!9mG(mua2e6y7 zbNO?c9j=A5qH~Rm;&V~QPzMcE~j$QZz$2Cf(Z|2Q{VTFcaE5kH0hN*1BGL>Nz zc{C~tlC^BZ@C?T=-JETDX2uT;735trv_day*r6Mmu7|I~#Z*qlBa|Yb!Ik2Ovu!%2 zcDHac-K?RqhNI4(%3gl+E*e_g_F~_tLwTBPOmKASX`QWZ)0idP8w}$dUkfH(QK-@S!<#3Mw!26 z>=U>4V@KS@G|#D->DyD&3$s(pOVbO@YmFs$@#^c1ndQRmm8HDo}RGsRgDf9a#S+0yDy|WQ11UsvDslkZ9cuY-LHZj^t1&(MwIbXU>R> zvhjtXj!&SXD*LT-zp3nhqc%EUvHqdT{B!3Ydfs>Puel#9{GsXpQSn6h`RF@A?soj<^`2k1+`tBQfJjUb>7IxN0A}B&@inG8Cgb1kG4(2bX3N0e4COeBSTd( zxMs6_G+X7PIV2T6Y&(YWluP`_EbeN2D8|D+q#i&X5^^!bBgk=A7IG$EFpRy$$S_V6 zxjQaoEMGE=Q6Z0(N%UBma1#~CNENpOwI0LRCDC>Z>CN{V#_2xp_6ZrU5oDmByFnov zvILH5S;H*u-b5YxC$rF@eY;G{+_<~M{U%MfWjAntbQe@@*}>Sb)!1m*o3|ABoFCme z3Vm{1?w`(b?^K8Rj)ylzrsr%mhK)>aTUKT4OmY7Kxs>*oD>`&qTq< z9+}u<>>u1**g3LeWS6;ZWY6ICk&T6k!gyg*;ea((7%l7@+&jpK;WJ#=8P5nD)AKC- zthg|$xcF&T?s!yI{E&t<6n7GaizHxKmbh4Yq!P*i<(j-$Ptx=8QzU{j|0PAnDLQ13 zRhC>C*7&o`_*uJgn>Dhg>1E8oGHF)Nlk&)oO;ThLKQY$vNl5WEiEpI<y2j^u&hhZp3h!dp1#?by|gkH$lct+bqVTRp1wNY z=pL`D(=*F+cVwJnw3C2Sw+UHHT*+jraeHy*hBZAqYh9%fSK~ssR~MI-7T@TdxzU)p zIh8mvRNk3hnwwr&ZhA6CPR}hgduAK!=1^+6xAJgj8}p6jMq!p5n{&%kON}?Cmu8!e zEP$}aiI}% zy}cAyvQh1Pn3`UW8&85Z7jHG}*B9p&3PNOXenbQNQ1T+e}I6 zD@iINHJDwRej}IqNf{fJuBW8NL*0&P%*3}p^<7?Ema5WnX^4z;fvLIKNMAb}vDD#` zy!6oyr>MU=?)LP2_4d-@3^V#vnzt_e@Vc(8(u}X`-PCh>THVbZH~H+SPX-!lChg@c%SX80dcs;cxIbE1cw>nLOFQ{>7ZEHQ9F`O-jhkbl)En<9&Y&s>XluwZjsIyX434)w*MP)j!Kiv$8xErimLymY zA}o)|H*rf7v}77i-2B#E(7I#F*FVe4weIq*J7!V+v%F&Kj_EpaW44WdDj4=MA)~WZ z5pu?QM34OYt=@S0n6&m-JFPy}#7dpE_E}2VMA+-O$E|}pq%5NbO1{C$$MlV8cipVF z*G6@fR?rCAt}VCLO<+V@OYu5vY-irATdci|$tW7Jv#h)fnY1#&gwHM@`HkBZr$6y1 zO$1i7oA7lzP=Q%eq3z3>D`1^w6pSh>Fm}y=v=4;H%nC6u_z~>GM4s(j+8#=^AlnMkOw4K6Z(Q zNuVP+{SH_Y7{+!InB>LQLMQJ~vY{~JXMA(BT?#UR*%R7MrBw*l-15p@nrll)O=tzT zo>9KE5mlkGX0)Nsdz_4lw(sPn#S0VqEsfBTdgVFd4HUApo~HtdS4_NJhaIGu30daX zvjp+0yafDh*7Z(B<Agc zJ21((6sXDQp?at)xH`Ot$-Eg=?WBe|YDfoDx`RmyN;*=N0+#yXw58XM+7T5e5BZkZ z4>^1`d`V_jwnnN(=p8%xUd(9Fro+Tt@Y$&S6Cjr1!as8l*>+ zBKm$&7c1V;#YG9sab5Ny2{J}`!gj|RwX-@XuDK3Zy$$4RqvBG%uyP6EQ76}@JHATTWp?8<8k8&<6j@?*pZH^(R0?^AK3P9Ia{3n+WC~7`4`#$ zx$OPH&};5@hX1bV|LKOWo8kXA@@E6N|K*WK3g0>68=o}IirHgcFy~ZN)zn7zq_3;@ zs3rAr)3|PY+BEVEVLAR}XyEfQvl%uyvQM?SbJ(l8davp+{AAgu2EH=FFhdmn*wg0N z-{uQUs&(139+cs{U-qm;Ate{`Jo_c%g$#EuXPGQt3b=bs$cqwWO309GVK3z%dKD~w&lx)aaqWId3;RBMIm1>g54C7fL2ZVgl6nZpYWwR^fxRBFA zPUdUujDdG@rA$hP;kkXa#%LOyQ_ot7d#E_Y7|*({__$Wwj&hH)c5U>Ms6 znbda<$;h%}Sm>b*#QDGoZ0KL%4^oVPf)ahstQPHd!C^`1Hb9Y1>zI(dr1 zS-Uko>ul!!>OrWzY1@S19Ne+fa6fDA;RDW$9CS>}+j?Ta^!(=@a?CIo-P>yfukMYE z@ZpWyja)S87`Xuf*(nU5SXE^WLt@!am`54`9-fB1#t`zQ8q+&8gr1kN@#4lO&Ah`LssDK{|3d!BRsLnz=@(nxX|VK4&-MbghX zM=jwu;*%!;)a72g>c^t&`QvA~5l^=9{DfU8Y)O|tn3ulNyLEYF0VYo#d*^t|@8w`x z$gO4q=zX}bFXP>POeJj!As1h`2~g6|$rNm1J>Xe$(wgcV))G(B@+gYFXyVC=f`2+D zZI$vD;yO?bY5^MqE^8?H!-}8?1vnj+m#1Nn0%>KmeqaMD>&9qg(*?K z6z`j!i8pYk?=%*c-Al`C8LziF71d`KlI>MzFzeZ+`RtXHT^zOUo=CRq>+_nulpnD^ z>!W{q_VpDul6nWGH<{O`WrsgE({N+ff-~KmnVak6hFDi;nh8gwFtd2;)?BkGTn*t= z_$@w1<6f+g)eMhn$^eOrkZjggk8cmx~J<&x1ZjquFEb-86#e+^b6Cs8o>gr8}{+S`!8_+#^Tb=^tqBg z!@a-RxI1s?d0 zmRGA)YaNaq73)kUty5Cx4c#$x^*gKEnd0re2sh%U>P(UDdTV;=Zt6AMks{ob#cNai zhsoBYh3Tjx-QLTKGq8U;b1ZfQ(4Dfc!$Hc2*d{4OXI6<%XG)!1u41>mV{SHKdj%bp z`g1V0Qts7*8B>K-%~Wi$PZFNa`uwVQ#gGbUXAv{W=Tcs$%_Zrz4ZT_@wU(_ln6kBK z?{th>o=U#lfz%WJ(CW@v?euH+&eXNVFVgQf7Y{l~GbC)XA)P9sG?D5xR;S<7?c2(s zDDHO_mt)r08;vE+ZMz3sO*7FNNw#ZwYIwjt^^5dl!P0lj{Bs1>+$dkj4??$G~0S)<#yayt!7*OvEMU5{Mihy@$dLL z)~3FyN3R#4tJ`f@ll-dB`Ck5U=}L)r$J|s*oLZAbkT}TDKAPUQ2g+6Lk(Rh)fJsBd zSq`mDqN7FD$zWBJtQ(@MP1Y$wccY|@)=|c;p)PHejv>He7>Jk%<4>nGE3I*vVkOb$ z_@*%yTV1|Gbi7889CL&pAWjZDKgE1^y~Ne|e1J z*;WY}t-EWjyFX5N(3CW(jpcol9lZXj+D+$*uMYU?i|iJj^%XqeVb9&>g_pf>pXWa2 zxfeb63+xI`vU2v-2~8i>^o*uQpq_h7)8m?+)^v>Rl=Am@Y=o`zUUsu}-7EB2r>sY; z!xnx@IZt}oPnpg&XVfZ-d@+5Tv6|M?)+?5T-5Jo{5mS9?!`K$0(<*!yZ!yf*6`RnIzAjpM-K|bgUhJxW> zLogDI1{;I1pb!*;C@2NxpcYhuYS0t(2K~W6FqrVLw|vsfXOC~qM4Rj&@9Uee=;X3w zT(qnCAa;qIo-D

<#%ab}2cd*{~Fp?5%kxb}2jCvtc{4+KWW!2Ov5(|4 zu}jr?G#gffs(m)^#V$4Hd^W5FHT!YrVo)$M*$F?NDQ>c#bzYE1Z^F-IN@Mn`&Q*CV zz(-^w3eydqkrO=;JsY^1W};UDkH4&b@-+=K4TbuJ=n5P4o_tSqo+ilAP=)Am&1-i+ zJrsmBHKjS;t;biD&AW1PFstCixB2Eq!LDkS_O3&4vxR}*W_pdoBNvWsA_K4{qnF(D zV}m(NDpGpKx1t-usxKPRH0U8*qidQc=G!sHS@^koV2-)POhqb7I)PnMbt`Z+yS#Uo zuhULG2Y??LCzs?KPOMX`sx#0omM%q$KL_9X2K-Z)(yd|ywn!tKs>;v;b%Y$zP1ts3 z^m4x7V6!ht=#=34 z3A5eF!^RG!xzt&akU_@X`-;OK2v%4&@d-&4f=LvT)4FK;pYa zA4YlWA<(Sw#3$68?&Kk-8Pmx_UUR0Chl1*BCs5SP>BJ|}-09?@qz2o;%4(?nP*KC} zhpGbRl9sKeM%oWO3V2KE)2raer4M~-to_ih#@i1A3Sf<)8)s0#or_~2te8mejc8tN z>3rClM2NPiZK?ZEMQxW?;^1tA0wJkJKGPlYBGI*Wxp%EM{KfN?lnw`0i&Vz zq+UkdReO0j`4wSqO9%GNq#x&mD^Gvo(TiO@5k>&c8uY@PvswFuu}_FkF38#2y|C92 zQHu+kUZ<49r#I-e4|!pqb4vRZW1k{EeLP&}+UZlq zXCN4`uY2L3^B(O}j^l{WU@&Ok@xmeJZ4rFA#l%aJ8w!T(kHHojc0L>X#jz^&43pTf z{Uy9C=WDT7RTsR9mlas{H}JBZ@5Wxe+N-yYQ()V_ftTa_PVCjMz54NT0>}PO@N%8M z-|01g7cw*Zhj?Y2e;j)a=vd;F2{QIS#mjU4S*MpI=mnnrFYwAb|0?#13m?|AVK&Ix z{~KPu^KW9WxbQi={J^*WJzjzHVG*FX#klarx*rBXV85fhFmyg2d&Pw>;S~m<{j+%G zov(L#mGR04dHY*<6`Ws^EsE4D{yVL=`>!?qlkS`;y zi`z~nkx)+zM9UyD6k+u(M(4q*Iw<2nDR1gENGes#G6(1-143B@z3QO{2Fg~MlSwIB zFQr$=$`u*x!w(1&RMjB~Qd=(-7B6+yAf!}5idS@_^Xjk!Mi|{SL#1&GPFd!>v@SX( zZ!M1b$h*jeq_5?5 zWA?I)NN)SmASWfr>NNv$Y%Atal+r+Fx+4#y z?q}~4xts<%CxJdsxhA6_(A}(=7gF=Qy(5*eHNq}4$psE9GAizN# zpq2#4rvYj@zz6}(=>R=RfI=FeM+X?KM>gvs^6st2Wht_?i5&=ldtc%nrS5$?;usO{ z>Hz&ofKnQuUk4Z`z-Qvx3?w1SgwS8)K-Kx23_R+5GJDs{(FJt@)bnG~JhB8c)Z+|7 z=X&$V=_@R8t>`M#kz8+y(7L^LwgoHecOr*mxgK3X=#7v#1G3c|Qt z)XMFez*D<;r=U--ExN#J8%xWcNLp^)UcPJHntoGIq{a8FEH16wnp(br##LDizYC{a>8WmbZ@hz3JKc^w$vOt6K{4frC|2DcVK%jE_E@Qq*LDKM<==O z4{>;LA`W4B0fK+|S>C@&;=NnW5q-04)liLrVN$c$GZ8;KkO2mg;X|1`?nl|khXcaG zdXf*&48b(z*kQAyWYfuv&2oG)a)FD`y%DBI3fZ?Vi#Ra!9{0oc4n52qOA&|$yIJMi zWA;9W1qoarKPt#}_CUrs(Cd3(T7U)xVU|GIzy%m)fsL~w3rttG#yV4VZ0(hX#s%nL z1eqQ_Ha?@lb|DyuC`5ad(C8^OX7>_{YWb#Q4KfBPy3|5`wa|1j3{tFZq&tjL?Wdhf8EZl@E*Sxfq`Em`M~;&-Pv^>} zC`<8@19j5p{yozEN`e7@=ICwUJZ)V(y zARB}=_6lvpmozHfK~!(HI6EYiHPMO*lF*b_)C4imey_4T#c{zo9KZR{=St@b17A8I zN?=egkYYGN0Cm90uBQt6q%r=7DLWP753}lLTCz#j*--xn-f!NB;hR`f4A=1f#t+F$= zi;jmNJp_UQOo~6|1VKztWJdceYC-q`EtJ1RU&B*vOhS7KC|*f12+x7tM)53rrLiP} z)yAwlgKEHXBO70)?(E4RDp_7yyz6MSvcdVq>DdmgwOiA7uOeZ;eSK+qwvkUgR~l2d zR+c+7&!Qv*IssGjB;Q~ldnSg;$ z=yAl2Sy<#DN@M@~Gaa4ipgOp0{hImPuKmw4pERBS$@@_@^TW~)d%e$Wf6e{Z+kfBm zzqj+VX83m||M^(%YtIx5zxIq{{IY4@G`|OGP>rg?YEIozKVzz|nCh#h`bATH!&JX% zs^8LUqi>tWcTD5gP2&gjUOHHTIu`kh_$z^Cvb(j*TuWvZm-SGFh5%%kQAU<=S+vaj zKs3-omQA@@M$aYr9#$Q?yB53cQySrO@GCVfbxCO zEP(P`r~uZxF5#YyfapE%LZ0h^?Cinq1$o@j%iUSQ;5|A3iuBkJJ|=CWz~V|U*RefaP(=!>^&(5ttL(B;pXm$|(EBBNaJzOPfDFg)}a zBj7vcV@HkL_URfuDEF{+N-ig-Uy{qYt1rvt(yS$y7e8U@Fw>tfKgr;0t+J#i~(Qe6eH{d!Mw7;$S~y^H|X+ z?vlsde~tcIJSdLG#qq+}qEWoER5OY%k3n7^d)qXMOW!cR$>q&2NZ7Z{=d(ufW2VIZ zxcMp@q0gBT^9$w}dHk$7cGM_-UAz21XmstZ%|`T1^R4$A(f7^wz27KJo;z=p_MSgt zlxAM(H_9KdibnYpCcUIgS&GIphn_ri<;XL~pE)sg^63*#p15@4(xE4hzj)+m@ksG_ z@!XZC4?T70>EjoVzk2f8$?20cqg==oS?`D&yN_cB+6ZoI7=cp$+V{7kcOx+0xJxa=Ls&5EaOMZ zW78#@s*04w4Zuw5JA#PbH%@qowuU65eVsV8k6cslwknR46@Q&-O(2>T?V{B^UD#Zv zR}+WM!U6r1R!NIXPI*)$lfvr)qU4gKFO49jkPTpkMXAL$ng6y$c#1ZV)?qOiK9n9V^dwB5OJT0D1xS^H=tXkOpT;bNkqWDt-gzk4rLporePvH;EnjKOw3prwGBVL#n)kGp z=BGuCSr{}LVcd5Q_bYo#EuRZ0>gvGdmeb>n={pVWwm!BvY=ykkSYER&aH+%-)3@b< zcMFHyA1f4hYy+laL}#NJt@dhK_}vGhoSUA#BTC{iKy~vp5YMG$^psl~w*n;+jqgSq zz}qaLsJt}SyxA^6vlHE%Ae;SI9V8POf@XqqXltqVu1vc?C;_O`AA=Dj|AyC2&k z(&|8|8%qs&LoI}4x+M>)bQxZ#{_KZq#ZCNkFvXAA|rO5Eyv7AricDLjd6@)CW;G{^1{zGX`Wbl|E2Pe#KeYYwDdEhmh3 z+@4-qURi3ahRSDeuQYGyQm&DM^wae_2Hob$(j8Pskd`brTwT=0TAY0gF3)`1?nxU` zxO|sudtm8J{o`cY5jWn;qaF8t;Qf0Tvq*sXYveq36H8heXCF1=saW@$sd*;U*v>^P z3F?B|-xp0^O*@qCNw?r6GNm^Mnh1JCC+M08tkNKHpIZ&QzX#ZUsENd?Q_LjeOl$oU z8_USH=9PXH8}oN%HL(tlnEX}1~+uZD6 z+oxmUmNZ32YMsromW3Px&0!?ZFc{p{*S6g60r+!Y&ro;i_P2kk62g13r(+L=*a6uC zJZQU^iW1W(|FK#vNx|qoTu7KKh}N^eU|Rj`0O#2>dX-zg^+jPeusMB3U%Z}Ql4n>8 z8`v~D))BN}m4C?k>!$NT>$9e{*}83g$+X_%Md0R~pJ$J)g0}Au)(OCdSqA{Xj!7)L zbw34<6k}-nVBPORwh4bfwDZRCBcat6Ns08y8nZVz#k@$Jj)a&V^xfz!VAO9TSX(93 z43I7%o~$ci$Uq(HK)&iW0A4dXg$=n(E(2uvQ|wi>6yeNqqzGVmYa=#*CAsSxK|BWM zT=0J-ZMs5?LSzK!`?jee!^p?#?ufn70U4|9Lj>aahP}htn>d8nz9@i{rHD4=1D>E` zBgRzG$1xnC#S<3}2=wcfc9K}mC`tkv_(cMkxT|~7I|vK&7RmQ(V6gatmbRj|M1okL zY3f-R^BP4Ky@#xjF(YR-B_H&UY1^lck?Sjhf-dr|>Mra=L$Oy}Xmc_5aa%-hlq zBk`SXhmCPNY;v|r3>v|vAUhpk-ntZa^dXA7*?!15EH1v7_y8P<-3<{eSU_}&yopFG zH`o-Zzt$m(5jb%M`6vOO9>en$sZSA^Xf#LIB5=0VL7{=)0Qn9EVkrFXbDVN z0B)A-kZzwUYJ54U4plE??9GUI#O90O*<Vg;V*3Gg#e2oM+BSo z*szDZuv_)0f(R3_Uo=2J5TGj(>v}0|eGyAZwxGg6;CzC2BaKa=KcL~^M}6JaS}H|m z8>rX&H3od@rtg9CYt_FN=AuuVApjy;sKnc=7kmYY_Jx(O%p35nO0+iwy;U^w`RJig zOwq_4Y8Ux(z7p*T!!QD{soNM;i2}+J@N+`z84*kXE9?^ zFr+M#zGw;P0JIG$1B(iB(GHO(6B^9ANNM2>qYoY-?uB)}i@2^}ob(4|M1m1BjMrWl zPrg{}$F#oLaeD@YyoT!N!LbKlLiriK-khJ4Pbnm~51AAbtmI~U3*MQ0Sg+W;l!Dw< zO%nzaNQTY!b1lzfiKmzcg2Ba5rhhfxs|Hx*aGkRfAP8GN^`6$PAaH$aTxUQ@>b)Yx zMu2T+eJ9%HNWQT%;Di7GZQ_iOO?nfyTEsNeH36eaZQHVbEizYQc2!UfBw?OB5;a%J zumv8V?b=*_M4(#a?8_K;>_$=nj61d3jt?Oj?+OHy@eZ>Cypm;J#D~p#-ziidT9v}; z5U@NDU1q(%6Efn`y`oQI$EW>H7y=N>kJ*QuJ$z9EVOHQ_0t<0L0XW*yj-`S5v85f0 zGV?u}(KxS3BmFyEKB)2j9S%qo#qdst%Uc@v54(_W473cwKrvYaHW%!kO&2c$ZLP@X zMu@=5sAv;a0eH)|g}Z!QlLDZPR)EP@WHFp&u(-?3lzOFZc!q`+x?O z&M{1TicX5W&<)yL&oy4hs+yYbTC1wl zl~#S|-K8a#eeO*92)x3!Ewa#x@r=GR24E!=BTgrdiiM-j$)eBMAjK4+!$i(ybRIob zT!VSh0Z>QUK!11xEV|es<0UYwgz2nEY>U~3rUIRFM2%3OH+M?M<0TA=sVssPbB;_% zx-~5V;mtw=3tDd8#d{>@;?0+&=faJmH8G}bNr_%i$J-c{UP%X`5FZ1IB*wuu;&c?@ zip+*mf-G)htK2-?#wpetd_x`OPYj)PmjA>NwTZ|dc(_%5QGcRjqVT|c0|H1dbNX@_ z3LJkf4v|{*@$w$Q$3+QZ3v7OKl(@FNH|G&tMh6=+U_;WY(jGRcHC^6djz~Vod$g_0 z^JFBdFgmcT4geW+zKE#xBFILOjfnL>xQTZDs44JPDZP!}+9a#M&C~}3Iis13B23BA zn|dudMtPk)R^W!6jnXyB0+#=XskYL5A2wO&6r4z2u2UZ$vHJk+<8ZntOAWpgiwS}` zLDrA}#F!u$m-I})>VF#veAGPT+ud`zqnCMf16F=A;jui+uskD&3_YV_58@szFU^6{))JRcQnJ134xjabiY70e*3-TF5BfV0Ub&-(VjoviP$_ezZ=Ip<*}K8Q=k zeEwZuzM%Eh4$5(a8Ziv-l-5Hxuwd62vvZ8`(SmR06(2q1E%fJP>A*Wbbwp#`6vzs2 z!uu%l@glQUI*sd@51iTV7$2xk6e~=wXsjWfC5HZu+uK={x6y3aFC!U-1W_%*Q?Fmz z-nFwux<+^L^<+FrYS+-%m|S-Z)N{Gd2tZZdyH0evg4#t2Uo?kXC6j`X*xH3bzn(u# zCUUV|EsN%R;wFKm7}o@pzivVmX&1e|SX^&?v4_ZCGEcP&47;BP^HD zrv?~n9*~-0T5|uXVh*S$b3?n=F^R{DsDKl-BF|UMd08{}gf;RC`C}PQeigsMw|k%` zY};dGsb2OgWA=4Xr0~mej$t3x;>yx@d-86+Tt8^<*4KwB=t}hjg&tb$i0>Q-`g;8u z1uNoMly*dW8inW}I0a}cPM|mM=>(qDR}zTOgpPVp`FaI_Wwjq&sotPe6MZl6?D-%^ z#mcSEsfG%b=$Hm!kXHwICto#h#$Bs>sh*9E4Dy-t8UbdA=}t3K>Hvj`!YnJtSLNlM zJVLKAeOD?dFw|_l4)im7!1pJk+i@ofb6ybc#~qA4uY{qE!1a3lVKbkr7h3OY+`jCb zlW6P)=u$zBYB_grU~?#d2M=l*&KMkaF*(Xq~k6LflXf%dJfHGG)8!Q2NN^RxfES zt#6wsAoEQ+v`2f`WgK>7Orjy#>I|}cfLTL-r#0;ypYN%ot41W$FQ}lLBjKXNfhvaZ zdC(;}VSL#%ezyhM4e(cP-m2`dk9p3y^O-N2KQO)DSI7L1ScULQ*3I01uL0}U8N796FS_vIe=F2?X&_yPhZrQyNh0#^br zr0?4V7>q_Y5nX=+8qI+1O$pb!7g&rurdHI&N;Q^Pv9 z$ZiQK=9^o_oVB@VIOlCPxbVI2!RyY&JlDh!^kDq7s86GSPaG$))VL~u-k8Pu(=gf$ zNLpcKl(u0t0+ko)*rK46KynQ+Hp?tum&J%)LFpUmX~~VFmG8yR#Yrz5ZNR#K21!Xe zC5Bz$QDTgjX@Ljnh#23MUIY}|_@mCFP0*>RSsORmXKm-P3z;vATG2nSUUPqmulhf; zE8%}-|BjjagzFc+tUizNg}Vn}W%b}Q-GhLoxax`58N$`8!=+~O=S4iS;w zr+0VY(?x|S?!k0``~75ax!+GZ(EWaDU2c9FL%H(mJa!gYG=56C5G@39bjv>Q?8i1~ zWn596V}I8gz-0-cmwR^dd1UoIOjMxZa%2BmwiyhO*g=sUm+ItZC6+ss1hy)Dtu#k% zxOk|`2(>Frwnje#v$zE2{@B2_^N`Gs@i)b}6521xkq?*(Ny%+6?^WZwCp%E@yVdS_ z>+9yfb?l$PmiB*{`Q=RJ|IB}P*!$|v*W7=%^QQl&lmDq1eslL%OS#`WF zo;82RRD)_r4XbVHj5?1=+7VdIh;i;=5rlg+LAcj6!aZZNYs+AX7i4?ZHcBPiC`X}D2IXE6 zRQ-s2&ZF`<|8-N;I4%o2;fnCWE{USmvqGMimE)|C=X}VFkf#HzzCQzA-grSyQF*F} z+XsYPj36Hr@}i{jHM0c$s-{1$>9;lg1x-Jy>0i_I3l-d zZ)ulLY5H|dKc;Dag_2BE;b}c4WLd~AfzEH0yI(T}Pv2XGnf2>t4@{@uFspEw_V&OC z+Ajh23Ar!`o2I7$D0chW3)rTx zf7^Uc9{!ejS)P8+bh$V?uOEg!e3*N8(SsjzE%)TvC%EJ{oPQLc_-6Msw0?mU^M@Z7mnR>S`^G8U z3;oZ-ckX`)aEx~*M(Na(oM83*!;tAikgIa{)>DwTO`#vs^uwBd z#C!&qPwV^7X!==AKd0&EHT{C7U)1zVn*NNYKda+@S>OMhre6_S{$2C<38T_8Hf&V- z#`YPN{uf=NGVnBHBe?a-f&F!(a!|-a4?zwceblI&9NlPCPK)n_=^>-?^dq5BxwMxU zmv=*+-4D642lAY_y>O&pRBn#-8*mCXwwF5{Sqen{a`BZ=mzq!p zE>dK9vpY1Fn`UIG823)ywi=C`I_T>vLMZK`;mN+nF53tLanps7i@v9l0M+AL%o(RR zW)vf864>)on!Yd+rpRm@I3q#2ZHowg9=Vdh!=;-^Pt!Wzpx~(*b;`yKp7c@O=OuD# zj#|GL`4(v7*iN!+#3`*VoHP?i>dpnDeG*9VgV51ySCx8+nH=WS+OU)_t;}80=hWf7 z+&C|%)K%AUyRx?u2kQnv7h}hZ(@U6TTm~moTJ3OU@9OiS-aYL4U7(`{1>FWi-vn%JbGOj)oW2G84*c#KyUvxwt}{kiIb15) zV20YrbMlZHcOFbO2i<2JCc2;k(oHe2`T(sKiVB0l8w7HiZc{bjE7`gxTh`$<{$1PM zzhLldf@uvkrZs7UcL8f{VNFvYspbH9`phoyPJ{D}Ys-tYR(C^Sl>w|*8DwM|@yDwG z_*rHTw%To=+fC9Ih?d@w39sQNwMyN_cqhQ^tA(}uF3bf zu8%%Z?P~2QO+sDKQv=t3W%hefpMB76 z44vsSwfvu2Z*Oyf8V#L-TgBC6xJM%F|bvIES|^wDu#1*GeGJ@ZVz1S;wps)^|4VA@w4K5e2s@v#R=;%YuWlf_7QG* zrE{L~g!L<$^(9Ol?7qKbPHC>i%bLE5ardo~qO~TX`R*dxDwG_bu-2zXB59&d&q$)aWl78Rh@R^TFLbQ$q=1{tE0?K;>Lrg;2Ag5pL537SwZae(MToV55c80rTr*)Q>@oF`S(&mCx?vfESfIQ? zqZGlMz=J{7kmS|_lv)KvM23k2!gX-fHPF>qQv=*m1!?VLi9Ns`JBHALsD#9l{CD*G zg~{l2cj>5Mme5$k7whfVbAJx7he$t*SaSb>2Fc6$^*Dg}f@y?ANsfX9H2}qy3doYS zPJjhehLGaHNvHxW7n41%fNG8C_HlsQ_}G=rw%Ei?ldvnTlU(5jT7o~6%s!}5@CN{u z%VWmWS_a~mx3bY4s->bAG@!i|M0Eu5k{~Z>XuAuXN>U-t+bD@hnE*B70(6(GUPK6n z69`>#LKMt1D15OfRKOT6xHlWPdfW;aO8_4AK5c}&BU#|bc}W9P<=`+CDhLU}pDNjL zt8ii`1tfie^c9sDRdPYb>DqPpL<++`#<6W^n=Al42B=|f)W}b8{VsOd1rlcgW|M*< znL}*^%?I=X>Mp=JdlGzNW&|r{z_{w1aSsYb$&tUuCX<+24yd(7{3KGEQ5+ZJdBeyN ziHGU~*b|ErPwmONZ*SL`AXRsE;;*m+m9&`Xbx12duMyN;4cpMD=q{%jjfU=WnpHJP ztn-cB(s<~LVn9`1(z3JzSzN35JC1={_p@M33IS5n#NXIN>LL&6Yaa z0oeND5lxw3f=A4|awu$t(;HgjC?WhR`VX9hi@V$D9%#5OxY!UCkYX4;8}9IT1P5#3 zemZDA+>SC%J{%I9)~Tdqo9$%=woUpeSE+5r9`~L2(2Ng|Pd<7EE8K4(*T(R6xHZ3( z=-VjSRw>#31K|OG=m3`2cN_?Ydjs%qyV2&_y}w=vcLlqH3_|UoKb*|%@+ZYj;JJlv z(KtqqMdn?=RQB(h&fnIUT-wb?JBge|^1GnGSUJklCKXW;(rA(*z$|IlD87^`m@5=B z@`luWT*uv@{2vY0dT8_8@8SD6cT z1{(#y8(j)TZ>UfSWxy%}1LRVvUiM=4#?}8&#rD+y2_vH% z4BX*acK$@bmGSW>|E+TVdnE?AH>=IknPnU(a8^NjU#@8UwRW#nlvq~-Ph%;uu%;c| z_?!Zn&NTGmm0fhr3wdtA;VET50j$^o# zBRcEM9jpWD{m!_I^qIQ6Xv<-M=Ru(9tQL?)3i=2!9S4+PMi^JxzygmXi$-mGIU^?F z0GlXd(pWP7@rDkd#)ulZV%_p=kr?BTGFbrh~A_}{3 zP$Z+AHo{5992T6x!l0NN%;tb(L@^A5vkXww%%D%n;lThfKvWtzKppv_Z4?T?C;9|{ zu>;w@F)4tq?Lu}6*-a+KK_R(y;N&JkEXXNpmkSBzk6f!Pok5ZA@yh_h9 zMv53O94#{FZV>WZv1(WYTRD`&t_&d2v+bUJ56NZozWrRhO`9<3>OI5(s9tve*tn4^ zl_MipE?0rA?BS@~z8+4=9Wwij-1u&Wr3sGh$Zgro(aT#WAlpZH+`&O4xt(%1$tfhc zT^k|0MWM>52U}ZD1|Ss#`D* zIkEMYkx@)A#^KcX%7m7gCy8)4{~K|g;h3I^Jy!j4IpI`J8)7j zOu%tgGWDcMvSx~E{YeGP`ECL7yO%Mq5ht&f9b3`=F) zZavZ5YDwI^q;5Z!e63}8gf@$%kQfYGi0$08q+R0IVgvnUnL%llMr2DZInq63ZzHKh zvBhhOnQX1Ptt*^MWMe-)DOcD;+Jpp9!@RpexLq=`;Z9$r1^MTQ)j?)|lb@*hKMi9{dz+qr!*v zFs3euX%ijKh~;-@v~G4LEX>2OWkusA4jLUncY{ZEO%ii5I;5~q-tqj1ayp)2$~=l* zW;*~5CuO4nk}}PEGCGRE|8AEP3QZs}<*Ip(oUXyLX)@Z48i`L+w&TJeg4ZZP*&(J? zf!T;&YaARy{w%2^8MdK0wr(tx#0TBOu7oC|V{r2bn^cT)K7>7lE{D_DL%<vqhsQWD5r@`0p2`QrjdnXctu}T$oK<7e z@M$9+)W<1et=xzjCVEAjvABiXy)cM4;G?CQH)_Lx$A*VE)}82iw0Tq60Pd#n-C|F)oJ8R{ z37J6)gARWRR)h&#YAbA9c+;qZ#Jc859rniR7lX$CTT1uyY;F5h{~_!0P5bYedFPMJ z@2kvzus)gfKAwBc{g<4h`0sPCg#S(czq4}RFZCK5%pK-ARYHwvyE>vy7zd31vzi%z!|2s8_@AwDu&3XHssA9y zJ{67@isbt_YBLLQvMbWtCG98{u5~V2^D7H<*Yl)wi5pq77Y5`j6+pcb&3Wz;5HMhB9Ax{Z zsbG+aDHgs35+5hQ_AkqkGJ3a{HBq`3?5|5=sH6#Y8wB`?>3Olot2bt~vyFvDbFO*v z#`N4m8+qHCIA2K@B2P4yr#Ur#+I{M_U_sXag4b-e3YQmeHWrT0&o9ns1X-VcKGmUF zc4-E~xR}gqYpBVFtZgT`WsJD2(Y9UdqGkaht)wj0e#xg9B+rzM`&-&%?kzG)w^+S1 zQbE~DtU|8p4cBV(zYoIK1|93J7KU~Wpf)yVyB0;;wUb+GmUfkmR5oGR76{`WR!!GH zMAyT8-Vftx3znmhVldcPaa>okls<#Wm}eV`SyI7*c5exT4m3t#72+c3z&Dh+U%Uop z7rTF0fNsipFXGl(x+OWRL3*-poSC~lCwhrVxdzi+RC{xXwde#yydG|EmG)qlW?@gf z14|VeHHcU`&em>sIreN0yN+F&j&VO*m3o(M;=RFv8V`tJXxRz2cd@eL3iwN_`d|d# zdRweEgybg#jdWu}-UV7CIcP24z0Qu>yO`uH|ApWy)?4nPi;Hx&*H@#y+U2XG&ahRr z_V{YIueSQ?g0HstY9~TiU!7<0SK(f?GzU4}{$Y#`K9t*py~5MhS&qC%EwYYTItF%S zae|ulh>X-snFgl-`_5z(wB;k5PL3r(y{@nU7Pw&z=~WH$gmQR&&oQxlrhnmJ-a5`1 zVy&30P6D4(uAavVL~tUg067=}mrw+eFbpE04DF6aYbPzZ*B803(u zg&+{}00g37h=ej2L@0&>`N8}^R36di%~K|GA~zTeoB~xVb^1n7P3S zOIUKc8Vge)N{A)I7Q)%z3dtlv^T?xmdB}*1CnPJ*p`5=O3t2NDrAf@LE))2v#ysFZ`q1SE$x;g~@(GlclVj!##MO6)zbz7|CofZ=oj>@m8L z&pl!hCTH^u=LE$+L@usAjBXT5Ym=OMw#qP?nHXBbIEyH3#=oerj*S*N0&4)&Y*@62 ZfizyVoN2~tCSB5{(N|xkg7^EW{~yrTbHD%q literal 0 HcmV?d00001 diff --git a/crates/sui-framework-snapshot/bytecode_snapshot/53/0x000000000000000000000000000000000000000000000000000000000000000b b/crates/sui-framework-snapshot/bytecode_snapshot/53/0x000000000000000000000000000000000000000000000000000000000000000b new file mode 100644 index 0000000000000000000000000000000000000000..7a2443d5f54132e627ef68943f13b9a7ad506532 GIT binary patch literal 19848 zcmdsfX^wbFNA>hE_e{?W(711aMGz!`0YDNYK!P}U?A2`a6oFpMOb@$z zNMdct>y<5Qy|$&bWvwMy@@l=7y_WvS4u^lOf5;9;C=~MgmmS(z|8O`I;q?^`9})H{ z9P;tbqI~;DHGP5#Yo|VUY-+MWX?fLWdzX*SA_TT$9r~=Lw#o`@n@cUf; zo;aocNchb_G6&hy_ zlXrAkl6U3!3BkFWo6O~M)m&+6c4lg>Jhi;Eyt24&YJYvHzA`sc$<=ZzD?!mOE-g)+ zU0DhOKj5}zTyRS|n&Hi5x?uZ0e5MeiZ6t9=7rADFC_JQC2;eF5;hV6yM&(TEoYF#T zZkwVwh45&bdx9&33tZ>m;W2dxZEJy|T$i~V`Ajan=jokmC55H6E}&*maFAF6RGM3k z9}1!|`KUrFS#q7{X#&?Sa-kgVAe&I?cO7Kx!c(c$jJyMU+VVa z&izf3>sEZf(;xI&gHCr-T)UEcJ^skVU;QxN9Jp`X`(oT4pd$N?Euye*4|<)=`_;#? z8gl;?nljy?SXyIjDftj-P@FH z^wVym8H3nai`$)z)_N)RLAyTaY^`_Vo{gyPS{$s!=z8~2v)|o_WxUZDsCZ**@JPkf zdGGyRccXdl(IDJxg=*GZo{Yr&v9K<$*i{zzj^ZT8=fd)^?K z6rC89>HKg8y+=(9mpAyh*-mDOYX)Nz)5O|7cSdZtXSU63X}0=(jO(y(rmKbRWX?3x zt~ejYZ5qhnqgH2tA#3)!-HkoZ4Q%6|kdD1~&mXpjjKtC+CABmT2=lWv_U+^+JTI~`Hr^dEyezOKkJI32v(T#ib9o$fbWWOIUD_(}vEg8g6^%#)PTmRgp%+ev zVW9FNTnJ=dhBLmZ%Q>~2Qu2o9_`9c}F8jqCk_(*q4Dzb${ z#q*~J*wO6zY`PW8r)hL^+>@6D1~W6G@GXM3hI31up0?msDUH=ZmN) z=mQ=@vx+u`E2J@qO43y*2Yf)o6JwnysVc=<4PQnRfkHtlucC5bdBV2}qT+L3l&q+N z(}J;cMT{}`Sy7?fY9R6=s!3nvP$=r1#5cosFBodaCl+jy{j$jT8t@sI7V~P+a+Wvs z*ZHFTTf7wfV}1_Qk|u`b(~8`$XvaooJO-fcfz z$Mzq@8*%S`yxD%#>~7^Yu+w6HFxyjKnargfi_xsXi8LzNeVgkY6iU_Z@$=D3%vXW= z&Mm>gJDB$3fTL(+6b>bs0G31&ummwfNWzjx0!pxN+S%avoJk?2rB~&vLR~-PeE5B? z|GBtm|C}}J{ifvvf8Y9tBKPmWTL~V5fx|+ektvXqBgZtsp^zCjU*HpXF+cS=U z_JdYuv)Ng5vp`?dR*1;HPv=sHcKYt77Y`mZ+uQv?cf+UP1_(BB8d10(Z*|u@Etd|S z9@UV?QIV8xUPI&Jpcp-dFK66wZ%U;P->WpJI zgiEz8I>=VS<1o082#l-X3MX+XMmpTM04fc1S#QzG2m2rqkL${dllRF&i6}<6z>0W`&l} zGQ}>@F1DW*&OWRuR>u-!m%+EQX%}>pkeyh~hck};WoP*{Oef|$bIts(RdId9jHdUq0`JCg_< zoSJ6r#uW12nwnwk^{H7LO>;S=N6`!iWWkqo?Vz_>ihx{o?F<@)GG%u zBTt7HN~gjL(--uGnG3ULLbIu8!8K$WNEC{s7Y$w?(xh+%&J}_GmW9&*(uwdq|vWY@fr97M$(Z?DCV{Hxh<^~Top%~r1;CneoUS=qtk9}bhkGLc57=Z-dszBktc8J*1dK=KRjN| zNjf)rHM?mGduS#S#2_|847T(Snw#4jqeJ0I$Ms?&;850i_)$h?&i-cFw6utNO7=KMkQKDFlOoM-7=(;u2g6a?(VDH+c0UexM3HDv z-Vw9CX~?D^UiMmTBbV(QiDAlU2)2?hKbz&*QQ+>x9X(GIr?Z@ocYS78(s-ZCMwWx{ zgp+#>LX{ElG)`(GYq|&|GM$BiS7wx)bf|;WH}hvFTUN-DK8$;PunBv}g-&Spg6Ojqh&7@p|)Kx4Z6}5Tvi>z1T^@QDA%$uMnRQn3t$9Oi15*aXapONWzz4 zXezz^g^B`DLq;ALn+ry zVmoX7G~IB+{c>8;j_ON0B26Q_GzwF?I0|A4pi@uavR59TYuN`h@QA5=c@Ltbj?UVX z*!6mvZ+x~6OE)v|@Lm+VzWBktXm@)eQv^5x`Dq;A zA{3uNP6+rH#3gYU$GEsIPFaqSC-@Cd+`{?#x(9qg4GTO2W(<`q?k5hn9G(lToE4rA zB-|*lO<0+*1NUG6(K$TiTj5#43nB(tegX2nFCjCNq%KM{9Dt)s5P8|9&@j)`IdI9! zC-D}N`$eIZ`&#jFJ~CsDUDuH{)L*^(@(k|P_A7dZ63B2PI6qBp}9*kHHk zfRFQKc_=3++m+C_hgDYtTg~Orwkz7VPVyR<@v<+6J$P0C?AT9jkbqRtL;3Rc=tP9R)2MppVk?r$W~*x;7cK8Wr1S0}PGpF^&{i84{lk-9uRN|Nez#2v58^P@OR zT}RxBy1X=s6Y5pp2@luhOX?Lzjg<{pfuIC}4+t^{Y~L0QG>X&2DN z?Sxyv6XGcmh6x-%ivwusoXoKZ2(UPamt(WT)pGJ8b_0l7wA)T9*B2*s4ZA-JqcZ?G z0J3`GcokbIW)ofo#B;(Lah4DqM-nB0i4vMJ1ySE-He`Ch7X*@iqmV%fnCeAQ+;5%x zHkaS$i|R-Gx482g)~_o4JNiBQJMNPAyKW=+FYXUy?w{p@!uRunEi#Xt;w$_d5S^+x z%Oqd{Qgi~4g$fd&9NJ+KPNRfoj+5$0r|F2R6AI@`LjBGFX<&IGgT9RB1+-%mVv=FX z!>N!nH8;=r0SNh=Bz=CE;*OAW6pkp=aLS2ga;;(oOTbzvqhQ&XMOYm}$#z(U!0hCF zg~QD$0d9d;^8@lG!xDM(MLPJL)BXg`%qedYD$SYPbZ*w0;3ZzHhSi!k<4t?jnKC}B z06<8RH%ZqmF1LdF5FOoXYhL%8sF`;zQH#!ib z0bg-nL2C+4WD;vMk=YAngWi!yj3yBtKDcqIK;Qr=A^?e97%?5kIYAENP~|QiqPk3y zd8z{}WTLc@lH*=Jd%p#xT5m1Y^4%gl(oh&JU#i-xwbs4}EVDUexWPjrPe0Y+jl|x1 z`$61(*lcaCH4_p@#)(jnWmRoz(-1SAY;X5^(AqU00NZT#JDcse33#;q;0fx#r|JDZ z1=gCV21y^7sr^RiYhj4PCTO^8n(`oSttBB~yX&>iCNxygl4adUNc*V@Fw^xphWn0t zLk*vKe@w$?^m)ZCh)$-eL{jM&Fk<7PSgN@D1T=W3)b(jV;Xwy7%b>Nf)!ZOih;)BR z3kthBR~){lpZhUIU?%w_@U-b{rqlZ|!Oh7Y|5O*iSC(e!KT3ay``7>7F#8_ynL?aM zmg!03VO0t_W6fIoJnJ}NZimEvu|(S%(0}3&p=Bcd95yi_LoiS{_Gw2eyieymcm%O1 zvBehvzzsL?VZa&1LF;7^8F3W>_Vo}ai048-2KJ%I5UT<&??pDwvx7d?J$4D`l)T6} z>p@?3b~1qNLFAtGC4$;>!Cj;Yp04`-ihM1}TmX~glfnxPK_%Xz450->u5@58((xZG0?~|u zcVv(iwMtE=y4{ti5J1lqYSOLR7hk(>I^&4R$VaRj7DCVAX*f3wL#H|xPUCUp(*WVH zz#)Wl%w_*$s3HWGY+E+kT5%4&qrbv0g5#0FKjmNLh3^5hr%VdRJMxk6h^8R~H7a-l zQl^@J_@G?4L**chC?0JMx*=IgY-|xM(}b-6ASxZV*ZQsI!;`Z~0I^L(1Ac3c3G?zn ztN*}#7`NN4ho{aaUpW1aPw+lTS%d~+RnbB^VOTpO0wp5}E^B+^okfJ064wHYUTsjX?3Y6cT9Ak;9 zqI$u)^}AgD3XIOaCw|6q{-yf1qyI4YGPnOQ_Z!^%^}>zdzZQPrA36oJxF&_8HmEFktsg#HEgKQtc94IJe0Tx?yd zwCzmN_Hv5UrOy%5RHvR-N%8Um30+uJjL)74zzm&${-Su|Bon9e1t!kHLd}{!x*tr@ z!6T3qWWI#yC2Mtr)tQNa*>n4eXIT&h=A0GNOxJ1^G(gYu8S<8Dq`ub62M&_Aa_TgB z`<9l;Ypl?0)d%KHhG*uD$=QV(tjD-pD_6+!3^J?bHl|R6ms?n5i$MXl2bF5AS`Vt# z>g;T_I9-{Yo}HO3?VFpOoSi?EFXRd{)zY!K>QuFKw)Bi;!v@O%ibCv-3(F{2kAaa6 zXkH`2@JoPLpd&GcS)^1!4j5Sxfd(6;X&oR9v81X1k3=aJ%*0500f!rlF{3kqW`>m1 zsd~f0^1*+B4WI1Ri1)&tg+dYG?cm}ZLx6Mz(>0SKlvdEjI2yiIn8T(;#LH3Rxd$#B zsuH7187m8{9r(Va1Vamb4zx5dH$f!Tj3O-`ETuJU0zy;{Sw?WA7_JZ=xI*J<2(r`* zbQ7F7#)Gy5(=BuuLxnIb(2^QWQN&$>25c?a&p}UxF~Xp!k^ZK(nrU+0B3(DBIt&+B zST$OX%b5kjPCZXy7=I()xEJ?kcD;|As?F_6yW3m8YwU$gJ>_BQSY*n+=Amu6{ir{P zH*ODLB{s5COIcL%ZpVXZs1?Z2Y6Mk|V9G@Q^T*Qf_(MHJyp}S%6DjPPY^w<}J)5w- z+nb#aw&P9ObWH~I9JaF&1Y%7?HL@K@jo;Gkdk3fcDR=I1J2+yX6P7oOKaSgA z=|@H*!~_?K?!jQN1%4g^z;PgJr{M6KqMp9=MZco-yO!VXS7EY~) zCz~;JS#4Oo_3T7P@wgU3_MwuP2Os<}CZ)ol)9!2;%Z(=Z@;1f>rZhg;Ql#_8aMpb@ z0jFr(Qf1jDG)SXPKfyo_Hg9A-2}`)On7Wnm$Hs>iGv$**w6*g-Od4U}*&1wPu!C_0 zOnS;a&HJQ-7{|z-KRO%t`dQ;_c2?Nl=5tSi+i?`8wZKMq7$P$(`gvlabo=hL=IX6$ zS6;r_ym9sR?Mp9TwV;kqerhodJk_JU5X=T(wv!YT*3ooxJpvz_^&t|Ov$zObtvC#H zh1ButSvBE_%hrAmnStt?SG>^i?7ux^M}fQsfg4ybRYLHhafe8h6Ugv=*F3J^kfIuUd<&h|0N0vNhjNkwmr!g{+9?Znci}JGX z`4W6@HSp9`U-F!W-JaS7JOgXO`Q$tMm@~3U z>iy%2z-^#&5|laMd*klVBTs zcdS>gnuQV6b#*KK=(4d3k%v%7vjK>?Ut&?sSZMOZLW}s^bEif%Kz)?8^N2!|(M}8P zlpK>-LwF0zb-9m@=AGMz$z8A z@*-`AE!tyWAYkQNR37_D*iSO{r)+W$Q8nkl%){^ttU8RoD5433oPEKA-1ab+XKbAe z#-7on3wfQCAa9cP<0h#+u9LpwGgTl5pYwnKfBsaH@%yKaF!B6>gG^kUo@e658<2y4 z;uxI2#*f1N7C#R6Z}UqS$20F8fxFF@ne{jM1AN{~cb;Q%^%}@~!i4GWquTn@q;*N0@wY9(g}F58^&KU*YF#O#U>d@YneH zZ6^OBzl@lli7hWrY7SzYLn6H|}5M>l;k|b>0Exuka4y{|3L0@HhE= zgnx}()j)&P1#+&E^A~6nR=;fAUnSSxzXg=wC1e2hE2TKqw7f% zuktzaK0CNdUb|0=Yhvv%rIjzP?BlY$@y@$&H$VG1xPOPgQ)A89ckAt`&+Wf==vw2| z#+}CP#!HPiE_|kb_rE4aMFx#4aZ}yGto7yME8*#y^ka;TQ3oOZvuv99-@@4 z+x{GUq63XTOEOtPsEc4BDBjjHBrh#-lL~Dm%$q5MqmTahIQTop0sIi^1x?N0F%IY`*F|EJNZU|Dc{C*OrpX((W&|0! zQcKh6wpVBd1pT7xUTLe74gvR}azjX+LYFawz8PJv%c!IbDK+ULYA`aYDFX63B;jF# z#x9+WEyhD>YN^mAUC>os0W+pcxX^_b(IKd-Tvu?j3pJru-~t5m8l{YhAi#i3D_0VW zM|yGa;VJQNfIW1po{uL0Q9tZ$;1q8i0Dp{!&*F z3rY~#x*1b!`_8(1 z?aHSxc76O7p8Hl}Ss3rSi}$!$Y<4>@HIJ}Vgm`v~*d1np_C}wXOh{;_VGj&!C_}~!<(?*~BQ^61m1<`1aBVdStfcE* zL(pe&4U-fnPiWTu?Kbi3{vk@a$>wGP(J9^4$zChU>9 zJ=PWq&5wcv3nnQ5ShwRO#RLstm|FPysZR=~KZY^1q?@v&I+wIy(u=UWZok^bfPAfx zqJr5L;cjjBAK@F~|}Jpu%i?~r1HyUds~!(}Me3Cx8(0u1~6LH|Lkm)*3L zbn!SCH)9?{2mhZpWv=d;gsF0WFAL}4t>B>rz|%3%vCF}G-387}2gbIN|1XWEcjLcV zzsF1_lvzL-Fg#(9;0`SCN87^V=rE|wLF=Y|yq1DJPxJndL&QK*AnqlXM1S0N+Is`X zxcrp%+5&!<{4D$lk1UiL8Uknm`e1&RE(}8eBhonBCrd-PRF;NPBSZGd;4^UN_w?dD z2ol0QVfDo+@lzzy3F|rSe*@CoUm;13B)X2yeTh_&U*XnIbMdDkRehCMA8S|sI+ zFAFFXn4lHTs0D-Ep)<(OVfYc|vP1yI)5gl1!{#xI4rh(!Hpf>&6s~YmF%jW!__HZM zM^F=V`oOvuadjKl(+w7#Yaq%3kQY{E6_8~TTOown$IVW;1S~y?tAR3H4RNO%IXJ*# z7gjb-qyhR4E&gF;`K)>|%`ll3tvrdb3vU6M6aZW`&}|2RH9*P8CHxv!?2r0RzVx1N{w*dBeq@#lWRQmUJXXh&p;9$=C*;VGd~Uv2e8xbI(~ysx}Y- z%Vg@xeu@Yw;vgBqhR@)BKMzkLuLT7499?j|;5*5yx#Rkxx=dMI%5oHc0ANJ?5x$i4 zRFsS~ttf-n(#*F}6 zwWn*ouL4U?rbKcvALGjQoe|1h1cW22Ccv5VpN z6sCrSv=aoGliC6U=cnHVN{2ZRT!N`EC=Nh#fvXl_K|Ms|Mc4%+vVlL~K$G7Ir%d#f zx_lGShXV~-9TrXG<+}VFA`d}HB7HXu)k9c(y;zs`5xE~q2&ntR5+YHxYQW%$vD?(> z03VZwt7rwTDti`&TSnocEYY8Nu&_vqFhGtb$zlfIO)kJL)Dgm0=A-QcE(~;mcD}c! z_AVjD&}D>3NuVvub5TQEb4tjpB1b z-~~lxW&*TH;VM3xlSe1cDbk3HazHs1n6bL5-q?{~Q-Z=`E9Q&gx$sRWVFDWA&N!9t zm2@-{&HBCo)iVJUUuYOD$iDiCaY8IZ>}dJ0668RD9SG!6U4E4-Z2sfz(G8@WCbPZ* z^^tbMoTsC?Mfsa!gkH&w=1sLQ-h=uEQ(z$|;4dB(>m z7RJPoK|F%lUIG*qtaKq zxE5nytzmtjQu@;(nCB|IYVrv>!atZr+kM=mTE>{5Ww7cQYQmzGVVPJ&1)|zVy(I(5 zF|Cx3zYJmtx_|Z-cDKD&Y_xy0%2aqNf;N^6^a=O1p|_zk5I{ZDzm~D(M~P4UVO!ku J_lb)8{|#>VMj`+J literal 0 HcmV?d00001 diff --git a/crates/sui-framework-snapshot/bytecode_snapshot/53/0x000000000000000000000000000000000000000000000000000000000000dee9 b/crates/sui-framework-snapshot/bytecode_snapshot/53/0x000000000000000000000000000000000000000000000000000000000000dee9 new file mode 100644 index 0000000000000000000000000000000000000000..d6568ff2626faa32de6303366338f09330d01be9 GIT binary patch literal 33346 zcmeIbd30UZecyZbIs4o*-udF*i;(~b5(GhjgCz1$BSBKsL`l#<%d#awAaN-{1OW;F zHQAOGPjT$nP8{2D;!I9kr$cJHO_MlrlXhjTrtdXP+pMNt?{!F<_u8bXJJ?-q`qt~} z%lrKHx#tcfNGq|M_x>m(?!C{R_x}C%Z%@DPzLs^fzu)--@Atefj(j7^5zAMW?b!R= z{Wb6IH~qh^#&iEn?TtTR|Ds#`B`;^WR%j{9iY(i*a^mvD<%=s2mlnfzupCD@wsMqK zwuPx}+twG>HqLuuEWL81dST=0`u5UVYk6gL{e`7BTALeN-i6K8?enYK!OH3@OPhqR z=*!F7FFKd6t_A!{y~3;OTgw+)OT;O4o&8}%&cZtBZq@~s^*evy_}1U~(K{rTE@iGP zjYGGz{~XIwUSvh8tYTY5Hf^LUh9c{>*oo9_vG!v-bVA+q)ZmdUQD#r*N)X$T9XXLi z7`m0@plig1Wz7u%5>$$y7fkz?y_<=nJ#u2gR1n#y_BZOu^c zRJ&@sb`m4fR4>;p*^O^fvPU`IrO?`;#opn!V&$$Lwy1YE{EymyBRiyMMAqRG2V*O; z51**_rIL=3ggd3$L#pvK)%f+PB;8J_ZXs1EO;y?{m9=B41ycEGDu2gR-`uIJM@gmA zRC>o$e{-i)&yvbcQ`w}7x_y}PiS^b_sa~M-lti~<6)^pJ&Zo5hP47hbRex{vk9{5g6aP2u{Le&w;VV(D`16r%)m2f|)TEkH zdl)B*OjV2{##Xj`+m5&$*Rvd7TRIop9wNZ?sKK~MiO?|fgrv1*Tw$+aPX<>b2r)+@ zaW`Xej|JkMj>QaY>Pv;itQ3lrFgk==?H(nj+Sd^Gejm3zI7pt(gjKSfy~87x&X4)F zr*)}T7puH$T&#iGfLIe&6RS}js1_^Ds#_^n;!3_!sN^bMMOR9dTD4wPp6@GP*}2G8 zf#tg**Njtp#&UALi4tjooz%~FBZsf-lNh8CpLRGNy`R1-qB2V=!iA{H&pA2cqCi9| zd5Smn@a(_}B!*JCfPW?{)%HfR5Ja8HPh4qW&d({To_aadBFiICcxE5U3zWBT!N}#X zZJ%1c;+h@6Axs>JDj%+3%eSvoP7pU^`>iSl2A#2dCmDYvL*78FQQ%^ZNRa^oRFX zGQPOEaXG88y}Gh%b^Yd<^@sOoreC6lvG`><7WyNUF0V3mW{tbBe8pLBy_(xN|5EG1 zw!3v@ZFSq-maY%CUt5xfLYw&N>dMmg#?tEgdTXT}!eh+C3G;AhA5)3V1Z*F(v9-*vOq*nx3&}FF66d%q zN$`-l+a?up64%U_zArOtk~_-4PCRAHoaqPRS8~eLw!d%Z#5?TqMz%_Hnfgqwl7;yB zwvSgBhSZ)26$TNemy0odW0q7N zPAFn(t7>8%EQq^Nq%4&m9I|Y;nMbPIIV0okU}Q|bie=+j5-Vrdt6Drqs)$`}PgrHK zrbkAxMoXiWk;-tz4jYv)tc8t|A9`WEQVHv&YM2Y%aIB)jW~o^jD;2__(okivGFV~? z(CM^*JeG+9iO*E%w5JUbx#H^}z&oN|#4{q7j%2FHW)o(DGy~GI=!9#Gw6|d)iH@*O zzcYtPPRkv~$xCr0VYYJ8=y+0annLCbS&N7G5iWC*)TSG(2xkI-?WABa+Y=5kqf_a+ z{K?H$D}DfZvbnyz_Q=LcOP_5mU%YM_SYBCai{)Bd7PHE~xODz?q|Zw0waPV~ms+p) zi0@{P`0h*gws#NtmDbkw=Emzwt;<)oU)L*}8&^sfDS3&V#}+|L6c`u}$$#{P)^;bv z6lf|bwIyD}6w%r=+mwq1gsy4%(mGAw@>jRg67o3KS{KRX#nrVHhg3Q8d8M@#c6|%R zd3l4zJw~?lHSYGF6kc^9>_9 zorq2iIciz;heI=C#f}OcFE`0fku9WT?RlZoh+Qc`=C@viOY^}6F`_3~>;cwN1ORh(*M)(Bp1w=TLgg@!Oq(-6vJ6@lcog^_L) z&+myRGkD{hN@jL1cU;9WxzTgX#8_rx6h^EwG3N%tyvM>@zWHnH)=ih4xbiF*fN47) z#Yq%e^D=*@M4Hg2!hEOOC-gy=-Kp}FP&MBmkw=zTY9Nxi-Wlk`gjvv&d ze$;(JQrpvqPegc(-c}wse4+t!bgC4&hgIWXTnG!o*m^j0H*(ika1C zXs7&7cQ+->hm&O8=CDX3iEQOMEhZt0vvxxGPX-Q4RyM#tDZMATiWeOy)eY5zhUD{M zE-5n1p`g&6Ajbs3Li15BDa9;1G(nC~N3tm24iV!>dM&AR%AU{a83m?sh{@}Q>+)!{(+Z$L$nofk37 z4%sYuYexf{m96nGOKA64U~^1hIl>Dp%wt>UTo&&lBUz2xN!>1y!7j4Aoh7S6KE$lH zRMH@L7$bXvnM|fKn-#vTWId~FJI9Vr zCLjf?Q4YtPEQkZfY9wPSvSRC7_h&l|&Sb{z@sB9yOX@RP|FZiN%KhJRUk$vEmVUk9 z|Gly2b6?)|(<=N2x)_T;~D-@d{R-9Kc_S+`oZS|=#(o3m2$EhMV4YACXtknnulpZ%tMa}>>f!KSLV zD@Rq@_h^ti;8{7=$09I&%QuHuAycKtK~*Y&*41La5psZLS?__iSntjk#Clh1JzX?kYbDCCth1G>SeMws zV69f`mUUOdV%k-tIb*IoB<^)%zH-;B z(stvWRSw^p@0`Ru`q&}NW2eM?=rG$*``lw*MMcj`WJUNXvkOdXStPb$Ti_m(C zXm#6!Z`7bYLQ@668$(HNVj5HBI$_3B43ZQj->wJe z!QC8+CJqt0o>ZnlI$KQ3IJ-rfAm)fHgS7CTa_nw7-B_}bPV4FfouqQkO5M@`dcf?` zea;=UYs_@R+-)iq4Cpg2Dzle&9KWJ`4i4HCA(u`^aUtV#b<+(|p|2@`A~H{M(3xBI z-$fChI7|sd?1YgM9f;VWP>SQ9IL-duoB#-s(oYT!6m>G4MpYsL{EGRaFX=$>X!nBd zB}Uq#rkkmsU!;!G?`iKtmk~|^OtsRSQ{qTYnqv-A)mRQ3(y~nP3^(abPmZ#4ewBX} zGL=(mx=So4J?Y3Al8a&q%eBALQ;bd%%r67-D*?oEKad6IaDXPCbXN2m-AitpH55ri?L31Pa&7J+dQYYL?j@qLtLt1KnA?fmqgS?9H`d)pH&AUbL$h`~)SMA%AsQq~b zlE%gjw=B`LjxIu{ao^bm(Ms#e#@6aKH#%D_PAJolm#=PY%U92NWwq~%vpN_`w=S=4 zSH(!1+97qh$1kO@OZ@fiQtP!VtDCK*?bXZVy?ps*2cUgdS1$Kh>)UlX6E!6tSvtS5 zacPM>wy$pO+SwbHB*yAW>qg;lfC(>2`pe6km$0sEu3l&v4@0hY32)=(tg^Z;*IY|$ ztDWxXJ*15}E#1hj&2pT~Qh4X2*5iA9W4+bBU^7x;$=sBc)>b*1-MG?P&zPzAg3Mpr z*ro+>+;*7WaW`J&O0aCCKyR;B zQlB=xObSm%$Kp$&AlOMIT9ps(gW?%wxQ>Rjmwu;x3(Dh zh17%bZ>Sq=BhwA#DV>(H?0nl;!);4iHs@y&(n@)oD^*I&5ys4!*D zoivt;SGP8Md2+{l+I;8QR+`nl#5K+RZd~HB$GzzvE7UCf+nw8IhbNA|(+NJ;VCK)^ zFfVgO9hcmF%AeyGQU@+M5|O{I>K5u$99GyIRj@9}>h%_@(93>h)X#7F`8S=XocBBL z;3h!)UUVK+FZq>mXTv$cjXZ*`=G zT-@$Z9W`gqIdjqt`#5i`a;PEaSkevb?>WGjrcY9bTt=u`fgAIT5Y{BeVsga9^`ysX zlANY-(M) zdDG~$#Y7L#BeJYp5APJ+E@wtm9vk(|Wu7a4oKLFEPUTuFr)>lS4d*BW`a#Dd|C}zo)2J(-xm{ zJQj}!@u&$M*Zafq(B2cf?tvh7BUk@Ck;1X067LFkm2^@~YPER4I0we{7i@8b14&&@ z`b#dC6+t|RD_0AhJ^DHKQJ+sJkC#_7F_K1D4+}}t{XgWayue9h`EXng%hX%f%D2Wt zdLtU@-VVe=VL2MA$E9#2EKTV*qf#73We)xGap3+1D(V zCf5!@>U|5TxD-i?8PUxsDGd8 z=iG154;`+UfSGdolXf@|*V7FWY+vTI!bcNL|*@BR@kGCk@?QgAXJ){+So?kei2 zmP{)5M`X7xpAcquT;xKhSab)%QJq9W!U6piA$&BROsRN0^rEq3Pno06`EWeh8;>a> zj`#8iqyOv=boiJ!8W zhhVDVa5!VCs&T?p-%{eD&Am(o&$OB98TVm7mRqBKrlNOYs$WoHBg{|f3-CwIZ9zBs z6QYJG3mk5;qY5JhQ(j1j`98I|CIy8b#`;JJUJp9|2O(+rSmTxs{kn2ZtOg5ToAM#f;({fD^v zxS%3jFbo$|gbV(?oSw)hJ=wzrjV`b0qmlIffc~%$EE*AhfMU^*;Rk;{9DyH(=+T}e zW5OA2D$4}=@Mn8C171j`4Oax2v_aptEp6Zmq|H9V6(Wen^iKkq&yTplj2BVpyohWvxW;xsRGnxNb`sB+oF)801%tnD{jn#$7rXG4Zc=WRTzPFvvgdFo+a^ znCNGaZ*mFQWspJ?M+L-$bWgV&eQTRVzR!q^k>r4|h}UKjL`KRY*Cdjw=yZx1;Ofh= z9y!OAj>zP}o}2@>EYWf@nKJ$LOpTMe?ixPJ!Xle`r1PN5JgAum=b*lqcOs8V%zQF0 zlWbCel^%~26RFyxZ+B02vzO%u7cG+5Vfk?onMJbLL6^dpgvlYJ)t85%7q`(^upz0V z$GC=4%uaG~NG+o(J=k%d&rW%6O6<8pf|(@>N~j`|}-evVGMR zhq|Jv6dkGva zoE#h1t5gFgjZ2c_?j`AFnJ;3v0L8cD_9(s7d(z)9d;LzgLCOXL(YSx?_}wL>Nj0L@~8l3utX??4DvXt6iUfm4MeAmvnm9X`)nppM6c)mR66`T zNOiZ6w4Fl$dx%y6+NDX%*e(>4yE-{Uog7da2wkrz`ULIjvZjioa`zV3CcHGE|5i6# zNHw8(2`tK>1QJhi)a`b%MzC3KRMd zl>4oo1d;T8JcWdp@dKm84dHZIm-eO2O1P#@MFxaI`N*s6woBr!MsyR}>ljrrSkx&* zF6yj)4K>jdc3EPvMBXWu5J@824HI7~a@vUxpeS945zfU{?2Dh-Ltc z946y3b<6NLiLT2S+ZuWW^_A4`lngUfE~4O&({e)|aJ_v9+d-Ge;aY!h?CYcMo!w+P zeUglscieli9hrZk2w{LWLAlD>I;Wp0cvKd{OeSawz&N5QFymgpjTVRr=Tbiv*#(cg zec3cVb1RuRG8Lo2U?-)92WW>)z!mTh`QdM%>Y3N8xCD(kg~UW>zcJ~=b4m&CqL zRt_F6h7^51ESp+Jzb^2eFG` z8VyTy67pKVrw~aeMLir8mJA1dAQe3&6M-t_^dt%&O?q!>kTX^oLkBkD1#;BA2fm7%i7nGe(Jq z)@UnLcI*8xj||s2VIm{!wN#tR*KLx6JI!%+#CemeQO?QbaskSSg&c~CV4&n0(E`{w zm!5M4bKzVx7tiJA3UkG|(p-7Y`g%T7IYI>tJ+1>z^0SIbdd&TR{eLO%|91YV_Wu#! zhR>p?^pgmNUkBXqcY+^t^1sI#_=mA=HIx9`_NaYo=BB_lkII0p^w58C(T1{i ziw;m-j@X7p3z)eIv|3Kis-^@>Yt6x-VA)_m!LJUFMBMWZZhK^mJe{GMV>we+&2sh+xB%TI1k9jIgTrE#CwGfA zFgPUElqJxH;pSko(imy_jasAFC^gEBfGw8Ss5Y9-p(YC#&j8&7&*q`G2$aC(4q0#u zH$c6ynCd~jrJy(NsU?Nr3uM%pi|w{Y?`IF>jhzJ}6m06xJHWTLTdvuˈp`w;Dcw~u(su6h5*!rk&2tjk=>$W8Ef3H+7; zuluhn0TCS>9ikgH=Xzt*clUDXAT}b~ZV!@%)ez7^6;0Q2J!XkjZZLH-XA7tf zx#DmpSF*|+mX%a(g7teb;m{A|)DRo?z=3q`k;Ifz>(JAoBzk;-tttz!NE8&o`hthZeJ8F}{Mq1D7X|I+JG? zmnW*(92&|lvLBZxYS^8CUR<7N8A~QTxV%EYm*Dbb3nnVxMu{7|BFiS$*C=~mgUdsL zLkA)&yWuo+17zM;wt6P7efGYeP|mNbk9+#J{NGpZ*TUZ}dEY<$F9!T?9C|+Y8;3t) zhre~p|6)f!a=qOBmajlpDcWB^FZ-mZ8~Vop0rL`o9g}QD@y&cLV@=-(2$R! zH2XgLrL{L{bglUxO*$Lbz(CeTD$#?_N(Z~TE(_4y0OX{GG<$U79DFQJoIbJ z%$gEfjhQSuI<=nBsf}d#IigeRYu^ftwk->Iqf;9Po)r&jD~}#+VIZAPOAY4J zUnIKds(y`mPV8S$23KhPN;=(I_j%mvJrrOZhve4Xu~D(TD{rjZ3&uJT7bWRE`I1<7 z7L0XA!Fb+ZHc=j^80)XAswnbWzpAP-nOk2}19h=~S`A2LtUsfg=KIg8rup7rKE-=I zwJr~vukTYJ2l4&50&9rwDBBo%HZNQ;|nz zjCFXwv3^9&9&o%l#d`UUJH^`N+$Glj)cQ-xG1|eGQtL0YKR?m7-@N-C%X&*Cla}=tjrk#Ce%hGJ z33dN4hY1|UNsQ076CF(suvU3vljYHzF%Pb9;C}oKQ5b&WjjNbTAEx12oxdb_#H~x` zFt?5QYWPmv?|DOfKB}9B(aA-CS7Kad`z9g8hz%3WuN|#x*zww+hRWZ zEGsVig%7cevFxj`hy7~!E}VZ=ZHv#>)iN7%=aqAlmh*E;%)e&LpI7IuT6*^7O;J3) zxQKb-WrU@EufK-*6KWC5eTV-f>c{8bLx8vP3f1s_Qr$ z@ZI1AVt>Bl`yNMp2T@+a5_?4GgmqoK%r^T9o{WYtoW~} zdrw$}v5%Tqh1pY5Okw_2DW;H|k{k=KhEHP^e?UFztGM`MihB8_FQ`XOSRYU)-%=;< zS-5!Sr8C=S!-Wqi@58DTEL?ibTX^BI3yT-dY&`W~@IiI*sl}(xytw${nRsD+@zUax ziyP0apSg7A$uk>E8_z$zxN-jJGlL7m3rnr~!V8NpE#4O_w;l*i1y|2LH~Grhm(RX) z@rlLOnbzXu!oh{t&OSf+J?i8e=iWHGdG?{;;o#n2B_p2doiQ4n|kp*$kZx+ zs48;elzMyqkcw*D*>mWRaAT8$hhNBvR%3*YaFcJ8Dv4s8sek*!Zs);Px$RCaR@qO82BDjY&(w zPPS5$v_Ujf+C}~tqJDi{CTUy~2aHrZXX9x)s<&cxPi4B!EJv;_(rWFHSh~5VSv~dW zq>>7QyC$)86E_c8BT?lry5H3_2wnAqV*JJ`}Le3h<>|^EhTnJ zA#;?)^RR?y>q-zi8Z;Mr+LXCPW4udP`X6m@*=}`O&yh+X%GQpkw~O|+sE@ZvM%rqo zJ}#vZs}n}Hut1PQy*{lTHwA{`Fmvh%sJe2EGA@3So&@}pD*FMOKH-lx+f$=K^PQ?_ z6R`mc&>~?6c6egh#*_{xFwMkdgi~@N%@7Wkm}Web{f6t;0g*NQGKESG$``e6B7#id zuqH2F?Q%g6%2&>?3Nd7Kh>x2l*&{q)TP}&Qc1ShDYc{+A&7ZTpwscDA@aTeWX!b3v;J!<*_%d*0ZluUPL=Aj z6eLbF&xKN=HYM(r{r#V`;eGAixz(bTZ#vk6z4v{mg^31#+Q~bYW{T=7vbS-*sc&i+ zM(Szz&Q7Vh$&+5qSWos5;szx#1Ry}h9aK+wL|9gM+pr5!BvyxF!rCbw0MCp@fht|o z{YE;chKP%-p*uT~Os0Na13{BZN0yI#NST*yk|B0peB_T~8xe<`pvuS&Qt6Sl1t38{ zSSt9y5zx3=J0#7FOCFOdXb1mm@#_882V6)~w1p<3Su)Sk_uv-F3u|kSiXQydsZ2fpI-gS; zm#?6eyuO`1we)R44)N(!fqX$;>ft4(Uc^J~VbMWut(a0DZf!5~PQ&usghBKIAFhKs z!~%PGRFs8J@#4_i$35hqYCkMwYWwydh`RnH?0;e+UX>TFZumsXx4}d-F7O!0`qEX= zl@@qFTYG$~cwuc7?(681XD5Xzd?ErwvEE7p`_B%qfl}17qeOX8>oVH%D@&p;KDe_t zr;3v|2r+8%o2~7uo9oxZGg>CorA9lg(Maz}kez2<>%X)kxZ}Hi$T`qHJ11SjPnqlZh$Yj{sp-|Ip9PKq~?!{I*AO10|-TH^Yx-}Z*@^k8@xlb z$`ex^gvE_8Dg)P{R%rD0uIqh`gvk192V_hAda#S+G`@p(Usf3+CNKkDAVND~V~SU< zo?lzNAh?(Ht&6SAKPgsb>_#A(CG&#cpBPHh+-j{|1ewLULEhq(x1*R3fWzdrTD;h` z8E?JFt5Qqp1B2#0D803Dx%GAsIMX-8=A>w-j3zfm>h$K&kKyUhAw~4$QvgpkFx&W^ z{`u|Op?*Sx`Z4&o8vua(jFN8$`jbAq*sjqvmq!`=hsTUF=i5O74P1i^VnPSMHhitG zfSuaqrr4p}D?sNqHoGVxgU#xP5Ou!{z*E@WybAfJ2`G{~68Y=ifc@z}i$u9p{(3=1 zqEjb-ppsJuu1tBw@#WsdC-yILz7>f7Tgth`Symrb?uQhwnSDw*ivXDX>wH0vQ;-qh zU*O`3*L>R-dqSq3Ph~DZee=SZx&55vd2j9(Lv>7*-|SqQf(YU%FEx)k6^c7N{fXML z+$$Q~l;mBFRrx)(JX`k=SBTXxMP_lzCxwxF`5oMaSymAp>lEe0Q%){#6?v%dfgGAI ze?%o{F35wTlEPeudPCl@=xE7fqT-oCnk2nWMDr2#QL=penSxGYZ)C!}dW42WaT--> z(Y{7!I<(8rbo8U9^ng1k+TG=86nWxFJ?2izXF+rz!BS1Tv+{{Xo?Ct|+UHUEeWJ%H zA08iXf?YySwL-q4-i=}%sZjlLDppeDu`V|$$v-Xvo7kO(;;vBHDwVD!1IJO+Q3P%em4=}1RqogSaJs(ZS<4;kl@gDF@# zkAj_K7pmZJl_B-GUH)UH*U1Fw(XcYdZkS?WDb@}&A9d-eWhVq(?RH@vPuG`MVXqN% ziqTGlQ9U3p0R7O7+h@Q88r6Eyb6vgtyI7j2;rar3FvW=`t`sL4of;^dG*CqROJ6_} z*U&oV^{#j>5g1@DM&a|Q8xNegoharn-W?9iCo|fBEO_yZL%@18lk5j}HlNJK2jjy* zJb&VHCwkLFAJ>P&!=c_2`|d3PB=hwL9bgX!lLPUg@KDK1=92kZyw^Anj_cpI#TD*N z4#i{P7&@i#Xb|tm71Tm^kA9kK&p7WskJ|QQc!sqJRN3?TbKHCFH{(Y9Ogc~(VC5hy?Qqn@ zDZeY82q)+*pkU9&v-)RLG~1(oI~z_!vvtsMbK&@uW|A0>hoTAKYNPR>`@7U}KAiJJ zEi?!0@ZD*SXg>2Yo4^jeS`&2GVCwyhfZVcz4rrbvJJ3_mfp9oFPzU8GQBbCSCZ3E& z!@)*88qI}6jTmKiWQggD!Q@ChlAi$~<;44pR1oj{zHl-eu7heB#m|oRCAX-29Wd9e zqAx1~N7U}6kEsyFG{Q;XBcA@Uo!^~BFu~DaG!zXtqRHgw>D#0I`sZvI&izF?tRq<_ zVDv!$6Fb}+?`aeFSUeR@CCRw{U+rkh(BJ(HT$GK9ywoo_9_~qQSK*(4sT?&M?~xAIW^BA)*tpSV<1E77XgH0~&(}lY3@L@F-?H;ErVZDpOg$9M0CW|Oo(2Tt z!w(?YdN~>psQy_yoI)n1v^W+|GDP6$FW8I)B-)hw>J;LRN?Fxg!<-co3d!j+Z z<$_Gz3#WVf8+J4Smq+fuw*`0z@({yr!sTy%s52Mr0ozzl1`LM>ee=MC5$xLF^|E=u za5(e8srbN-lfYa!&m0NT?I6<;Rrq%d*YE%wj`nny!^H`Q|E4XThQmk0QQ^Ol08SVc z4%d71Irnjy1fDS*J_-+{lfdWUaESyCVH9SC<8~P?kr>gg)~K>CIN-qI~tffLK#Q50fhR&YeoZ@^Jss2H0;x#GxGgM?Xc&O zP$S=eB^?bZ-8!S;XFH?e%bn36)j+8sHB3xEzN7PC~H2`;rHc&H=yh!1W)m7q5j5tJB6F zecFAbFUQ<8DI8Kfh(It+@CHq;F^D2Rc_=P`hm435rMdF1ZAtP?&PD~^29U*e(H^0F zA5^c0e)%z;n|49I%9i6@f~;hv&ocvwz@Zpk?7^_Q>`ZtY`5GGJs}u2}WAX^G7@!h) zC*-Ru$g6ZKXC8UYqtcS&$E#?#Am;9gi{O|*W!d}}B#&0YWRaTk>T)777Ahx?k+Tu< zyhaQ*Eia%Gwt3!hFA)?Em}>cHk9BG%Z(#??6UmeA6(N$WO7gHQK+NP^6x*Z17uS)V z76c*i1yYs>LqTqqQfqNQkr3G*NGlVpQD1a^B%}hh_epI8}$P-@pr0sqV zfSaKwtdNHly%joqZ4B^|06JB9Tu@_u7+`)}juwW< zm7oU$OtO9qumBVV0}PyyK{919z|R`^F9wT{XJgl_0O%z*Ih}$&`Smiv2PeSgj67m@ z{=7X!@BM&EQNSz{4GMUfMUa!6&rrY=E-2sw0;Xf$bO5vq3YgVR9}3tJ6tFBCQxq`! zpbQ1PhyMCO^%)tbW+TI|5YTfeOrS!~wQ<1ho~zJv13jCSSeAVk#`X6qajeK9w}cA} zEuB~fzdFv?%Dap(DSF+!-z!S=haMaVF{OF3729CmtqN*VhNXG3729SF74-0o|VeOQfyWRWgp0o z9LBOj{vkp3$Ff4U_tHO~Ry?ZG?jN3BH}Xw5tKR9K&H(Q&P2y(9GadwKJQo<|yDF$0qxc8^7<^MZka;Kq;st%d{iZz-&XgOmE% zsLCp{#B`U!7$3zp{L0$yp18sS`Q7atLQbH0$f?BBHYslXBDUdK7Mo38l&C`msG;91 z)PxGPlnR22g$i|EemL!ZSUwQUCPs1?3o^J^kRgW!89Xe=;A26C01GmNSdf9`6@r2z z+4jJ7<2=CS{OQY4vAZH*tumQbnK=QX{HkJ}C>WwlLzEv!A?ogC^$Gy)a2PygUScc26A1L7WqRw9@K;;^+H{CJGI^Vb@zSJv=VcU{v?ZAAyd7VOg#A_WcsWjQ`9suAX7ah zQ#~b9Jtb2;B~v{mljH@NB)7LsCeD&oN~6EaB}kh_`=HTh)I}psyb~Zr(m$pYUWiIs zhb;}PD zm`I#|r08=_Cp3-4D2h=K!+_EA;^I6|)0NBh8FnV$vRKGhq?K;ZWq2)seQAL>EAU+y5^FU#~VK=x(H3#U_FEzePP-5E6e;D&*< zPqH7-rza&IcM}{&^uyYpOAB|GnYoqATQOAhz_)E0{c~;8q^D>a&r9vr=HNeTwQ13w zHmKjFw`q4@)8xk@(x%A|N%S?1^~~F9nq={|nl=ZiKChU=N$^668?sJ+!S?dhki4w` zcW01ySPq6Yyx4`j`~8r2;vDOPyz|oo){n3%ka8VpPGV?(xt*L~VS|AdWGx ztYeHb>lh=>I#v>+ECvrjSjTw&!8%rxpOG4<@td!t;j-+QYahv+fqjcOS%|Vhv2V@X ze$BoubLVRIQE>~0yU98+gJiwVk1D3Q0T&d!mt;YW?c-25WO9hsY~@66mF z{O-!!Va>ifa|bp1p0=CcY<${20j!cMGARH9`C^HDu|&RDB3~@J2?P0JiF~n)eBnVI zhCYv=n~NldR-gkf;Ac@$Pj&+*u+5^MUZ-c-BL_ae?Ex6d=ao(#I?wt1P^!g+uv`qg z3%P~TLV2OGP+h1k3@p?anhS#qLm-z%7DgAw7IrO+FMx@%ey;P{05_J5hkeeGuPWYw z8+Sio^Aoz?az5qwZ+Xw>{v~gg{9CUY|99`d>imC>eO?NPtb&^0;Ex|lL?PW$tkwiU z33`&>BM}58*YtFW=D7{|-4UyvLLmoIt06x$!o3}@1BkE~)7%}8iZSW)a_Te&GjiSr zT*`5sSg~KU*hk<$&hH{BiKZkPKW*3qO*c5e&wAKH#vEygdykk-vCM6yQ?0UGaB9Zf zRp9>7*;~TY>F+7({0Kh^#xnz>Rk4Og#0sOqpvj)R5ex*CTDexL4G&jqwc5z=(D3MR zJ;?ExfYAWwLK&&v{RfW9B2X(hx5r!D3Lzv25)dHb;1Wzc8 zyH9hZI~437F$1fbs)CEAzsWqc<);_;%|mh}69HJHSQT-}`vyQ$P>nY)9SD|!coJfg zNHW4Y?+Ij1;;G)}>3j9F`&6+5qouvL{6fp9TL({OZ^*Y*ox5+R@9?XMnVxR1hHmGF zZL{~w27to!+V%Khcwt z7mm~4Cydv69@O@)`$0o31$3XO&YSX5Ex^^4qWO~i+Ap4qPT|d-u zD0&R)v3zuIkxe*z)v#Pl6lQ^WhU+O&266YY<4xr0t+oeJ&8+Y%sp5*sxvebl-OCvf zVpaYc8z%EZX8brAHyCveo;Ytr1%rnUdBw=$_qlLUpHQ);jpF7B!NQwAj-tBzv`G|6 zb`=`Z+U_=FH-}9#ft(TPud=fjEP`3JY zPKS9TSWYH9Zs)iitCyqGMRtgF#j{(k`K3J51W4)rC0fl#By^P>n`wir>yY(uOo55K zWEpj$f=s= Date: Sun, 28 Jul 2024 20:08:32 -0700 Subject: [PATCH 159/163] Cherry pick #18827 (#18832) ## Description - Cherry pick 18827 into 1.30 - Changes protocol version 53, which has already hit devnet, but not testnet ## Test plan - CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- bridge/move/tokens/btc/Move.toml | 2 +- bridge/move/tokens/eth/Move.toml | 2 +- bridge/move/tokens/mock/ka/Move.toml | 2 +- bridge/move/tokens/usdc/Move.toml | 2 +- bridge/move/tokens/usdt/Move.toml | 2 +- .../tests/size_limits/event_limits_tests.exp | 4 +- .../size_limits/move_object_size_limit.exp | 4 +- .../move_package_management_tests.rs | 6 +- crates/sui-move/src/unit_test.rs | 5 +- crates/sui-open-rpc/spec/openrpc.json | 31 +- crates/sui-protocol-config/src/lib.rs | 96 + ...ocol_config__test__Mainnet_version_53.snap | 29 + ...ocol_config__test__Testnet_version_53.snap | 29 + ...sui_protocol_config__test__version_53.snap | 30 + .../reference_safety/imm_borrow_loc.mvir | 1 - .../imm_borrow_loc_valid.mvir | 1 - .../reference_safety/imm_borrow_on_mut.mvir | 1 - .../tests/type_safety/cant_deref_resource.exp | 8 +- .../type_safety/cant_deref_resource.mvir | 18 +- .../mut_call_from_get_resource.mvir | 18 +- .../crates/language-benchmarks/src/move_vm.rs | 1 + .../move-analyzer/tests/completion/Move.toml | 1 - .../move-analyzer/tests/dot_completion.exp | 92 + .../move-analyzer/tests/enums/Move.toml | 1 - .../move-analyzer/tests/implicit_uses.exp | 6 +- .../move-analyzer/tests/inlay-hints/Move.toml | 1 - .../crates/move-analyzer/tests/macros.exp | 74 +- .../crates/move-analyzer/tests/macros.ide | 6 +- .../tests/mod-ident-uniform/Move.toml | 2 +- .../move-analyzer/tests/move-2024/Move.toml | 1 - .../tests/parse-error-dep/Move.toml | 2 +- .../move-analyzer/tests/parse-error/Move.toml | 2 +- .../move-analyzer/tests/partial-dot/Move.toml | 2 +- .../tests/partial-function/Move.toml | 2 +- .../tests/pkg-naming-error/Move.toml | 2 +- .../tests/pre-type-error-dep/Move.toml | 2 +- .../tests/pre-type-error/Move.toml | 2 +- .../move-analyzer/tests/symbols/Move.toml | 2 +- .../move/crates/move-cli/src/main.rs | 11 +- .../build_with_bytecode/B/Move.toml | 1 + .../build_with_bytecode/C/Move.toml | 1 + .../build_tests/build_with_bytecode/Move.toml | 1 + .../build_with_dep_warnings/Move.toml | 1 + .../build_with_dep_warnings/dep/Move.toml | 1 + .../build_tests/build_with_warnings/Move.toml | 1 + .../build_tests/canonicalize_module/Move.toml | 1 + .../canonicalize_module/sources/m.move | 8 +- .../circular_dependencies/Move.toml | 1 + .../circular_dependencies/bar/Move.toml | 1 + .../build_tests/dependency_chain/Move.toml | 1 + .../dependency_chain/bar/Move.toml | 1 + .../dependency_chain/foo/Move.toml | 1 + .../tests/build_tests/dev_address/Move.toml | 1 + .../build_tests/disassemble_module/Move.toml | 1 + .../disassemble_module/sources/m.move | 7 +- .../empty_module_no_deps/Move.toml | 1 + .../include_exclude_stdlib/Move.toml | 1 + .../include_exclude_stdlib/args.exp | 22 +- .../sources/UseSigner.move | 8 +- .../tests/build_tests/json_errors/Move.toml | 1 + .../tests/build_tests/migration/Move.toml | 1 + .../rebuild_after_adding_new_source/Move.toml | 1 + .../Move.toml | 1 + .../rebuild_after_touching_manifest/Move.toml | 1 + .../rebuild_after_touching_source/Move.toml | 1 + .../rebuild_no_modification/Move.toml | 1 + .../build_tests/unbound_address/Move.toml | 1 + .../build_tests/unbound_dependency/Move.toml | 1 + .../tests/metatests/cov/plain/Move.toml | 1 + .../cov/two-runs-diff-module/Move.toml | 1 + .../cov/two-runs-diff-module/sources/M1.move | 4 +- .../cov/two-runs-diff-module/sources/M2.move | 4 +- .../cov/two-runs-same-module/Move.toml | 1 + .../cov/two-runs-same-module/sources/M.move | 4 +- .../assign_dev_addr_for_dep/Move.toml | 1 + .../assign_dev_addr_for_dep/dep/Move.toml | 1 + .../Move.toml | 1 + .../Move.toml | 1 + .../build_modules_and_scripts/Move.toml | 1 + .../build_modules_and_scripts/sources/M.move | 4 +- .../doctor_with_stdlib/Move.toml | 3 +- .../doctor_with_stdlib/sources/M.move | 4 +- .../explain_arithmetic_failure/Move.toml | 1 + .../explain_stdlib_abort/Move.toml | 1 + .../sources/bad_borrow.move | 1 - .../explain_user_module_abort/Move.toml | 1 + .../sources/Fail.move | 4 +- .../sandbox_tests/gas_metering/Move.toml | 1 + .../generate_struct_layout/Move.toml | 1 + .../generate_struct_layout/sources/M1.move | 8 +- .../generate_struct_layout/sources/M2.move | 2 +- .../sources/phantoms.move | 10 +- .../module_disassemble/Move.toml | 1 + .../module_disassemble/deps1/Move.toml | 1 + .../module_disassemble/deps2/Move.toml | 1 + .../module_disassemble/sources/M1.move | 3 +- .../module_publish_view/Move.toml | 1 + .../module_publish_view/sources/Module.move | 6 +- .../multi_module_publish/Move.toml | 1 + .../sources/GoodFriends.move | 3 +- .../Move.toml | 1 + .../dep/Move.toml | 1 + .../dep/sources/m.move | 4 +- .../sandbox_tests/package_basics/Move.toml | 1 + .../sandbox_tests/package_basics/args.exp | 13 +- .../sandbox_tests/package_basics/args.txt | 2 +- .../sandbox_tests/print_stack_trace/Move.toml | 3 +- .../print_stack_trace/sources/M.move | 4 +- .../print_stack_trace/sources/N.move | 6 +- .../sources/print_stack_trace.move | 3 +- .../sandbox_tests/print_values/Move.toml | 3 +- .../tests/sandbox_tests/print_values/args.exp | 7 - .../sandbox_tests/print_values/sources/M.move | 40 +- .../sandbox_tests/publish_then_run/Move.toml | 1 + .../publish_then_run/sources/M.move | 4 +- .../random_test_flag_correctness/Move.toml | 1 + .../sandbox_tests/use_named_address/Move.toml | 1 + .../Move.toml | 1 + .../Move.toml | 1 + .../no_git_remote_package/Move.toml | 1 + .../upload_tests/valid_package1/Move.toml | 1 + .../upload_tests/valid_package2/Move.toml | 1 + .../upload_tests/valid_package3/Move.toml | 1 + .../crates/move-compiler/src/editions/mod.rs | 2 +- .../move_2024/typing/dot_call_non_struct.exp | 2 +- .../typing/duplicate_defines_primitive.exp | 4 +- .../typing/duplicate_defines_primitive.move | 4 +- .../tests/move_check_testsuite.rs | 2 +- .../tests/sources/different_visbilities.move | 4 +- ...t_template_AnotherTypeOfScript.notest_move | 4 +- .../root_template_OneTypeOfScript.notest_move | 4 +- .../src/resolution/resolution_graph.rs | 3 +- .../tests/borrow/basic_test.move | 22 +- .../tests/borrow/function_call.exp | 4192 +++++++++++-- .../tests/borrow/function_call.move | 10 +- .../tests/borrow/hyper_edge.exp | 4194 +++++++++++-- .../tests/borrow/hyper_edge.move | 13 +- .../tests/borrow_strong/basic_test.move | 28 +- .../tests/eliminate_imm_refs/basic_test.move | 4 +- .../escape_analysis/return_internal_refs.move | 4 +- .../escape_analysis/return_refs_into_vec.exp | 5250 +++++++++++++++-- .../escape_analysis/return_refs_into_vec.move | 6 +- .../tests/escape_analysis/struct_eq.exp | 7 - .../tests/escape_analysis/struct_eq.move | 4 +- .../tests/from_move/smoke_test.exp | 16 +- .../tests/from_move/smoke_test.move | 8 +- .../tests/livevar/basic_test.move | 6 +- .../tests/memory_instr/basic_test.move | 22 +- .../mut_ref_instrumentation/basic_test.move | 22 +- .../crates/move-stdlib-natives/src/lib.rs | 89 +- .../move/crates/move-stdlib/Move.toml | 1 + .../move/crates/move-stdlib/docs/address.md | 44 + .../move/crates/move-stdlib/docs/ascii.md | 372 +- .../move/crates/move-stdlib/docs/bcs.md | 4 +- .../crates/move-stdlib/docs/bit_vector.md | 81 +- .../move-stdlib/{nursery => }/docs/debug.md | 5 +- .../move/crates/move-stdlib/docs/error.md | 475 -- .../crates/move-stdlib/docs/fixed_point32.md | 235 +- .../move/crates/move-stdlib/docs/hash.md | 8 +- .../move/crates/move-stdlib/docs/macros.md | 14 + .../move/crates/move-stdlib/docs/option.md | 62 +- .../move/crates/move-stdlib/docs/overview.md | 11 +- .../move/crates/move-stdlib/docs/signer.md | 63 - .../move/crates/move-stdlib/docs/string.md | 268 +- .../move/crates/move-stdlib/docs/type_name.md | 222 +- .../move/crates/move-stdlib/docs/u128.md | 195 + .../move/crates/move-stdlib/docs/u16.md | 195 + .../move/crates/move-stdlib/docs/u256.md | 145 + .../move/crates/move-stdlib/docs/u32.md | 195 + .../move/crates/move-stdlib/docs/u64.md | 195 + .../move/crates/move-stdlib/docs/u8.md | 195 + .../move/crates/move-stdlib/docs/vector.md | 100 +- .../move-stdlib/error_description.errmap | Bin 1310 -> 0 bytes .../move/crates/move-stdlib/nursery/Move.toml | 8 - .../move-stdlib/nursery/docs/compare.md | 167 - .../move-stdlib/nursery/sources/compare.move | 70 - .../move-stdlib/nursery/sources/debug.move | 18 - .../nursery/tests/compare_tests.move | 86 - .../crates/move-stdlib/sources/address.move | 12 + .../crates/move-stdlib/sources/ascii.move | 167 +- .../move/crates/move-stdlib/sources/bcs.move | 3 + .../move-stdlib/sources/bit_vector.move | 45 +- .../crates/move-stdlib/sources/debug.move | 9 + .../crates/move-stdlib/sources/error.move | 82 - .../move-stdlib/sources/fixed_point32.move | 70 +- .../move/crates/move-stdlib/sources/hash.move | 3 + .../crates/move-stdlib/sources/macros.move | 102 + .../crates/move-stdlib/sources/option.move | 162 +- .../crates/move-stdlib/sources/signer.move | 15 - .../crates/move-stdlib/sources/string.move | 118 +- .../crates/move-stdlib/sources/type_name.move | 97 +- .../move/crates/move-stdlib/sources/u128.move | 79 + .../move/crates/move-stdlib/sources/u16.move | 79 + .../move/crates/move-stdlib/sources/u256.move | 50 + .../move/crates/move-stdlib/sources/u32.move | 79 + .../move/crates/move-stdlib/sources/u64.move | 79 + .../move/crates/move-stdlib/sources/u8.move | 79 + .../crates/move-stdlib/sources/unit_test.move | 22 + .../crates/move-stdlib/sources/vector.move | 300 +- .../move/crates/move-stdlib/src/lib.rs | 24 - .../move/crates/move-stdlib/src/main.rs | 5 - .../crates/move-stdlib/tests/ascii_tests.move | 188 +- .../crates/move-stdlib/tests/bcs_tests.move | 44 +- .../move-stdlib/tests/bit_vector_tests.move | 133 +- .../move-stdlib/tests/fixedpoint32_tests.move | 100 +- .../crates/move-stdlib/tests/hash_tests.move | 9 +- .../move-stdlib/tests/integer_tests.move | 220 + .../move-stdlib/tests/move_unit_test.rs | 50 - .../tests/move_verification_test.rs | 13 - .../move-stdlib/tests/option_tests.move | 156 +- .../move-stdlib/tests/string_tests.move | 80 +- .../move-stdlib/tests/type_name_tests.move | 103 +- .../crates/move-stdlib/tests/u128_tests.move | 78 + .../crates/move-stdlib/tests/u16_tests.move | 78 + .../crates/move-stdlib/tests/u256_tests.move | 72 + .../crates/move-stdlib/tests/u32_tests.move | 78 + .../crates/move-stdlib/tests/u64_tests.move | 79 + .../crates/move-stdlib/tests/u8_tests.move | 77 + .../move-stdlib/tests/vector_tests.move | 840 ++- .../src/vm_test_harness.rs | 1 + .../crates/move-unit-test/src/test_runner.rs | 1 + .../tests/test_sources/address_args.move | 4 +- .../tests/test_sources/arithmetic_errors.move | 4 +- .../tests/test_sources/construct_data.move | 8 +- .../test_sources/cross_module_aborts.exp | 8 +- .../test_sources/cross_module_aborts.move | 6 +- .../tests/test_sources/do_nothing.move | 4 +- .../test_sources/expected_abort_no_abort.move | 4 +- .../tests/test_sources/native_abort.exp | 12 +- .../tests/test_sources/native_abort.move | 1 - .../test_sources/non_exsistent_native.move | 4 +- .../tests/test_sources/proposal_test.move | 8 +- .../tests/test_sources/signer_args.exp | 6 +- .../tests/test_sources/signer_args.move | 10 +- .../tests/test_sources/timeout.exp | 4 +- .../tests/test_sources/timeout.move | 6 +- .../tests/test_sources/unexpected_abort.exp | 38 +- .../tests/test_sources/unexpected_abort.move | 4 +- .../move-vm-integration-tests/Cargo.toml | 2 +- .../src/tests/binary_format_version.rs | 2 + .../src/tests/depth_tests_modules.move | 66 +- .../src/tests/function_arg_tests.rs | 4 +- .../src/tests/loader_tests_modules.move | 268 +- .../src/tests/nested_loop_tests.rs | 6 +- .../src/tests/relinking_tests_b_v1.move | 2 +- .../src/tests/relinking_tests_c_v0.move | 2 +- .../src/tests/relinking_tests_c_v1.move | 4 +- .../src/tests/relinking_tests_c_v2.move | 6 +- .../tests/builtins/get_txn_sender.exp | 4 + .../tests/builtins/get_txn_sender.mvir | 10 +- .../tests/entry_points/call_native.exp | 4 +- .../tests/entry_points/call_native.move | 2 +- .../move/crates/test-generation/src/lib.rs | 1 + .../sui-adapter/src/execution_engine.rs | 2 +- .../latest/sui-move-natives/src/lib.rs | 116 +- sui-execution/src/latest.rs | 2 +- 256 files changed, 18603 insertions(+), 4224 deletions(-) create mode 100644 external-crates/move/crates/move-stdlib/docs/address.md rename external-crates/move/crates/move-stdlib/{nursery => }/docs/debug.md (86%) delete mode 100644 external-crates/move/crates/move-stdlib/docs/error.md create mode 100644 external-crates/move/crates/move-stdlib/docs/macros.md delete mode 100644 external-crates/move/crates/move-stdlib/docs/signer.md create mode 100644 external-crates/move/crates/move-stdlib/docs/u128.md create mode 100644 external-crates/move/crates/move-stdlib/docs/u16.md create mode 100644 external-crates/move/crates/move-stdlib/docs/u256.md create mode 100644 external-crates/move/crates/move-stdlib/docs/u32.md create mode 100644 external-crates/move/crates/move-stdlib/docs/u64.md create mode 100644 external-crates/move/crates/move-stdlib/docs/u8.md delete mode 100644 external-crates/move/crates/move-stdlib/error_description.errmap delete mode 100644 external-crates/move/crates/move-stdlib/nursery/Move.toml delete mode 100644 external-crates/move/crates/move-stdlib/nursery/docs/compare.md delete mode 100644 external-crates/move/crates/move-stdlib/nursery/sources/compare.move delete mode 100644 external-crates/move/crates/move-stdlib/nursery/sources/debug.move delete mode 100644 external-crates/move/crates/move-stdlib/nursery/tests/compare_tests.move create mode 100644 external-crates/move/crates/move-stdlib/sources/address.move create mode 100644 external-crates/move/crates/move-stdlib/sources/debug.move delete mode 100644 external-crates/move/crates/move-stdlib/sources/error.move create mode 100644 external-crates/move/crates/move-stdlib/sources/macros.move delete mode 100644 external-crates/move/crates/move-stdlib/sources/signer.move create mode 100644 external-crates/move/crates/move-stdlib/sources/u128.move create mode 100644 external-crates/move/crates/move-stdlib/sources/u16.move create mode 100644 external-crates/move/crates/move-stdlib/sources/u256.move create mode 100644 external-crates/move/crates/move-stdlib/sources/u32.move create mode 100644 external-crates/move/crates/move-stdlib/sources/u64.move create mode 100644 external-crates/move/crates/move-stdlib/sources/u8.move create mode 100644 external-crates/move/crates/move-stdlib/tests/integer_tests.move delete mode 100644 external-crates/move/crates/move-stdlib/tests/move_unit_test.rs delete mode 100644 external-crates/move/crates/move-stdlib/tests/move_verification_test.rs create mode 100644 external-crates/move/crates/move-stdlib/tests/u128_tests.move create mode 100644 external-crates/move/crates/move-stdlib/tests/u16_tests.move create mode 100644 external-crates/move/crates/move-stdlib/tests/u256_tests.move create mode 100644 external-crates/move/crates/move-stdlib/tests/u32_tests.move create mode 100644 external-crates/move/crates/move-stdlib/tests/u64_tests.move create mode 100644 external-crates/move/crates/move-stdlib/tests/u8_tests.move diff --git a/bridge/move/tokens/btc/Move.toml b/bridge/move/tokens/btc/Move.toml index cbd69d8556431..47824231423d3 100644 --- a/bridge/move/tokens/btc/Move.toml +++ b/bridge/move/tokens/btc/Move.toml @@ -1,6 +1,7 @@ [package] name = "BridgedBTC" version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../../crates/sui-framework/packages/move-stdlib" } @@ -8,4 +9,3 @@ Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } [addresses] bridged_btc = "0x0" - diff --git a/bridge/move/tokens/eth/Move.toml b/bridge/move/tokens/eth/Move.toml index 215aa37ce8687..1a21898cc0355 100644 --- a/bridge/move/tokens/eth/Move.toml +++ b/bridge/move/tokens/eth/Move.toml @@ -1,6 +1,7 @@ [package] name = "BridgedETH" version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../../crates/sui-framework/packages/move-stdlib" } @@ -8,4 +9,3 @@ Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } [addresses] bridged_eth = "0x0" - diff --git a/bridge/move/tokens/mock/ka/Move.toml b/bridge/move/tokens/mock/ka/Move.toml index ad08496bd39e1..1fbdf04ca2975 100644 --- a/bridge/move/tokens/mock/ka/Move.toml +++ b/bridge/move/tokens/mock/ka/Move.toml @@ -1,6 +1,7 @@ [package] name = "BridgedKa" version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../../../crates/sui-framework/packages/move-stdlib" } @@ -8,4 +9,3 @@ Sui = { local = "../../../../../crates/sui-framework/packages/sui-framework" } [addresses] bridged_ka = "0x0" - diff --git a/bridge/move/tokens/usdc/Move.toml b/bridge/move/tokens/usdc/Move.toml index e98ae4d71c621..a956409c0839f 100644 --- a/bridge/move/tokens/usdc/Move.toml +++ b/bridge/move/tokens/usdc/Move.toml @@ -1,6 +1,7 @@ [package] name = "BridgedUSDC" version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../../crates/sui-framework/packages/move-stdlib" } @@ -8,4 +9,3 @@ Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } [addresses] bridged_usdc = "0x0" - diff --git a/bridge/move/tokens/usdt/Move.toml b/bridge/move/tokens/usdt/Move.toml index 699123ddb0325..1d86a908fdd8e 100644 --- a/bridge/move/tokens/usdt/Move.toml +++ b/bridge/move/tokens/usdt/Move.toml @@ -1,6 +1,7 @@ [package] name = "BridgedUSDT" version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../../crates/sui-framework/packages/move-stdlib" } @@ -8,4 +9,3 @@ Sui = { local = "../../../../crates/sui-framework/packages/sui-framework" } [addresses] bridged_usdt = "0x0" - diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp index 4b2c0d8cf17e2..bddf4a6d99846 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/event_limits_tests.exp @@ -32,13 +32,13 @@ task 6, lines 68-70: //# run Test::M1::emit_event_with_size --args 200000 --gas-budget 100000000000000 --summarize events: 1 mutated: 1 -gas summary: computation_cost: 1393000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 +gas summary: computation_cost: 1394000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 task 7, lines 71-73: //# run Test::M1::emit_event_with_size --args 256000 --gas-budget 100000000000000 --summarize events: 1 mutated: 1 -gas summary: computation_cost: 1814000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 +gas summary: computation_cost: 1815000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 task 8, lines 74-76: //# run Test::M1::emit_event_with_size --args 256001 --gas-budget 100000000000000 --summarize diff --git a/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp b/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp index dfa9be123b60f..7767e2f318584 100644 --- a/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp +++ b/crates/sui-adapter-transactional-tests/tests/size_limits/move_object_size_limit.exp @@ -18,10 +18,10 @@ task 3, lines 82-84: //# run Test::M1::transfer_object_with_size --args 255999 --sender A --gas-budget 100000000000000 created: object(3,0) mutated: object(0,0) -gas summary: computation_cost: 1863000000, storage_cost: 1947553200, storage_rebate: 978120, non_refundable_storage_fee: 9880 +gas summary: computation_cost: 1864000000, storage_cost: 1947553200, storage_rebate: 978120, non_refundable_storage_fee: 9880 task 4, line 85: //# run Test::M1::transfer_object_with_size --args 256000 --sender A --gas-budget 100000000000000 created: object(4,0) mutated: object(0,0) -gas summary: computation_cost: 1863000000, storage_cost: 1947560800, storage_rebate: 978120, non_refundable_storage_fee: 9880 +gas summary: computation_cost: 1864000000, storage_cost: 1947560800, storage_rebate: 978120, non_refundable_storage_fee: 9880 diff --git a/crates/sui-core/src/unit_tests/move_package_management_tests.rs b/crates/sui-core/src/unit_tests/move_package_management_tests.rs index e3c4dd8df6344..feb538ca0fb32 100644 --- a/crates/sui-core/src/unit_tests/move_package_management_tests.rs +++ b/crates/sui-core/src/unit_tests/move_package_management_tests.rs @@ -46,7 +46,7 @@ async fn test_manage_package_update() { .read_to_string(&mut lock_file_contents) .expect("Error reading Move.lock file"); - let expected = expect![[r#" + let expected = expect![[r##" # @generated by Move, please check-in and do not edit manually. [move] @@ -56,7 +56,7 @@ async fn test_manage_package_update() { [move.toolchain-version] compiler-version = "0.0.1" - edition = "legacy" + edition = "2024.beta" flavor = "sui" [env] @@ -66,6 +66,6 @@ async fn test_manage_package_update() { original-published-id = "0x000000000000000000000000000000000000000000000000000000000000000a" latest-published-id = "0x000000000000000000000000000000000000000000000000000000000000000b" published-version = "5" - "#]]; + "##]]; expected.assert_eq(lock_file_contents.as_str()); } diff --git a/crates/sui-move/src/unit_test.rs b/crates/sui-move/src/unit_test.rs index a5d0bf3b192ef..3bb4da1f2da0f 100644 --- a/crates/sui-move/src/unit_test.rs +++ b/crates/sui-move/src/unit_test.rs @@ -114,7 +114,10 @@ pub fn run_move_unit_tests( report_stacktrace_on_abort: true, ..config }, - sui_move_natives::all_natives(/* silent */ false), + sui_move_natives::all_natives( + /* silent */ false, + &ProtocolConfig::get_for_max_version_UNSAFE(), + ), Some(initial_cost_schedule_for_unit_tests()), compute_coverage, &mut std::io::stdout(), diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 244d7016f3af5..2935b547a40cd 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -1368,6 +1368,9 @@ "base_tx_cost_per_byte": { "u64": "0" }, + "bcs_failure_cost": null, + "bcs_legacy_min_output_size_cost": null, + "bcs_per_byte_serialized_cost": null, "binary_address_identifiers": null, "binary_constant_pool": null, "binary_enum_def_instantiations": null, @@ -1419,6 +1422,8 @@ "crypto_invalid_arguments_cost": { "u64": "100" }, + "debug_print_base_cost": null, + "debug_print_stack_trace_base_cost": null, "dynamic_field_add_child_object_cost_base": { "u64": "100" }, @@ -1652,6 +1657,12 @@ "hash_keccak256_data_cost_per_byte": { "u64": "2" }, + "hash_sha2_256_base_cost": null, + "hash_sha2_256_legacy_min_input_len_cost": null, + "hash_sha2_256_per_byte_cost": null, + "hash_sha3_256_base_cost": null, + "hash_sha3_256_legacy_min_input_len_cost": null, + "hash_sha3_256_per_byte_cost": null, "hmac_hmac_sha3_256_cost_base": { "u64": "52" }, @@ -1875,6 +1886,14 @@ "storage_rebate_rate": { "u64": "9900" }, + "string_check_utf8_base_cost": null, + "string_check_utf8_per_byte_cost": null, + "string_index_of_base_cost": null, + "string_index_of_per_byte_pattern_cost": null, + "string_index_of_per_byte_searched_cost": null, + "string_is_char_boundary_base_cost": null, + "string_sub_string_base_cost": null, + "string_sub_string_per_byte_cost": null, "transfer_freeze_object_cost_base": { "u64": "52" }, @@ -1888,6 +1907,8 @@ "tx_context_derive_id_cost_base": { "u64": "52" }, + "type_name_get_base_cost": null, + "type_name_get_per_byte_cost": null, "types_is_one_time_witness_cost_base": { "u64": "52" }, @@ -1904,7 +1925,15 @@ "u64": "2" }, "vdf_hash_to_input_cost": null, - "vdf_verify_vdf_cost": null + "vdf_verify_vdf_cost": null, + "vector_borrow_base_cost": null, + "vector_destroy_empty_base_cost": null, + "vector_empty_base_cost": null, + "vector_length_base_cost": null, + "vector_pop_back_base_cost": null, + "vector_push_back_base_cost": null, + "vector_push_back_legacy_per_abstract_memory_unit_cost": null, + "vector_swap_base_cost": null } } } diff --git a/crates/sui-protocol-config/src/lib.rs b/crates/sui-protocol-config/src/lib.rs index 0a630e7a87b44..0a1ddec049c8b 100644 --- a/crates/sui-protocol-config/src/lib.rs +++ b/crates/sui-protocol-config/src/lib.rs @@ -164,6 +164,7 @@ const MAX_PROTOCOL_VERSION: u64 = 53; // Version 53: Add feature flag to decide whether to attempt to finalize bridge committee // Enable consensus commit prologue V3 on testnet. // Turn on shared object congestion control in testnet. +// Update stdlib natives costs #[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct ProtocolVersion(u64); @@ -1101,6 +1102,40 @@ pub struct ProtocolConfig { vdf_verify_vdf_cost: Option, vdf_hash_to_input_cost: Option, + // Stdlib costs + bcs_per_byte_serialized_cost: Option, + bcs_legacy_min_output_size_cost: Option, + bcs_failure_cost: Option, + + hash_sha2_256_base_cost: Option, + hash_sha2_256_per_byte_cost: Option, + hash_sha2_256_legacy_min_input_len_cost: Option, + hash_sha3_256_base_cost: Option, + hash_sha3_256_per_byte_cost: Option, + hash_sha3_256_legacy_min_input_len_cost: Option, + type_name_get_base_cost: Option, + type_name_get_per_byte_cost: Option, + + string_check_utf8_base_cost: Option, + string_check_utf8_per_byte_cost: Option, + string_is_char_boundary_base_cost: Option, + string_sub_string_base_cost: Option, + string_sub_string_per_byte_cost: Option, + string_index_of_base_cost: Option, + string_index_of_per_byte_pattern_cost: Option, + string_index_of_per_byte_searched_cost: Option, + + vector_empty_base_cost: Option, + vector_length_base_cost: Option, + vector_push_back_base_cost: Option, + vector_push_back_legacy_per_abstract_memory_unit_cost: Option, + vector_borrow_base_cost: Option, + vector_pop_back_base_cost: Option, + vector_destroy_empty_base_cost: Option, + vector_swap_base_cost: Option, + debug_print_base_cost: Option, + debug_print_stack_trace_base_cost: Option, + // ==== Ephemeral (consensus only) params deleted ==== // // Const params for consensus scoring decision @@ -1909,6 +1944,36 @@ impl ProtocolConfig { vdf_verify_vdf_cost: None, vdf_hash_to_input_cost: None, + bcs_per_byte_serialized_cost: None, + bcs_legacy_min_output_size_cost: None, + bcs_failure_cost: None, + hash_sha2_256_base_cost: None, + hash_sha2_256_per_byte_cost: None, + hash_sha2_256_legacy_min_input_len_cost: None, + hash_sha3_256_base_cost: None, + hash_sha3_256_per_byte_cost: None, + hash_sha3_256_legacy_min_input_len_cost: None, + type_name_get_base_cost: None, + type_name_get_per_byte_cost: None, + string_check_utf8_base_cost: None, + string_check_utf8_per_byte_cost: None, + string_is_char_boundary_base_cost: None, + string_sub_string_base_cost: None, + string_sub_string_per_byte_cost: None, + string_index_of_base_cost: None, + string_index_of_per_byte_pattern_cost: None, + string_index_of_per_byte_searched_cost: None, + vector_empty_base_cost: None, + vector_length_base_cost: None, + vector_push_back_base_cost: None, + vector_push_back_legacy_per_abstract_memory_unit_cost: None, + vector_borrow_base_cost: None, + vector_pop_back_base_cost: None, + vector_destroy_empty_base_cost: None, + vector_swap_base_cost: None, + debug_print_base_cost: None, + debug_print_stack_trace_base_cost: None, + max_size_written_objects: None, max_size_written_objects_system_tx: None, @@ -2536,6 +2601,37 @@ impl ProtocolConfig { cfg.feature_flags.per_object_congestion_control_mode = PerObjectCongestionControlMode::TotalTxCount; } + + // Adjust stdlib gas costs + cfg.bcs_per_byte_serialized_cost = Some(2); + cfg.bcs_legacy_min_output_size_cost = Some(1); + cfg.bcs_failure_cost = Some(52); + cfg.debug_print_base_cost = Some(52); + cfg.debug_print_stack_trace_base_cost = Some(52); + cfg.hash_sha2_256_base_cost = Some(52); + cfg.hash_sha2_256_per_byte_cost = Some(2); + cfg.hash_sha2_256_legacy_min_input_len_cost = Some(1); + cfg.hash_sha3_256_base_cost = Some(52); + cfg.hash_sha3_256_per_byte_cost = Some(2); + cfg.hash_sha3_256_legacy_min_input_len_cost = Some(1); + cfg.type_name_get_base_cost = Some(52); + cfg.type_name_get_per_byte_cost = Some(2); + cfg.string_check_utf8_base_cost = Some(52); + cfg.string_check_utf8_per_byte_cost = Some(2); + cfg.string_is_char_boundary_base_cost = Some(52); + cfg.string_sub_string_base_cost = Some(52); + cfg.string_sub_string_per_byte_cost = Some(2); + cfg.string_index_of_base_cost = Some(52); + cfg.string_index_of_per_byte_pattern_cost = Some(2); + cfg.string_index_of_per_byte_searched_cost = Some(2); + cfg.vector_empty_base_cost = Some(52); + cfg.vector_length_base_cost = Some(52); + cfg.vector_push_back_base_cost = Some(52); + cfg.vector_push_back_legacy_per_abstract_memory_unit_cost = Some(2); + cfg.vector_borrow_base_cost = Some(52); + cfg.vector_pop_back_base_cost = Some(52); + cfg.vector_destroy_empty_base_cost = Some(52); + cfg.vector_swap_base_cost = Some(52); } // Use this template when making changes: // diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap index 2761b97f0f926..5317182e71a72 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Mainnet_version_53.snap @@ -268,6 +268,35 @@ 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 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap index 0419b3548b467..671eb71756050 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__Testnet_version_53.snap @@ -272,6 +272,35 @@ 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 diff --git a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap index 095c918715c91..b686158e23286 100644 --- a/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap +++ b/crates/sui-protocol-config/src/snapshots/sui_protocol_config__test__version_53.snap @@ -281,6 +281,35 @@ 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 @@ -299,3 +328,4 @@ 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: 10 + diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc.mvir b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc.mvir index ba1630fa4c4be..1e66a269fd30c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc.mvir +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc.mvir @@ -1,6 +1,5 @@ //# publish module 0x1.Tester { - import 0x1.signer; struct Data has key { v1: u64, v2: u64 } struct Box has key { f: u64 } diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc_valid.mvir b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc_valid.mvir index c7bef57b0cf67..1721acce33997 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc_valid.mvir +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_loc_valid.mvir @@ -1,6 +1,5 @@ //# publish module 0x1.Tester { - import 0x1.signer; struct Data has key { v1: u64, v2: u64 } struct Box has key { f: u64 } diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut.mvir b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut.mvir index a3e85b9b6bb64..17f91c9d54e84 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut.mvir +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/reference_safety/imm_borrow_on_mut.mvir @@ -1,6 +1,5 @@ //# publish module 0x1.Tester { - import 0x1.signer; struct Initializer has key { x: u64, y: u64 } struct Point { x: u64, y: u64 } diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp index b435375c82a0f..e121d67ab237c 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.exp @@ -1,21 +1,21 @@ processed 2 tasks -task 0, lines 1-42: +task 0, lines 1-39: //# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000001::Token'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, location: 0x1::Token, indices: [(FunctionDefinition, 4)], - offsets: [(FunctionDefinitionIndex(4), 13)], + offsets: [(FunctionDefinitionIndex(4), 10)], } -task 1, lines 44-85: +task 1, lines 41-79: //# publish Error: Unable to publish module '0000000000000000000000000000000000000000000000000000000000000002::Token'. Got VMError: { major_status: READREF_WITHOUT_COPY_ABILITY, sub_status: None, location: 0x2::Token, indices: [(FunctionDefinition, 4)], - offsets: [(FunctionDefinitionIndex(4), 13)], + offsets: [(FunctionDefinitionIndex(4), 10)], } diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.mvir b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.mvir index 92835730f53c6..dcd42a7d76848 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.mvir +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/cant_deref_resource.mvir @@ -1,6 +1,5 @@ //# publish module 0x1.Token { - import 0x1.signer; struct T has key {v: u64} @@ -19,23 +18,21 @@ module 0x1.Token { return move(res); } - public publish(account: &signer, t: Self.T) { + public publish(account: address, t: Self.T) { label b0: abort(0); } fake(addr: address): &mut Self.T { label b0: abort(0); } - public test(account: &signer) { - let addr: address; + public test(account: address) { let t: Self.T; let tref: &mut Self.T; let y: Self.T; label b0: - addr = signer.address_of(copy(account)); t = Self.new(0); Self.publish(copy(account), move(t)); - tref = Self.fake(move(addr)); + tref = Self.fake(move(account)); y = *move(tref); return; } @@ -43,7 +40,6 @@ module 0x1.Token { //# publish module 0x2.Token { - import 0x1.signer; enum T has key { V{v: u64}} @@ -62,23 +58,21 @@ module 0x2.Token { return move(res); } - public publish(account: &signer, t: Self.T) { + public publish(account: address, t: Self.T) { label b0: abort(0); } fake(addr: address): &mut Self.T { label b0: abort(0); } - public test(account: &signer) { - let addr: address; + public test(account: address) { let t: Self.T; let tref: &mut Self.T; let y: Self.T; label b0: - addr = signer.address_of(copy(account)); t = Self.new(0); Self.publish(copy(account), move(t)); - tref = Self.fake(move(addr)); + tref = Self.fake(move(account)); y = *move(tref); return; } diff --git a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_from_get_resource.mvir b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_from_get_resource.mvir index b953092719047..75bacb56d4435 100644 --- a/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_from_get_resource.mvir +++ b/external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/mut_call_from_get_resource.mvir @@ -1,6 +1,5 @@ //# publish module 0x42.Token { - import 0x1.signer; struct T has key {balance: u64} @@ -28,16 +27,15 @@ module 0x42.Token { return; } - public publish(account: &signer, t: Self.T) { + public publish(account: address, t: Self.T) { label b0: abort(0); } fake(addr: address): &mut Self.T { label b0: abort(0); } - public test(account: &signer) { + public test(account: address) { let z: Self.T; - let addr1: address; let struct1: &mut Self.T; let imm_struct1: &Self.T; let struct1_original_balance: u64; @@ -46,9 +44,8 @@ module 0x42.Token { z = Self.new(0); Self.publish(copy(account), move(z)); - addr1 = signer.address_of(move(account)); // returns mut reference, test its usage - struct1 = Self.fake(copy(addr1)); + struct1 = Self.fake(copy(account)); imm_struct1 = freeze(copy(struct1)); struct1_original_balance = Self.value(move(imm_struct1)); @@ -66,7 +63,6 @@ module 0x42.Token { //# publish module 0x43.Token { - import 0x1.signer; enum T has key {V { balance: u64} } @@ -94,16 +90,15 @@ module 0x43.Token { return; } - public publish(account: &signer, t: Self.T) { + public publish(account: address, t: Self.T) { label b0: abort(0); } fake(addr: address): &mut Self.T { label b0: abort(0); } - public test(account: &signer) { + public test(account: address) { let z: Self.T; - let addr1: address; let struct1: &mut Self.T; let imm_struct1: &Self.T; let struct1_original_balance: u64; @@ -112,9 +107,8 @@ module 0x43.Token { z = Self.new(0); Self.publish(copy(account), move(z)); - addr1 = signer.address_of(move(account)); // returns mut reference, test its usage - struct1 = Self.fake(copy(addr1)); + struct1 = Self.fake(copy(account)); imm_struct1 = freeze(copy(struct1)); struct1_original_balance = Self.value(move(imm_struct1)); diff --git a/external-crates/move/crates/language-benchmarks/src/move_vm.rs b/external-crates/move/crates/language-benchmarks/src/move_vm.rs index 2927af76b9acc..68cdeca91dc0f 100644 --- a/external-crates/move/crates/language-benchmarks/src/move_vm.rs +++ b/external-crates/move/crates/language-benchmarks/src/move_vm.rs @@ -28,6 +28,7 @@ pub fn bench(c: &mut Criterion, fun: &str) { let move_vm = MoveVM::new(move_stdlib_natives::all_natives( AccountAddress::from_hex_literal("0x1").unwrap(), move_stdlib_natives::GasParameters::zeros(), + /* silent debug */ true, )) .unwrap(); execute(c, &move_vm, modules, fun); diff --git a/external-crates/move/crates/move-analyzer/tests/completion/Move.toml b/external-crates/move/crates/move-analyzer/tests/completion/Move.toml index c2c82541db7ae..cddaad6938c8e 100644 --- a/external-crates/move/crates/move-analyzer/tests/completion/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/completion/Move.toml @@ -1,6 +1,5 @@ [package] name = "Completion" -version = "0.0.1" edition = "2024.beta" [dependencies] diff --git a/external-crates/move/crates/move-analyzer/tests/dot_completion.exp b/external-crates/move/crates/move-analyzer/tests/dot_completion.exp index e0e9e954c6635..ad426b6f92568 100644 --- a/external-crates/move/crates/move-analyzer/tests/dot_completion.exp +++ b/external-crates/move/crates/move-analyzer/tests/dot_completion.exp @@ -52,6 +52,14 @@ Method 'test()' == other_mod_dot.move ======================================================== -- test 0 ------------------- use line: 4, use_col: 10 +Method 'all!()' + INSERT TEXT: 'all!(|${1}| ${2})' + TARGET : '(std::vector::all)' + TYPE : 'fun <$T>(&vector<$T>, |&$T| -> bool): bool' +Method 'any!()' + INSERT TEXT: 'any!(|${1}| ${2})' + TARGET : '(std::vector::any)' + TYPE : 'fun <$T>(&vector<$T>, |&$T| -> bool): bool' Method 'append()' INSERT TEXT: 'append(${1:other})' TARGET : '(std::vector::append)' @@ -68,10 +76,42 @@ Method 'contains()' INSERT TEXT: 'contains(${1:e})' TARGET : '(std::vector::contains)' TYPE : 'fun (&vector, &Element): bool' +Method 'count!()' + INSERT TEXT: 'count!(|${1}| ${2})' + TARGET : '(std::vector::count)' + TYPE : 'fun <$T>(&vector<$T>, |&$T| -> bool): u64' +Method 'destroy!()' + INSERT TEXT: 'destroy!(|${1}| ${2})' + TARGET : '(std::vector::destroy)' + TYPE : 'fun <$T>(vector<$T>, |$T| -> ())' Method 'destroy_empty()' INSERT TEXT: 'destroy_empty()' TARGET : '(std::vector::destroy_empty)' TYPE : 'fun (vector)' +Method 'do!()' + INSERT TEXT: 'do!(|${1}| ${2})' + TARGET : '(std::vector::do)' + TYPE : 'fun <$T>(vector<$T>, |$T| -> ())' +Method 'do_mut!()' + INSERT TEXT: 'do_mut!(|${1}| ${2})' + TARGET : '(std::vector::do_mut)' + TYPE : 'fun <$T>(&mut vector<$T>, |&mut $T| -> ())' +Method 'do_ref!()' + INSERT TEXT: 'do_ref!(|${1}| ${2})' + TARGET : '(std::vector::do_ref)' + TYPE : 'fun <$T>(&vector<$T>, |&$T| -> ())' +Method 'filter!()' + INSERT TEXT: 'filter!(|${1}| ${2})' + TARGET : '(std::vector::filter)' + TYPE : 'fun <$T>(vector<$T>, |&$T| -> bool): vector<$T>' +Method 'find_index!()' + INSERT TEXT: 'find_index!(|${1}| ${2})' + TARGET : '(std::vector::find_index)' + TYPE : 'fun <$T>(vector<$T>, |&$T| -> bool): Option' +Method 'fold!()' + INSERT TEXT: 'fold!(${1:init}, |${2}, ${3}| ${4})' + TARGET : '(std::vector::fold)' + TYPE : 'fun <$T, $Acc>(vector<$T>, $Acc, |$Acc, $T| -> $Acc): $Acc' Method 'index_of()' INSERT TEXT: 'index_of(${1:e})' TARGET : '(std::vector::index_of)' @@ -88,6 +128,18 @@ Method 'length()' INSERT TEXT: 'length()' TARGET : '(std::vector::length)' TYPE : 'fun (&vector): u64' +Method 'map!()' + INSERT TEXT: 'map!(|${1}| ${2})' + TARGET : '(std::vector::map)' + TYPE : 'fun <$T, $U>(vector<$T>, |$T| -> $U): vector<$U>' +Method 'map_ref!()' + INSERT TEXT: 'map_ref!(|${1}| ${2})' + TARGET : '(std::vector::map_ref)' + TYPE : 'fun <$T, $U>(&vector<$T>, |&$T| -> $U): vector<$U>' +Method 'partition!()' + INSERT TEXT: 'partition!(|${1}| ${2})' + TARGET : '(std::vector::partition)' + TYPE : 'fun <$T>(vector<$T>, |&$T| -> bool): (vector<$T>, vector<$T>)' Method 'pop_back()' INSERT TEXT: 'pop_back()' TARGET : '(std::vector::pop_back)' @@ -112,4 +164,44 @@ Method 'swap_remove()' INSERT TEXT: 'swap_remove(${1:i})' TARGET : '(std::vector::swap_remove)' TYPE : 'fun (&mut vector, u64): Element' +Method 'to_ascii_string()' + INSERT TEXT: 'to_ascii_string()' + TARGET : '(std::ascii::string)' + TYPE : 'fun (vector): String' +Method 'to_string()' + INSERT TEXT: 'to_string()' + TARGET : '(std::string::utf8)' + TYPE : 'fun (vector): String' +Method 'try_to_ascii_string()' + INSERT TEXT: 'try_to_ascii_string()' + TARGET : '(std::ascii::try_string)' + TYPE : 'fun (vector): Option' +Method 'try_to_string()' + INSERT TEXT: 'try_to_string()' + TARGET : '(std::string::try_utf8)' + TYPE : 'fun (vector): Option' +Method 'zip_do!()' + INSERT TEXT: 'zip_do!(${1:v2}, |${2}, ${3}| ${4})' + TARGET : '(std::vector::zip_do)' + TYPE : 'fun <$T1, $T2>(vector<$T1>, vector<$T2>, |$T1, $T2| -> ())' +Method 'zip_do_mut!()' + INSERT TEXT: 'zip_do_mut!(${1:v2}, |${2}, ${3}| ${4})' + TARGET : '(std::vector::zip_do_mut)' + TYPE : 'fun <$T1, $T2>(&mut vector<$T1>, &mut vector<$T2>, |&mut $T1, &mut $T2| -> ())' +Method 'zip_do_ref!()' + INSERT TEXT: 'zip_do_ref!(${1:v2}, |${2}, ${3}| ${4})' + TARGET : '(std::vector::zip_do_ref)' + TYPE : 'fun <$T1, $T2>(&vector<$T1>, &vector<$T2>, |&$T1, &$T2| -> ())' +Method 'zip_do_reverse!()' + INSERT TEXT: 'zip_do_reverse!(${1:v2}, |${2}, ${3}| ${4})' + TARGET : '(std::vector::zip_do_reverse)' + TYPE : 'fun <$T1, $T2>(vector<$T1>, vector<$T2>, |$T1, $T2| -> ())' +Method 'zip_map!()' + INSERT TEXT: 'zip_map!(${1:v2}, |${2}, ${3}| ${4})' + TARGET : '(std::vector::zip_map)' + TYPE : 'fun <$T1, $T2, $U>(vector<$T1>, vector<$T2>, |$T1, $T2| -> $U): vector<$U>' +Method 'zip_map_ref!()' + INSERT TEXT: 'zip_map_ref!(${1:v2}, |${2}, ${3}| ${4})' + TARGET : '(std::vector::zip_map_ref)' + TYPE : 'fun <$T1, $T2, $U>(&vector<$T1>, &vector<$T2>, |&$T1, &$T2| -> $U): vector<$U>' diff --git a/external-crates/move/crates/move-analyzer/tests/enums/Move.toml b/external-crates/move/crates/move-analyzer/tests/enums/Move.toml index f1a3c05aaa2cf..0fa60b5d2ecf3 100644 --- a/external-crates/move/crates/move-analyzer/tests/enums/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/enums/Move.toml @@ -1,6 +1,5 @@ [package] name = "Enums" -version = "0.0.1" edition = "2024.alpha" [dependencies] diff --git a/external-crates/move/crates/move-analyzer/tests/implicit_uses.exp b/external-crates/move/crates/move-analyzer/tests/implicit_uses.exp index 71a24a5239fe0..1ae18e4ecb1c0 100644 --- a/external-crates/move/crates/move-analyzer/tests/implicit_uses.exp +++ b/external-crates/move/crates/move-analyzer/tests/implicit_uses.exp @@ -2,8 +2,8 @@ -- test 0 ------------------- use line: 4, use_ndx: 1 Use: 'Option', start: 13, end: 19 -Def: 'Option', line: 6, def char: 11 -TypeDef: 'Option', line: 6, char: 11 +Def: 'Option', line: 7, def char: 18 +TypeDef: 'Option', line: 7, char: 18 On Hover: public struct std::option::Option has copy, drop, store { vec: vector @@ -16,7 +16,7 @@ zero or one because Move bytecode does not have ADTs. -- test 1 ------------------- use line: 8, use_ndx: 2 Use: 'option', start: 26, end: 32 -Def: 'option', line: 1, def char: 12 +Def: 'option', line: 4, def char: 12 TypeDef: no info On Hover: module std::option diff --git a/external-crates/move/crates/move-analyzer/tests/inlay-hints/Move.toml b/external-crates/move/crates/move-analyzer/tests/inlay-hints/Move.toml index f5aa6ee913e03..7920464fd5d5a 100644 --- a/external-crates/move/crates/move-analyzer/tests/inlay-hints/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/inlay-hints/Move.toml @@ -1,6 +1,5 @@ [package] name = "InlayHints" -version = "0.0.1" edition = "2024.beta" [dependencies] diff --git a/external-crates/move/crates/move-analyzer/tests/macros.exp b/external-crates/move/crates/move-analyzer/tests/macros.exp index 10f0e3341fc97..d0e0324404abf 100644 --- a/external-crates/move/crates/move-analyzer/tests/macros.exp +++ b/external-crates/move/crates/move-analyzer/tests/macros.exp @@ -34,29 +34,41 @@ macro fun Macros::fun_type::macro_fun() == macros.move ======================================================== -- test 0 ------------------- use line: 7, use_ndx: 0 +Use: 'n foo(', start: 12, end: 18 +Def: 'vector', line: 6, def char: 12 +TypeDef: no info +On Hover: +module std::vector + +A variable-sized container that can hold any type. Indexing is 0-based, and +vectors are growable. This module has many native functions. + + +-- test 1 ------------------- +use line: 7, use_ndx: 1 Use: 'foo', start: 14, end: 17 Def: 'foo', line: 6, def char: 14 TypeDef: no info On Hover: macro fun Macros::macros::foo($i: u64, $body: |u64| -> u64): u64 --- test 1 ------------------- -use line: 7, use_ndx: 1 +-- test 2 ------------------- +use line: 7, use_ndx: 2 Use: '$i', start: 18, end: 20 Def: '$i', line: 6, def char: 18 TypeDef: no info On Hover: $i: u64 --- test 2 ------------------- -use line: 7, use_ndx: 2 +-- test 3 ------------------- +use line: 7, use_ndx: 3 Use: '$body', start: 27, end: 32 Def: '$body', line: 6, def char: 27 TypeDef: no info On Hover: $body: |u64| -> u64 --- test 3 ------------------- +-- test 4 ------------------- use line: 15, use_ndx: 0 Use: 'bar', start: 14, end: 17 Def: 'bar', line: 14, def char: 14 @@ -64,7 +76,7 @@ TypeDef: no info On Hover: macro fun Macros::macros::bar($i: Macros::macros::SomeStruct, $body: |Macros::macros::SomeStruct| -> Macros::macros::SomeStruct): Macros::macros::SomeStruct --- test 4 ------------------- +-- test 5 ------------------- use line: 15, use_ndx: 1 Use: '$i', start: 18, end: 20 Def: '$i', line: 14, def char: 18 @@ -72,7 +84,7 @@ TypeDef: 'SomeStruct', line: 2, char: 18 On Hover: $i: Macros::macros::SomeStruct --- test 5 ------------------- +-- test 6 ------------------- use line: 15, use_ndx: 2 Use: 'SomeStruct', start: 22, end: 32 Def: 'SomeStruct', line: 2, def char: 18 @@ -82,7 +94,7 @@ public struct Macros::macros::SomeStruct has drop { some_field: u64 } --- test 6 ------------------- +-- test 7 ------------------- use line: 15, use_ndx: 3 Use: '$body', start: 34, end: 39 Def: '$body', line: 14, def char: 34 @@ -90,7 +102,7 @@ TypeDef: no info On Hover: $body: |Macros::macros::SomeStruct| -> Macros::macros::SomeStruct --- test 7 ------------------- +-- test 8 ------------------- use line: 15, use_ndx: 4 Use: 'SomeStruct', start: 42, end: 52 Def: 'SomeStruct', line: 2, def char: 18 @@ -100,7 +112,7 @@ public struct Macros::macros::SomeStruct has drop { some_field: u64 } --- test 8 ------------------- +-- test 9 ------------------- use line: 15, use_ndx: 5 Use: 'SomeStruct', start: 57, end: 67 Def: 'SomeStruct', line: 2, def char: 18 @@ -110,7 +122,7 @@ public struct Macros::macros::SomeStruct has drop { some_field: u64 } --- test 9 ------------------- +-- test 10 ------------------- use line: 15, use_ndx: 6 Use: 'SomeStruct', start: 70, end: 80 Def: 'SomeStruct', line: 2, def char: 18 @@ -120,7 +132,7 @@ public struct Macros::macros::SomeStruct has drop { some_field: u64 } --- test 10 ------------------- +-- test 11 ------------------- use line: 19, use_ndx: 0 Use: 'for_each', start: 14, end: 22 Def: 'for_each', line: 18, def char: 14 @@ -128,7 +140,7 @@ TypeDef: no info On Hover: macro fun Macros::macros::for_each<$T>($v: &vector<$T>, $body: |&$T| -> ()) --- test 11 ------------------- +-- test 12 ------------------- use line: 19, use_ndx: 1 Use: '$T', start: 23, end: 25 Def: '$T', line: 18, def char: 23 @@ -136,7 +148,7 @@ TypeDef: no info On Hover: $T --- test 12 ------------------- +-- test 13 ------------------- use line: 19, use_ndx: 2 Use: '$v', start: 27, end: 29 Def: '$v', line: 18, def char: 27 @@ -144,7 +156,7 @@ TypeDef: no info On Hover: let $v: &vector --- test 13 ------------------- +-- test 14 ------------------- use line: 19, use_ndx: 3 Use: '$T', start: 39, end: 41 Def: '$T', line: 18, def char: 23 @@ -152,7 +164,7 @@ TypeDef: no info On Hover: $T --- test 14 ------------------- +-- test 15 ------------------- use line: 19, use_ndx: 4 Use: '$body', start: 44, end: 49 Def: '$body', line: 18, def char: 44 @@ -160,7 +172,7 @@ TypeDef: no info On Hover: $body: |&$T| -> () --- test 15 ------------------- +-- test 16 ------------------- use line: 19, use_ndx: 5 Use: '$T', start: 53, end: 55 Def: '$T', line: 18, def char: 23 @@ -168,7 +180,7 @@ TypeDef: no info On Hover: $T --- test 16 ------------------- +-- test 17 ------------------- use line: 33, use_ndx: 0 Use: 'macros', start: 16, end: 22 Def: 'macros', line: 0, def char: 15 @@ -176,7 +188,7 @@ TypeDef: no info On Hover: module Macros::macros --- test 17 ------------------- +-- test 18 ------------------- use line: 33, use_ndx: 1 Use: 'foo', start: 24, end: 27 Def: 'foo', line: 6, def char: 14 @@ -184,7 +196,7 @@ TypeDef: no info On Hover: macro fun Macros::macros::foo($i: u64, $body: |u64| -> u64): u64 --- test 18 ------------------- +-- test 19 ------------------- use line: 33, use_ndx: 2 Use: 'p', start: 29, end: 30 Def: 'p', line: 31, def char: 12 @@ -192,7 +204,7 @@ TypeDef: no info On Hover: let p: u64 --- test 19 ------------------- +-- test 20 ------------------- use line: 33, use_ndx: 3 Use: 'x', start: 33, end: 34 Def: 'x', line: 32, def char: 33 @@ -200,7 +212,7 @@ TypeDef: no info On Hover: let x: u64 --- test 20 ------------------- +-- test 21 ------------------- use line: 33, use_ndx: 4 Use: 'x', start: 36, end: 37 Def: 'x', line: 32, def char: 33 @@ -208,7 +220,7 @@ TypeDef: no info On Hover: let x: u64 --- test 21 ------------------- +-- test 22 ------------------- use line: 38, use_ndx: 5 Use: 'y', start: 49, end: 50 Def: 'y', line: 37, def char: 49 @@ -216,7 +228,7 @@ TypeDef: no info On Hover: let y: u64 --- test 22 ------------------- +-- test 23 ------------------- use line: 38, use_ndx: 7 Use: 'foo', start: 68, end: 71 Def: 'foo', line: 6, def char: 14 @@ -224,7 +236,7 @@ TypeDef: no info On Hover: macro fun Macros::macros::foo($i: u64, $body: |u64| -> u64): u64 --- test 23 ------------------- +-- test 24 ------------------- use line: 38, use_ndx: 8 Use: 'y', start: 73, end: 74 Def: 'y', line: 37, def char: 49 @@ -232,7 +244,7 @@ TypeDef: no info On Hover: let y: u64 --- test 24 ------------------- +-- test 25 ------------------- use line: 38, use_ndx: 9 Use: 'z', start: 77, end: 78 Def: 'z', line: 37, def char: 77 @@ -240,7 +252,7 @@ TypeDef: no info On Hover: let z: u64 --- test 25 ------------------- +-- test 26 ------------------- use line: 38, use_ndx: 10 Use: 'z', start: 80, end: 81 Def: 'z', line: 37, def char: 77 @@ -248,7 +260,7 @@ TypeDef: no info On Hover: let z: u64 --- test 26 ------------------- +-- test 27 ------------------- use line: 44, use_ndx: 4 Use: 'sum', start: 48, end: 51 Def: 'sum', line: 42, def char: 16 @@ -256,7 +268,7 @@ TypeDef: no info On Hover: let mut sum: u64 --- test 27 ------------------- +-- test 28 ------------------- use line: 45, use_ndx: 0 Use: 'es', start: 8, end: 10 Def: 'es', line: 41, def char: 12 @@ -264,7 +276,7 @@ TypeDef: no info On Hover: let es: vector --- test 28 ------------------- +-- test 29 ------------------- use line: 45, use_ndx: 1 Use: 'feach', start: 11, end: 16 Def: 'for_each', line: 18, def char: 14 @@ -272,7 +284,7 @@ TypeDef: no info On Hover: macro fun Macros::macros::for_each<$T>($v: &vector<$T>, $body: |&$T| -> ()) --- test 29 ------------------- +-- test 30 ------------------- use line: 52, use_ndx: 2 Use: 'SomeStruct', start: 34, end: 44 Def: 'SomeStruct', line: 2, def char: 18 diff --git a/external-crates/move/crates/move-analyzer/tests/macros.ide b/external-crates/move/crates/move-analyzer/tests/macros.ide index 76471b5f246f1..2a2dc12a448e5 100644 --- a/external-crates/move/crates/move-analyzer/tests/macros.ide +++ b/external-crates/move/crates/move-analyzer/tests/macros.ide @@ -35,6 +35,10 @@ "use_line": 7, "use_ndx": 2 }, + { + "use_line": 7, + "use_ndx": 3 + }, { "use_line": 15, "use_ndx": 0 @@ -146,4 +150,4 @@ ] } } -} \ No newline at end of file +} diff --git a/external-crates/move/crates/move-analyzer/tests/mod-ident-uniform/Move.toml b/external-crates/move/crates/move-analyzer/tests/mod-ident-uniform/Move.toml index 4d4ae972dec2a..4c87e222272d8 100644 --- a/external-crates/move/crates/move-analyzer/tests/mod-ident-uniform/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/mod-ident-uniform/Move.toml @@ -1,6 +1,6 @@ [package] name = "ModIdentUniform" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-analyzer/tests/move-2024/Move.toml b/external-crates/move/crates/move-analyzer/tests/move-2024/Move.toml index 6e8e5c1001331..0d679d0771239 100644 --- a/external-crates/move/crates/move-analyzer/tests/move-2024/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/move-2024/Move.toml @@ -1,6 +1,5 @@ [package] name = "Move2024" -version = "0.0.1" edition = "2024.beta" [dependencies] diff --git a/external-crates/move/crates/move-analyzer/tests/parse-error-dep/Move.toml b/external-crates/move/crates/move-analyzer/tests/parse-error-dep/Move.toml index bd210e0806f65..1149112ed88b1 100644 --- a/external-crates/move/crates/move-analyzer/tests/parse-error-dep/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/parse-error-dep/Move.toml @@ -1,6 +1,6 @@ [package] name = "ParseErrorDep" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-analyzer/tests/parse-error/Move.toml b/external-crates/move/crates/move-analyzer/tests/parse-error/Move.toml index d0dd5b9d61241..a27b40aaebcb9 100644 --- a/external-crates/move/crates/move-analyzer/tests/parse-error/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/parse-error/Move.toml @@ -1,6 +1,6 @@ [package] name = "ParseError" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-analyzer/tests/partial-dot/Move.toml b/external-crates/move/crates/move-analyzer/tests/partial-dot/Move.toml index 66aeb5dcdcfa7..da0955faa0d8e 100644 --- a/external-crates/move/crates/move-analyzer/tests/partial-dot/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/partial-dot/Move.toml @@ -1,6 +1,6 @@ [package] name = "PartialDot" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-analyzer/tests/partial-function/Move.toml b/external-crates/move/crates/move-analyzer/tests/partial-function/Move.toml index 917b1f61cf461..b9876d64b3a67 100644 --- a/external-crates/move/crates/move-analyzer/tests/partial-function/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/partial-function/Move.toml @@ -1,6 +1,6 @@ [package] name = "PartialFunction" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-analyzer/tests/pkg-naming-error/Move.toml b/external-crates/move/crates/move-analyzer/tests/pkg-naming-error/Move.toml index f8feb6145014d..9463d76e478b3 100644 --- a/external-crates/move/crates/move-analyzer/tests/pkg-naming-error/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/pkg-naming-error/Move.toml @@ -1,6 +1,6 @@ [package] name = "PkgNamingError" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-analyzer/tests/pre-type-error-dep/Move.toml b/external-crates/move/crates/move-analyzer/tests/pre-type-error-dep/Move.toml index 7b2f8dce30660..b9ebf9b55b5bf 100644 --- a/external-crates/move/crates/move-analyzer/tests/pre-type-error-dep/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/pre-type-error-dep/Move.toml @@ -1,6 +1,6 @@ [package] name = "PreTypeErrorDep" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-analyzer/tests/pre-type-error/Move.toml b/external-crates/move/crates/move-analyzer/tests/pre-type-error/Move.toml index 8ff3b2be186ee..05bd4a4a6a41d 100644 --- a/external-crates/move/crates/move-analyzer/tests/pre-type-error/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/pre-type-error/Move.toml @@ -1,6 +1,6 @@ [package] name = "PreTypeError" -version = "0.0.1" +edition = "legacy" [addresses] PreTypeError = "0xCAFE" diff --git a/external-crates/move/crates/move-analyzer/tests/symbols/Move.toml b/external-crates/move/crates/move-analyzer/tests/symbols/Move.toml index ddd0a6d3582c2..858e952648a42 100644 --- a/external-crates/move/crates/move-analyzer/tests/symbols/Move.toml +++ b/external-crates/move/crates/move-analyzer/tests/symbols/Move.toml @@ -1,6 +1,6 @@ [package] name = "Symbols" -version = "0.0.1" +edition = "legacy" [dependencies] MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } } diff --git a/external-crates/move/crates/move-cli/src/main.rs b/external-crates/move/crates/move-cli/src/main.rs index acbbbe6d23a8d..11eb3d0699814 100644 --- a/external-crates/move/crates/move-cli/src/main.rs +++ b/external-crates/move/crates/move-cli/src/main.rs @@ -4,19 +4,12 @@ use anyhow::Result; use move_core_types::account_address::AccountAddress; -use move_stdlib_natives::{all_natives, nursery_natives, GasParameters, NurseryGasParameters}; +use move_stdlib_natives::{all_natives, GasParameters}; fn main() -> Result<()> { let cost_table = &move_vm_test_utils::gas_schedule::INITIAL_COST_SCHEDULE; let addr = AccountAddress::from_hex_literal("0x1").unwrap(); - let natives = all_natives(addr, GasParameters::zeros()) - .into_iter() - .chain(nursery_natives( - /* silent */ false, - addr, - NurseryGasParameters::zeros(), - )) - .collect(); + let natives = all_natives(addr, GasParameters::zeros(), /* silent */ false); move_cli::move_cli(natives, cost_table) } diff --git a/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/B/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/B/Move.toml index a6ad126c76313..cd03254de0669 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/B/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/B/Move.toml @@ -1,5 +1,6 @@ [package] name = "Bar" +edition = "2024.beta" [addresses] B = "0x2" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/C/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/C/Move.toml index db95e4a84a73b..6f2a8b5a3aa38 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/C/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/C/Move.toml @@ -1,5 +1,6 @@ [package] name = "Foo" +edition = "2024.beta" [addresses] C = "0x3" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/Move.toml index 3b41905ce8d07..959dd1966ec1f 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/Move.toml @@ -1,5 +1,6 @@ [package] name = "A" +edition = "2024.beta" [addresses] A = "0x2" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/Move.toml index 18ae248f3b8c4..92679a7fff084 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/Move.toml @@ -1,5 +1,6 @@ [package] name = "Test" +edition = "2024.beta" [dependencies] SomeDep = { local = "dep" } diff --git a/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/dep/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/dep/Move.toml index a03576b363c0b..2d3274e227456 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/dep/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/build_with_dep_warnings/dep/Move.toml @@ -1,2 +1,3 @@ [package] name = "SomeDep" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/build_with_warnings/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/build_with_warnings/Move.toml index cb7453ae43828..c8f2665caf8cb 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/build_with_warnings/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/build_with_warnings/Move.toml @@ -1,2 +1,3 @@ [package] name = "Test" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/Move.toml index 799d21da627c2..eb51a49a36279 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/Move.toml @@ -1,5 +1,6 @@ [package] name = "Test" +edition = "2024.beta" [addresses] foo = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/sources/m.move b/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/sources/m.move index 0947c77107c1c..f055c1d054ec4 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/sources/m.move +++ b/external-crates/move/crates/move-cli/tests/build_tests/canonicalize_module/sources/m.move @@ -12,9 +12,9 @@ module bar::b { module bar::c { #[allow(unused_field)] - struct B { x: u64 } + public struct B { x: u64 } #[allow(unused_field)] - struct A { b: vector } + public struct A { b: vector } public fun g(): u64 { foo::a::f() + @@ -35,8 +35,8 @@ module baz::d { } module qux::e { - struct B has drop { x: u64 } - struct A has drop { x: u64 } + public struct B has drop { x: u64 } + public struct A has drop { x: u64 } public fun a(): A { A { x: 46 } diff --git a/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/Move.toml index 6aaff66ce5b5a..d0203b9635df7 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/Move.toml @@ -1,5 +1,6 @@ [package] name = "Foo" +edition = "2024.beta" [dependencies] Bar = { local = "bar" } diff --git a/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/bar/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/bar/Move.toml index 4dba0ffcdc0b3..765a6cfe26577 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/bar/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/circular_dependencies/bar/Move.toml @@ -1,5 +1,6 @@ [package] name = "Bar" +edition = "2024.beta" [dependencies] Foo = { local = ".." } diff --git a/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/Move.toml index 9555addf395da..074036f200787 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/Move.toml @@ -1,5 +1,6 @@ [package] name = "A" +edition = "2024.beta" [addresses] A = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/bar/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/bar/Move.toml index b1a9789ad67de..55f3cce59b4b1 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/bar/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/bar/Move.toml @@ -1,5 +1,6 @@ [package] name = "Bar" +edition = "2024.beta" [addresses] A = "_" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/foo/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/foo/Move.toml index 54db278827612..1d171931f5650 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/foo/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/dependency_chain/foo/Move.toml @@ -1,5 +1,6 @@ [package] name = "Foo" +edition = "2024.beta" [addresses] A = "_" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/dev_address/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/dev_address/Move.toml index bf79537d599bd..1fe668353dcbf 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/dev_address/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/dev_address/Move.toml @@ -1,5 +1,6 @@ [package] name = "A" +edition = "2024.beta" [addresses] A = "_" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/Move.toml index cb7453ae43828..c8f2665caf8cb 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/Move.toml @@ -1,2 +1,3 @@ [package] name = "Test" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/sources/m.move b/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/sources/m.move index 35af0da97addc..b8b8c95c001ae 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/sources/m.move +++ b/external-crates/move/crates/move-cli/tests/build_tests/disassemble_module/sources/m.move @@ -1,7 +1,7 @@ -module 0x42::m { +module 0x42::m; -struct Zs {} -struct As {} +public struct Zs {} +public struct As {} const Zc: u64 = 1; const Ac: u32 = 0; @@ -12,4 +12,3 @@ public fun zf(): u64 { Zc } public fun af(): u32 { Ac } public fun sf(): vector { AString } public fun nf(): vector { NotAString } -} diff --git a/external-crates/move/crates/move-cli/tests/build_tests/empty_module_no_deps/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/empty_module_no_deps/Move.toml index 1cf5dd8272d40..c3f61cd7e71ad 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/empty_module_no_deps/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/empty_module_no_deps/Move.toml @@ -1,2 +1,3 @@ [package] name = "A" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/Move.toml index 4fe19dd013e56..6e3fa396834c9 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/Move.toml @@ -1,5 +1,6 @@ [package] name = "build_include_exclude_stdlib" +edition = "2024.beta" [addresses] std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/args.exp b/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/args.exp index 5620f9e5d8cf6..2089ac58027a6 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/args.exp +++ b/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/args.exp @@ -1,24 +1,16 @@ Command `build -v`: BUILDING build_include_exclude_stdlib error[E03002]: unbound module - ┌─ ./sources/UseSigner.move:2:7 + ┌─ ./sources/UseSigner.move:2:9 │ -2 │ use std::signer; - │ ^^^^^^^^^^^ Invalid 'use'. Unbound module: 'std::signer' +2 │ use std::address; + │ ^^^^^^^^^^^^ Invalid 'use'. Unbound module: 'std::address' -warning[W09002]: unused variable - ┌─ ./sources/UseSigner.move:4:16 +error[E03006]: unexpected name in this position + ┌─ ./sources/UseSigner.move:5:9 │ -4 │ public fun f(account: &signer): address { - │ ^^^^^^^ Unused parameter 'account'. Consider removing or prefixing with an underscore: '_account' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03002]: unbound module - ┌─ ./sources/UseSigner.move:5:5 - │ -5 │ signer::address_of(account) - │ ^^^^^^ Unbound module alias 'signer' +5 │ address::length() + │ ^^^^^^^ Could not resolve the name 'address' Command `-d -v build`: INCLUDING DEPENDENCY MoveStdlib diff --git a/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/sources/UseSigner.move b/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/sources/UseSigner.move index fdec0d78b1d5b..471e9ac62e941 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/sources/UseSigner.move +++ b/external-crates/move/crates/move-cli/tests/build_tests/include_exclude_stdlib/sources/UseSigner.move @@ -1,7 +1,7 @@ module 0x1::Example { - use std::signer; + use std::address; - public fun f(account: &signer): address { - signer::address_of(account) - } + public fun f(): u64 { + address::length() + } } diff --git a/external-crates/move/crates/move-cli/tests/build_tests/json_errors/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/json_errors/Move.toml index cb7453ae43828..c8f2665caf8cb 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/json_errors/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/json_errors/Move.toml @@ -1,2 +1,3 @@ [package] name = "Test" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/migration/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/migration/Move.toml index a1c46ce0fd4e6..dba667925d24a 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/migration/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/migration/Move.toml @@ -3,6 +3,7 @@ [package] name = "A" +edition = "2024.beta" # this is a comment [addresses] diff --git a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_adding_new_source/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_adding_new_source/Move.toml index 38c8578e70c5d..fb502b9d63a8b 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_adding_new_source/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_adding_new_source/Move.toml @@ -1,2 +1,3 @@ [package] name = "Foo" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_deleting_output_artifact/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_deleting_output_artifact/Move.toml index 38c8578e70c5d..fb502b9d63a8b 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_deleting_output_artifact/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_deleting_output_artifact/Move.toml @@ -1,2 +1,3 @@ [package] name = "Foo" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_manifest/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_manifest/Move.toml index 38c8578e70c5d..fb502b9d63a8b 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_manifest/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_manifest/Move.toml @@ -1,2 +1,3 @@ [package] name = "Foo" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_source/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_source/Move.toml index 38c8578e70c5d..fb502b9d63a8b 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_source/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_after_touching_source/Move.toml @@ -1,2 +1,3 @@ [package] name = "Foo" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_no_modification/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_no_modification/Move.toml index 38c8578e70c5d..fb502b9d63a8b 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/rebuild_no_modification/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/rebuild_no_modification/Move.toml @@ -1,2 +1,3 @@ [package] name = "Foo" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/unbound_address/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/unbound_address/Move.toml index eb004df99fa61..d3b1acf0e1ca2 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/unbound_address/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/unbound_address/Move.toml @@ -1,5 +1,6 @@ [package] name = "A" +edition = "2024.beta" [addresses] A = "_" diff --git a/external-crates/move/crates/move-cli/tests/build_tests/unbound_dependency/Move.toml b/external-crates/move/crates/move-cli/tests/build_tests/unbound_dependency/Move.toml index 34150a5abc8c8..72e580593a81d 100644 --- a/external-crates/move/crates/move-cli/tests/build_tests/unbound_dependency/Move.toml +++ b/external-crates/move/crates/move-cli/tests/build_tests/unbound_dependency/Move.toml @@ -1,5 +1,6 @@ [package] name = "A" +edition = "2024.beta" [dependencies] Foo = { local = "foo" } diff --git a/external-crates/move/crates/move-cli/tests/metatests/cov/plain/Move.toml b/external-crates/move/crates/move-cli/tests/metatests/cov/plain/Move.toml index 22033b4afee83..1a5af0edcf304 100644 --- a/external-crates/move/crates/move-cli/tests/metatests/cov/plain/Move.toml +++ b/external-crates/move/crates/move-cli/tests/metatests/cov/plain/Move.toml @@ -1,2 +1,3 @@ [package] name = "plain" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/Move.toml b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/Move.toml index 4e912138c202f..c338346e40e39 100644 --- a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/Move.toml +++ b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/Move.toml @@ -1,2 +1,3 @@ [package] name = "two-runs-diff-module" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M1.move b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M1.move index 1bd0d579ed22c..9fd7c6bce4215 100644 --- a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M1.move +++ b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M1.move @@ -1,5 +1,3 @@ -address 0x42 { -module M1 { +module 0x42::M1 { public entry fun test() {} } -} diff --git a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M2.move b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M2.move index efe2e57019bd7..9b7708349de42 100644 --- a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M2.move +++ b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-diff-module/sources/M2.move @@ -1,5 +1,3 @@ -address 0x42 { -module M2 { +module 0x42::M2 { public entry fun test() {} } -} diff --git a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/Move.toml b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/Move.toml index 5b3ff32dba14f..e2281d4558338 100644 --- a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/Move.toml +++ b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/Move.toml @@ -1,2 +1,3 @@ [package] name = "two-runs-same-module" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/sources/M.move b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/sources/M.move index 2bf7c4f6e69ff..63bfb22fe0cfc 100644 --- a/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/sources/M.move +++ b/external-crates/move/crates/move-cli/tests/metatests/cov/two-runs-same-module/sources/M.move @@ -1,5 +1,4 @@ -address 0x42 { -module M { +module 0x42::M { public entry fun test(x: u8) { if (x == 0) { return () @@ -8,4 +7,3 @@ module M { } } } -} diff --git a/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/Move.toml b/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/Move.toml index 9807273047ad1..de9900102115b 100644 --- a/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/Move.toml +++ b/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/Move.toml @@ -1,5 +1,6 @@ [package] name = "Foo" +edition = "2024.beta" [addresses] A = "_" diff --git a/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/dep/Move.toml b/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/dep/Move.toml index 504a96e8b969e..b2e5ff722fc15 100644 --- a/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/dep/Move.toml +++ b/external-crates/move/crates/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/dep/Move.toml @@ -1,5 +1,6 @@ [package] name = "Bar" +edition = "2024.beta" [addresses] B = "_" diff --git a/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_dev_addr_assignment/Move.toml b/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_dev_addr_assignment/Move.toml index 9eda613c2785f..ec94f223d05ea 100644 --- a/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_dev_addr_assignment/Move.toml +++ b/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_dev_addr_assignment/Move.toml @@ -1,5 +1,6 @@ [package] name = "StandaloneModule" +edition = "2024.beta" [addresses] A = "_" diff --git a/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_regular_addr_assignment/Move.toml b/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_regular_addr_assignment/Move.toml index b9d25c351bf5d..125b57dc7e2c4 100644 --- a/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_regular_addr_assignment/Move.toml +++ b/external-crates/move/crates/move-cli/tests/move_unit_tests/standalone_module_with_regular_addr_assignment/Move.toml @@ -1,5 +1,6 @@ [package] name = "StandaloneModule" +edition = "2024.beta" [addresses] A = "0x2" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/Move.toml index 227421ece9413..213deb0302a27 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/Move.toml @@ -1,2 +1,3 @@ [package] name = "build_modules_and_scripts" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/sources/M.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/sources/M.move index 323f521c5fa9b..9b26c6106d495 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/sources/M.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/build_modules_and_scripts/sources/M.move @@ -1,4 +1,2 @@ -address 0x42 { -module M { -} +module 0x42::M { } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/Move.toml index 54d0c7b5cf984..2e8f58e6a36bd 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/Move.toml @@ -1,8 +1,9 @@ [package] name = "doctor_with_stdlib" +edition = "2024.beta" [addresses] std = "0x1" [dependencies] -MoveNursery = { local = "../../../../move-stdlib/nursery" } +MoveStdlib = { local = "../../../../move-stdlib" } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/sources/M.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/sources/M.move index 2a3b4679e1879..8d8f2c2eec2a6 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/sources/M.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/doctor_with_stdlib/sources/M.move @@ -1,5 +1,4 @@ -address 0x2 { -module M { +module 0x42::M { use std::debug; #[allow(unused_function)] @@ -7,4 +6,3 @@ module M { debug::print(&7); } } -} diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_arithmetic_failure/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_arithmetic_failure/Move.toml index 82f9ed8591dc3..19fb61793939a 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_arithmetic_failure/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_arithmetic_failure/Move.toml @@ -1,2 +1,3 @@ [package] name = "explain_arithmetic_failure" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/Move.toml index 30d499f2e0e75..0997e9909a1ed 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/Move.toml @@ -1,5 +1,6 @@ [package] name = "explain_stdlib_abort" +edition = "2024.beta" [addresses] std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/sources/bad_borrow.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/sources/bad_borrow.move index a88ee72f325ca..4305fd427223b 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/sources/bad_borrow.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_stdlib_abort/sources/bad_borrow.move @@ -1,5 +1,4 @@ module 0x42::m { - use std::vector; entry fun bad_borrow() { let v = vector::empty(); let _ref = vector::borrow(&v, 0); diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/Move.toml index 59b849a5b413c..af4f2f265a5db 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/Move.toml @@ -1,2 +1,3 @@ [package] name = "explain_user_module_abort" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/sources/Fail.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/sources/Fail.move index ca5da8df3229e..a60f498cb193a 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/sources/Fail.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/explain_user_module_abort/sources/Fail.move @@ -1,7 +1,5 @@ -address 0x2 { -module Fail { +module 0x2::Fail { public entry fun f() { abort 77 } } -} diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/gas_metering/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/gas_metering/Move.toml index f712729a5a34a..2a77d599f217f 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/gas_metering/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/gas_metering/Move.toml @@ -1,2 +1,3 @@ [package] name = "gas_metering" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/Move.toml index a504af284913b..4113037316681 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/Move.toml @@ -1,2 +1,3 @@ [package] name = "generate_struct_layout" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M1.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M1.move index 7c6f5a31f98c8..c171a80fb3ccf 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M1.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M1.move @@ -2,11 +2,11 @@ module 0x1::M1 { use 0x1::M2::C; - struct A { f: u64, v: vector, b: B } + public struct A { f: u64, v: vector, b: B } - struct B { a: address, c: C, t: T } + public struct B { a: address, c: C, t: T } - struct S { t: T } + public struct S { t: T } - struct G { x: u64, s: S } + public struct G { x: u64, s: S } } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M2.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M2.move index 8e8baa58fe0e4..f3cc297417d58 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M2.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/M2.move @@ -1,5 +1,5 @@ module 0x1::M2 { #[allow(unused_field)] - struct C { t: T, b: bool } + public struct C { t: T, b: bool } } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/phantoms.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/phantoms.move index 36c04fd66ca1b..6c177ab6c6454 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/phantoms.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/generate_struct_layout/sources/phantoms.move @@ -1,19 +1,19 @@ #[allow(unused_field)] module 0x1::phantoms { - struct A {} + public struct A {} - struct B {} + public struct B {} - struct C { + public struct C { a: A, b: B } - struct D { + public struct D { v: vector } - struct E { + public struct E { v1: vector, v2: vector } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/Move.toml index c2cd982ee3515..2d1699293e385 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/Move.toml @@ -1,5 +1,6 @@ [package] name = "module_publish_view" +edition = "2024.beta" [addresses] std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps1/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps1/Move.toml index c0a24ac0f10be..295dd96c2e4cf 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps1/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps1/Move.toml @@ -1,2 +1,3 @@ [package] name = "Deps1" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps2/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps2/Move.toml index 75c9ff86ecfa0..a34d60f2624e0 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps2/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/deps2/Move.toml @@ -1,2 +1,3 @@ [package] name = "Deps2" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/sources/M1.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/sources/M1.move index f5aed00e50400..7c289c5e51e5d 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/sources/M1.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_disassemble/sources/M1.move @@ -1,8 +1,7 @@ module 0xa::M1 { - use std::vector; #[allow(unused_field)] - struct S { i: u64 } + public struct S { i: u64 } public fun foo(x: u64): vector { let y = bar(); diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/Move.toml index a9da3b168aaf4..fb820c1d04de9 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/Move.toml @@ -1,2 +1,3 @@ [package] name = "module_publish_view" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/sources/Module.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/sources/Module.move index 3bde7f18c916b..0dc254cd9b2ae 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/sources/Module.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/module_publish_view/sources/Module.move @@ -1,9 +1,7 @@ -address 0x42 { -module Module { - struct S { i: u64 } +module 0x42::Module { + public struct S { i: u64 } public fun foo(i: u64): S { S { i } } } -} diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/Move.toml index ce353a9bdb159..584de0746e044 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/Move.toml @@ -1,2 +1,3 @@ [package] name = "multi_module_publish" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/sources/GoodFriends.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/sources/GoodFriends.move index c96b84ac900bc..74c3ff22d4e9b 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/sources/GoodFriends.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/multi_module_publish/sources/GoodFriends.move @@ -1,6 +1,5 @@ module 0x2::A { - friend 0x2::B; - public(friend) fun foo() {} + public(package) fun foo() {} } module 0x2::B { diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/Move.toml index 387bb7c90102f..5cd377a29dca2 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/Move.toml @@ -1,5 +1,6 @@ [package] name = "use_named_address" +edition = "2024.beta" [addresses] a = "0x42" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/Move.toml index 0c63f88d75992..c13bafbb000c8 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/Move.toml @@ -1,5 +1,6 @@ [package] name = "Dep" +edition = "2024.beta" [addresses] a = "0x41" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/sources/m.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/sources/m.move index 51a295bafbfbf..276a1997bf484 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/sources/m.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/named_address_conflicts_in_error/dep/sources/m.move @@ -1,6 +1,6 @@ module a::m { - struct X {} - struct Y {} + public struct X {} + public struct Y {} public fun x(): X { X {} } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/Move.toml index cba2b427b2f55..e1714b99487c0 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/Move.toml @@ -1,5 +1,6 @@ [package] name = "PackageBasics" +edition = "2024.beta" [addresses] std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.exp b/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.exp index a46298ad88699..f036924fe828f 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.exp +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.exp @@ -77,20 +77,17 @@ Constants [ 0 => u64: 0 ] } -Command `disassemble --package MoveStdlib --name signer`: +Command `disassemble --package MoveStdlib --name address`: // Move bytecode v6 -module 1.signer { +module 1.address { -native public borrow_address(s#0#0: &signer): &address -public address_of(s#0#0: &signer): address { +public length(): u64 { B0: - 0: MoveLoc[0](s#0#0: &signer) - 1: Call borrow_address(&signer): &address - 2: ReadRef - 3: Ret + 0: LdU64(32) + 1: Ret } } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.txt b/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.txt index a80887c977c7f..803155024e873 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.txt +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/package_basics/args.txt @@ -3,7 +3,7 @@ test --coverage --threads 1 coverage summary --summarize-functions coverage source --module AModule coverage bytecode --module AModule -disassemble --package MoveStdlib --name signer +disassemble --package MoveStdlib --name address info test double_two test one_one diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/Move.toml index 446c3c961dab2..fcc74b457f32b 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/Move.toml @@ -1,8 +1,9 @@ [package] name = "print_stack_trace" +edition = "2024.beta" [addresses] std = "0x1" [dependencies] -MoveNursery = { local = "../../../../move-stdlib/nursery" } +MoveStdlib = { local = "../../../../move-stdlib" } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/M.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/M.move index 3cc1425e225a1..978efd65b36a7 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/M.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/M.move @@ -1,5 +1,4 @@ -address 0x2 { -module M { +module 0x2::M { use std::debug; public fun sum(n: u64): u64 { @@ -11,4 +10,3 @@ module M { } } } -} diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/N.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/N.move index 24f61a218d635..08e2467602b16 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/N.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/N.move @@ -1,14 +1,12 @@ -address 0x2 { #[allow(unused_type_parameter, unused_mut_ref)] -module N { +module 0x2::N { use 0x2::M; public fun foo(): u64 { - let x = 3; + let mut x = 3; let y = &mut x; let z = M::sum(4); _ = y; z } } -} diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/print_stack_trace.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/print_stack_trace.move index 6cc01bb23aa7c..cda19d634c1e7 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/print_stack_trace.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_stack_trace/sources/print_stack_trace.move @@ -1,11 +1,10 @@ module 0x42::print_stack_trace { use std::debug; - use std::vector; use 0x2::N; #[allow(unused_mut_ref)] entry fun print_stack_trace() { - let v = vector::empty(); + let mut v = vector::empty(); vector::push_back(&mut v, true); vector::push_back(&mut v, false); let r = vector::borrow(&mut v, 1); diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/Move.toml index 1f13306640b9f..32e1a378ac3a8 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/Move.toml @@ -1,8 +1,9 @@ [package] name = "print_values" +edition = "2024.beta" [addresses] std = "0x1" [dependencies] -MoveNursery = { local = "../../../../move-stdlib/nursery" } +MoveStdlib = { local = "../../../../move-stdlib" } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/args.exp b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/args.exp index c6d94de4f98f7..327546f02d9de 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/args.exp +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/args.exp @@ -1,6 +1,5 @@ Command `sandbox publish`: Command `test`: -INCLUDING DEPENDENCY MoveNursery INCLUDING DEPENDENCY MoveStdlib BUILDING print_values Running Move unit tests @@ -38,7 +37,6 @@ Running Move unit tests [debug] false [debug] true [debug] @0x1234c0ffee -[debug] signer(0x0) [debug] "test_print_struct" [debug] 0x2::M::TestInner { val: 100, @@ -62,7 +60,6 @@ Running Move unit tests [debug] [ 256, 257, 258, 259 ] [debug] [ true, false ] [debug] [ @0x1234, @0x5678, @0xabcdef ] -[debug] [ signer(0x0), signer(0x100000000000000000000000000000000000000000000000000000000000000), signer(0x200000000000000000000000000000000000000000000000000000000000000), signer(0x300000000000000000000000000000000000000000000000000000000000000) ] [debug] [ 0x2::M::TestInner { val: 4, @@ -113,10 +110,6 @@ Running Move unit tests [ @0x1234, @0x5678 ], [ @0xabcdef, @0x9999 ] ] -[debug] [ - [ signer(0x0), signer(0x100000000000000000000000000000000000000000000000000000000000000) ], - [ signer(0x0), signer(0x100000000000000000000000000000000000000000000000000000000000000) ] -] [debug] [ [ 0x2::M::TestInner { diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/sources/M.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/sources/M.move index e4c8ba1f3b1c2..cb661dfb65ad2 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/sources/M.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/print_values/sources/M.move @@ -1,33 +1,26 @@ -address 0x2 { #[allow(unused_field)] -module M { +module 0x2::M { #[test_only] use std::ascii; #[test_only] use std::debug::print; - #[test_only] - use std::debug::print_string; use std::string; - #[test_only] - use std::unit_test::create_signers_for_testing; - #[test_only] - use std::vector; - struct Foo has drop {} - struct Bar has drop { x: u128, y: Foo, z: bool } - struct Box has drop { x: T } + public struct Foo has drop {} + public struct Bar has drop { x: u128, y: Foo, z: bool } + public struct Box has drop { x: T } - struct GenericStruct has drop { + public struct GenericStruct has drop { val: u64, } - struct TestInner has drop { + public struct TestInner has drop { val: u128, vec: vector, msgs: vector> } - struct TestStruct has drop { + public struct TestStruct has drop { addr: address, number: u8, bytes: vector, @@ -40,7 +33,7 @@ module M { let x = 42; print(&x); - let v = vector::empty(); + let mut v = vector::empty(); vector::push_back(&mut v, 100); vector::push_back(&mut v, 200); vector::push_back(&mut v, 300); @@ -124,11 +117,6 @@ module M { let a = @0x1234c0ffee; print(&a); - - // print a signer - let senders = create_signers_for_testing(1); - let sender = vector::pop_back(&mut senders); - print(&sender); } #[allow(unused_const)] @@ -185,9 +173,6 @@ module M { let v_addr = vector[@0x1234, @0x5678, @0xabcdef]; print(&v_addr); - let v_signer = create_signers_for_testing(4); - print(&v_signer); - let v = vector[ TestInner { val: 4u128, @@ -231,9 +216,6 @@ module M { let v_addr = vector[vector[@0x1234, @0x5678], vector[@0xabcdef, @0x9999]]; print(&v_addr); - let v_signer = vector[create_signers_for_testing(2), create_signers_for_testing(2)]; - print(&v_signer); - let v = vector[ vector[ TestInner { val: 4u128, vec: vector[127u128, 128u128], msgs: vector[] }, @@ -275,5 +257,9 @@ module M { print(&obj); } -} + + #[test_only] + public fun print_string(utf8_bytes: vector) { + print(&string::utf8(utf8_bytes)); + } } diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/Move.toml index e6ea5df3aeac9..2c09426b415c0 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/Move.toml @@ -1,2 +1,3 @@ [package] name = "publish_then_run" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/sources/M.move b/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/sources/M.move index f25c55efc332b..7dd1a97c43805 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/sources/M.move +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/publish_then_run/sources/M.move @@ -1,5 +1,3 @@ -address 0x2 { -module M { +module 0x2::M { public entry fun f() {} } -} diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/random_test_flag_correctness/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/random_test_flag_correctness/Move.toml index c88176fe599b1..ec5322a2c6e18 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/random_test_flag_correctness/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/random_test_flag_correctness/Move.toml @@ -1,5 +1,6 @@ [package] name = "random_test_flag_correctness" +edition = "2024.beta" [addresses] std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/use_named_address/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/use_named_address/Move.toml index cbec350b0c2ea..076d820a22706 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/use_named_address/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/use_named_address/Move.toml @@ -1,5 +1,6 @@ [package] name = "use_named_address" +edition = "2024.beta" [addresses] A = "0x42" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_multi_module_publish/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_multi_module_publish/Move.toml index e162affa0e604..939bd5cabd656 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_multi_module_publish/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_multi_module_publish/Move.toml @@ -1,2 +1,3 @@ [package] name = "verify_native_functions_in_publish" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_publish/Move.toml b/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_publish/Move.toml index e162affa0e604..939bd5cabd656 100644 --- a/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_publish/Move.toml +++ b/external-crates/move/crates/move-cli/tests/sandbox_tests/verify_native_functions_in_publish/Move.toml @@ -1,2 +1,3 @@ [package] name = "verify_native_functions_in_publish" +edition = "2024.beta" diff --git a/external-crates/move/crates/move-cli/tests/upload_tests/no_git_remote_package/Move.toml b/external-crates/move/crates/move-cli/tests/upload_tests/no_git_remote_package/Move.toml index 56dceb553f5b5..8d8563b904bcf 100644 --- a/external-crates/move/crates/move-cli/tests/upload_tests/no_git_remote_package/Move.toml +++ b/external-crates/move/crates/move-cli/tests/upload_tests/no_git_remote_package/Move.toml @@ -1,5 +1,6 @@ [package] name = "Package1" +edition = "2024.beta" [addresses] Std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/upload_tests/valid_package1/Move.toml b/external-crates/move/crates/move-cli/tests/upload_tests/valid_package1/Move.toml index 56dceb553f5b5..8d8563b904bcf 100644 --- a/external-crates/move/crates/move-cli/tests/upload_tests/valid_package1/Move.toml +++ b/external-crates/move/crates/move-cli/tests/upload_tests/valid_package1/Move.toml @@ -1,5 +1,6 @@ [package] name = "Package1" +edition = "2024.beta" [addresses] Std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/upload_tests/valid_package2/Move.toml b/external-crates/move/crates/move-cli/tests/upload_tests/valid_package2/Move.toml index 56dceb553f5b5..8d8563b904bcf 100644 --- a/external-crates/move/crates/move-cli/tests/upload_tests/valid_package2/Move.toml +++ b/external-crates/move/crates/move-cli/tests/upload_tests/valid_package2/Move.toml @@ -1,5 +1,6 @@ [package] name = "Package1" +edition = "2024.beta" [addresses] Std = "0x1" diff --git a/external-crates/move/crates/move-cli/tests/upload_tests/valid_package3/Move.toml b/external-crates/move/crates/move-cli/tests/upload_tests/valid_package3/Move.toml index 56dceb553f5b5..8d8563b904bcf 100644 --- a/external-crates/move/crates/move-cli/tests/upload_tests/valid_package3/Move.toml +++ b/external-crates/move/crates/move-cli/tests/upload_tests/valid_package3/Move.toml @@ -1,5 +1,6 @@ [package] name = "Package1" +edition = "2024.beta" [addresses] Std = "0x1" diff --git a/external-crates/move/crates/move-compiler/src/editions/mod.rs b/external-crates/move/crates/move-compiler/src/editions/mod.rs index 7793a573480e9..5cfea4d99d59d 100644 --- a/external-crates/move/crates/move-compiler/src/editions/mod.rs +++ b/external-crates/move/crates/move-compiler/src/editions/mod.rs @@ -397,6 +397,6 @@ impl Serialize for Flavor { impl Default for Edition { fn default() -> Self { - Edition::LEGACY + Edition::E2024_BETA } } diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.exp index 494f2b8aa3740..72686085d4c6e 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.exp @@ -25,7 +25,7 @@ error[E04023]: invalid method call 10 │ 0u64.f(); │ ^^^^^^^^ │ │ │ - │ │ No local 'use fun' alias was found for 'u64.f' + │ │ No local 'use fun' alias was found for 'u64.f', and no function 'f' was found in the defining module 'std::u64' │ Invalid method call. No known method 'f' on type 'u64' error[E04023]: invalid method call diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.exp index 2a0680e60c94a..8d45aad08e11a 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.exp +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.exp @@ -4,6 +4,6 @@ error[E10004]: invalid usage of known attribute 2 │ module a::m {} │ - Previously declared here 3 │ -4 │ #[defines_primitive(u64)] - │ ^^^^^^^^^^^^^^^^^^^^^^ Duplicate definer annotated for primitive type 'u64' +4 │ #[defines_primitive(signer)] + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate definer annotated for primitive type 'signer' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.move b/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.move index f2f7f25da2bd9..565d0fdeae2e4 100644 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.move +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.move @@ -1,5 +1,5 @@ -#[defines_primitive(u64)] +#[defines_primitive(signer)] module a::m {} -#[defines_primitive(u64)] +#[defines_primitive(signer)] module a::n {} diff --git a/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs b/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs index 1296da8588f72..104ea80dd79f8 100644 --- a/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs +++ b/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs @@ -64,7 +64,7 @@ fn move_check_testsuite(path: &Path) -> datatest_stable::Result<()> { } else if path_contains(DEV_DIR) { Edition::DEVELOPMENT } else { - Edition::default() + Edition::LEGACY }; let config = PackageConfig { flavor, diff --git a/external-crates/move/crates/move-docgen/tests/sources/different_visbilities.move b/external-crates/move/crates/move-docgen/tests/sources/different_visbilities.move index 3d1aaad29ed34..0bb17bf6ad845 100644 --- a/external-crates/move/crates/move-docgen/tests/sources/different_visbilities.move +++ b/external-crates/move/crates/move-docgen/tests/sources/different_visbilities.move @@ -1,5 +1,4 @@ -address 0x2 { -module TestViz { +module 0x2::TestViz { /// This is a public function public fun this_is_a_public_fun() { } @@ -13,4 +12,3 @@ module TestViz { /// This is a private function fun this_is_a_private_fun() {} } -} diff --git a/external-crates/move/crates/move-docgen/tests/sources/root_template_AnotherTypeOfScript.notest_move b/external-crates/move/crates/move-docgen/tests/sources/root_template_AnotherTypeOfScript.notest_move index eb7dbd3b1d754..aeeb87e9a1268 100644 --- a/external-crates/move/crates/move-docgen/tests/sources/root_template_AnotherTypeOfScript.notest_move +++ b/external-crates/move/crates/move-docgen/tests/sources/root_template_AnotherTypeOfScript.notest_move @@ -1,5 +1,4 @@ -address 0x1 { -module AnotherTypeOfScript { +module 0x1::AnotherTypeOfScript { /// This is a script entry fun script3() {} @@ -7,4 +6,3 @@ module AnotherTypeOfScript { /// This is another script entry fun script4() {} } -} diff --git a/external-crates/move/crates/move-docgen/tests/sources/root_template_OneTypeOfScript.notest_move b/external-crates/move/crates/move-docgen/tests/sources/root_template_OneTypeOfScript.notest_move index e793028b23b20..2de14cdce79fd 100644 --- a/external-crates/move/crates/move-docgen/tests/sources/root_template_OneTypeOfScript.notest_move +++ b/external-crates/move/crates/move-docgen/tests/sources/root_template_OneTypeOfScript.notest_move @@ -1,5 +1,4 @@ -address 0x1 { -module OneTypeOfScript { +module 0x1::OneTypeOfScript { /// This is a script entry fun script1() {} @@ -7,4 +6,3 @@ module OneTypeOfScript { /// This is another script entry fun script2() {} } -} diff --git a/external-crates/move/crates/move-package/src/resolution/resolution_graph.rs b/external-crates/move/crates/move-package/src/resolution/resolution_graph.rs index 8b8e45ca8a0ec..603d4c07f7493 100644 --- a/external-crates/move/crates/move-package/src/resolution/resolution_graph.rs +++ b/external-crates/move/crates/move-package/src/resolution/resolution_graph.rs @@ -7,6 +7,7 @@ use move_command_line_common::files::{ extension_equals, find_filenames, find_move_filenames, FileHash, MOVE_COMPILED_EXTENSION, }; use move_compiler::command_line::DEFAULT_OUTPUT_DIR; +use move_compiler::editions::Edition; use move_compiler::{diagnostics::WarningFilters, shared::PackageConfig}; use move_core_types::account_address::AccountAddress; use move_symbol_pool::Symbol; @@ -574,7 +575,7 @@ impl Package { .package .edition .or(config.default_edition) - .unwrap_or_default(), + .unwrap_or(Edition::LEGACY), // TODO require edition warning_filter: WarningFilters::new_for_source(), } } diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/basic_test.move b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/basic_test.move index 49592ecd81250..f4c8062d09456 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/basic_test.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/basic_test.move @@ -1,10 +1,10 @@ module 0x42::TestBorrow { - struct R has copy, drop { + public struct R has copy, drop { x: u64 } fun test1() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; let x_ref = &mut r_ref.x; *x_ref = 0; @@ -21,7 +21,7 @@ module 0x42::TestBorrow { } fun test4() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; test3(r_ref, 0); r @@ -32,7 +32,7 @@ module 0x42::TestBorrow { } fun test6() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; let x_ref = test5(r_ref); test2(x_ref, 0); @@ -40,19 +40,19 @@ module 0x42::TestBorrow { } fun test7(b: bool) { - let r1 = R {x: 3}; - let r2 = R {x: 4}; - let r_ref = &mut r1; + let mut r1 = R {x: 3}; + let mut r2 = R {x: 4}; + let mut r_ref = &mut r1; if (b) { r_ref = &mut r2; }; test3(r_ref, 0) } - fun test8(b: bool, n: u64, r_ref: &mut R) { - let r1 = R {x: 3}; - let r2 = R {x: 4}; - let t_ref = &mut r2; + fun test8(b: bool, mut n: u64, r_ref: &mut R) { + let mut r1 = R {x: 3}; + let mut r2 = R {x: 4}; + let mut t_ref = &mut r2; while (0 < n) { if (n/2 == 0) { t_ref = &mut r1 diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.exp b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.exp index 30226bd8972fb..0559d22411800 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.exp +++ b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.exp @@ -1,5 +1,339 @@ ============ initial translation from Move ================ +[variant baseline] +public fun u64::diff($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 14 + 8: label L1 + 9: $t10 := move($t3) + 10: $t11 := move($t4) + 11: $t12 := -($t10, $t11) + 12: $t2 := $t12 + 13: goto 20 + 14: label L0 + 15: $t13 := move($t4) + 16: $t14 := move($t3) + 17: $t15 := -($t13, $t14) + 18: $t2 := $t15 + 19: goto 20 + 20: label L2 + 21: $t16 := move($t2) + 22: return $t16 +} + + +[variant baseline] +public fun u64::divide_and_round_up($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: bool + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := %($t7, $t8) + 7: $t10 := 0 + 8: $t11 := ==($t9, $t10) + 9: if ($t11) goto 10 else goto 16 + 10: label L1 + 11: $t12 := move($t3) + 12: $t13 := move($t4) + 13: $t14 := /($t12, $t13) + 14: $t2 := $t14 + 15: goto 24 + 16: label L0 + 17: $t15 := move($t3) + 18: $t16 := move($t4) + 19: $t17 := /($t15, $t16) + 20: $t18 := 1 + 21: $t19 := +($t17, $t18) + 22: $t2 := $t19 + 23: goto 24 + 24: label L2 + 25: $t20 := move($t2) + 26: return $t20 +} + + +[variant baseline] +public fun u64::max($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::min($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := <($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::pow($t0|base: u64, $t1|exponent: u8): u64 { + var $t2|base#1#1: u64 + var $t3|exponent#1#1: u8 + var $t4|res#1#1: u64 + var $t5: u64 + var $t6: u8 + var $t7: u64 + var $t8: u8 + var $t9: u8 + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: bool + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u8 + var $t20: u8 + var $t21: u8 + var $t22: u64 + var $t23: u64 + var $t24: u64 + var $t25: u8 + var $t26: u8 + var $t27: u8 + var $t28: u64 + 0: $t5 := move($t0) + 1: $t2 := $t5 + 2: $t6 := move($t1) + 3: $t3 := $t6 + 4: $t7 := 1 + 5: $t4 := $t7 + 6: goto 7 + 7: label L5 + 8: $t8 := copy($t3) + 9: $t9 := 1 + 10: $t10 := >=($t8, $t9) + 11: if ($t10) goto 12 else goto 41 + 12: label L1 + 13: goto 14 + 14: label L2 + 15: $t11 := copy($t3) + 16: $t12 := 2 + 17: $t13 := %($t11, $t12) + 18: $t14 := 0 + 19: $t15 := ==($t13, $t14) + 20: if ($t15) goto 21 else goto 31 + 21: label L4 + 22: $t16 := copy($t2) + 23: $t17 := move($t2) + 24: $t18 := *($t16, $t17) + 25: $t2 := $t18 + 26: $t19 := move($t3) + 27: $t20 := 2 + 28: $t21 := /($t19, $t20) + 29: $t3 := $t21 + 30: goto 7 + 31: label L3 + 32: $t22 := move($t4) + 33: $t23 := copy($t2) + 34: $t24 := *($t22, $t23) + 35: $t4 := $t24 + 36: $t25 := move($t3) + 37: $t26 := 1 + 38: $t27 := -($t25, $t26) + 39: $t3 := $t27 + 40: goto 7 + 41: label L0 + 42: $t28 := move($t4) + 43: return $t28 +} + + +[variant baseline] +public fun u64::sqrt($t0|x: u64): u64 { + var $t1|bit#1#1: u128 + var $t2|res#1#1: u128 + var $t3|x#1#1: u64 + var $t4|x#2#1: u128 + var $t5: u64 + var $t6: u128 + var $t7: u128 + var $t8: u64 + var $t9: u128 + var $t10: u128 + var $t11: u128 + var $t12: bool + var $t13: u128 + var $t14: u128 + var $t15: u128 + var $t16: u128 + var $t17: bool + var $t18: u128 + var $t19: u128 + var $t20: u128 + var $t21: u128 + var $t22: u128 + var $t23: u128 + var $t24: u8 + var $t25: u128 + var $t26: u128 + var $t27: u128 + var $t28: u128 + var $t29: u8 + var $t30: u128 + var $t31: u128 + var $t32: u8 + var $t33: u128 + var $t34: u128 + var $t35: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := 18446744073709551616 + 3: $t1 := $t6 + 4: $t7 := 0 + 5: $t2 := $t7 + 6: $t8 := move($t3) + 7: $t9 := (u128)($t8) + 8: $t4 := $t9 + 9: goto 10 + 10: label L6 + 11: $t10 := copy($t1) + 12: $t11 := 0 + 13: $t12 := !=($t10, $t11) + 14: if ($t12) goto 15 else goto 50 + 15: label L1 + 16: goto 17 + 17: label L2 + 18: $t13 := copy($t4) + 19: $t14 := copy($t2) + 20: $t15 := copy($t1) + 21: $t16 := +($t14, $t15) + 22: $t17 := >=($t13, $t16) + 23: if ($t17) goto 24 else goto 38 + 24: label L4 + 25: $t18 := move($t4) + 26: $t19 := copy($t2) + 27: $t20 := copy($t1) + 28: $t21 := +($t19, $t20) + 29: $t22 := -($t18, $t21) + 30: $t4 := $t22 + 31: $t23 := move($t2) + 32: $t24 := 1 + 33: $t25 := >>($t23, $t24) + 34: $t26 := copy($t1) + 35: $t27 := +($t25, $t26) + 36: $t2 := $t27 + 37: goto 44 + 38: label L3 + 39: $t28 := move($t2) + 40: $t29 := 1 + 41: $t30 := >>($t28, $t29) + 42: $t2 := $t30 + 43: goto 44 + 44: label L5 + 45: $t31 := move($t1) + 46: $t32 := 2 + 47: $t33 := >>($t31, $t32) + 48: $t1 := $t33 + 49: goto 10 + 50: label L0 + 51: $t34 := move($t2) + 52: $t35 := (u64)($t34) + 53: return $t35 +} + + [variant baseline] public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { var $t2: &mut vector<#0> @@ -231,27 +565,25 @@ public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { 15: $t13 := move($t1) 16: vector::push_back<#0>($t12, $t13) 17: goto 18 - 18: label L5 + 18: label L4 19: $t14 := copy($t2) 20: $t15 := copy($t3) 21: $t16 := <($t14, $t15) - 22: if ($t16) goto 23 else goto 35 + 22: if ($t16) goto 23 else goto 33 23: label L3 - 24: goto 25 - 25: label L4 - 26: $t17 := copy($t0) - 27: $t18 := copy($t2) - 28: $t19 := copy($t3) - 29: vector::swap<#0>($t17, $t18, $t19) - 30: $t20 := move($t2) - 31: $t21 := 1 - 32: $t22 := +($t20, $t21) - 33: $t2 := $t22 - 34: goto 18 - 35: label L2 - 36: $t23 := move($t0) - 37: destroy($t23) - 38: return () + 24: $t17 := copy($t0) + 25: $t18 := copy($t2) + 26: $t19 := copy($t3) + 27: vector::swap<#0>($t17, $t18, $t19) + 28: $t20 := move($t2) + 29: $t21 := 1 + 30: $t22 := +($t20, $t21) + 31: $t2 := $t22 + 32: goto 18 + 33: label L2 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: return () } @@ -329,31 +661,29 @@ public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { 16: $t15 := -($t13, $t14) 17: $t4 := $t15 18: goto 19 - 19: label L5 + 19: label L4 20: $t16 := copy($t1) 21: $t17 := copy($t4) 22: $t18 := <($t16, $t17) - 23: if ($t18) goto 24 else goto 40 + 23: if ($t18) goto 24 else goto 38 24: label L3 - 25: goto 26 - 26: label L4 - 27: $t19 := copy($t0) - 28: $t3 := $t19 - 29: $t20 := copy($t1) - 30: $t2 := $t20 - 31: $t21 := move($t1) - 32: $t22 := 1 - 33: $t23 := +($t21, $t22) - 34: $t1 := $t23 - 35: $t24 := move($t3) - 36: $t25 := move($t2) - 37: $t26 := copy($t1) - 38: vector::swap<#0>($t24, $t25, $t26) - 39: goto 19 - 40: label L2 - 41: $t27 := move($t0) - 42: $t28 := vector::pop_back<#0>($t27) - 43: return $t28 + 25: $t19 := copy($t0) + 26: $t3 := $t19 + 27: $t20 := copy($t1) + 28: $t2 := $t20 + 29: $t21 := move($t1) + 30: $t22 := 1 + 31: $t23 := +($t21, $t22) + 32: $t1 := $t23 + 33: $t24 := move($t3) + 34: $t25 := move($t2) + 35: $t26 := copy($t1) + 36: vector::swap<#0>($t24, $t25, $t26) + 37: goto 19 + 38: label L2 + 39: $t27 := move($t0) + 40: $t28 := vector::pop_back<#0>($t27) + 41: return $t28 } @@ -406,31 +736,29 @@ public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { 17: $t14 := -($t12, $t13) 18: $t1 := $t14 19: goto 20 - 20: label L5 + 20: label L4 21: $t15 := copy($t2) 22: $t16 := copy($t1) 23: $t17 := <($t15, $t16) - 24: if ($t17) goto 25 else goto 41 + 24: if ($t17) goto 25 else goto 39 25: label L3 - 26: goto 27 - 27: label L4 - 28: $t18 := copy($t0) - 29: $t19 := copy($t2) - 30: $t20 := copy($t1) - 31: vector::swap<#0>($t18, $t19, $t20) - 32: $t21 := move($t2) - 33: $t22 := 1 - 34: $t23 := +($t21, $t22) - 35: $t2 := $t23 - 36: $t24 := move($t1) - 37: $t25 := 1 - 38: $t26 := -($t24, $t25) - 39: $t1 := $t26 - 40: goto 20 - 41: label L2 - 42: $t27 := move($t0) - 43: destroy($t27) - 44: return () + 26: $t18 := copy($t0) + 27: $t19 := copy($t2) + 28: $t20 := copy($t1) + 29: vector::swap<#0>($t18, $t19, $t20) + 30: $t21 := move($t2) + 31: $t22 := 1 + 32: $t23 := +($t21, $t22) + 33: $t2 := $t23 + 34: $t24 := move($t1) + 35: $t25 := 1 + 36: $t26 := -($t24, $t25) + 37: $t1 := $t26 + 38: goto 20 + 39: label L2 + 40: $t27 := move($t0) + 41: destroy($t27) + 42: return () } @@ -504,364 +832,3550 @@ public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { [variant baseline] -fun MultiLayerCalling::inner($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { - var $t1: &mut MultiLayerCalling::HasVector - var $t2: &mut vector - var $t3: u64 - var $t4: &mut MultiLayerCalling::HasAnotherVector - 0: $t1 := move($t0) - 1: $t2 := borrow_field.v($t1) - 2: $t3 := 7 - 3: $t4 := vector::borrow_mut($t2, $t3) - 4: return $t4 +public fun option::borrow<#0>($t0|t: &option::Option<#0>): � { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: &option::Option<#0> + var $t4: u64 + var $t5: &option::Option<#0> + var $t6: &vector<#0> + var $t7: u64 + var $t8: � + 0: $t1 := copy($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 10 + 5: label L0 + 6: $t3 := move($t0) + 7: destroy($t3) + 8: $t4 := 262145 + 9: abort($t4) + 10: label L2 + 11: $t5 := move($t0) + 12: $t6 := borrow_field>.vec($t5) + 13: $t7 := 0 + 14: $t8 := vector::borrow<#0>($t6, $t7) + 15: return $t8 } [variant baseline] -fun MultiLayerCalling::mid($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { - var $t1: &mut MultiLayerCalling::HasVector - var $t2: &mut MultiLayerCalling::HasAnotherVector - 0: $t1 := move($t0) - 1: $t2 := MultiLayerCalling::inner($t1) - 2: return $t2 +public fun option::borrow_mut<#0>($t0|t: &mut option::Option<#0>): &mut #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> + var $t5: u64 + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: u64 + var $t9: &mut #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := 0 + 15: $t9 := vector::borrow_mut<#0>($t7, $t8) + 16: return $t9 } [variant baseline] -fun MultiLayerCalling::outer($t0|has_vector: &mut MultiLayerCalling::HasVector) { - var $t1: &mut MultiLayerCalling::HasVector - var $t2: &mut MultiLayerCalling::HasAnotherVector - var $t3: &mut vector - var $t4: u8 - 0: $t1 := move($t0) - 1: $t2 := MultiLayerCalling::mid($t1) - 2: $t3 := borrow_field.v($t2) - 3: $t4 := 42 - 4: vector::push_back($t3, $t4) - 5: return () +public fun option::contains<#0>($t0|t: &option::Option<#0>, $t1|e_ref: �): bool { + var $t2: &option::Option<#0> + var $t3: &vector<#0> + var $t4: � + var $t5: bool + 0: $t2 := move($t0) + 1: $t3 := borrow_field>.vec($t2) + 2: $t4 := move($t1) + 3: $t5 := vector::contains<#0>($t3, $t4) + 4: return $t5 } -============ after pipeline `borrow` ================ [variant baseline] -public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { - var $t2: &mut vector<#0> - var $t3: vector<#0> - var $t4: bool - var $t5: bool - var $t6: &mut vector<#0> - var $t7: #0 - var $t8: vector<#0> - 0: $t2 := borrow_local($t1) - 1: vector::reverse<#0>($t2) - 2: label L3 - 3: $t3 := copy($t1) - 4: $t4 := vector::is_empty<#0>($t3) - 5: $t5 := !($t4) - 6: if ($t5) goto 7 else goto 13 - 7: label L1 - 8: label L2 - 9: $t6 := borrow_local($t1) - 10: $t7 := vector::pop_back<#0>($t6) - 11: vector::push_back<#0>($t0, $t7) - 12: goto 2 - 13: label L0 - 14: destroy($t0) - 15: $t8 := move($t1) - 16: vector::destroy_empty<#0>($t8) - 17: trace_local[lhs]($t0) - 18: return () +public fun option::swap<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): #0 { + var $t2|old_value#1#0: #0 + var $t3|vec_ref#1#0: &mut vector<#0> + var $t4: &mut option::Option<#0> + var $t5: &option::Option<#0> + var $t6: bool + var $t7: &mut option::Option<#0> + var $t8: u64 + var $t9: &mut option::Option<#0> + var $t10: &mut vector<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: &mut vector<#0> + var $t14: #0 + var $t15: #0 + 0: $t4 := copy($t0) + 1: $t5 := freeze_ref($t4) + 2: $t6 := option::is_some<#0>($t5) + 3: if ($t6) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t7 := move($t0) + 8: destroy($t7) + 9: $t8 := 262145 + 10: abort($t8) + 11: label L2 + 12: $t9 := move($t0) + 13: $t10 := borrow_field>.vec($t9) + 14: $t3 := $t10 + 15: $t11 := copy($t3) + 16: $t12 := vector::pop_back<#0>($t11) + 17: $t2 := $t12 + 18: $t13 := move($t3) + 19: $t14 := move($t1) + 20: vector::push_back<#0>($t13, $t14) + 21: $t15 := move($t2) + 22: return $t15 } [variant baseline] -public native fun vector::borrow<#0>($t0|v: vector<#0>, $t1|i: u64): #0; +public fun option::borrow_with_default<#0>($t0|t: &option::Option<#0>, $t1|default_ref: �): � { + var $t2|tmp#$2: � + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: � + var $t10: � + var $t11: &vector<#0> + var $t12: u64 + var $t13: � + var $t14: � + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 20 + 12: label L0 + 13: $t10 := move($t1) + 14: destroy($t10) + 15: $t11 := move($t3) + 16: $t12 := 0 + 17: $t13 := vector::borrow<#0>($t11, $t12) + 18: $t2 := $t13 + 19: goto 20 + 20: label L2 + 21: $t14 := move($t2) + 22: return $t14 +} [variant baseline] -public native fun vector::borrow_mut<#0>($t0|v: &mut vector<#0>, $t1|i: u64): &mut #0; +public fun option::destroy_none<#0>($t0|t: option::Option<#0>) { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: option::Option<#0> + var $t5: vector<#0> + 0: $t1 := borrow_local($t0) + 1: $t2 := option::is_none<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 262144 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := unpack option::Option<#0>($t4) + 11: vector::destroy_empty<#0>($t5) + 12: return () +} [variant baseline] -public fun vector::contains<#0>($t0|v: vector<#0>, $t1|e: #0): bool { - var $t2|i#1#0: u64 - var $t3|len#1#0: u64 - var $t4: u64 +public fun option::destroy_some<#0>($t0|t: option::Option<#0>): #0 { + var $t1|elem#1#0: #0 + var $t2|vec#1#0: vector<#0> + var $t3: &option::Option<#0> + var $t4: bool var $t5: u64 - var $t6: bool - var $t7: #0 - var $t8: bool - var $t9: bool - var $t10: u64 - var $t11: bool - 0: $t4 := 0 - 1: $t2 := $t4 - 2: $t5 := vector::length<#0>($t0) - 3: label L5 - 4: $t6 := <($t2, $t5) - 5: if ($t6) goto 6 else goto 18 - 6: label L1 - 7: label L2 - 8: $t7 := vector::borrow<#0>($t0, $t2) - 9: $t8 := ==($t7, $t1) - 10: if ($t8) goto 11 else goto 14 - 11: label L4 - 12: $t9 := true - 13: return $t9 - 14: label L3 - 15: $t10 := 1 - 16: $t2 := +($t2, $t10) - 17: goto 3 - 18: label L0 - 19: $t11 := false - 20: return $t11 + var $t6: option::Option<#0> + var $t7: vector<#0> + var $t8: &mut vector<#0> + var $t9: #0 + var $t10: vector<#0> + var $t11: #0 + 0: $t3 := borrow_local($t0) + 1: $t4 := option::is_some<#0>($t3) + 2: if ($t4) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t5 := 262145 + 7: abort($t5) + 8: label L2 + 9: $t6 := move($t0) + 10: $t7 := unpack option::Option<#0>($t6) + 11: $t2 := $t7 + 12: $t8 := borrow_local($t2) + 13: $t9 := vector::pop_back<#0>($t8) + 14: $t1 := $t9 + 15: $t10 := move($t2) + 16: vector::destroy_empty<#0>($t10) + 17: $t11 := move($t1) + 18: return $t11 } [variant baseline] -public native fun vector::destroy_empty<#0>($t0|v: vector<#0>); +public fun option::destroy_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec#1#0: vector<#0> + var $t4: option::Option<#0> + var $t5: vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: #0 + var $t9: &mut vector<#0> + var $t10: #0 + var $t11: #0 + 0: $t4 := move($t0) + 1: $t5 := unpack option::Option<#0>($t4) + 2: $t3 := $t5 + 3: $t6 := borrow_local($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 10 + 6: label L1 + 7: $t8 := move($t1) + 8: $t2 := $t8 + 9: goto 15 + 10: label L0 + 11: $t9 := borrow_local($t3) + 12: $t10 := vector::pop_back<#0>($t9) + 13: $t2 := $t10 + 14: goto 15 + 15: label L2 + 16: $t11 := move($t2) + 17: return $t11 +} [variant baseline] -public native fun vector::empty<#0>(): vector<#0>; - +public fun option::extract<#0>($t0|t: &mut option::Option<#0>): #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> + var $t5: u64 + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := vector::pop_back<#0>($t7) + 15: return $t8 +} + + +[variant baseline] +public fun option::fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0) { + var $t2|vec_ref#1#0: &mut vector<#0> + var $t3: &mut option::Option<#0> + var $t4: &mut vector<#0> + var $t5: &mut vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &mut vector<#0> + var $t9: u64 + var $t10: &mut vector<#0> + var $t11: #0 + 0: $t3 := move($t0) + 1: $t4 := borrow_field>.vec($t3) + 2: $t2 := $t4 + 3: $t5 := copy($t2) + 4: $t6 := freeze_ref($t5) + 5: $t7 := vector::is_empty<#0>($t6) + 6: if ($t7) goto 7 else goto 9 + 7: label L1 + 8: goto 14 + 9: label L0 + 10: $t8 := move($t2) + 11: destroy($t8) + 12: $t9 := 262144 + 13: abort($t9) + 14: label L2 + 15: $t10 := move($t2) + 16: $t11 := move($t1) + 17: vector::push_back<#0>($t10, $t11) + 18: return () +} + + +[variant baseline] +public fun option::get_with_default<#0>($t0|t: &option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: #0 + var $t10: &vector<#0> + var $t11: u64 + var $t12: � + var $t13: #0 + var $t14: #0 + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 19 + 12: label L0 + 13: $t10 := move($t3) + 14: $t11 := 0 + 15: $t12 := vector::borrow<#0>($t10, $t11) + 16: $t13 := read_ref($t12) + 17: $t2 := $t13 + 18: goto 19 + 19: label L2 + 20: $t14 := move($t2) + 21: return $t14 +} + + +[variant baseline] +public fun option::is_none<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::is_some<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + var $t4: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: $t4 := !($t3) + 4: return $t4 +} + + +[variant baseline] +public fun option::none<#0>(): option::Option<#0> { + var $t0: vector<#0> + var $t1: option::Option<#0> + 0: $t0 := vector::empty<#0>() + 1: $t1 := pack option::Option<#0>($t0) + 2: return $t1 +} + + +[variant baseline] +public fun option::some<#0>($t0|e: #0): option::Option<#0> { + var $t1: #0 + var $t2: vector<#0> + var $t3: option::Option<#0> + 0: $t1 := move($t0) + 1: $t2 := vector::singleton<#0>($t1) + 2: $t3 := pack option::Option<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::swap_or_fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): option::Option<#0> { + var $t2|tmp#$2: option::Option<#0> + var $t3|old_value#1#0: option::Option<#0> + var $t4|vec_ref#1#0: &mut vector<#0> + var $t5: &mut option::Option<#0> + var $t6: &mut vector<#0> + var $t7: &mut vector<#0> + var $t8: &vector<#0> + var $t9: bool + var $t10: option::Option<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: option::Option<#0> + var $t14: option::Option<#0> + var $t15: &mut vector<#0> + var $t16: #0 + var $t17: option::Option<#0> + 0: $t5 := move($t0) + 1: $t6 := borrow_field>.vec($t5) + 2: $t4 := $t6 + 3: $t7 := copy($t4) + 4: $t8 := freeze_ref($t7) + 5: $t9 := vector::is_empty<#0>($t8) + 6: if ($t9) goto 7 else goto 11 + 7: label L1 + 8: $t10 := option::none<#0>() + 9: $t2 := $t10 + 10: goto 17 + 11: label L0 + 12: $t11 := copy($t4) + 13: $t12 := vector::pop_back<#0>($t11) + 14: $t13 := option::some<#0>($t12) + 15: $t2 := $t13 + 16: goto 17 + 17: label L2 + 18: $t14 := move($t2) + 19: $t3 := $t14 + 20: $t15 := move($t4) + 21: $t16 := move($t1) + 22: vector::push_back<#0>($t15, $t16) + 23: $t17 := move($t3) + 24: return $t17 +} + + +[variant baseline] +public fun option::to_vec<#0>($t0|t: option::Option<#0>): vector<#0> { + var $t1: option::Option<#0> + var $t2: vector<#0> + 0: $t1 := move($t0) + 1: $t2 := unpack option::Option<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::append($t0|string: &mut ascii::String, $t1|other: ascii::String) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: ascii::String + var $t5: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := ascii::into_bytes($t4) + 4: vector::append($t3, $t5) + 5: return () +} + + +[variant baseline] +public fun ascii::index_of($t0|string: &ascii::String, $t1|substr: &ascii::String): u64 { + var $t2|tmp#$2: bool + var $t3|i#1#0: u64 + var $t4|j#1#0: u64 + var $t5|m#1#0: u64 + var $t6|n#1#0: u64 + var $t7: u64 + var $t8: &ascii::String + var $t9: u64 + var $t10: &ascii::String + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: bool + var $t15: &ascii::String + var $t16: &ascii::String + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: u64 + var $t22: bool + var $t23: u64 + var $t24: u64 + var $t25: u64 + var $t26: bool + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: u64 + var $t31: u64 + var $t32: &u8 + var $t33: u8 + var $t34: &ascii::String + var $t35: &vector + var $t36: u64 + var $t37: &u8 + var $t38: u8 + var $t39: bool + var $t40: bool + var $t41: bool + var $t42: u64 + var $t43: u64 + var $t44: u64 + var $t45: u64 + var $t46: u64 + var $t47: bool + var $t48: &ascii::String + var $t49: &ascii::String + var $t50: u64 + var $t51: u64 + var $t52: u64 + var $t53: u64 + var $t54: &ascii::String + var $t55: &ascii::String + var $t56: u64 + 0: $t7 := 0 + 1: $t3 := $t7 + 2: $t8 := copy($t0) + 3: $t9 := ascii::length($t8) + 4: $t10 := copy($t1) + 5: $t11 := ascii::length($t10) + 6: $t5 := $t11 + 7: $t6 := $t9 + 8: $t12 := copy($t6) + 9: $t13 := copy($t5) + 10: $t14 := <($t12, $t13) + 11: if ($t14) goto 12 else goto 19 + 12: label L1 + 13: $t15 := move($t1) + 14: destroy($t15) + 15: $t16 := move($t0) + 16: destroy($t16) + 17: $t17 := move($t6) + 18: return $t17 + 19: label L0 + 20: $t18 := copy($t3) + 21: $t19 := copy($t6) + 22: $t20 := copy($t5) + 23: $t21 := -($t19, $t20) + 24: $t22 := <=($t18, $t21) + 25: if ($t22) goto 26 else goto 84 + 26: label L3 + 27: $t23 := 0 + 28: $t4 := $t23 + 29: goto 30 + 30: label L10 + 31: $t24 := copy($t4) + 32: $t25 := copy($t5) + 33: $t26 := <($t24, $t25) + 34: if ($t26) goto 35 else goto 53 + 35: label L5 + 36: goto 37 + 37: label L6 + 38: $t27 := copy($t0) + 39: $t28 := borrow_field.bytes($t27) + 40: $t29 := copy($t3) + 41: $t30 := copy($t4) + 42: $t31 := +($t29, $t30) + 43: $t32 := vector::borrow($t28, $t31) + 44: $t33 := read_ref($t32) + 45: $t34 := copy($t1) + 46: $t35 := borrow_field.bytes($t34) + 47: $t36 := copy($t4) + 48: $t37 := vector::borrow($t35, $t36) + 49: $t38 := read_ref($t37) + 50: $t39 := ==($t33, $t38) + 51: $t2 := $t39 + 52: goto 57 + 53: label L4 + 54: $t40 := false + 55: $t2 := $t40 + 56: goto 57 + 57: label L7 + 58: $t41 := move($t2) + 59: if ($t41) goto 60 else goto 66 + 60: label L9 + 61: $t42 := move($t4) + 62: $t43 := 1 + 63: $t44 := +($t42, $t43) + 64: $t4 := $t44 + 65: goto 30 + 66: label L8 + 67: $t45 := move($t4) + 68: $t46 := copy($t5) + 69: $t47 := ==($t45, $t46) + 70: if ($t47) goto 71 else goto 78 + 71: label L12 + 72: $t48 := move($t1) + 73: destroy($t48) + 74: $t49 := move($t0) + 75: destroy($t49) + 76: $t50 := move($t3) + 77: return $t50 + 78: label L11 + 79: $t51 := move($t3) + 80: $t52 := 1 + 81: $t53 := +($t51, $t52) + 82: $t3 := $t53 + 83: goto 19 + 84: label L2 + 85: $t54 := move($t1) + 86: destroy($t54) + 87: $t55 := move($t0) + 88: destroy($t55) + 89: $t56 := move($t6) + 90: return $t56 +} + + +[variant baseline] +public fun ascii::insert($t0|s: &mut ascii::String, $t1|at: u64, $t2|o: ascii::String) { + var $t3|e#1#2: u8 + var $t4|v#1#1: vector + var $t5: u64 + var $t6: &mut ascii::String + var $t7: &ascii::String + var $t8: u64 + var $t9: bool + var $t10: &mut ascii::String + var $t11: u64 + var $t12: ascii::String + var $t13: vector + var $t14: &vector + var $t15: bool + var $t16: bool + var $t17: &mut vector + var $t18: u8 + var $t19: &mut ascii::String + var $t20: &mut vector + var $t21: u8 + var $t22: u64 + var $t23: &mut ascii::String + var $t24: vector + 0: $t5 := copy($t1) + 1: $t6 := copy($t0) + 2: $t7 := freeze_ref($t6) + 3: $t8 := ascii::length($t7) + 4: $t9 := <=($t5, $t8) + 5: if ($t9) goto 6 else goto 8 + 6: label L1 + 7: goto 13 + 8: label L0 + 9: $t10 := move($t0) + 10: destroy($t10) + 11: $t11 := 65537 + 12: abort($t11) + 13: label L2 + 14: $t12 := move($t2) + 15: $t13 := ascii::into_bytes($t12) + 16: $t4 := $t13 + 17: goto 18 + 18: label L5 + 19: $t14 := borrow_local($t4) + 20: $t15 := vector::is_empty($t14) + 21: $t16 := !($t15) + 22: if ($t16) goto 23 else goto 33 + 23: label L4 + 24: $t17 := borrow_local($t4) + 25: $t18 := vector::pop_back($t17) + 26: $t3 := $t18 + 27: $t19 := copy($t0) + 28: $t20 := borrow_field.bytes($t19) + 29: $t21 := move($t3) + 30: $t22 := copy($t1) + 31: vector::insert($t20, $t21, $t22) + 32: goto 18 + 33: label L3 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: $t24 := move($t4) + 37: vector::destroy_empty($t24) + 38: return () +} + + +[variant baseline] +public fun ascii::is_empty($t0|string: &ascii::String): bool { + var $t1: &ascii::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::length($t0|string: &ascii::String): u64 { + var $t1: &ascii::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := ascii::as_bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::all_characters_printable($t0|string: &ascii::String): bool { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|i#1#12: u64 + var $t4|i#1#9: u64 + var $t5|stop#1#9: u64 + var $t6|v#1#3: &vector + var $t7: &ascii::String + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u64 + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool + var $t25: u64 + var $t26: u64 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + 0: $t7 := move($t0) + 1: $t8 := borrow_field.bytes($t7) + 2: $t6 := $t8 + 3: $t9 := copy($t6) + 4: $t10 := vector::length($t9) + 5: $t1 := $t10 + 6: $t11 := 0 + 7: $t4 := $t11 + 8: $t12 := move($t1) + 9: $t5 := $t12 + 10: goto 11 + 11: label L5 + 12: $t13 := copy($t4) + 13: $t14 := copy($t5) + 14: $t15 := <($t13, $t14) + 15: if ($t15) goto 16 else goto 38 + 16: label L1 + 17: $t16 := copy($t4) + 18: $t3 := $t16 + 19: $t17 := copy($t6) + 20: $t18 := move($t3) + 21: $t19 := vector::borrow($t17, $t18) + 22: $t20 := read_ref($t19) + 23: $t21 := ascii::is_printable_char($t20) + 24: $t22 := !($t21) + 25: if ($t22) goto 26 else goto 32 + 26: label L3 + 27: $t23 := move($t6) + 28: destroy($t23) + 29: $t24 := false + 30: $t2 := $t24 + 31: goto 44 + 32: label L2 + 33: $t25 := move($t4) + 34: $t26 := 1 + 35: $t27 := +($t25, $t26) + 36: $t4 := $t27 + 37: goto 11 + 38: label L0 + 39: $t28 := move($t6) + 40: destroy($t28) + 41: $t29 := true + 42: $t2 := $t29 + 43: goto 44 + 44: label L4 + 45: $t30 := move($t2) + 46: return $t30 +} + + +[variant baseline] +public fun ascii::string($t0|bytes: vector): ascii::String { + var $t1|x#1#0: option::Option + var $t2: vector + var $t3: option::Option + var $t4: &option::Option + var $t5: bool + var $t6: u64 + var $t7: option::Option + var $t8: ascii::String + 0: $t2 := move($t0) + 1: $t3 := ascii::try_string($t2) + 2: $t1 := $t3 + 3: $t4 := borrow_local($t1) + 4: $t5 := option::is_some($t4) + 5: if ($t5) goto 6 else goto 8 + 6: label L1 + 7: goto 11 + 8: label L0 + 9: $t6 := 65536 + 10: abort($t6) + 11: label L2 + 12: $t7 := move($t1) + 13: $t8 := option::destroy_some($t7) + 14: return $t8 +} + + +[variant baseline] +public fun ascii::as_bytes($t0|string: &ascii::String): &vector { + var $t1: &ascii::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::byte($t0|char: ascii::Char): u8 { + var $t1: ascii::Char + var $t2: u8 + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::Char($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::char($t0|byte: u8): ascii::Char { + var $t1: u8 + var $t2: bool + var $t3: u64 + var $t4: u8 + var $t5: ascii::Char + 0: $t1 := copy($t0) + 1: $t2 := ascii::is_valid_char($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 65536 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack ascii::Char($t4) + 11: return $t5 +} + + +[variant baseline] +fun ascii::char_to_lowercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 65 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 90 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := +($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +fun ascii::char_to_uppercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 97 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 122 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := -($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +public fun ascii::into_bytes($t0|string: ascii::String): vector { + var $t1: ascii::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::is_printable_char($t0|byte: u8): bool { + var $t1|tmp#$1: bool + var $t2: u8 + var $t3: u8 + var $t4: bool + var $t5: u8 + var $t6: u8 + var $t7: bool + var $t8: bool + var $t9: bool + 0: $t2 := copy($t0) + 1: $t3 := 32 + 2: $t4 := >=($t2, $t3) + 3: if ($t4) goto 4 else goto 10 + 4: label L1 + 5: $t5 := move($t0) + 6: $t6 := 126 + 7: $t7 := <=($t5, $t6) + 8: $t1 := $t7 + 9: goto 14 + 10: label L0 + 11: $t8 := false + 12: $t1 := $t8 + 13: goto 14 + 14: label L2 + 15: $t9 := move($t1) + 16: return $t9 +} + + +[variant baseline] +public fun ascii::is_valid_char($t0|b: u8): bool { + var $t1: u8 + var $t2: u8 + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := 127 + 2: $t3 := <=($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::pop_char($t0|string: &mut ascii::String): ascii::Char { + var $t1: &mut ascii::String + var $t2: &mut vector + var $t3: u8 + var $t4: ascii::Char + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::pop_back($t2) + 3: $t4 := pack ascii::Char($t3) + 4: return $t4 +} + + +[variant baseline] +public fun ascii::push_char($t0|string: &mut ascii::String, $t1|char: ascii::Char) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: &ascii::Char + var $t5: &u8 + var $t6: u8 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.byte($t4) + 4: $t6 := read_ref($t5) + 5: vector::push_back($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun ascii::substring($t0|string: &ascii::String, $t1|i: u64, $t2|j: u64): ascii::String { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|i#1#3: u64 + var $t6|i#1#6: u64 + var $t7|stop#1#3: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: &ascii::String + var $t13: u64 + var $t14: bool + var $t15: bool + var $t16: bool + var $t17: &ascii::String + var $t18: u64 + var $t19: vector + var $t20: u64 + var $t21: u64 + var $t22: u64 + var $t23: u64 + var $t24: bool + var $t25: u64 + var $t26: &mut vector + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: &u8 + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &ascii::String + var $t36: vector + var $t37: ascii::String + 0: $t8 := copy($t1) + 1: $t9 := copy($t2) + 2: $t10 := <=($t8, $t9) + 3: if ($t10) goto 4 else goto 11 + 4: label L1 + 5: $t11 := copy($t2) + 6: $t12 := copy($t0) + 7: $t13 := ascii::length($t12) + 8: $t14 := <=($t11, $t13) + 9: $t3 := $t14 + 10: goto 15 + 11: label L0 + 12: $t15 := false + 13: $t3 := $t15 + 14: goto 15 + 15: label L2 + 16: $t16 := move($t3) + 17: if ($t16) goto 18 else goto 20 + 18: label L4 + 19: goto 25 + 20: label L3 + 21: $t17 := move($t0) + 22: destroy($t17) + 23: $t18 := 65537 + 24: abort($t18) + 25: label L5 + 26: $t19 := [] + 27: $t4 := $t19 + 28: $t20 := move($t1) + 29: $t5 := $t20 + 30: $t21 := move($t2) + 31: $t7 := $t21 + 32: goto 33 + 33: label L8 + 34: $t22 := copy($t5) + 35: $t23 := copy($t7) + 36: $t24 := <($t22, $t23) + 37: if ($t24) goto 38 else goto 53 + 38: label L7 + 39: $t25 := copy($t5) + 40: $t6 := $t25 + 41: $t26 := borrow_local($t4) + 42: $t27 := copy($t0) + 43: $t28 := borrow_field.bytes($t27) + 44: $t29 := move($t6) + 45: $t30 := vector::borrow($t28, $t29) + 46: $t31 := read_ref($t30) + 47: vector::push_back($t26, $t31) + 48: $t32 := move($t5) + 49: $t33 := 1 + 50: $t34 := +($t32, $t33) + 51: $t5 := $t34 + 52: goto 33 + 53: label L6 + 54: $t35 := move($t0) + 55: destroy($t35) + 56: $t36 := move($t4) + 57: $t37 := pack ascii::String($t36) + 58: return $t37 +} + + +[variant baseline] +public fun ascii::to_lowercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_lowercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} + + +[variant baseline] +public fun ascii::to_uppercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_uppercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} + + +[variant baseline] +public fun ascii::try_string($t0|bytes: vector): option::Option { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|tmp#$3: option::Option + var $t4|i#1#12: u64 + var $t5|i#1#9: u64 + var $t6|stop#1#9: u64 + var $t7|v#1#3: &vector + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u64 + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool + var $t25: u64 + var $t26: u64 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + var $t31: vector + var $t32: ascii::String + var $t33: option::Option + var $t34: option::Option + var $t35: option::Option + 0: $t8 := borrow_local($t0) + 1: $t7 := $t8 + 2: $t9 := copy($t7) + 3: $t10 := vector::length($t9) + 4: $t1 := $t10 + 5: $t11 := 0 + 6: $t5 := $t11 + 7: $t12 := move($t1) + 8: $t6 := $t12 + 9: goto 10 + 10: label L5 + 11: $t13 := copy($t5) + 12: $t14 := copy($t6) + 13: $t15 := <($t13, $t14) + 14: if ($t15) goto 15 else goto 37 + 15: label L1 + 16: $t16 := copy($t5) + 17: $t4 := $t16 + 18: $t17 := copy($t7) + 19: $t18 := move($t4) + 20: $t19 := vector::borrow($t17, $t18) + 21: $t20 := read_ref($t19) + 22: $t21 := ascii::is_valid_char($t20) + 23: $t22 := !($t21) + 24: if ($t22) goto 25 else goto 31 + 25: label L3 + 26: $t23 := move($t7) + 27: destroy($t23) + 28: $t24 := false + 29: $t2 := $t24 + 30: goto 43 + 31: label L2 + 32: $t25 := move($t5) + 33: $t26 := 1 + 34: $t27 := +($t25, $t26) + 35: $t5 := $t27 + 36: goto 10 + 37: label L0 + 38: $t28 := move($t7) + 39: destroy($t28) + 40: $t29 := true + 41: $t2 := $t29 + 42: goto 43 + 43: label L4 + 44: $t30 := move($t2) + 45: if ($t30) goto 46 else goto 52 + 46: label L7 + 47: $t31 := move($t0) + 48: $t32 := pack ascii::String($t31) + 49: $t33 := option::some($t32) + 50: $t3 := $t33 + 51: goto 56 + 52: label L6 + 53: $t34 := option::none() + 54: $t3 := $t34 + 55: goto 56 + 56: label L8 + 57: $t35 := move($t3) + 58: return $t35 +} + + +[variant baseline] +public fun string::append($t0|s: &mut string::String, $t1|r: string::String) { + var $t2: &mut string::String + var $t3: &mut vector + var $t4: &string::String + var $t5: &vector + var $t6: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := read_ref($t5) + 5: vector::append($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun string::index_of($t0|s: &string::String, $t1|r: &string::String): u64 { + var $t2: &string::String + var $t3: &vector + var $t4: &string::String + var $t5: &vector + var $t6: u64 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := string::internal_index_of($t3, $t5) + 5: return $t6 +} + + +[variant baseline] +public fun string::insert($t0|s: &mut string::String, $t1|at: u64, $t2|o: string::String) { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: &vector + var $t5|end#1#0: string::String + var $t6|front#1#0: string::String + var $t7|l#1#0: u64 + var $t8: &mut string::String + var $t9: &vector + var $t10: u64 + var $t11: &vector + var $t12: u64 + var $t13: bool + var $t14: &vector + var $t15: u64 + var $t16: bool + var $t17: &vector + var $t18: bool + var $t19: bool + var $t20: &mut string::String + var $t21: u64 + var $t22: &mut string::String + var $t23: &string::String + var $t24: u64 + var $t25: &mut string::String + var $t26: &string::String + var $t27: u64 + var $t28: u64 + var $t29: string::String + var $t30: &mut string::String + var $t31: &string::String + var $t32: u64 + var $t33: u64 + var $t34: string::String + var $t35: &mut string::String + var $t36: string::String + var $t37: &mut string::String + var $t38: string::String + var $t39: string::String + var $t40: &mut string::String + 0: $t8 := copy($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t4 := $t9 + 3: $t10 := copy($t1) + 4: $t11 := copy($t4) + 5: $t12 := vector::length($t11) + 6: $t13 := <=($t10, $t12) + 7: if ($t13) goto 8 else goto 14 + 8: label L1 + 9: $t14 := move($t4) + 10: $t15 := copy($t1) + 11: $t16 := string::internal_is_char_boundary($t14, $t15) + 12: $t3 := $t16 + 13: goto 20 + 14: label L0 + 15: $t17 := move($t4) + 16: destroy($t17) + 17: $t18 := false + 18: $t3 := $t18 + 19: goto 20 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 25 + 23: label L4 + 24: goto 30 + 25: label L3 + 26: $t20 := move($t0) + 27: destroy($t20) + 28: $t21 := 2 + 29: abort($t21) + 30: label L5 + 31: $t22 := copy($t0) + 32: $t23 := freeze_ref($t22) + 33: $t24 := string::length($t23) + 34: $t7 := $t24 + 35: $t25 := copy($t0) + 36: $t26 := freeze_ref($t25) + 37: $t27 := 0 + 38: $t28 := copy($t1) + 39: $t29 := string::substring($t26, $t27, $t28) + 40: $t6 := $t29 + 41: $t30 := copy($t0) + 42: $t31 := freeze_ref($t30) + 43: $t32 := move($t1) + 44: $t33 := move($t7) + 45: $t34 := string::substring($t31, $t32, $t33) + 46: $t5 := $t34 + 47: $t35 := borrow_local($t6) + 48: $t36 := move($t2) + 49: string::append($t35, $t36) + 50: $t37 := borrow_local($t6) + 51: $t38 := move($t5) + 52: string::append($t37, $t38) + 53: $t39 := move($t6) + 54: $t40 := move($t0) + 55: write_ref($t40, $t39) + 56: return () +} + + +[variant baseline] +public fun string::is_empty($t0|s: &string::String): bool { + var $t1: &string::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::length($t0|s: &string::String): u64 { + var $t1: &string::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::as_bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::into_bytes($t0|s: string::String): vector { + var $t1: string::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack string::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := string::as_bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::substring($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3|tmp#$3: bool + var $t4|tmp#$4: bool + var $t5|tmp#$5: bool + var $t6|bytes#1#0: &vector + var $t7|l#1#0: u64 + var $t8: &string::String + var $t9: &vector + var $t10: &vector + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: bool + var $t15: u64 + var $t16: u64 + var $t17: bool + var $t18: bool + var $t19: bool + var $t20: &vector + var $t21: u64 + var $t22: bool + var $t23: bool + var $t24: bool + var $t25: &vector + var $t26: u64 + var $t27: bool + var $t28: bool + var $t29: bool + var $t30: &vector + var $t31: u64 + var $t32: &vector + var $t33: u64 + var $t34: u64 + var $t35: vector + var $t36: string::String + 0: $t8 := move($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t6 := $t9 + 3: $t10 := copy($t6) + 4: $t11 := vector::length($t10) + 5: $t7 := $t11 + 6: $t12 := copy($t2) + 7: $t13 := move($t7) + 8: $t14 := <=($t12, $t13) + 9: if ($t14) goto 10 else goto 16 + 10: label L1 + 11: $t15 := copy($t1) + 12: $t16 := copy($t2) + 13: $t17 := <=($t15, $t16) + 14: $t3 := $t17 + 15: goto 20 + 16: label L0 + 17: $t18 := false + 18: $t3 := $t18 + 19: goto 20 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 29 + 23: label L4 + 24: $t20 := copy($t6) + 25: $t21 := copy($t1) + 26: $t22 := string::internal_is_char_boundary($t20, $t21) + 27: $t4 := $t22 + 28: goto 33 + 29: label L3 + 30: $t23 := false + 31: $t4 := $t23 + 32: goto 33 + 33: label L5 + 34: $t24 := move($t4) + 35: if ($t24) goto 36 else goto 42 + 36: label L7 + 37: $t25 := copy($t6) + 38: $t26 := copy($t2) + 39: $t27 := string::internal_is_char_boundary($t25, $t26) + 40: $t5 := $t27 + 41: goto 46 + 42: label L6 + 43: $t28 := false + 44: $t5 := $t28 + 45: goto 46 + 46: label L8 + 47: $t29 := move($t5) + 48: if ($t29) goto 49 else goto 51 + 49: label L10 + 50: goto 56 + 51: label L9 + 52: $t30 := move($t6) + 53: destroy($t30) + 54: $t31 := 2 + 55: abort($t31) + 56: label L11 + 57: $t32 := move($t6) + 58: $t33 := move($t1) + 59: $t34 := move($t2) + 60: $t35 := string::internal_sub_string($t32, $t33, $t34) + 61: $t36 := pack string::String($t35) + 62: return $t36 +} + + +[variant baseline] +public fun string::append_utf8($t0|s: &mut string::String, $t1|bytes: vector) { + var $t2: &mut string::String + var $t3: vector + var $t4: string::String + 0: $t2 := move($t0) + 1: $t3 := move($t1) + 2: $t4 := string::utf8($t3) + 3: string::append($t2, $t4) + 4: return () +} + + +[variant baseline] +public fun string::from_ascii($t0|s: ascii::String): string::String { + var $t1: ascii::String + var $t2: vector + var $t3: string::String + 0: $t1 := move($t0) + 1: $t2 := ascii::into_bytes($t1) + 2: $t3 := pack string::String($t2) + 3: return $t3 +} + + +[variant baseline] +native fun string::internal_check_utf8($t0|v: &vector): bool; + + +[variant baseline] +native fun string::internal_index_of($t0|v: &vector, $t1|r: &vector): u64; + + +[variant baseline] +native fun string::internal_is_char_boundary($t0|v: &vector, $t1|i: u64): bool; + + +[variant baseline] +native fun string::internal_sub_string($t0|v: &vector, $t1|i: u64, $t2|j: u64): vector; + + +[variant baseline] +public fun string::sub_string($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3: &string::String + var $t4: u64 + var $t5: u64 + var $t6: string::String + 0: $t3 := move($t0) + 1: $t4 := move($t1) + 2: $t5 := move($t2) + 3: $t6 := string::substring($t3, $t4, $t5) + 4: return $t6 +} + + +[variant baseline] +public fun string::to_ascii($t0|s: string::String): ascii::String { + var $t1: string::String + var $t2: vector + var $t3: ascii::String + 0: $t1 := move($t0) + 1: $t2 := unpack string::String($t1) + 2: $t3 := ascii::string($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::try_utf8($t0|bytes: vector): option::Option { + var $t1|tmp#$1: option::Option + var $t2: &vector + var $t3: bool + var $t4: vector + var $t5: string::String + var $t6: option::Option + var $t7: option::Option + var $t8: option::Option + 0: $t2 := borrow_local($t0) + 1: $t3 := string::internal_check_utf8($t2) + 2: if ($t3) goto 3 else goto 9 + 3: label L1 + 4: $t4 := move($t0) + 5: $t5 := pack string::String($t4) + 6: $t6 := option::some($t5) + 7: $t1 := $t6 + 8: goto 13 + 9: label L0 + 10: $t7 := option::none() + 11: $t1 := $t7 + 12: goto 13 + 13: label L2 + 14: $t8 := move($t1) + 15: return $t8 +} + + +[variant baseline] +public fun string::utf8($t0|bytes: vector): string::String { + var $t1: &vector + var $t2: bool + var $t3: u64 + var $t4: vector + var $t5: string::String + 0: $t1 := borrow_local($t0) + 1: $t2 := string::internal_check_utf8($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 1 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack string::String($t4) + 11: return $t5 +} + + +[variant baseline] +fun MultiLayerCalling::inner($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { + var $t1: &mut MultiLayerCalling::HasVector + var $t2: &mut vector + var $t3: u64 + var $t4: &mut MultiLayerCalling::HasAnotherVector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.v($t1) + 2: $t3 := 7 + 3: $t4 := vector::borrow_mut($t2, $t3) + 4: return $t4 +} + + +[variant baseline] +fun MultiLayerCalling::mid($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { + var $t1: &mut MultiLayerCalling::HasVector + var $t2: &mut MultiLayerCalling::HasAnotherVector + 0: $t1 := move($t0) + 1: $t2 := MultiLayerCalling::inner($t1) + 2: return $t2 +} + + +[variant baseline] +fun MultiLayerCalling::outer($t0|has_vector: &mut MultiLayerCalling::HasVector) { + var $t1: &mut MultiLayerCalling::HasVector + var $t2: &mut MultiLayerCalling::HasAnotherVector + var $t3: &mut vector + var $t4: u8 + 0: $t1 := move($t0) + 1: $t2 := MultiLayerCalling::mid($t1) + 2: $t3 := borrow_field.v($t2) + 3: $t4 := 42 + 4: vector::push_back($t3, $t4) + 5: return () +} + +============ after pipeline `borrow` ================ + +[variant baseline] +public fun u64::diff($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: bool + 0: $t5 := >($t0, $t1) + 1: if ($t5) goto 2 else goto 5 + 2: label L1 + 3: $t2 := -($t0, $t1) + 4: goto 7 + 5: label L0 + 6: $t2 := -($t1, $t0) + 7: label L2 + 8: return $t2 +} + + +[variant baseline] +public fun u64::divide_and_round_up($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: u64 + 0: $t5 := %($t0, $t1) + 1: $t6 := 0 + 2: $t7 := ==($t5, $t6) + 3: if ($t7) goto 4 else goto 7 + 4: label L1 + 5: $t2 := /($t0, $t1) + 6: goto 11 + 7: label L0 + 8: $t8 := /($t0, $t1) + 9: $t9 := 1 + 10: $t2 := +($t8, $t9) + 11: label L2 + 12: return $t2 +} + + +[variant baseline] +public fun u64::max($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: bool + 0: $t5 := >($t0, $t1) + 1: if ($t5) goto 2 else goto 5 + 2: label L1 + 3: $t2 := $t0 + 4: goto 7 + 5: label L0 + 6: $t2 := $t1 + 7: label L2 + 8: return $t2 +} + + +[variant baseline] +public fun u64::min($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: bool + 0: $t5 := <($t0, $t1) + 1: if ($t5) goto 2 else goto 5 + 2: label L1 + 3: $t2 := $t0 + 4: goto 7 + 5: label L0 + 6: $t2 := $t1 + 7: label L2 + 8: return $t2 +} + + +[variant baseline] +public fun u64::pow($t0|base: u64, $t1|exponent: u8): u64 { + var $t2|base#1#1: u64 + var $t3|exponent#1#1: u8 + var $t4|res#1#1: u64 + var $t5: u64 + var $t6: u8 + var $t7: bool + var $t8: u8 + var $t9: u8 + var $t10: u8 + var $t11: bool + var $t12: u8 + var $t13: u8 + 0: $t2 := $t0 + 1: $t3 := $t1 + 2: $t5 := 1 + 3: $t4 := $t5 + 4: label L5 + 5: $t6 := 1 + 6: $t7 := >=($t3, $t6) + 7: if ($t7) goto 8 else goto 25 + 8: label L1 + 9: label L2 + 10: $t8 := 2 + 11: $t9 := %($t3, $t8) + 12: $t10 := 0 + 13: $t11 := ==($t9, $t10) + 14: if ($t11) goto 15 else goto 20 + 15: label L4 + 16: $t2 := *($t2, $t2) + 17: $t12 := 2 + 18: $t3 := /($t3, $t12) + 19: goto 4 + 20: label L3 + 21: $t4 := *($t4, $t2) + 22: $t13 := 1 + 23: $t3 := -($t3, $t13) + 24: goto 4 + 25: label L0 + 26: return $t4 +} + + +[variant baseline] +public fun u64::sqrt($t0|x: u64): u64 { + var $t1|bit#1#1: u128 + var $t2|res#1#1: u128 + var $t3|x#1#1: u64 + var $t4|x#2#1: u128 + var $t5: u128 + var $t6: u128 + var $t7: u128 + var $t8: bool + var $t9: u128 + var $t10: bool + var $t11: u128 + var $t12: u8 + var $t13: u128 + var $t14: u8 + var $t15: u8 + var $t16: u64 + 0: $t5 := 18446744073709551616 + 1: $t1 := $t5 + 2: $t6 := 0 + 3: $t2 := $t6 + 4: $t4 := (u128)($t0) + 5: label L6 + 6: $t7 := 0 + 7: $t8 := !=($t1, $t7) + 8: if ($t8) goto 9 else goto 28 + 9: label L1 + 10: label L2 + 11: $t9 := +($t2, $t1) + 12: $t10 := >=($t4, $t9) + 13: if ($t10) goto 14 else goto 21 + 14: label L4 + 15: $t11 := +($t2, $t1) + 16: $t4 := -($t4, $t11) + 17: $t12 := 1 + 18: $t13 := >>($t2, $t12) + 19: $t2 := +($t13, $t1) + 20: goto 24 + 21: label L3 + 22: $t14 := 1 + 23: $t2 := >>($t2, $t14) + 24: label L5 + 25: $t15 := 2 + 26: $t1 := >>($t1, $t15) + 27: goto 5 + 28: label L0 + 29: $t16 := (u64)($t2) + 30: return $t16 +} + + +[variant baseline] +public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { + var $t2: &mut vector<#0> + var $t3: vector<#0> + var $t4: bool + var $t5: bool + var $t6: &mut vector<#0> + var $t7: #0 + var $t8: vector<#0> + 0: $t2 := borrow_local($t1) + 1: vector::reverse<#0>($t2) + 2: label L3 + 3: $t3 := copy($t1) + 4: $t4 := vector::is_empty<#0>($t3) + 5: $t5 := !($t4) + 6: if ($t5) goto 7 else goto 13 + 7: label L1 + 8: label L2 + 9: $t6 := borrow_local($t1) + 10: $t7 := vector::pop_back<#0>($t6) + 11: vector::push_back<#0>($t0, $t7) + 12: goto 2 + 13: label L0 + 14: destroy($t0) + 15: $t8 := move($t1) + 16: vector::destroy_empty<#0>($t8) + 17: trace_local[lhs]($t0) + 18: return () +} + + +[variant baseline] +public native fun vector::borrow<#0>($t0|v: vector<#0>, $t1|i: u64): #0; + + +[variant baseline] +public native fun vector::borrow_mut<#0>($t0|v: &mut vector<#0>, $t1|i: u64): &mut #0; + + +[variant baseline] +public fun vector::contains<#0>($t0|v: vector<#0>, $t1|e: #0): bool { + var $t2|i#1#0: u64 + var $t3|len#1#0: u64 + var $t4: u64 + var $t5: u64 + var $t6: bool + var $t7: #0 + var $t8: bool + var $t9: bool + var $t10: u64 + var $t11: bool + 0: $t4 := 0 + 1: $t2 := $t4 + 2: $t5 := vector::length<#0>($t0) + 3: label L5 + 4: $t6 := <($t2, $t5) + 5: if ($t6) goto 6 else goto 18 + 6: label L1 + 7: label L2 + 8: $t7 := vector::borrow<#0>($t0, $t2) + 9: $t8 := ==($t7, $t1) + 10: if ($t8) goto 11 else goto 14 + 11: label L4 + 12: $t9 := true + 13: return $t9 + 14: label L3 + 15: $t10 := 1 + 16: $t2 := +($t2, $t10) + 17: goto 3 + 18: label L0 + 19: $t11 := false + 20: return $t11 +} + + +[variant baseline] +public native fun vector::destroy_empty<#0>($t0|v: vector<#0>); + + +[variant baseline] +public native fun vector::empty<#0>(): vector<#0>; + + +[variant baseline] +public fun vector::index_of<#0>($t0|v: vector<#0>, $t1|e: #0): (bool, u64) { + var $t2|i#1#0: u64 + var $t3|len#1#0: u64 + var $t4: u64 + var $t5: u64 + var $t6: bool + var $t7: #0 + var $t8: bool + var $t9: bool + var $t10: u64 + var $t11: bool + var $t12: u64 + 0: $t4 := 0 + 1: $t2 := $t4 + 2: $t5 := vector::length<#0>($t0) + 3: label L5 + 4: $t6 := <($t2, $t5) + 5: if ($t6) goto 6 else goto 18 + 6: label L1 + 7: label L2 + 8: $t7 := vector::borrow<#0>($t0, $t2) + 9: $t8 := ==($t7, $t1) + 10: if ($t8) goto 11 else goto 14 + 11: label L4 + 12: $t9 := true + 13: return ($t9, $t2) + 14: label L3 + 15: $t10 := 1 + 16: $t2 := +($t2, $t10) + 17: goto 3 + 18: label L0 + 19: $t11 := false + 20: $t12 := 0 + 21: return ($t11, $t12) +} + + +[variant baseline] +public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { + var $t3|len#1#0: u64 + var $t4: vector<#0> + var $t5: u64 + var $t6: bool + var $t7: u64 + var $t8: bool + var $t9: u64 + 0: $t4 := read_ref($t0) + 1: $t5 := vector::length<#0>($t4) + 2: $t6 := >($t2, $t5) + 3: if ($t6) goto 4 else goto 8 + 4: label L1 + 5: destroy($t0) + 6: $t7 := 131072 + 7: abort($t7) + 8: label L0 + 9: vector::push_back<#0>($t0, $t1) + 10: label L4 + 11: $t8 := <($t2, $t5) + 12: if ($t8) goto 13 else goto 18 + 13: label L3 + 14: vector::swap<#0>($t0, $t2, $t5) + 15: $t9 := 1 + 16: $t2 := +($t2, $t9) + 17: goto 10 + 18: label L2 + 19: destroy($t0) + 20: trace_local[v]($t0) + 21: return () +} + + +[variant baseline] +public fun vector::is_empty<#0>($t0|v: vector<#0>): bool { + var $t1: u64 + var $t2: u64 + var $t3: bool + 0: $t1 := vector::length<#0>($t0) + 1: $t2 := 0 + 2: $t3 := ==($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +public native fun vector::length<#0>($t0|v: vector<#0>): u64; + + +[variant baseline] +public native fun vector::pop_back<#0>($t0|v: &mut vector<#0>): #0; + + +[variant baseline] +public native fun vector::push_back<#0>($t0|v: &mut vector<#0>, $t1|e: #0); + + +[variant baseline] +public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { + var $t2|tmp#$2: u64 + var $t3|tmp#$3: &mut vector<#0> + var $t4|len#1#0: u64 + var $t5: vector<#0> + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: bool + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: #0 + 0: $t5 := read_ref($t0) + 1: $t6 := vector::length<#0>($t5) + 2: $t7 := >=($t1, $t6) + 3: if ($t7) goto 4 else goto 8 + 4: label L1 + 5: destroy($t0) + 6: $t8 := 131072 + 7: abort($t8) + 8: label L0 + 9: $t9 := 1 + 10: $t10 := -($t6, $t9) + 11: label L4 + 12: $t11 := <($t1, $t10) + 13: if ($t11) goto 14 else goto 21 + 14: label L3 + 15: $t12 := copy($t1) + 16: $t13 := 1 + 17: $t14 := +($t1, $t13) + 18: $t1 := $t14 + 19: vector::swap<#0>($t0, $t12, $t14) + 20: goto 11 + 21: label L2 + 22: $t15 := vector::pop_back<#0>($t0) + 23: trace_local[v]($t0) + 24: return $t15 +} + + +[variant baseline] +public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { + var $t1|back_index#1#0: u64 + var $t2|front_index#1#0: u64 + var $t3|len#1#0: u64 + var $t4: vector<#0> + var $t5: u64 + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: u64 + 0: $t4 := read_ref($t0) + 1: $t5 := vector::length<#0>($t4) + 2: $t6 := 0 + 3: $t7 := ==($t5, $t6) + 4: if ($t7) goto 5 else goto 9 + 5: label L1 + 6: destroy($t0) + 7: trace_local[v]($t0) + 8: return () + 9: label L0 + 10: $t8 := 0 + 11: $t2 := $t8 + 12: $t9 := 1 + 13: $t1 := -($t5, $t9) + 14: label L4 + 15: $t10 := <($t2, $t1) + 16: if ($t10) goto 17 else goto 24 + 17: label L3 + 18: vector::swap<#0>($t0, $t2, $t1) + 19: $t11 := 1 + 20: $t2 := +($t2, $t11) + 21: $t12 := 1 + 22: $t1 := -($t1, $t12) + 23: goto 14 + 24: label L2 + 25: destroy($t0) + 26: trace_local[v]($t0) + 27: return () +} + + +[variant baseline] +public fun vector::singleton<#0>($t0|e: #0): vector<#0> { + var $t1|v#1#0: vector<#0> + var $t2: &mut vector<#0> + var $t3: vector<#0> + 0: $t1 := vector::empty<#0>() + 1: $t2 := borrow_local($t1) + 2: vector::push_back<#0>($t2, $t0) + 3: $t3 := move($t1) + 4: return $t3 +} + + +[variant baseline] +public native fun vector::swap<#0>($t0|v: &mut vector<#0>, $t1|i: u64, $t2|j: u64); + + +[variant baseline] +public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { + var $t2|last_idx#1#0: u64 + var $t3: vector<#0> + var $t4: bool + var $t5: bool + var $t6: u64 + var $t7: vector<#0> + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: #0 + 0: $t3 := read_ref($t0) + 1: $t4 := vector::is_empty<#0>($t3) + 2: $t5 := !($t4) + 3: if ($t5) goto 4 else goto 6 + 4: label L1 + 5: goto 10 + 6: label L0 + 7: destroy($t0) + 8: $t6 := 131072 + 9: abort($t6) + 10: label L2 + 11: $t7 := read_ref($t0) + 12: $t8 := vector::length<#0>($t7) + 13: $t9 := 1 + 14: $t10 := -($t8, $t9) + 15: vector::swap<#0>($t0, $t1, $t10) + 16: $t11 := vector::pop_back<#0>($t0) + 17: trace_local[v]($t0) + 18: return $t11 +} + + +[variant baseline] +public fun option::borrow<#0>($t0|t: option::Option<#0>): #0 { + var $t1: bool + var $t2: u64 + var $t3: vector<#0> + var $t4: u64 + var $t5: #0 + 0: $t1 := option::is_some<#0>($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 262145 + 6: abort($t2) + 7: label L2 + 8: $t3 := get_field>.vec($t0) + 9: $t4 := 0 + 10: $t5 := vector::borrow<#0>($t3, $t4) + 11: return $t5 +} + + +[variant baseline] +public fun option::borrow_mut<#0>($t0|t: &mut option::Option<#0>): &mut #0 { + var $t1: option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: &mut vector<#0> + var $t5: u64 + var $t6: &mut #0 + 0: $t1 := read_ref($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 9 + 5: label L0 + 6: destroy($t0) + 7: $t3 := 262145 + 8: abort($t3) + 9: label L2 + 10: $t4 := borrow_field>.vec($t0) + 11: $t5 := 0 + 12: $t6 := vector::borrow_mut<#0>($t4, $t5) + 13: trace_local[t]($t0) + 14: return $t6 +} + + +[variant baseline] +public fun option::contains<#0>($t0|t: option::Option<#0>, $t1|e_ref: #0): bool { + var $t2: vector<#0> + var $t3: bool + 0: $t2 := get_field>.vec($t0) + 1: $t3 := vector::contains<#0>($t2, $t1) + 2: return $t3 +} + + +[variant baseline] +public fun option::swap<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): #0 { + var $t2|old_value#1#0: #0 + var $t3|vec_ref#1#0: &mut vector<#0> + var $t4: option::Option<#0> + var $t5: bool + var $t6: u64 + var $t7: &mut vector<#0> + var $t8: #0 + 0: $t4 := read_ref($t0) + 1: $t5 := option::is_some<#0>($t4) + 2: if ($t5) goto 3 else goto 5 + 3: label L1 + 4: goto 9 + 5: label L0 + 6: destroy($t0) + 7: $t6 := 262145 + 8: abort($t6) + 9: label L2 + 10: $t7 := borrow_field>.vec($t0) + 11: $t8 := vector::pop_back<#0>($t7) + 12: vector::push_back<#0>($t7, $t1) + 13: trace_local[t]($t0) + 14: return $t8 +} + + +[variant baseline] +public fun option::borrow_with_default<#0>($t0|t: option::Option<#0>, $t1|default_ref: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: u64 + 0: $t4 := get_field>.vec($t0) + 1: $t5 := vector::is_empty<#0>($t4) + 2: if ($t5) goto 3 else goto 6 + 3: label L1 + 4: $t2 := $t1 + 5: goto 9 + 6: label L0 + 7: $t6 := 0 + 8: $t2 := vector::borrow<#0>($t4, $t6) + 9: label L2 + 10: return $t2 +} + + +[variant baseline] +public fun option::destroy_none<#0>($t0|t: option::Option<#0>) { + var $t1: bool + var $t2: u64 + var $t3: vector<#0> + 0: $t1 := option::is_none<#0>($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 262144 + 6: abort($t2) + 7: label L2 + 8: $t3 := unpack option::Option<#0>($t0) + 9: vector::destroy_empty<#0>($t3) + 10: return () +} + + +[variant baseline] +public fun option::destroy_some<#0>($t0|t: option::Option<#0>): #0 { + var $t1|elem#1#0: #0 + var $t2|vec#1#0: vector<#0> + var $t3: bool + var $t4: u64 + var $t5: &mut vector<#0> + var $t6: #0 + var $t7: vector<#0> + 0: $t3 := option::is_some<#0>($t0) + 1: if ($t3) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t4 := 262145 + 6: abort($t4) + 7: label L2 + 8: $t2 := unpack option::Option<#0>($t0) + 9: $t5 := borrow_local($t2) + 10: $t6 := vector::pop_back<#0>($t5) + 11: $t7 := move($t2) + 12: vector::destroy_empty<#0>($t7) + 13: return $t6 +} + + +[variant baseline] +public fun option::destroy_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec#1#0: vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: &mut vector<#0> + 0: $t3 := unpack option::Option<#0>($t0) + 1: $t4 := copy($t3) + 2: $t5 := vector::is_empty<#0>($t4) + 3: if ($t5) goto 4 else goto 7 + 4: label L1 + 5: $t2 := $t1 + 6: goto 10 + 7: label L0 + 8: $t6 := borrow_local($t3) + 9: $t2 := vector::pop_back<#0>($t6) + 10: label L2 + 11: return $t2 +} + + +[variant baseline] +public fun option::extract<#0>($t0|t: &mut option::Option<#0>): #0 { + var $t1: option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: &mut vector<#0> + var $t5: #0 + 0: $t1 := read_ref($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 9 + 5: label L0 + 6: destroy($t0) + 7: $t3 := 262145 + 8: abort($t3) + 9: label L2 + 10: $t4 := borrow_field>.vec($t0) + 11: $t5 := vector::pop_back<#0>($t4) + 12: trace_local[t]($t0) + 13: return $t5 +} + + +[variant baseline] +public fun option::fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0) { + var $t2|vec_ref#1#0: &mut vector<#0> + var $t3: &mut vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: u64 + 0: $t3 := borrow_field>.vec($t0) + 1: $t4 := read_ref($t3) + 2: $t5 := vector::is_empty<#0>($t4) + 3: if ($t5) goto 4 else goto 14 + 4: label L1 + 5: goto 10 + 6: label L0 + 7: destroy($t3) + 8: $t6 := 262144 + 9: abort($t6) + 10: label L2 + 11: vector::push_back<#0>($t3, $t1) + 12: trace_local[t]($t0) + 13: return () + 14: label L3 + 15: destroy($t0) + 16: goto 6 +} + + +[variant baseline] +public fun option::get_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: u64 + var $t7: #0 + 0: $t4 := get_field>.vec($t0) + 1: $t5 := vector::is_empty<#0>($t4) + 2: if ($t5) goto 3 else goto 6 + 3: label L1 + 4: $t2 := $t1 + 5: goto 10 + 6: label L0 + 7: $t6 := 0 + 8: $t7 := vector::borrow<#0>($t4, $t6) + 9: $t2 := $t7 + 10: label L2 + 11: return $t2 +} + + +[variant baseline] +public fun option::is_none<#0>($t0|t: option::Option<#0>): bool { + var $t1: vector<#0> + var $t2: bool + 0: $t1 := get_field>.vec($t0) + 1: $t2 := vector::is_empty<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun option::is_some<#0>($t0|t: option::Option<#0>): bool { + var $t1: vector<#0> + var $t2: bool + var $t3: bool + 0: $t1 := get_field>.vec($t0) + 1: $t2 := vector::is_empty<#0>($t1) + 2: $t3 := !($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::none<#0>(): option::Option<#0> { + var $t0: vector<#0> + var $t1: option::Option<#0> + 0: $t0 := vector::empty<#0>() + 1: $t1 := pack option::Option<#0>($t0) + 2: return $t1 +} + + +[variant baseline] +public fun option::some<#0>($t0|e: #0): option::Option<#0> { + var $t1: vector<#0> + var $t2: option::Option<#0> + 0: $t1 := vector::singleton<#0>($t0) + 1: $t2 := pack option::Option<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun option::swap_or_fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): option::Option<#0> { + var $t2|tmp#$2: option::Option<#0> + var $t3|old_value#1#0: option::Option<#0> + var $t4|vec_ref#1#0: &mut vector<#0> + var $t5: &mut vector<#0> + var $t6: vector<#0> + var $t7: bool + var $t8: #0 + 0: $t5 := borrow_field>.vec($t0) + 1: $t6 := read_ref($t5) + 2: $t7 := vector::is_empty<#0>($t6) + 3: if ($t7) goto 4 else goto 7 + 4: label L1 + 5: $t2 := option::none<#0>() + 6: goto 10 + 7: label L0 + 8: $t8 := vector::pop_back<#0>($t5) + 9: $t2 := option::some<#0>($t8) + 10: label L2 + 11: vector::push_back<#0>($t5, $t1) + 12: trace_local[t]($t0) + 13: return $t2 +} + + +[variant baseline] +public fun option::to_vec<#0>($t0|t: option::Option<#0>): vector<#0> { + var $t1: vector<#0> + 0: $t1 := unpack option::Option<#0>($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::append($t0|string: &mut ascii::String, $t1|other: ascii::String) { + var $t2: &mut vector + var $t3: vector + 0: $t2 := borrow_field.bytes($t0) + 1: $t3 := ascii::into_bytes($t1) + 2: vector::append($t2, $t3) + 3: trace_local[string]($t0) + 4: return () +} + + +[variant baseline] +public fun ascii::index_of($t0|string: ascii::String, $t1|substr: ascii::String): u64 { + var $t2|tmp#$2: bool + var $t3|i#1#0: u64 + var $t4|j#1#0: u64 + var $t5|m#1#0: u64 + var $t6|n#1#0: u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: bool + var $t13: u64 + var $t14: bool + var $t15: vector + var $t16: u64 + var $t17: u8 + var $t18: vector + var $t19: u8 + var $t20: bool + var $t21: u64 + var $t22: bool + var $t23: u64 + 0: $t7 := 0 + 1: $t3 := $t7 + 2: $t8 := ascii::length($t0) + 3: $t9 := ascii::length($t1) + 4: $t10 := <($t8, $t9) + 5: if ($t10) goto 6 else goto 8 + 6: label L1 + 7: return $t8 + 8: label L0 + 9: $t11 := -($t8, $t9) + 10: $t12 := <=($t3, $t11) + 11: if ($t12) goto 12 else goto 45 + 12: label L3 + 13: $t13 := 0 + 14: $t4 := $t13 + 15: label L10 + 16: $t14 := <($t4, $t9) + 17: if ($t14) goto 18 else goto 27 + 18: label L5 + 19: label L6 + 20: $t15 := get_field.bytes($t0) + 21: $t16 := +($t3, $t4) + 22: $t17 := vector::borrow($t15, $t16) + 23: $t18 := get_field.bytes($t1) + 24: $t19 := vector::borrow($t18, $t4) + 25: $t2 := ==($t17, $t19) + 26: goto 30 + 27: label L4 + 28: $t20 := false + 29: $t2 := $t20 + 30: label L7 + 31: if ($t2) goto 32 else goto 36 + 32: label L9 + 33: $t21 := 1 + 34: $t4 := +($t4, $t21) + 35: goto 15 + 36: label L8 + 37: $t22 := ==($t4, $t9) + 38: if ($t22) goto 39 else goto 41 + 39: label L12 + 40: return $t3 + 41: label L11 + 42: $t23 := 1 + 43: $t3 := +($t3, $t23) + 44: goto 8 + 45: label L2 + 46: return $t8 +} + + +[variant baseline] +public fun ascii::insert($t0|s: &mut ascii::String, $t1|at: u64, $t2|o: ascii::String) { + var $t3|e#1#2: u8 + var $t4|v#1#1: vector + var $t5: ascii::String + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: vector + var $t10: bool + var $t11: bool + var $t12: &mut vector + var $t13: u8 + var $t14: &mut vector + var $t15: vector + 0: $t5 := read_ref($t0) + 1: $t6 := ascii::length($t5) + 2: $t7 := <=($t1, $t6) + 3: if ($t7) goto 4 else goto 6 + 4: label L1 + 5: goto 10 + 6: label L0 + 7: destroy($t0) + 8: $t8 := 65537 + 9: abort($t8) + 10: label L2 + 11: $t4 := ascii::into_bytes($t2) + 12: label L5 + 13: $t9 := copy($t4) + 14: $t10 := vector::is_empty($t9) + 15: $t11 := !($t10) + 16: if ($t11) goto 17 else goto 23 + 17: label L4 + 18: $t12 := borrow_local($t4) + 19: $t13 := vector::pop_back($t12) + 20: $t14 := borrow_field.bytes($t0) + 21: vector::insert($t14, $t13, $t1) + 22: goto 12 + 23: label L3 + 24: destroy($t0) + 25: $t15 := move($t4) + 26: vector::destroy_empty($t15) + 27: trace_local[s]($t0) + 28: return () +} + + +[variant baseline] +public fun ascii::is_empty($t0|string: ascii::String): bool { + var $t1: vector + var $t2: bool + 0: $t1 := get_field.bytes($t0) + 1: $t2 := vector::is_empty($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::length($t0|string: ascii::String): u64 { + var $t1: vector + var $t2: u64 + 0: $t1 := ascii::as_bytes($t0) + 1: $t2 := vector::length($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::all_characters_printable($t0|string: ascii::String): bool { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|i#1#12: u64 + var $t4|i#1#9: u64 + var $t5|stop#1#9: u64 + var $t6|v#1#3: vector + var $t7: vector + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u8 + var $t12: bool + var $t13: bool + var $t14: bool + var $t15: u64 + var $t16: bool + 0: $t7 := get_field.bytes($t0) + 1: $t8 := vector::length($t7) + 2: $t9 := 0 + 3: $t4 := $t9 + 4: label L5 + 5: $t10 := <($t4, $t8) + 6: if ($t10) goto 7 else goto 20 + 7: label L1 + 8: $t11 := vector::borrow($t7, $t4) + 9: $t12 := ascii::is_printable_char($t11) + 10: $t13 := !($t12) + 11: if ($t13) goto 12 else goto 16 + 12: label L3 + 13: $t14 := false + 14: $t2 := $t14 + 15: goto 23 + 16: label L2 + 17: $t15 := 1 + 18: $t4 := +($t4, $t15) + 19: goto 4 + 20: label L0 + 21: $t16 := true + 22: $t2 := $t16 + 23: label L4 + 24: return $t2 +} + + +[variant baseline] +public fun ascii::string($t0|bytes: vector): ascii::String { + var $t1|x#1#0: option::Option + var $t2: option::Option + var $t3: bool + var $t4: u64 + var $t5: ascii::String + 0: $t2 := ascii::try_string($t0) + 1: $t3 := option::is_some($t2) + 2: if ($t3) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t4 := 65536 + 7: abort($t4) + 8: label L2 + 9: $t5 := option::destroy_some($t2) + 10: return $t5 +} + + +[variant baseline] +public fun ascii::as_bytes($t0|string: ascii::String): vector { + var $t1: vector + 0: $t1 := get_field.bytes($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::byte($t0|char: ascii::Char): u8 { + var $t1: u8 + 0: $t1 := unpack ascii::Char($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::char($t0|byte: u8): ascii::Char { + var $t1: bool + var $t2: u64 + var $t3: ascii::Char + 0: $t1 := ascii::is_valid_char($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 65536 + 6: abort($t2) + 7: label L2 + 8: $t3 := pack ascii::Char($t0) + 9: return $t3 +} + + +[variant baseline] +fun ascii::char_to_lowercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: bool + var $t5: u8 + var $t6: bool + var $t7: u8 + 0: $t3 := 65 + 1: $t4 := >=($t0, $t3) + 2: if ($t4) goto 3 else goto 7 + 3: label L1 + 4: $t5 := 90 + 5: $t1 := <=($t0, $t5) + 6: goto 10 + 7: label L0 + 8: $t6 := false + 9: $t1 := $t6 + 10: label L2 + 11: if ($t1) goto 12 else goto 16 + 12: label L4 + 13: $t7 := 32 + 14: $t2 := +($t0, $t7) + 15: goto 18 + 16: label L3 + 17: $t2 := $t0 + 18: label L5 + 19: return $t2 +} + + +[variant baseline] +fun ascii::char_to_uppercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: bool + var $t5: u8 + var $t6: bool + var $t7: u8 + 0: $t3 := 97 + 1: $t4 := >=($t0, $t3) + 2: if ($t4) goto 3 else goto 7 + 3: label L1 + 4: $t5 := 122 + 5: $t1 := <=($t0, $t5) + 6: goto 10 + 7: label L0 + 8: $t6 := false + 9: $t1 := $t6 + 10: label L2 + 11: if ($t1) goto 12 else goto 16 + 12: label L4 + 13: $t7 := 32 + 14: $t2 := -($t0, $t7) + 15: goto 18 + 16: label L3 + 17: $t2 := $t0 + 18: label L5 + 19: return $t2 +} + + +[variant baseline] +public fun ascii::into_bytes($t0|string: ascii::String): vector { + var $t1: vector + 0: $t1 := unpack ascii::String($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::is_printable_char($t0|byte: u8): bool { + var $t1|tmp#$1: bool + var $t2: u8 + var $t3: bool + var $t4: u8 + var $t5: bool + 0: $t2 := 32 + 1: $t3 := >=($t0, $t2) + 2: if ($t3) goto 3 else goto 7 + 3: label L1 + 4: $t4 := 126 + 5: $t1 := <=($t0, $t4) + 6: goto 10 + 7: label L0 + 8: $t5 := false + 9: $t1 := $t5 + 10: label L2 + 11: return $t1 +} + + +[variant baseline] +public fun ascii::is_valid_char($t0|b: u8): bool { + var $t1: u8 + var $t2: bool + 0: $t1 := 127 + 1: $t2 := <=($t0, $t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::pop_char($t0|string: &mut ascii::String): ascii::Char { + var $t1: &mut vector + var $t2: u8 + var $t3: ascii::Char + 0: $t1 := borrow_field.bytes($t0) + 1: $t2 := vector::pop_back($t1) + 2: $t3 := pack ascii::Char($t2) + 3: trace_local[string]($t0) + 4: return $t3 +} + [variant baseline] -public fun vector::index_of<#0>($t0|v: vector<#0>, $t1|e: #0): (bool, u64) { - var $t2|i#1#0: u64 - var $t3|len#1#0: u64 - var $t4: u64 - var $t5: u64 - var $t6: bool - var $t7: #0 - var $t8: bool - var $t9: bool - var $t10: u64 - var $t11: bool - var $t12: u64 - 0: $t4 := 0 - 1: $t2 := $t4 - 2: $t5 := vector::length<#0>($t0) - 3: label L5 - 4: $t6 := <($t2, $t5) - 5: if ($t6) goto 6 else goto 18 - 6: label L1 - 7: label L2 - 8: $t7 := vector::borrow<#0>($t0, $t2) - 9: $t8 := ==($t7, $t1) - 10: if ($t8) goto 11 else goto 14 - 11: label L4 - 12: $t9 := true - 13: return ($t9, $t2) - 14: label L3 - 15: $t10 := 1 - 16: $t2 := +($t2, $t10) - 17: goto 3 - 18: label L0 - 19: $t11 := false - 20: $t12 := 0 - 21: return ($t11, $t12) +public fun ascii::push_char($t0|string: &mut ascii::String, $t1|char: ascii::Char) { + var $t2: &mut vector + var $t3: u8 + 0: $t2 := borrow_field.bytes($t0) + 1: $t3 := get_field.byte($t1) + 2: vector::push_back($t2, $t3) + 3: trace_local[string]($t0) + 4: return () } [variant baseline] -public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { - var $t3|len#1#0: u64 - var $t4: vector<#0> - var $t5: u64 - var $t6: bool - var $t7: u64 +public fun ascii::substring($t0|string: ascii::String, $t1|i: u64, $t2|j: u64): ascii::String { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|i#1#3: u64 + var $t6|i#1#6: u64 + var $t7|stop#1#3: u64 var $t8: bool var $t9: u64 - 0: $t4 := read_ref($t0) - 1: $t5 := vector::length<#0>($t4) - 2: $t6 := >($t2, $t5) - 3: if ($t6) goto 4 else goto 8 - 4: label L1 - 5: destroy($t0) - 6: $t7 := 131072 - 7: abort($t7) - 8: label L0 - 9: vector::push_back<#0>($t0, $t1) - 10: label L5 - 11: $t8 := <($t2, $t5) - 12: if ($t8) goto 13 else goto 19 + var $t10: bool + var $t11: u64 + var $t12: vector + var $t13: bool + var $t14: &mut vector + var $t15: vector + var $t16: u8 + var $t17: u64 + var $t18: vector + var $t19: ascii::String + 0: $t8 := <=($t1, $t2) + 1: if ($t8) goto 2 else goto 6 + 2: label L1 + 3: $t9 := ascii::length($t0) + 4: $t3 := <=($t2, $t9) + 5: goto 9 + 6: label L0 + 7: $t10 := false + 8: $t3 := $t10 + 9: label L2 + 10: if ($t3) goto 11 else goto 13 + 11: label L4 + 12: goto 16 13: label L3 - 14: label L4 - 15: vector::swap<#0>($t0, $t2, $t5) - 16: $t9 := 1 - 17: $t2 := +($t2, $t9) - 18: goto 10 - 19: label L2 - 20: destroy($t0) - 21: trace_local[v]($t0) - 22: return () + 14: $t11 := 65537 + 15: abort($t11) + 16: label L5 + 17: $t12 := [] + 18: $t4 := $t12 + 19: $t5 := $t1 + 20: label L8 + 21: $t13 := <($t5, $t2) + 22: if ($t13) goto 23 else goto 31 + 23: label L7 + 24: $t14 := borrow_local($t4) + 25: $t15 := get_field.bytes($t0) + 26: $t16 := vector::borrow($t15, $t5) + 27: vector::push_back($t14, $t16) + 28: $t17 := 1 + 29: $t5 := +($t5, $t17) + 30: goto 20 + 31: label L6 + 32: $t18 := move($t4) + 33: $t19 := pack ascii::String($t18) + 34: return $t19 } [variant baseline] -public fun vector::is_empty<#0>($t0|v: vector<#0>): bool { - var $t1: u64 - var $t2: u64 - var $t3: bool - 0: $t1 := vector::length<#0>($t0) - 1: $t2 := 0 - 2: $t3 := ==($t1, $t2) - 3: return $t3 +public fun ascii::to_lowercase($t0|string: ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: vector + var $t10|v#1#3: vector + var $t11: vector + var $t12: vector + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u8 + var $t17: &mut vector + var $t18: u8 + var $t19: u64 + var $t20: vector + var $t21: ascii::String + 0: $t11 := ascii::as_bytes($t0) + 1: $t12 := [] + 2: $t7 := $t12 + 3: $t13 := vector::length($t11) + 4: $t14 := 0 + 5: $t6 := $t14 + 6: label L2 + 7: $t15 := <($t6, $t13) + 8: if ($t15) goto 9 else goto 17 + 9: label L1 + 10: $t16 := vector::borrow($t11, $t6) + 11: $t17 := borrow_local($t7) + 12: $t18 := ascii::char_to_lowercase($t16) + 13: vector::push_back($t17, $t18) + 14: $t19 := 1 + 15: $t6 := +($t6, $t19) + 16: goto 6 + 17: label L0 + 18: $t20 := move($t7) + 19: $t21 := pack ascii::String($t20) + 20: return $t21 } [variant baseline] -public native fun vector::length<#0>($t0|v: vector<#0>): u64; +public fun ascii::to_uppercase($t0|string: ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: vector + var $t10|v#1#3: vector + var $t11: vector + var $t12: vector + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u8 + var $t17: &mut vector + var $t18: u8 + var $t19: u64 + var $t20: vector + var $t21: ascii::String + 0: $t11 := ascii::as_bytes($t0) + 1: $t12 := [] + 2: $t7 := $t12 + 3: $t13 := vector::length($t11) + 4: $t14 := 0 + 5: $t6 := $t14 + 6: label L2 + 7: $t15 := <($t6, $t13) + 8: if ($t15) goto 9 else goto 17 + 9: label L1 + 10: $t16 := vector::borrow($t11, $t6) + 11: $t17 := borrow_local($t7) + 12: $t18 := ascii::char_to_uppercase($t16) + 13: vector::push_back($t17, $t18) + 14: $t19 := 1 + 15: $t6 := +($t6, $t19) + 16: goto 6 + 17: label L0 + 18: $t20 := move($t7) + 19: $t21 := pack ascii::String($t20) + 20: return $t21 +} [variant baseline] -public native fun vector::pop_back<#0>($t0|v: &mut vector<#0>): #0; +public fun ascii::try_string($t0|bytes: vector): option::Option { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|tmp#$3: option::Option + var $t4|i#1#12: u64 + var $t5|i#1#9: u64 + var $t6|stop#1#9: u64 + var $t7|v#1#3: vector + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u8 + var $t12: bool + var $t13: bool + var $t14: bool + var $t15: u64 + var $t16: bool + var $t17: ascii::String + 0: $t8 := vector::length($t0) + 1: $t9 := 0 + 2: $t5 := $t9 + 3: label L5 + 4: $t10 := <($t5, $t8) + 5: if ($t10) goto 6 else goto 19 + 6: label L1 + 7: $t11 := vector::borrow($t0, $t5) + 8: $t12 := ascii::is_valid_char($t11) + 9: $t13 := !($t12) + 10: if ($t13) goto 11 else goto 15 + 11: label L3 + 12: $t14 := false + 13: $t2 := $t14 + 14: goto 22 + 15: label L2 + 16: $t15 := 1 + 17: $t5 := +($t5, $t15) + 18: goto 3 + 19: label L0 + 20: $t16 := true + 21: $t2 := $t16 + 22: label L4 + 23: if ($t2) goto 24 else goto 28 + 24: label L7 + 25: $t17 := pack ascii::String($t0) + 26: $t3 := option::some($t17) + 27: goto 30 + 28: label L6 + 29: $t3 := option::none() + 30: label L8 + 31: return $t3 +} [variant baseline] -public native fun vector::push_back<#0>($t0|v: &mut vector<#0>, $t1|e: #0); +public fun string::append($t0|s: &mut string::String, $t1|r: string::String) { + var $t2: &mut vector + var $t3: vector + 0: $t2 := borrow_field.bytes($t0) + 1: $t3 := get_field.bytes($t1) + 2: vector::append($t2, $t3) + 3: trace_local[s]($t0) + 4: return () +} [variant baseline] -public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { - var $t2|tmp#$2: u64 - var $t3|tmp#$3: &mut vector<#0> - var $t4|len#1#0: u64 - var $t5: vector<#0> - var $t6: u64 - var $t7: bool - var $t8: u64 +public fun string::index_of($t0|s: string::String, $t1|r: string::String): u64 { + var $t2: vector + var $t3: vector + var $t4: u64 + 0: $t2 := get_field.bytes($t0) + 1: $t3 := get_field.bytes($t1) + 2: $t4 := string::internal_index_of($t2, $t3) + 3: return $t4 +} + + +[variant baseline] +public fun string::insert($t0|s: &mut string::String, $t1|at: u64, $t2|o: string::String) { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|end#1#0: string::String + var $t6|front#1#0: string::String + var $t7|l#1#0: u64 + var $t8: vector var $t9: u64 - var $t10: u64 + var $t10: bool var $t11: bool var $t12: u64 - var $t13: u64 + var $t13: string::String var $t14: u64 - var $t15: #0 - 0: $t5 := read_ref($t0) - 1: $t6 := vector::length<#0>($t5) - 2: $t7 := >=($t1, $t6) - 3: if ($t7) goto 4 else goto 8 + var $t15: string::String + var $t16: u64 + var $t17: string::String + var $t18: string::String + var $t19: &mut string::String + var $t20: &mut string::String + var $t21: string::String + 0: $t8 := get_field.bytes($t0) + 1: $t9 := vector::length($t8) + 2: $t10 := <=($t1, $t9) + 3: if ($t10) goto 4 else goto 7 4: label L1 - 5: destroy($t0) - 6: $t8 := 131072 - 7: abort($t8) - 8: label L0 - 9: $t9 := 1 - 10: $t10 := -($t6, $t9) - 11: label L5 - 12: $t11 := <($t1, $t10) - 13: if ($t11) goto 14 else goto 22 + 5: $t3 := string::internal_is_char_boundary($t8, $t1) + 6: goto 10 + 7: label L0 + 8: $t11 := false + 9: $t3 := $t11 + 10: label L2 + 11: if ($t3) goto 12 else goto 14 + 12: label L4 + 13: goto 18 14: label L3 - 15: label L4 - 16: $t12 := copy($t1) - 17: $t13 := 1 - 18: $t14 := +($t1, $t13) - 19: $t1 := $t14 - 20: vector::swap<#0>($t0, $t12, $t14) - 21: goto 11 - 22: label L2 - 23: $t15 := vector::pop_back<#0>($t0) - 24: trace_local[v]($t0) - 25: return $t15 + 15: destroy($t0) + 16: $t12 := 2 + 17: abort($t12) + 18: label L5 + 19: $t13 := read_ref($t0) + 20: $t14 := string::length($t13) + 21: $t15 := read_ref($t0) + 22: $t16 := 0 + 23: $t6 := string::substring($t15, $t16, $t1) + 24: $t17 := read_ref($t0) + 25: $t18 := string::substring($t17, $t1, $t14) + 26: $t19 := borrow_local($t6) + 27: string::append($t19, $t2) + 28: $t20 := borrow_local($t6) + 29: string::append($t20, $t18) + 30: $t21 := move($t6) + 31: write_ref($t0, $t21) + 32: trace_local[s]($t0) + 33: return () } [variant baseline] -public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { - var $t1|back_index#1#0: u64 - var $t2|front_index#1#0: u64 - var $t3|len#1#0: u64 - var $t4: vector<#0> - var $t5: u64 - var $t6: u64 - var $t7: bool - var $t8: u64 - var $t9: u64 - var $t10: bool - var $t11: u64 - var $t12: u64 - 0: $t4 := read_ref($t0) - 1: $t5 := vector::length<#0>($t4) - 2: $t6 := 0 - 3: $t7 := ==($t5, $t6) - 4: if ($t7) goto 5 else goto 9 - 5: label L1 - 6: destroy($t0) - 7: trace_local[v]($t0) - 8: return () - 9: label L0 - 10: $t8 := 0 - 11: $t2 := $t8 - 12: $t9 := 1 - 13: $t1 := -($t5, $t9) - 14: label L5 - 15: $t10 := <($t2, $t1) - 16: if ($t10) goto 17 else goto 25 - 17: label L3 - 18: label L4 - 19: vector::swap<#0>($t0, $t2, $t1) - 20: $t11 := 1 - 21: $t2 := +($t2, $t11) - 22: $t12 := 1 - 23: $t1 := -($t1, $t12) - 24: goto 14 - 25: label L2 - 26: destroy($t0) - 27: trace_local[v]($t0) - 28: return () +public fun string::is_empty($t0|s: string::String): bool { + var $t1: vector + var $t2: bool + 0: $t1 := get_field.bytes($t0) + 1: $t2 := vector::is_empty($t1) + 2: return $t2 } [variant baseline] -public fun vector::singleton<#0>($t0|e: #0): vector<#0> { - var $t1|v#1#0: vector<#0> - var $t2: &mut vector<#0> - var $t3: vector<#0> - 0: $t1 := vector::empty<#0>() - 1: $t2 := borrow_local($t1) - 2: vector::push_back<#0>($t2, $t0) - 3: $t3 := move($t1) - 4: return $t3 +public fun string::length($t0|s: string::String): u64 { + var $t1: vector + var $t2: u64 + 0: $t1 := get_field.bytes($t0) + 1: $t2 := vector::length($t1) + 2: return $t2 } [variant baseline] -public native fun vector::swap<#0>($t0|v: &mut vector<#0>, $t1|i: u64, $t2|j: u64); +public fun string::as_bytes($t0|s: string::String): vector { + var $t1: vector + 0: $t1 := get_field.bytes($t0) + 1: return $t1 +} [variant baseline] -public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { - var $t2|last_idx#1#0: u64 - var $t3: vector<#0> - var $t4: bool - var $t5: bool - var $t6: u64 - var $t7: vector<#0> - var $t8: u64 +public fun string::into_bytes($t0|s: string::String): vector { + var $t1: vector + 0: $t1 := unpack string::String($t0) + 1: return $t1 +} + + +[variant baseline] +public fun string::bytes($t0|s: string::String): vector { + var $t1: vector + 0: $t1 := string::as_bytes($t0) + 1: return $t1 +} + + +[variant baseline] +public fun string::substring($t0|s: string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3|tmp#$3: bool + var $t4|tmp#$4: bool + var $t5|tmp#$5: bool + var $t6|bytes#1#0: vector + var $t7|l#1#0: u64 + var $t8: vector var $t9: u64 - var $t10: u64 - var $t11: #0 - 0: $t3 := read_ref($t0) - 1: $t4 := vector::is_empty<#0>($t3) - 2: $t5 := !($t4) - 3: if ($t5) goto 4 else goto 6 + var $t10: bool + var $t11: bool + var $t12: bool + var $t13: bool + var $t14: u64 + var $t15: vector + var $t16: string::String + 0: $t8 := get_field.bytes($t0) + 1: $t9 := vector::length($t8) + 2: $t10 := <=($t2, $t9) + 3: if ($t10) goto 4 else goto 7 4: label L1 - 5: goto 10 - 6: label L0 - 7: destroy($t0) - 8: $t6 := 131072 - 9: abort($t6) + 5: $t3 := <=($t1, $t2) + 6: goto 10 + 7: label L0 + 8: $t11 := false + 9: $t3 := $t11 10: label L2 - 11: $t7 := read_ref($t0) - 12: $t8 := vector::length<#0>($t7) - 13: $t9 := 1 - 14: $t10 := -($t8, $t9) - 15: vector::swap<#0>($t0, $t1, $t10) - 16: $t11 := vector::pop_back<#0>($t0) - 17: trace_local[v]($t0) - 18: return $t11 + 11: if ($t3) goto 12 else goto 15 + 12: label L4 + 13: $t4 := string::internal_is_char_boundary($t8, $t1) + 14: goto 18 + 15: label L3 + 16: $t12 := false + 17: $t4 := $t12 + 18: label L5 + 19: if ($t4) goto 20 else goto 23 + 20: label L7 + 21: $t5 := string::internal_is_char_boundary($t8, $t2) + 22: goto 26 + 23: label L6 + 24: $t13 := false + 25: $t5 := $t13 + 26: label L8 + 27: if ($t5) goto 28 else goto 30 + 28: label L10 + 29: goto 33 + 30: label L9 + 31: $t14 := 2 + 32: abort($t14) + 33: label L11 + 34: $t15 := string::internal_sub_string($t8, $t1, $t2) + 35: $t16 := pack string::String($t15) + 36: return $t16 +} + + +[variant baseline] +public fun string::append_utf8($t0|s: &mut string::String, $t1|bytes: vector) { + var $t2: string::String + 0: $t2 := string::utf8($t1) + 1: string::append($t0, $t2) + 2: trace_local[s]($t0) + 3: return () +} + + +[variant baseline] +public fun string::from_ascii($t0|s: ascii::String): string::String { + var $t1: vector + var $t2: string::String + 0: $t1 := ascii::into_bytes($t0) + 1: $t2 := pack string::String($t1) + 2: return $t2 +} + + +[variant baseline] +native fun string::internal_check_utf8($t0|v: vector): bool; + + +[variant baseline] +native fun string::internal_index_of($t0|v: vector, $t1|r: vector): u64; + + +[variant baseline] +native fun string::internal_is_char_boundary($t0|v: vector, $t1|i: u64): bool; + + +[variant baseline] +native fun string::internal_sub_string($t0|v: vector, $t1|i: u64, $t2|j: u64): vector; + + +[variant baseline] +public fun string::sub_string($t0|s: string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3: string::String + 0: $t3 := string::substring($t0, $t1, $t2) + 1: return $t3 +} + + +[variant baseline] +public fun string::to_ascii($t0|s: string::String): ascii::String { + var $t1: vector + var $t2: ascii::String + 0: $t1 := unpack string::String($t0) + 1: $t2 := ascii::string($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::try_utf8($t0|bytes: vector): option::Option { + var $t1|tmp#$1: option::Option + var $t2: bool + var $t3: string::String + 0: $t2 := string::internal_check_utf8($t0) + 1: if ($t2) goto 2 else goto 6 + 2: label L1 + 3: $t3 := pack string::String($t0) + 4: $t1 := option::some($t3) + 5: goto 8 + 6: label L0 + 7: $t1 := option::none() + 8: label L2 + 9: return $t1 +} + + +[variant baseline] +public fun string::utf8($t0|bytes: vector): string::String { + var $t1: bool + var $t2: u64 + var $t3: string::String + 0: $t1 := string::internal_check_utf8($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 1 + 6: abort($t2) + 7: label L2 + 8: $t3 := pack string::String($t0) + 9: return $t3 } @@ -908,6 +4422,10 @@ fun vector::borrow_mut[baseline] borrowed_by: Reference($t0) -> {([], Return(0))} borrows_from: Return(0) -> {([], Reference($t0))} +fun option::borrow_mut[baseline] +borrowed_by: Reference($t0) -> {(.vec (vector<#0>)/[], Return(0))} +borrows_from: Return(0) -> {(.vec (vector<#0>)/[], Reference($t0))} + fun MultiLayerCalling::inner[baseline] borrowed_by: Reference($t0) -> {(.v (vector)/[], Return(0))} borrows_from: Return(0) -> {(.v (vector)/[], Reference($t0))} diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.move b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.move index 003dbbcee8dab..b2f766c47e846 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/function_call.move @@ -1,13 +1,17 @@ +// dep: ../move-stdlib/sources/macros.move +// dep: ../move-stdlib/sources/u64.move +// dep: ../move-stdlib/sources/option.move +// dep: ../move-stdlib/sources/ascii.move +// dep: ../move-stdlib/sources/string.move // dep: ../move-stdlib/sources/vector.move module 0x2::MultiLayerCalling { - use std::vector; - struct HasVector { + public struct HasVector { v: vector, } - struct HasAnotherVector { + public struct HasAnotherVector { v: vector, } diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.exp b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.exp index e367f9ebff288..f3986a7ff742b 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.exp +++ b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.exp @@ -1,5 +1,339 @@ ============ initial translation from Move ================ +[variant baseline] +public fun u64::diff($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 14 + 8: label L1 + 9: $t10 := move($t3) + 10: $t11 := move($t4) + 11: $t12 := -($t10, $t11) + 12: $t2 := $t12 + 13: goto 20 + 14: label L0 + 15: $t13 := move($t4) + 16: $t14 := move($t3) + 17: $t15 := -($t13, $t14) + 18: $t2 := $t15 + 19: goto 20 + 20: label L2 + 21: $t16 := move($t2) + 22: return $t16 +} + + +[variant baseline] +public fun u64::divide_and_round_up($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: bool + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := %($t7, $t8) + 7: $t10 := 0 + 8: $t11 := ==($t9, $t10) + 9: if ($t11) goto 10 else goto 16 + 10: label L1 + 11: $t12 := move($t3) + 12: $t13 := move($t4) + 13: $t14 := /($t12, $t13) + 14: $t2 := $t14 + 15: goto 24 + 16: label L0 + 17: $t15 := move($t3) + 18: $t16 := move($t4) + 19: $t17 := /($t15, $t16) + 20: $t18 := 1 + 21: $t19 := +($t17, $t18) + 22: $t2 := $t19 + 23: goto 24 + 24: label L2 + 25: $t20 := move($t2) + 26: return $t20 +} + + +[variant baseline] +public fun u64::max($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::min($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := <($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::pow($t0|base: u64, $t1|exponent: u8): u64 { + var $t2|base#1#1: u64 + var $t3|exponent#1#1: u8 + var $t4|res#1#1: u64 + var $t5: u64 + var $t6: u8 + var $t7: u64 + var $t8: u8 + var $t9: u8 + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: bool + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u8 + var $t20: u8 + var $t21: u8 + var $t22: u64 + var $t23: u64 + var $t24: u64 + var $t25: u8 + var $t26: u8 + var $t27: u8 + var $t28: u64 + 0: $t5 := move($t0) + 1: $t2 := $t5 + 2: $t6 := move($t1) + 3: $t3 := $t6 + 4: $t7 := 1 + 5: $t4 := $t7 + 6: goto 7 + 7: label L5 + 8: $t8 := copy($t3) + 9: $t9 := 1 + 10: $t10 := >=($t8, $t9) + 11: if ($t10) goto 12 else goto 41 + 12: label L1 + 13: goto 14 + 14: label L2 + 15: $t11 := copy($t3) + 16: $t12 := 2 + 17: $t13 := %($t11, $t12) + 18: $t14 := 0 + 19: $t15 := ==($t13, $t14) + 20: if ($t15) goto 21 else goto 31 + 21: label L4 + 22: $t16 := copy($t2) + 23: $t17 := move($t2) + 24: $t18 := *($t16, $t17) + 25: $t2 := $t18 + 26: $t19 := move($t3) + 27: $t20 := 2 + 28: $t21 := /($t19, $t20) + 29: $t3 := $t21 + 30: goto 7 + 31: label L3 + 32: $t22 := move($t4) + 33: $t23 := copy($t2) + 34: $t24 := *($t22, $t23) + 35: $t4 := $t24 + 36: $t25 := move($t3) + 37: $t26 := 1 + 38: $t27 := -($t25, $t26) + 39: $t3 := $t27 + 40: goto 7 + 41: label L0 + 42: $t28 := move($t4) + 43: return $t28 +} + + +[variant baseline] +public fun u64::sqrt($t0|x: u64): u64 { + var $t1|bit#1#1: u128 + var $t2|res#1#1: u128 + var $t3|x#1#1: u64 + var $t4|x#2#1: u128 + var $t5: u64 + var $t6: u128 + var $t7: u128 + var $t8: u64 + var $t9: u128 + var $t10: u128 + var $t11: u128 + var $t12: bool + var $t13: u128 + var $t14: u128 + var $t15: u128 + var $t16: u128 + var $t17: bool + var $t18: u128 + var $t19: u128 + var $t20: u128 + var $t21: u128 + var $t22: u128 + var $t23: u128 + var $t24: u8 + var $t25: u128 + var $t26: u128 + var $t27: u128 + var $t28: u128 + var $t29: u8 + var $t30: u128 + var $t31: u128 + var $t32: u8 + var $t33: u128 + var $t34: u128 + var $t35: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := 18446744073709551616 + 3: $t1 := $t6 + 4: $t7 := 0 + 5: $t2 := $t7 + 6: $t8 := move($t3) + 7: $t9 := (u128)($t8) + 8: $t4 := $t9 + 9: goto 10 + 10: label L6 + 11: $t10 := copy($t1) + 12: $t11 := 0 + 13: $t12 := !=($t10, $t11) + 14: if ($t12) goto 15 else goto 50 + 15: label L1 + 16: goto 17 + 17: label L2 + 18: $t13 := copy($t4) + 19: $t14 := copy($t2) + 20: $t15 := copy($t1) + 21: $t16 := +($t14, $t15) + 22: $t17 := >=($t13, $t16) + 23: if ($t17) goto 24 else goto 38 + 24: label L4 + 25: $t18 := move($t4) + 26: $t19 := copy($t2) + 27: $t20 := copy($t1) + 28: $t21 := +($t19, $t20) + 29: $t22 := -($t18, $t21) + 30: $t4 := $t22 + 31: $t23 := move($t2) + 32: $t24 := 1 + 33: $t25 := >>($t23, $t24) + 34: $t26 := copy($t1) + 35: $t27 := +($t25, $t26) + 36: $t2 := $t27 + 37: goto 44 + 38: label L3 + 39: $t28 := move($t2) + 40: $t29 := 1 + 41: $t30 := >>($t28, $t29) + 42: $t2 := $t30 + 43: goto 44 + 44: label L5 + 45: $t31 := move($t1) + 46: $t32 := 2 + 47: $t33 := >>($t31, $t32) + 48: $t1 := $t33 + 49: goto 10 + 50: label L0 + 51: $t34 := move($t2) + 52: $t35 := (u64)($t34) + 53: return $t35 +} + + [variant baseline] public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { var $t2: &mut vector<#0> @@ -231,27 +565,25 @@ public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { 15: $t13 := move($t1) 16: vector::push_back<#0>($t12, $t13) 17: goto 18 - 18: label L5 + 18: label L4 19: $t14 := copy($t2) 20: $t15 := copy($t3) 21: $t16 := <($t14, $t15) - 22: if ($t16) goto 23 else goto 35 + 22: if ($t16) goto 23 else goto 33 23: label L3 - 24: goto 25 - 25: label L4 - 26: $t17 := copy($t0) - 27: $t18 := copy($t2) - 28: $t19 := copy($t3) - 29: vector::swap<#0>($t17, $t18, $t19) - 30: $t20 := move($t2) - 31: $t21 := 1 - 32: $t22 := +($t20, $t21) - 33: $t2 := $t22 - 34: goto 18 - 35: label L2 - 36: $t23 := move($t0) - 37: destroy($t23) - 38: return () + 24: $t17 := copy($t0) + 25: $t18 := copy($t2) + 26: $t19 := copy($t3) + 27: vector::swap<#0>($t17, $t18, $t19) + 28: $t20 := move($t2) + 29: $t21 := 1 + 30: $t22 := +($t20, $t21) + 31: $t2 := $t22 + 32: goto 18 + 33: label L2 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: return () } @@ -329,31 +661,29 @@ public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { 16: $t15 := -($t13, $t14) 17: $t4 := $t15 18: goto 19 - 19: label L5 + 19: label L4 20: $t16 := copy($t1) 21: $t17 := copy($t4) 22: $t18 := <($t16, $t17) - 23: if ($t18) goto 24 else goto 40 + 23: if ($t18) goto 24 else goto 38 24: label L3 - 25: goto 26 - 26: label L4 - 27: $t19 := copy($t0) - 28: $t3 := $t19 - 29: $t20 := copy($t1) - 30: $t2 := $t20 - 31: $t21 := move($t1) - 32: $t22 := 1 - 33: $t23 := +($t21, $t22) - 34: $t1 := $t23 - 35: $t24 := move($t3) - 36: $t25 := move($t2) - 37: $t26 := copy($t1) - 38: vector::swap<#0>($t24, $t25, $t26) - 39: goto 19 - 40: label L2 - 41: $t27 := move($t0) - 42: $t28 := vector::pop_back<#0>($t27) - 43: return $t28 + 25: $t19 := copy($t0) + 26: $t3 := $t19 + 27: $t20 := copy($t1) + 28: $t2 := $t20 + 29: $t21 := move($t1) + 30: $t22 := 1 + 31: $t23 := +($t21, $t22) + 32: $t1 := $t23 + 33: $t24 := move($t3) + 34: $t25 := move($t2) + 35: $t26 := copy($t1) + 36: vector::swap<#0>($t24, $t25, $t26) + 37: goto 19 + 38: label L2 + 39: $t27 := move($t0) + 40: $t28 := vector::pop_back<#0>($t27) + 41: return $t28 } @@ -406,31 +736,29 @@ public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { 17: $t14 := -($t12, $t13) 18: $t1 := $t14 19: goto 20 - 20: label L5 + 20: label L4 21: $t15 := copy($t2) 22: $t16 := copy($t1) 23: $t17 := <($t15, $t16) - 24: if ($t17) goto 25 else goto 41 + 24: if ($t17) goto 25 else goto 39 25: label L3 - 26: goto 27 - 27: label L4 - 28: $t18 := copy($t0) - 29: $t19 := copy($t2) - 30: $t20 := copy($t1) - 31: vector::swap<#0>($t18, $t19, $t20) - 32: $t21 := move($t2) - 33: $t22 := 1 - 34: $t23 := +($t21, $t22) - 35: $t2 := $t23 - 36: $t24 := move($t1) - 37: $t25 := 1 - 38: $t26 := -($t24, $t25) - 39: $t1 := $t26 - 40: goto 20 - 41: label L2 - 42: $t27 := move($t0) - 43: destroy($t27) - 44: return () + 26: $t18 := copy($t0) + 27: $t19 := copy($t2) + 28: $t20 := copy($t1) + 29: vector::swap<#0>($t18, $t19, $t20) + 30: $t21 := move($t2) + 31: $t22 := 1 + 32: $t23 := +($t21, $t22) + 33: $t2 := $t23 + 34: $t24 := move($t1) + 35: $t25 := 1 + 36: $t26 := -($t24, $t25) + 37: $t1 := $t26 + 38: goto 20 + 39: label L2 + 40: $t27 := move($t0) + 41: destroy($t27) + 42: return () } @@ -504,376 +832,3562 @@ public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { [variant baseline] -public fun Collection::borrow_mut<#0>($t0|c: &mut Collection::Collection<#0>, $t1|i: u64): &mut #0 { - var $t2: &mut Collection::Collection<#0> - var $t3: &mut vector<#0> +public fun option::borrow<#0>($t0|t: &option::Option<#0>): � { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: &option::Option<#0> var $t4: u64 - var $t5: &mut #0 + var $t5: &option::Option<#0> + var $t6: &vector<#0> + var $t7: u64 + var $t8: � + 0: $t1 := copy($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 10 + 5: label L0 + 6: $t3 := move($t0) + 7: destroy($t3) + 8: $t4 := 262145 + 9: abort($t4) + 10: label L2 + 11: $t5 := move($t0) + 12: $t6 := borrow_field>.vec($t5) + 13: $t7 := 0 + 14: $t8 := vector::borrow<#0>($t6, $t7) + 15: return $t8 +} + + +[variant baseline] +public fun option::borrow_mut<#0>($t0|t: &mut option::Option<#0>): &mut #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> + var $t5: u64 + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: u64 + var $t9: &mut #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := 0 + 15: $t9 := vector::borrow_mut<#0>($t7, $t8) + 16: return $t9 +} + + +[variant baseline] +public fun option::contains<#0>($t0|t: &option::Option<#0>, $t1|e_ref: �): bool { + var $t2: &option::Option<#0> + var $t3: &vector<#0> + var $t4: � + var $t5: bool 0: $t2 := move($t0) - 1: $t3 := borrow_field>.items($t2) + 1: $t3 := borrow_field>.vec($t2) 2: $t4 := move($t1) - 3: $t5 := vector::borrow_mut<#0>($t3, $t4) + 3: $t5 := vector::contains<#0>($t3, $t4) 4: return $t5 } [variant baseline] -public fun Collection::make_collection<#0>(): Collection::Collection<#0> { - var $t0: vector<#0> - var $t1: address - var $t2: Collection::Collection<#0> - 0: $t0 := vector::empty<#0>() - 1: $t1 := 0x2 - 2: $t2 := pack Collection::Collection<#0>($t0, $t1) - 3: return $t2 +public fun option::swap<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): #0 { + var $t2|old_value#1#0: #0 + var $t3|vec_ref#1#0: &mut vector<#0> + var $t4: &mut option::Option<#0> + var $t5: &option::Option<#0> + var $t6: bool + var $t7: &mut option::Option<#0> + var $t8: u64 + var $t9: &mut option::Option<#0> + var $t10: &mut vector<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: &mut vector<#0> + var $t14: #0 + var $t15: #0 + 0: $t4 := copy($t0) + 1: $t5 := freeze_ref($t4) + 2: $t6 := option::is_some<#0>($t5) + 3: if ($t6) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t7 := move($t0) + 8: destroy($t7) + 9: $t8 := 262145 + 10: abort($t8) + 11: label L2 + 12: $t9 := move($t0) + 13: $t10 := borrow_field>.vec($t9) + 14: $t3 := $t10 + 15: $t11 := copy($t3) + 16: $t12 := vector::pop_back<#0>($t11) + 17: $t2 := $t12 + 18: $t13 := move($t3) + 19: $t14 := move($t1) + 20: vector::push_back<#0>($t13, $t14) + 21: $t15 := move($t2) + 22: return $t15 } [variant baseline] -public fun Test::foo<#0>($t0|i: u64) { - var $t1|c#1#0: Collection::Collection> - var $t2|t#1#0: &mut Test::Token<#0> - var $t3: Collection::Collection> - var $t4: &mut Collection::Collection> - var $t5: u64 - var $t6: &mut Test::Token<#0> - var $t7: u64 - var $t8: &mut Test::Token<#0> - var $t9: &mut u64 - 0: $t3 := Collection::make_collection>() - 1: $t1 := $t3 - 2: $t4 := borrow_local($t1) - 3: $t5 := move($t0) - 4: $t6 := Collection::borrow_mut>($t4, $t5) - 5: $t2 := $t6 - 6: $t7 := 0 - 7: $t8 := move($t2) - 8: $t9 := borrow_field>.value($t8) - 9: write_ref($t9, $t7) - 10: return () +public fun option::borrow_with_default<#0>($t0|t: &option::Option<#0>, $t1|default_ref: �): � { + var $t2|tmp#$2: � + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: � + var $t10: � + var $t11: &vector<#0> + var $t12: u64 + var $t13: � + var $t14: � + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 20 + 12: label L0 + 13: $t10 := move($t1) + 14: destroy($t10) + 15: $t11 := move($t3) + 16: $t12 := 0 + 17: $t13 := vector::borrow<#0>($t11, $t12) + 18: $t2 := $t13 + 19: goto 20 + 20: label L2 + 21: $t14 := move($t2) + 22: return $t14 } -============ after pipeline `borrow` ================ [variant baseline] -public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { - var $t2: &mut vector<#0> - var $t3: vector<#0> - var $t4: bool - var $t5: bool - var $t6: &mut vector<#0> - var $t7: #0 - var $t8: vector<#0> - 0: $t2 := borrow_local($t1) - 1: vector::reverse<#0>($t2) - 2: label L3 - 3: $t3 := copy($t1) - 4: $t4 := vector::is_empty<#0>($t3) - 5: $t5 := !($t4) - 6: if ($t5) goto 7 else goto 13 - 7: label L1 +public fun option::destroy_none<#0>($t0|t: option::Option<#0>) { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: option::Option<#0> + var $t5: vector<#0> + 0: $t1 := borrow_local($t0) + 1: $t2 := option::is_none<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 262144 + 7: abort($t3) 8: label L2 - 9: $t6 := borrow_local($t1) - 10: $t7 := vector::pop_back<#0>($t6) - 11: vector::push_back<#0>($t0, $t7) - 12: goto 2 - 13: label L0 - 14: destroy($t0) - 15: $t8 := move($t1) - 16: vector::destroy_empty<#0>($t8) - 17: trace_local[lhs]($t0) - 18: return () + 9: $t4 := move($t0) + 10: $t5 := unpack option::Option<#0>($t4) + 11: vector::destroy_empty<#0>($t5) + 12: return () } [variant baseline] -public native fun vector::borrow<#0>($t0|v: vector<#0>, $t1|i: u64): #0; +public fun option::destroy_some<#0>($t0|t: option::Option<#0>): #0 { + var $t1|elem#1#0: #0 + var $t2|vec#1#0: vector<#0> + var $t3: &option::Option<#0> + var $t4: bool + var $t5: u64 + var $t6: option::Option<#0> + var $t7: vector<#0> + var $t8: &mut vector<#0> + var $t9: #0 + var $t10: vector<#0> + var $t11: #0 + 0: $t3 := borrow_local($t0) + 1: $t4 := option::is_some<#0>($t3) + 2: if ($t4) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t5 := 262145 + 7: abort($t5) + 8: label L2 + 9: $t6 := move($t0) + 10: $t7 := unpack option::Option<#0>($t6) + 11: $t2 := $t7 + 12: $t8 := borrow_local($t2) + 13: $t9 := vector::pop_back<#0>($t8) + 14: $t1 := $t9 + 15: $t10 := move($t2) + 16: vector::destroy_empty<#0>($t10) + 17: $t11 := move($t1) + 18: return $t11 +} [variant baseline] -public native fun vector::borrow_mut<#0>($t0|v: &mut vector<#0>, $t1|i: u64): &mut #0; +public fun option::destroy_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec#1#0: vector<#0> + var $t4: option::Option<#0> + var $t5: vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: #0 + var $t9: &mut vector<#0> + var $t10: #0 + var $t11: #0 + 0: $t4 := move($t0) + 1: $t5 := unpack option::Option<#0>($t4) + 2: $t3 := $t5 + 3: $t6 := borrow_local($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 10 + 6: label L1 + 7: $t8 := move($t1) + 8: $t2 := $t8 + 9: goto 15 + 10: label L0 + 11: $t9 := borrow_local($t3) + 12: $t10 := vector::pop_back<#0>($t9) + 13: $t2 := $t10 + 14: goto 15 + 15: label L2 + 16: $t11 := move($t2) + 17: return $t11 +} [variant baseline] -public fun vector::contains<#0>($t0|v: vector<#0>, $t1|e: #0): bool { - var $t2|i#1#0: u64 - var $t3|len#1#0: u64 - var $t4: u64 +public fun option::extract<#0>($t0|t: &mut option::Option<#0>): #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> var $t5: u64 - var $t6: bool - var $t7: #0 - var $t8: bool - var $t9: bool - var $t10: u64 - var $t11: bool - 0: $t4 := 0 - 1: $t2 := $t4 - 2: $t5 := vector::length<#0>($t0) - 3: label L5 - 4: $t6 := <($t2, $t5) - 5: if ($t6) goto 6 else goto 18 - 6: label L1 - 7: label L2 - 8: $t7 := vector::borrow<#0>($t0, $t2) - 9: $t8 := ==($t7, $t1) + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := vector::pop_back<#0>($t7) + 15: return $t8 +} + + +[variant baseline] +public fun option::fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0) { + var $t2|vec_ref#1#0: &mut vector<#0> + var $t3: &mut option::Option<#0> + var $t4: &mut vector<#0> + var $t5: &mut vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &mut vector<#0> + var $t9: u64 + var $t10: &mut vector<#0> + var $t11: #0 + 0: $t3 := move($t0) + 1: $t4 := borrow_field>.vec($t3) + 2: $t2 := $t4 + 3: $t5 := copy($t2) + 4: $t6 := freeze_ref($t5) + 5: $t7 := vector::is_empty<#0>($t6) + 6: if ($t7) goto 7 else goto 9 + 7: label L1 + 8: goto 14 + 9: label L0 + 10: $t8 := move($t2) + 11: destroy($t8) + 12: $t9 := 262144 + 13: abort($t9) + 14: label L2 + 15: $t10 := move($t2) + 16: $t11 := move($t1) + 17: vector::push_back<#0>($t10, $t11) + 18: return () +} + + +[variant baseline] +public fun option::get_with_default<#0>($t0|t: &option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: #0 + var $t10: &vector<#0> + var $t11: u64 + var $t12: � + var $t13: #0 + var $t14: #0 + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 19 + 12: label L0 + 13: $t10 := move($t3) + 14: $t11 := 0 + 15: $t12 := vector::borrow<#0>($t10, $t11) + 16: $t13 := read_ref($t12) + 17: $t2 := $t13 + 18: goto 19 + 19: label L2 + 20: $t14 := move($t2) + 21: return $t14 +} + + +[variant baseline] +public fun option::is_none<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::is_some<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + var $t4: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: $t4 := !($t3) + 4: return $t4 +} + + +[variant baseline] +public fun option::none<#0>(): option::Option<#0> { + var $t0: vector<#0> + var $t1: option::Option<#0> + 0: $t0 := vector::empty<#0>() + 1: $t1 := pack option::Option<#0>($t0) + 2: return $t1 +} + + +[variant baseline] +public fun option::some<#0>($t0|e: #0): option::Option<#0> { + var $t1: #0 + var $t2: vector<#0> + var $t3: option::Option<#0> + 0: $t1 := move($t0) + 1: $t2 := vector::singleton<#0>($t1) + 2: $t3 := pack option::Option<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::swap_or_fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): option::Option<#0> { + var $t2|tmp#$2: option::Option<#0> + var $t3|old_value#1#0: option::Option<#0> + var $t4|vec_ref#1#0: &mut vector<#0> + var $t5: &mut option::Option<#0> + var $t6: &mut vector<#0> + var $t7: &mut vector<#0> + var $t8: &vector<#0> + var $t9: bool + var $t10: option::Option<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: option::Option<#0> + var $t14: option::Option<#0> + var $t15: &mut vector<#0> + var $t16: #0 + var $t17: option::Option<#0> + 0: $t5 := move($t0) + 1: $t6 := borrow_field>.vec($t5) + 2: $t4 := $t6 + 3: $t7 := copy($t4) + 4: $t8 := freeze_ref($t7) + 5: $t9 := vector::is_empty<#0>($t8) + 6: if ($t9) goto 7 else goto 11 + 7: label L1 + 8: $t10 := option::none<#0>() + 9: $t2 := $t10 + 10: goto 17 + 11: label L0 + 12: $t11 := copy($t4) + 13: $t12 := vector::pop_back<#0>($t11) + 14: $t13 := option::some<#0>($t12) + 15: $t2 := $t13 + 16: goto 17 + 17: label L2 + 18: $t14 := move($t2) + 19: $t3 := $t14 + 20: $t15 := move($t4) + 21: $t16 := move($t1) + 22: vector::push_back<#0>($t15, $t16) + 23: $t17 := move($t3) + 24: return $t17 +} + + +[variant baseline] +public fun option::to_vec<#0>($t0|t: option::Option<#0>): vector<#0> { + var $t1: option::Option<#0> + var $t2: vector<#0> + 0: $t1 := move($t0) + 1: $t2 := unpack option::Option<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::append($t0|string: &mut ascii::String, $t1|other: ascii::String) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: ascii::String + var $t5: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := ascii::into_bytes($t4) + 4: vector::append($t3, $t5) + 5: return () +} + + +[variant baseline] +public fun ascii::index_of($t0|string: &ascii::String, $t1|substr: &ascii::String): u64 { + var $t2|tmp#$2: bool + var $t3|i#1#0: u64 + var $t4|j#1#0: u64 + var $t5|m#1#0: u64 + var $t6|n#1#0: u64 + var $t7: u64 + var $t8: &ascii::String + var $t9: u64 + var $t10: &ascii::String + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: bool + var $t15: &ascii::String + var $t16: &ascii::String + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: u64 + var $t22: bool + var $t23: u64 + var $t24: u64 + var $t25: u64 + var $t26: bool + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: u64 + var $t31: u64 + var $t32: &u8 + var $t33: u8 + var $t34: &ascii::String + var $t35: &vector + var $t36: u64 + var $t37: &u8 + var $t38: u8 + var $t39: bool + var $t40: bool + var $t41: bool + var $t42: u64 + var $t43: u64 + var $t44: u64 + var $t45: u64 + var $t46: u64 + var $t47: bool + var $t48: &ascii::String + var $t49: &ascii::String + var $t50: u64 + var $t51: u64 + var $t52: u64 + var $t53: u64 + var $t54: &ascii::String + var $t55: &ascii::String + var $t56: u64 + 0: $t7 := 0 + 1: $t3 := $t7 + 2: $t8 := copy($t0) + 3: $t9 := ascii::length($t8) + 4: $t10 := copy($t1) + 5: $t11 := ascii::length($t10) + 6: $t5 := $t11 + 7: $t6 := $t9 + 8: $t12 := copy($t6) + 9: $t13 := copy($t5) + 10: $t14 := <($t12, $t13) + 11: if ($t14) goto 12 else goto 19 + 12: label L1 + 13: $t15 := move($t1) + 14: destroy($t15) + 15: $t16 := move($t0) + 16: destroy($t16) + 17: $t17 := move($t6) + 18: return $t17 + 19: label L0 + 20: $t18 := copy($t3) + 21: $t19 := copy($t6) + 22: $t20 := copy($t5) + 23: $t21 := -($t19, $t20) + 24: $t22 := <=($t18, $t21) + 25: if ($t22) goto 26 else goto 84 + 26: label L3 + 27: $t23 := 0 + 28: $t4 := $t23 + 29: goto 30 + 30: label L10 + 31: $t24 := copy($t4) + 32: $t25 := copy($t5) + 33: $t26 := <($t24, $t25) + 34: if ($t26) goto 35 else goto 53 + 35: label L5 + 36: goto 37 + 37: label L6 + 38: $t27 := copy($t0) + 39: $t28 := borrow_field.bytes($t27) + 40: $t29 := copy($t3) + 41: $t30 := copy($t4) + 42: $t31 := +($t29, $t30) + 43: $t32 := vector::borrow($t28, $t31) + 44: $t33 := read_ref($t32) + 45: $t34 := copy($t1) + 46: $t35 := borrow_field.bytes($t34) + 47: $t36 := copy($t4) + 48: $t37 := vector::borrow($t35, $t36) + 49: $t38 := read_ref($t37) + 50: $t39 := ==($t33, $t38) + 51: $t2 := $t39 + 52: goto 57 + 53: label L4 + 54: $t40 := false + 55: $t2 := $t40 + 56: goto 57 + 57: label L7 + 58: $t41 := move($t2) + 59: if ($t41) goto 60 else goto 66 + 60: label L9 + 61: $t42 := move($t4) + 62: $t43 := 1 + 63: $t44 := +($t42, $t43) + 64: $t4 := $t44 + 65: goto 30 + 66: label L8 + 67: $t45 := move($t4) + 68: $t46 := copy($t5) + 69: $t47 := ==($t45, $t46) + 70: if ($t47) goto 71 else goto 78 + 71: label L12 + 72: $t48 := move($t1) + 73: destroy($t48) + 74: $t49 := move($t0) + 75: destroy($t49) + 76: $t50 := move($t3) + 77: return $t50 + 78: label L11 + 79: $t51 := move($t3) + 80: $t52 := 1 + 81: $t53 := +($t51, $t52) + 82: $t3 := $t53 + 83: goto 19 + 84: label L2 + 85: $t54 := move($t1) + 86: destroy($t54) + 87: $t55 := move($t0) + 88: destroy($t55) + 89: $t56 := move($t6) + 90: return $t56 +} + + +[variant baseline] +public fun ascii::insert($t0|s: &mut ascii::String, $t1|at: u64, $t2|o: ascii::String) { + var $t3|e#1#2: u8 + var $t4|v#1#1: vector + var $t5: u64 + var $t6: &mut ascii::String + var $t7: &ascii::String + var $t8: u64 + var $t9: bool + var $t10: &mut ascii::String + var $t11: u64 + var $t12: ascii::String + var $t13: vector + var $t14: &vector + var $t15: bool + var $t16: bool + var $t17: &mut vector + var $t18: u8 + var $t19: &mut ascii::String + var $t20: &mut vector + var $t21: u8 + var $t22: u64 + var $t23: &mut ascii::String + var $t24: vector + 0: $t5 := copy($t1) + 1: $t6 := copy($t0) + 2: $t7 := freeze_ref($t6) + 3: $t8 := ascii::length($t7) + 4: $t9 := <=($t5, $t8) + 5: if ($t9) goto 6 else goto 8 + 6: label L1 + 7: goto 13 + 8: label L0 + 9: $t10 := move($t0) + 10: destroy($t10) + 11: $t11 := 65537 + 12: abort($t11) + 13: label L2 + 14: $t12 := move($t2) + 15: $t13 := ascii::into_bytes($t12) + 16: $t4 := $t13 + 17: goto 18 + 18: label L5 + 19: $t14 := borrow_local($t4) + 20: $t15 := vector::is_empty($t14) + 21: $t16 := !($t15) + 22: if ($t16) goto 23 else goto 33 + 23: label L4 + 24: $t17 := borrow_local($t4) + 25: $t18 := vector::pop_back($t17) + 26: $t3 := $t18 + 27: $t19 := copy($t0) + 28: $t20 := borrow_field.bytes($t19) + 29: $t21 := move($t3) + 30: $t22 := copy($t1) + 31: vector::insert($t20, $t21, $t22) + 32: goto 18 + 33: label L3 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: $t24 := move($t4) + 37: vector::destroy_empty($t24) + 38: return () +} + + +[variant baseline] +public fun ascii::is_empty($t0|string: &ascii::String): bool { + var $t1: &ascii::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::length($t0|string: &ascii::String): u64 { + var $t1: &ascii::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := ascii::as_bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::all_characters_printable($t0|string: &ascii::String): bool { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|i#1#12: u64 + var $t4|i#1#9: u64 + var $t5|stop#1#9: u64 + var $t6|v#1#3: &vector + var $t7: &ascii::String + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u64 + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool + var $t25: u64 + var $t26: u64 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + 0: $t7 := move($t0) + 1: $t8 := borrow_field.bytes($t7) + 2: $t6 := $t8 + 3: $t9 := copy($t6) + 4: $t10 := vector::length($t9) + 5: $t1 := $t10 + 6: $t11 := 0 + 7: $t4 := $t11 + 8: $t12 := move($t1) + 9: $t5 := $t12 + 10: goto 11 + 11: label L5 + 12: $t13 := copy($t4) + 13: $t14 := copy($t5) + 14: $t15 := <($t13, $t14) + 15: if ($t15) goto 16 else goto 38 + 16: label L1 + 17: $t16 := copy($t4) + 18: $t3 := $t16 + 19: $t17 := copy($t6) + 20: $t18 := move($t3) + 21: $t19 := vector::borrow($t17, $t18) + 22: $t20 := read_ref($t19) + 23: $t21 := ascii::is_printable_char($t20) + 24: $t22 := !($t21) + 25: if ($t22) goto 26 else goto 32 + 26: label L3 + 27: $t23 := move($t6) + 28: destroy($t23) + 29: $t24 := false + 30: $t2 := $t24 + 31: goto 44 + 32: label L2 + 33: $t25 := move($t4) + 34: $t26 := 1 + 35: $t27 := +($t25, $t26) + 36: $t4 := $t27 + 37: goto 11 + 38: label L0 + 39: $t28 := move($t6) + 40: destroy($t28) + 41: $t29 := true + 42: $t2 := $t29 + 43: goto 44 + 44: label L4 + 45: $t30 := move($t2) + 46: return $t30 +} + + +[variant baseline] +public fun ascii::string($t0|bytes: vector): ascii::String { + var $t1|x#1#0: option::Option + var $t2: vector + var $t3: option::Option + var $t4: &option::Option + var $t5: bool + var $t6: u64 + var $t7: option::Option + var $t8: ascii::String + 0: $t2 := move($t0) + 1: $t3 := ascii::try_string($t2) + 2: $t1 := $t3 + 3: $t4 := borrow_local($t1) + 4: $t5 := option::is_some($t4) + 5: if ($t5) goto 6 else goto 8 + 6: label L1 + 7: goto 11 + 8: label L0 + 9: $t6 := 65536 + 10: abort($t6) + 11: label L2 + 12: $t7 := move($t1) + 13: $t8 := option::destroy_some($t7) + 14: return $t8 +} + + +[variant baseline] +public fun ascii::as_bytes($t0|string: &ascii::String): &vector { + var $t1: &ascii::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::byte($t0|char: ascii::Char): u8 { + var $t1: ascii::Char + var $t2: u8 + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::Char($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::char($t0|byte: u8): ascii::Char { + var $t1: u8 + var $t2: bool + var $t3: u64 + var $t4: u8 + var $t5: ascii::Char + 0: $t1 := copy($t0) + 1: $t2 := ascii::is_valid_char($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 65536 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack ascii::Char($t4) + 11: return $t5 +} + + +[variant baseline] +fun ascii::char_to_lowercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 65 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 90 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := +($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +fun ascii::char_to_uppercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 97 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 122 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := -($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +public fun ascii::into_bytes($t0|string: ascii::String): vector { + var $t1: ascii::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::is_printable_char($t0|byte: u8): bool { + var $t1|tmp#$1: bool + var $t2: u8 + var $t3: u8 + var $t4: bool + var $t5: u8 + var $t6: u8 + var $t7: bool + var $t8: bool + var $t9: bool + 0: $t2 := copy($t0) + 1: $t3 := 32 + 2: $t4 := >=($t2, $t3) + 3: if ($t4) goto 4 else goto 10 + 4: label L1 + 5: $t5 := move($t0) + 6: $t6 := 126 + 7: $t7 := <=($t5, $t6) + 8: $t1 := $t7 + 9: goto 14 + 10: label L0 + 11: $t8 := false + 12: $t1 := $t8 + 13: goto 14 + 14: label L2 + 15: $t9 := move($t1) + 16: return $t9 +} + + +[variant baseline] +public fun ascii::is_valid_char($t0|b: u8): bool { + var $t1: u8 + var $t2: u8 + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := 127 + 2: $t3 := <=($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::pop_char($t0|string: &mut ascii::String): ascii::Char { + var $t1: &mut ascii::String + var $t2: &mut vector + var $t3: u8 + var $t4: ascii::Char + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::pop_back($t2) + 3: $t4 := pack ascii::Char($t3) + 4: return $t4 +} + + +[variant baseline] +public fun ascii::push_char($t0|string: &mut ascii::String, $t1|char: ascii::Char) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: &ascii::Char + var $t5: &u8 + var $t6: u8 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.byte($t4) + 4: $t6 := read_ref($t5) + 5: vector::push_back($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun ascii::substring($t0|string: &ascii::String, $t1|i: u64, $t2|j: u64): ascii::String { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|i#1#3: u64 + var $t6|i#1#6: u64 + var $t7|stop#1#3: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: &ascii::String + var $t13: u64 + var $t14: bool + var $t15: bool + var $t16: bool + var $t17: &ascii::String + var $t18: u64 + var $t19: vector + var $t20: u64 + var $t21: u64 + var $t22: u64 + var $t23: u64 + var $t24: bool + var $t25: u64 + var $t26: &mut vector + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: &u8 + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &ascii::String + var $t36: vector + var $t37: ascii::String + 0: $t8 := copy($t1) + 1: $t9 := copy($t2) + 2: $t10 := <=($t8, $t9) + 3: if ($t10) goto 4 else goto 11 + 4: label L1 + 5: $t11 := copy($t2) + 6: $t12 := copy($t0) + 7: $t13 := ascii::length($t12) + 8: $t14 := <=($t11, $t13) + 9: $t3 := $t14 + 10: goto 15 + 11: label L0 + 12: $t15 := false + 13: $t3 := $t15 + 14: goto 15 + 15: label L2 + 16: $t16 := move($t3) + 17: if ($t16) goto 18 else goto 20 + 18: label L4 + 19: goto 25 + 20: label L3 + 21: $t17 := move($t0) + 22: destroy($t17) + 23: $t18 := 65537 + 24: abort($t18) + 25: label L5 + 26: $t19 := [] + 27: $t4 := $t19 + 28: $t20 := move($t1) + 29: $t5 := $t20 + 30: $t21 := move($t2) + 31: $t7 := $t21 + 32: goto 33 + 33: label L8 + 34: $t22 := copy($t5) + 35: $t23 := copy($t7) + 36: $t24 := <($t22, $t23) + 37: if ($t24) goto 38 else goto 53 + 38: label L7 + 39: $t25 := copy($t5) + 40: $t6 := $t25 + 41: $t26 := borrow_local($t4) + 42: $t27 := copy($t0) + 43: $t28 := borrow_field.bytes($t27) + 44: $t29 := move($t6) + 45: $t30 := vector::borrow($t28, $t29) + 46: $t31 := read_ref($t30) + 47: vector::push_back($t26, $t31) + 48: $t32 := move($t5) + 49: $t33 := 1 + 50: $t34 := +($t32, $t33) + 51: $t5 := $t34 + 52: goto 33 + 53: label L6 + 54: $t35 := move($t0) + 55: destroy($t35) + 56: $t36 := move($t4) + 57: $t37 := pack ascii::String($t36) + 58: return $t37 +} + + +[variant baseline] +public fun ascii::to_lowercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_lowercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} + + +[variant baseline] +public fun ascii::to_uppercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_uppercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} + + +[variant baseline] +public fun ascii::try_string($t0|bytes: vector): option::Option { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|tmp#$3: option::Option + var $t4|i#1#12: u64 + var $t5|i#1#9: u64 + var $t6|stop#1#9: u64 + var $t7|v#1#3: &vector + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u64 + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool + var $t25: u64 + var $t26: u64 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + var $t31: vector + var $t32: ascii::String + var $t33: option::Option + var $t34: option::Option + var $t35: option::Option + 0: $t8 := borrow_local($t0) + 1: $t7 := $t8 + 2: $t9 := copy($t7) + 3: $t10 := vector::length($t9) + 4: $t1 := $t10 + 5: $t11 := 0 + 6: $t5 := $t11 + 7: $t12 := move($t1) + 8: $t6 := $t12 + 9: goto 10 + 10: label L5 + 11: $t13 := copy($t5) + 12: $t14 := copy($t6) + 13: $t15 := <($t13, $t14) + 14: if ($t15) goto 15 else goto 37 + 15: label L1 + 16: $t16 := copy($t5) + 17: $t4 := $t16 + 18: $t17 := copy($t7) + 19: $t18 := move($t4) + 20: $t19 := vector::borrow($t17, $t18) + 21: $t20 := read_ref($t19) + 22: $t21 := ascii::is_valid_char($t20) + 23: $t22 := !($t21) + 24: if ($t22) goto 25 else goto 31 + 25: label L3 + 26: $t23 := move($t7) + 27: destroy($t23) + 28: $t24 := false + 29: $t2 := $t24 + 30: goto 43 + 31: label L2 + 32: $t25 := move($t5) + 33: $t26 := 1 + 34: $t27 := +($t25, $t26) + 35: $t5 := $t27 + 36: goto 10 + 37: label L0 + 38: $t28 := move($t7) + 39: destroy($t28) + 40: $t29 := true + 41: $t2 := $t29 + 42: goto 43 + 43: label L4 + 44: $t30 := move($t2) + 45: if ($t30) goto 46 else goto 52 + 46: label L7 + 47: $t31 := move($t0) + 48: $t32 := pack ascii::String($t31) + 49: $t33 := option::some($t32) + 50: $t3 := $t33 + 51: goto 56 + 52: label L6 + 53: $t34 := option::none() + 54: $t3 := $t34 + 55: goto 56 + 56: label L8 + 57: $t35 := move($t3) + 58: return $t35 +} + + +[variant baseline] +public fun string::append($t0|s: &mut string::String, $t1|r: string::String) { + var $t2: &mut string::String + var $t3: &mut vector + var $t4: &string::String + var $t5: &vector + var $t6: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := read_ref($t5) + 5: vector::append($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun string::index_of($t0|s: &string::String, $t1|r: &string::String): u64 { + var $t2: &string::String + var $t3: &vector + var $t4: &string::String + var $t5: &vector + var $t6: u64 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := string::internal_index_of($t3, $t5) + 5: return $t6 +} + + +[variant baseline] +public fun string::insert($t0|s: &mut string::String, $t1|at: u64, $t2|o: string::String) { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: &vector + var $t5|end#1#0: string::String + var $t6|front#1#0: string::String + var $t7|l#1#0: u64 + var $t8: &mut string::String + var $t9: &vector + var $t10: u64 + var $t11: &vector + var $t12: u64 + var $t13: bool + var $t14: &vector + var $t15: u64 + var $t16: bool + var $t17: &vector + var $t18: bool + var $t19: bool + var $t20: &mut string::String + var $t21: u64 + var $t22: &mut string::String + var $t23: &string::String + var $t24: u64 + var $t25: &mut string::String + var $t26: &string::String + var $t27: u64 + var $t28: u64 + var $t29: string::String + var $t30: &mut string::String + var $t31: &string::String + var $t32: u64 + var $t33: u64 + var $t34: string::String + var $t35: &mut string::String + var $t36: string::String + var $t37: &mut string::String + var $t38: string::String + var $t39: string::String + var $t40: &mut string::String + 0: $t8 := copy($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t4 := $t9 + 3: $t10 := copy($t1) + 4: $t11 := copy($t4) + 5: $t12 := vector::length($t11) + 6: $t13 := <=($t10, $t12) + 7: if ($t13) goto 8 else goto 14 + 8: label L1 + 9: $t14 := move($t4) + 10: $t15 := copy($t1) + 11: $t16 := string::internal_is_char_boundary($t14, $t15) + 12: $t3 := $t16 + 13: goto 20 + 14: label L0 + 15: $t17 := move($t4) + 16: destroy($t17) + 17: $t18 := false + 18: $t3 := $t18 + 19: goto 20 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 25 + 23: label L4 + 24: goto 30 + 25: label L3 + 26: $t20 := move($t0) + 27: destroy($t20) + 28: $t21 := 2 + 29: abort($t21) + 30: label L5 + 31: $t22 := copy($t0) + 32: $t23 := freeze_ref($t22) + 33: $t24 := string::length($t23) + 34: $t7 := $t24 + 35: $t25 := copy($t0) + 36: $t26 := freeze_ref($t25) + 37: $t27 := 0 + 38: $t28 := copy($t1) + 39: $t29 := string::substring($t26, $t27, $t28) + 40: $t6 := $t29 + 41: $t30 := copy($t0) + 42: $t31 := freeze_ref($t30) + 43: $t32 := move($t1) + 44: $t33 := move($t7) + 45: $t34 := string::substring($t31, $t32, $t33) + 46: $t5 := $t34 + 47: $t35 := borrow_local($t6) + 48: $t36 := move($t2) + 49: string::append($t35, $t36) + 50: $t37 := borrow_local($t6) + 51: $t38 := move($t5) + 52: string::append($t37, $t38) + 53: $t39 := move($t6) + 54: $t40 := move($t0) + 55: write_ref($t40, $t39) + 56: return () +} + + +[variant baseline] +public fun string::is_empty($t0|s: &string::String): bool { + var $t1: &string::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::length($t0|s: &string::String): u64 { + var $t1: &string::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::as_bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::into_bytes($t0|s: string::String): vector { + var $t1: string::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack string::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := string::as_bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::substring($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3|tmp#$3: bool + var $t4|tmp#$4: bool + var $t5|tmp#$5: bool + var $t6|bytes#1#0: &vector + var $t7|l#1#0: u64 + var $t8: &string::String + var $t9: &vector + var $t10: &vector + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: bool + var $t15: u64 + var $t16: u64 + var $t17: bool + var $t18: bool + var $t19: bool + var $t20: &vector + var $t21: u64 + var $t22: bool + var $t23: bool + var $t24: bool + var $t25: &vector + var $t26: u64 + var $t27: bool + var $t28: bool + var $t29: bool + var $t30: &vector + var $t31: u64 + var $t32: &vector + var $t33: u64 + var $t34: u64 + var $t35: vector + var $t36: string::String + 0: $t8 := move($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t6 := $t9 + 3: $t10 := copy($t6) + 4: $t11 := vector::length($t10) + 5: $t7 := $t11 + 6: $t12 := copy($t2) + 7: $t13 := move($t7) + 8: $t14 := <=($t12, $t13) + 9: if ($t14) goto 10 else goto 16 + 10: label L1 + 11: $t15 := copy($t1) + 12: $t16 := copy($t2) + 13: $t17 := <=($t15, $t16) + 14: $t3 := $t17 + 15: goto 20 + 16: label L0 + 17: $t18 := false + 18: $t3 := $t18 + 19: goto 20 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 29 + 23: label L4 + 24: $t20 := copy($t6) + 25: $t21 := copy($t1) + 26: $t22 := string::internal_is_char_boundary($t20, $t21) + 27: $t4 := $t22 + 28: goto 33 + 29: label L3 + 30: $t23 := false + 31: $t4 := $t23 + 32: goto 33 + 33: label L5 + 34: $t24 := move($t4) + 35: if ($t24) goto 36 else goto 42 + 36: label L7 + 37: $t25 := copy($t6) + 38: $t26 := copy($t2) + 39: $t27 := string::internal_is_char_boundary($t25, $t26) + 40: $t5 := $t27 + 41: goto 46 + 42: label L6 + 43: $t28 := false + 44: $t5 := $t28 + 45: goto 46 + 46: label L8 + 47: $t29 := move($t5) + 48: if ($t29) goto 49 else goto 51 + 49: label L10 + 50: goto 56 + 51: label L9 + 52: $t30 := move($t6) + 53: destroy($t30) + 54: $t31 := 2 + 55: abort($t31) + 56: label L11 + 57: $t32 := move($t6) + 58: $t33 := move($t1) + 59: $t34 := move($t2) + 60: $t35 := string::internal_sub_string($t32, $t33, $t34) + 61: $t36 := pack string::String($t35) + 62: return $t36 +} + + +[variant baseline] +public fun string::append_utf8($t0|s: &mut string::String, $t1|bytes: vector) { + var $t2: &mut string::String + var $t3: vector + var $t4: string::String + 0: $t2 := move($t0) + 1: $t3 := move($t1) + 2: $t4 := string::utf8($t3) + 3: string::append($t2, $t4) + 4: return () +} + + +[variant baseline] +public fun string::from_ascii($t0|s: ascii::String): string::String { + var $t1: ascii::String + var $t2: vector + var $t3: string::String + 0: $t1 := move($t0) + 1: $t2 := ascii::into_bytes($t1) + 2: $t3 := pack string::String($t2) + 3: return $t3 +} + + +[variant baseline] +native fun string::internal_check_utf8($t0|v: &vector): bool; + + +[variant baseline] +native fun string::internal_index_of($t0|v: &vector, $t1|r: &vector): u64; + + +[variant baseline] +native fun string::internal_is_char_boundary($t0|v: &vector, $t1|i: u64): bool; + + +[variant baseline] +native fun string::internal_sub_string($t0|v: &vector, $t1|i: u64, $t2|j: u64): vector; + + +[variant baseline] +public fun string::sub_string($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3: &string::String + var $t4: u64 + var $t5: u64 + var $t6: string::String + 0: $t3 := move($t0) + 1: $t4 := move($t1) + 2: $t5 := move($t2) + 3: $t6 := string::substring($t3, $t4, $t5) + 4: return $t6 +} + + +[variant baseline] +public fun string::to_ascii($t0|s: string::String): ascii::String { + var $t1: string::String + var $t2: vector + var $t3: ascii::String + 0: $t1 := move($t0) + 1: $t2 := unpack string::String($t1) + 2: $t3 := ascii::string($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::try_utf8($t0|bytes: vector): option::Option { + var $t1|tmp#$1: option::Option + var $t2: &vector + var $t3: bool + var $t4: vector + var $t5: string::String + var $t6: option::Option + var $t7: option::Option + var $t8: option::Option + 0: $t2 := borrow_local($t0) + 1: $t3 := string::internal_check_utf8($t2) + 2: if ($t3) goto 3 else goto 9 + 3: label L1 + 4: $t4 := move($t0) + 5: $t5 := pack string::String($t4) + 6: $t6 := option::some($t5) + 7: $t1 := $t6 + 8: goto 13 + 9: label L0 + 10: $t7 := option::none() + 11: $t1 := $t7 + 12: goto 13 + 13: label L2 + 14: $t8 := move($t1) + 15: return $t8 +} + + +[variant baseline] +public fun string::utf8($t0|bytes: vector): string::String { + var $t1: &vector + var $t2: bool + var $t3: u64 + var $t4: vector + var $t5: string::String + 0: $t1 := borrow_local($t0) + 1: $t2 := string::internal_check_utf8($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 1 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack string::String($t4) + 11: return $t5 +} + + +[variant baseline] +public fun Collection::borrow_mut<#0>($t0|c: &mut Collection::Collection<#0>, $t1|i: u64): &mut #0 { + var $t2: &mut Collection::Collection<#0> + var $t3: &mut vector<#0> + var $t4: u64 + var $t5: &mut #0 + 0: $t2 := move($t0) + 1: $t3 := borrow_field>.items($t2) + 2: $t4 := move($t1) + 3: $t5 := vector::borrow_mut<#0>($t3, $t4) + 4: return $t5 +} + + +[variant baseline] +public fun Collection::make_collection<#0>(): Collection::Collection<#0> { + var $t0: vector<#0> + var $t1: address + var $t2: Collection::Collection<#0> + 0: $t0 := vector::empty<#0>() + 1: $t1 := 0x2 + 2: $t2 := pack Collection::Collection<#0>($t0, $t1) + 3: return $t2 +} + + +[variant baseline] +public fun Test::foo<#0>($t0|i: u64) { + var $t1|c#1#0: Collection::Collection> + var $t2|t#1#0: &mut Test::Token<#0> + var $t3: Collection::Collection> + var $t4: &mut Collection::Collection> + var $t5: u64 + var $t6: &mut Test::Token<#0> + var $t7: u64 + var $t8: &mut Test::Token<#0> + var $t9: &mut u64 + 0: $t3 := Collection::make_collection>() + 1: $t1 := $t3 + 2: $t4 := borrow_local($t1) + 3: $t5 := move($t0) + 4: $t6 := Collection::borrow_mut>($t4, $t5) + 5: $t2 := $t6 + 6: $t7 := 0 + 7: $t8 := move($t2) + 8: $t9 := borrow_field>.value($t8) + 9: write_ref($t9, $t7) + 10: return () +} + +============ after pipeline `borrow` ================ + +[variant baseline] +public fun u64::diff($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: bool + 0: $t5 := >($t0, $t1) + 1: if ($t5) goto 2 else goto 5 + 2: label L1 + 3: $t2 := -($t0, $t1) + 4: goto 7 + 5: label L0 + 6: $t2 := -($t1, $t0) + 7: label L2 + 8: return $t2 +} + + +[variant baseline] +public fun u64::divide_and_round_up($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: u64 + 0: $t5 := %($t0, $t1) + 1: $t6 := 0 + 2: $t7 := ==($t5, $t6) + 3: if ($t7) goto 4 else goto 7 + 4: label L1 + 5: $t2 := /($t0, $t1) + 6: goto 11 + 7: label L0 + 8: $t8 := /($t0, $t1) + 9: $t9 := 1 + 10: $t2 := +($t8, $t9) + 11: label L2 + 12: return $t2 +} + + +[variant baseline] +public fun u64::max($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: bool + 0: $t5 := >($t0, $t1) + 1: if ($t5) goto 2 else goto 5 + 2: label L1 + 3: $t2 := $t0 + 4: goto 7 + 5: label L0 + 6: $t2 := $t1 + 7: label L2 + 8: return $t2 +} + + +[variant baseline] +public fun u64::min($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: bool + 0: $t5 := <($t0, $t1) + 1: if ($t5) goto 2 else goto 5 + 2: label L1 + 3: $t2 := $t0 + 4: goto 7 + 5: label L0 + 6: $t2 := $t1 + 7: label L2 + 8: return $t2 +} + + +[variant baseline] +public fun u64::pow($t0|base: u64, $t1|exponent: u8): u64 { + var $t2|base#1#1: u64 + var $t3|exponent#1#1: u8 + var $t4|res#1#1: u64 + var $t5: u64 + var $t6: u8 + var $t7: bool + var $t8: u8 + var $t9: u8 + var $t10: u8 + var $t11: bool + var $t12: u8 + var $t13: u8 + 0: $t2 := $t0 + 1: $t3 := $t1 + 2: $t5 := 1 + 3: $t4 := $t5 + 4: label L5 + 5: $t6 := 1 + 6: $t7 := >=($t3, $t6) + 7: if ($t7) goto 8 else goto 25 + 8: label L1 + 9: label L2 + 10: $t8 := 2 + 11: $t9 := %($t3, $t8) + 12: $t10 := 0 + 13: $t11 := ==($t9, $t10) + 14: if ($t11) goto 15 else goto 20 + 15: label L4 + 16: $t2 := *($t2, $t2) + 17: $t12 := 2 + 18: $t3 := /($t3, $t12) + 19: goto 4 + 20: label L3 + 21: $t4 := *($t4, $t2) + 22: $t13 := 1 + 23: $t3 := -($t3, $t13) + 24: goto 4 + 25: label L0 + 26: return $t4 +} + + +[variant baseline] +public fun u64::sqrt($t0|x: u64): u64 { + var $t1|bit#1#1: u128 + var $t2|res#1#1: u128 + var $t3|x#1#1: u64 + var $t4|x#2#1: u128 + var $t5: u128 + var $t6: u128 + var $t7: u128 + var $t8: bool + var $t9: u128 + var $t10: bool + var $t11: u128 + var $t12: u8 + var $t13: u128 + var $t14: u8 + var $t15: u8 + var $t16: u64 + 0: $t5 := 18446744073709551616 + 1: $t1 := $t5 + 2: $t6 := 0 + 3: $t2 := $t6 + 4: $t4 := (u128)($t0) + 5: label L6 + 6: $t7 := 0 + 7: $t8 := !=($t1, $t7) + 8: if ($t8) goto 9 else goto 28 + 9: label L1 + 10: label L2 + 11: $t9 := +($t2, $t1) + 12: $t10 := >=($t4, $t9) + 13: if ($t10) goto 14 else goto 21 + 14: label L4 + 15: $t11 := +($t2, $t1) + 16: $t4 := -($t4, $t11) + 17: $t12 := 1 + 18: $t13 := >>($t2, $t12) + 19: $t2 := +($t13, $t1) + 20: goto 24 + 21: label L3 + 22: $t14 := 1 + 23: $t2 := >>($t2, $t14) + 24: label L5 + 25: $t15 := 2 + 26: $t1 := >>($t1, $t15) + 27: goto 5 + 28: label L0 + 29: $t16 := (u64)($t2) + 30: return $t16 +} + + +[variant baseline] +public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { + var $t2: &mut vector<#0> + var $t3: vector<#0> + var $t4: bool + var $t5: bool + var $t6: &mut vector<#0> + var $t7: #0 + var $t8: vector<#0> + 0: $t2 := borrow_local($t1) + 1: vector::reverse<#0>($t2) + 2: label L3 + 3: $t3 := copy($t1) + 4: $t4 := vector::is_empty<#0>($t3) + 5: $t5 := !($t4) + 6: if ($t5) goto 7 else goto 13 + 7: label L1 + 8: label L2 + 9: $t6 := borrow_local($t1) + 10: $t7 := vector::pop_back<#0>($t6) + 11: vector::push_back<#0>($t0, $t7) + 12: goto 2 + 13: label L0 + 14: destroy($t0) + 15: $t8 := move($t1) + 16: vector::destroy_empty<#0>($t8) + 17: trace_local[lhs]($t0) + 18: return () +} + + +[variant baseline] +public native fun vector::borrow<#0>($t0|v: vector<#0>, $t1|i: u64): #0; + + +[variant baseline] +public native fun vector::borrow_mut<#0>($t0|v: &mut vector<#0>, $t1|i: u64): &mut #0; + + +[variant baseline] +public fun vector::contains<#0>($t0|v: vector<#0>, $t1|e: #0): bool { + var $t2|i#1#0: u64 + var $t3|len#1#0: u64 + var $t4: u64 + var $t5: u64 + var $t6: bool + var $t7: #0 + var $t8: bool + var $t9: bool + var $t10: u64 + var $t11: bool + 0: $t4 := 0 + 1: $t2 := $t4 + 2: $t5 := vector::length<#0>($t0) + 3: label L5 + 4: $t6 := <($t2, $t5) + 5: if ($t6) goto 6 else goto 18 + 6: label L1 + 7: label L2 + 8: $t7 := vector::borrow<#0>($t0, $t2) + 9: $t8 := ==($t7, $t1) 10: if ($t8) goto 11 else goto 14 11: label L4 12: $t9 := true 13: return $t9 14: label L3 - 15: $t10 := 1 - 16: $t2 := +($t2, $t10) - 17: goto 3 - 18: label L0 - 19: $t11 := false - 20: return $t11 + 15: $t10 := 1 + 16: $t2 := +($t2, $t10) + 17: goto 3 + 18: label L0 + 19: $t11 := false + 20: return $t11 +} + + +[variant baseline] +public native fun vector::destroy_empty<#0>($t0|v: vector<#0>); + + +[variant baseline] +public native fun vector::empty<#0>(): vector<#0>; + + +[variant baseline] +public fun vector::index_of<#0>($t0|v: vector<#0>, $t1|e: #0): (bool, u64) { + var $t2|i#1#0: u64 + var $t3|len#1#0: u64 + var $t4: u64 + var $t5: u64 + var $t6: bool + var $t7: #0 + var $t8: bool + var $t9: bool + var $t10: u64 + var $t11: bool + var $t12: u64 + 0: $t4 := 0 + 1: $t2 := $t4 + 2: $t5 := vector::length<#0>($t0) + 3: label L5 + 4: $t6 := <($t2, $t5) + 5: if ($t6) goto 6 else goto 18 + 6: label L1 + 7: label L2 + 8: $t7 := vector::borrow<#0>($t0, $t2) + 9: $t8 := ==($t7, $t1) + 10: if ($t8) goto 11 else goto 14 + 11: label L4 + 12: $t9 := true + 13: return ($t9, $t2) + 14: label L3 + 15: $t10 := 1 + 16: $t2 := +($t2, $t10) + 17: goto 3 + 18: label L0 + 19: $t11 := false + 20: $t12 := 0 + 21: return ($t11, $t12) +} + + +[variant baseline] +public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { + var $t3|len#1#0: u64 + var $t4: vector<#0> + var $t5: u64 + var $t6: bool + var $t7: u64 + var $t8: bool + var $t9: u64 + 0: $t4 := read_ref($t0) + 1: $t5 := vector::length<#0>($t4) + 2: $t6 := >($t2, $t5) + 3: if ($t6) goto 4 else goto 8 + 4: label L1 + 5: destroy($t0) + 6: $t7 := 131072 + 7: abort($t7) + 8: label L0 + 9: vector::push_back<#0>($t0, $t1) + 10: label L4 + 11: $t8 := <($t2, $t5) + 12: if ($t8) goto 13 else goto 18 + 13: label L3 + 14: vector::swap<#0>($t0, $t2, $t5) + 15: $t9 := 1 + 16: $t2 := +($t2, $t9) + 17: goto 10 + 18: label L2 + 19: destroy($t0) + 20: trace_local[v]($t0) + 21: return () +} + + +[variant baseline] +public fun vector::is_empty<#0>($t0|v: vector<#0>): bool { + var $t1: u64 + var $t2: u64 + var $t3: bool + 0: $t1 := vector::length<#0>($t0) + 1: $t2 := 0 + 2: $t3 := ==($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +public native fun vector::length<#0>($t0|v: vector<#0>): u64; + + +[variant baseline] +public native fun vector::pop_back<#0>($t0|v: &mut vector<#0>): #0; + + +[variant baseline] +public native fun vector::push_back<#0>($t0|v: &mut vector<#0>, $t1|e: #0); + + +[variant baseline] +public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { + var $t2|tmp#$2: u64 + var $t3|tmp#$3: &mut vector<#0> + var $t4|len#1#0: u64 + var $t5: vector<#0> + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: bool + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: #0 + 0: $t5 := read_ref($t0) + 1: $t6 := vector::length<#0>($t5) + 2: $t7 := >=($t1, $t6) + 3: if ($t7) goto 4 else goto 8 + 4: label L1 + 5: destroy($t0) + 6: $t8 := 131072 + 7: abort($t8) + 8: label L0 + 9: $t9 := 1 + 10: $t10 := -($t6, $t9) + 11: label L4 + 12: $t11 := <($t1, $t10) + 13: if ($t11) goto 14 else goto 21 + 14: label L3 + 15: $t12 := copy($t1) + 16: $t13 := 1 + 17: $t14 := +($t1, $t13) + 18: $t1 := $t14 + 19: vector::swap<#0>($t0, $t12, $t14) + 20: goto 11 + 21: label L2 + 22: $t15 := vector::pop_back<#0>($t0) + 23: trace_local[v]($t0) + 24: return $t15 +} + + +[variant baseline] +public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { + var $t1|back_index#1#0: u64 + var $t2|front_index#1#0: u64 + var $t3|len#1#0: u64 + var $t4: vector<#0> + var $t5: u64 + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: u64 + 0: $t4 := read_ref($t0) + 1: $t5 := vector::length<#0>($t4) + 2: $t6 := 0 + 3: $t7 := ==($t5, $t6) + 4: if ($t7) goto 5 else goto 9 + 5: label L1 + 6: destroy($t0) + 7: trace_local[v]($t0) + 8: return () + 9: label L0 + 10: $t8 := 0 + 11: $t2 := $t8 + 12: $t9 := 1 + 13: $t1 := -($t5, $t9) + 14: label L4 + 15: $t10 := <($t2, $t1) + 16: if ($t10) goto 17 else goto 24 + 17: label L3 + 18: vector::swap<#0>($t0, $t2, $t1) + 19: $t11 := 1 + 20: $t2 := +($t2, $t11) + 21: $t12 := 1 + 22: $t1 := -($t1, $t12) + 23: goto 14 + 24: label L2 + 25: destroy($t0) + 26: trace_local[v]($t0) + 27: return () +} + + +[variant baseline] +public fun vector::singleton<#0>($t0|e: #0): vector<#0> { + var $t1|v#1#0: vector<#0> + var $t2: &mut vector<#0> + var $t3: vector<#0> + 0: $t1 := vector::empty<#0>() + 1: $t2 := borrow_local($t1) + 2: vector::push_back<#0>($t2, $t0) + 3: $t3 := move($t1) + 4: return $t3 +} + + +[variant baseline] +public native fun vector::swap<#0>($t0|v: &mut vector<#0>, $t1|i: u64, $t2|j: u64); + + +[variant baseline] +public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { + var $t2|last_idx#1#0: u64 + var $t3: vector<#0> + var $t4: bool + var $t5: bool + var $t6: u64 + var $t7: vector<#0> + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: #0 + 0: $t3 := read_ref($t0) + 1: $t4 := vector::is_empty<#0>($t3) + 2: $t5 := !($t4) + 3: if ($t5) goto 4 else goto 6 + 4: label L1 + 5: goto 10 + 6: label L0 + 7: destroy($t0) + 8: $t6 := 131072 + 9: abort($t6) + 10: label L2 + 11: $t7 := read_ref($t0) + 12: $t8 := vector::length<#0>($t7) + 13: $t9 := 1 + 14: $t10 := -($t8, $t9) + 15: vector::swap<#0>($t0, $t1, $t10) + 16: $t11 := vector::pop_back<#0>($t0) + 17: trace_local[v]($t0) + 18: return $t11 +} + + +[variant baseline] +public fun option::borrow<#0>($t0|t: option::Option<#0>): #0 { + var $t1: bool + var $t2: u64 + var $t3: vector<#0> + var $t4: u64 + var $t5: #0 + 0: $t1 := option::is_some<#0>($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 262145 + 6: abort($t2) + 7: label L2 + 8: $t3 := get_field>.vec($t0) + 9: $t4 := 0 + 10: $t5 := vector::borrow<#0>($t3, $t4) + 11: return $t5 +} + + +[variant baseline] +public fun option::borrow_mut<#0>($t0|t: &mut option::Option<#0>): &mut #0 { + var $t1: option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: &mut vector<#0> + var $t5: u64 + var $t6: &mut #0 + 0: $t1 := read_ref($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 9 + 5: label L0 + 6: destroy($t0) + 7: $t3 := 262145 + 8: abort($t3) + 9: label L2 + 10: $t4 := borrow_field>.vec($t0) + 11: $t5 := 0 + 12: $t6 := vector::borrow_mut<#0>($t4, $t5) + 13: trace_local[t]($t0) + 14: return $t6 +} + + +[variant baseline] +public fun option::contains<#0>($t0|t: option::Option<#0>, $t1|e_ref: #0): bool { + var $t2: vector<#0> + var $t3: bool + 0: $t2 := get_field>.vec($t0) + 1: $t3 := vector::contains<#0>($t2, $t1) + 2: return $t3 +} + + +[variant baseline] +public fun option::swap<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): #0 { + var $t2|old_value#1#0: #0 + var $t3|vec_ref#1#0: &mut vector<#0> + var $t4: option::Option<#0> + var $t5: bool + var $t6: u64 + var $t7: &mut vector<#0> + var $t8: #0 + 0: $t4 := read_ref($t0) + 1: $t5 := option::is_some<#0>($t4) + 2: if ($t5) goto 3 else goto 5 + 3: label L1 + 4: goto 9 + 5: label L0 + 6: destroy($t0) + 7: $t6 := 262145 + 8: abort($t6) + 9: label L2 + 10: $t7 := borrow_field>.vec($t0) + 11: $t8 := vector::pop_back<#0>($t7) + 12: vector::push_back<#0>($t7, $t1) + 13: trace_local[t]($t0) + 14: return $t8 +} + + +[variant baseline] +public fun option::borrow_with_default<#0>($t0|t: option::Option<#0>, $t1|default_ref: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: u64 + 0: $t4 := get_field>.vec($t0) + 1: $t5 := vector::is_empty<#0>($t4) + 2: if ($t5) goto 3 else goto 6 + 3: label L1 + 4: $t2 := $t1 + 5: goto 9 + 6: label L0 + 7: $t6 := 0 + 8: $t2 := vector::borrow<#0>($t4, $t6) + 9: label L2 + 10: return $t2 +} + + +[variant baseline] +public fun option::destroy_none<#0>($t0|t: option::Option<#0>) { + var $t1: bool + var $t2: u64 + var $t3: vector<#0> + 0: $t1 := option::is_none<#0>($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 262144 + 6: abort($t2) + 7: label L2 + 8: $t3 := unpack option::Option<#0>($t0) + 9: vector::destroy_empty<#0>($t3) + 10: return () +} + + +[variant baseline] +public fun option::destroy_some<#0>($t0|t: option::Option<#0>): #0 { + var $t1|elem#1#0: #0 + var $t2|vec#1#0: vector<#0> + var $t3: bool + var $t4: u64 + var $t5: &mut vector<#0> + var $t6: #0 + var $t7: vector<#0> + 0: $t3 := option::is_some<#0>($t0) + 1: if ($t3) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t4 := 262145 + 6: abort($t4) + 7: label L2 + 8: $t2 := unpack option::Option<#0>($t0) + 9: $t5 := borrow_local($t2) + 10: $t6 := vector::pop_back<#0>($t5) + 11: $t7 := move($t2) + 12: vector::destroy_empty<#0>($t7) + 13: return $t6 +} + + +[variant baseline] +public fun option::destroy_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec#1#0: vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: &mut vector<#0> + 0: $t3 := unpack option::Option<#0>($t0) + 1: $t4 := copy($t3) + 2: $t5 := vector::is_empty<#0>($t4) + 3: if ($t5) goto 4 else goto 7 + 4: label L1 + 5: $t2 := $t1 + 6: goto 10 + 7: label L0 + 8: $t6 := borrow_local($t3) + 9: $t2 := vector::pop_back<#0>($t6) + 10: label L2 + 11: return $t2 +} + + +[variant baseline] +public fun option::extract<#0>($t0|t: &mut option::Option<#0>): #0 { + var $t1: option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: &mut vector<#0> + var $t5: #0 + 0: $t1 := read_ref($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 9 + 5: label L0 + 6: destroy($t0) + 7: $t3 := 262145 + 8: abort($t3) + 9: label L2 + 10: $t4 := borrow_field>.vec($t0) + 11: $t5 := vector::pop_back<#0>($t4) + 12: trace_local[t]($t0) + 13: return $t5 +} + + +[variant baseline] +public fun option::fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0) { + var $t2|vec_ref#1#0: &mut vector<#0> + var $t3: &mut vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: u64 + 0: $t3 := borrow_field>.vec($t0) + 1: $t4 := read_ref($t3) + 2: $t5 := vector::is_empty<#0>($t4) + 3: if ($t5) goto 4 else goto 14 + 4: label L1 + 5: goto 10 + 6: label L0 + 7: destroy($t3) + 8: $t6 := 262144 + 9: abort($t6) + 10: label L2 + 11: vector::push_back<#0>($t3, $t1) + 12: trace_local[t]($t0) + 13: return () + 14: label L3 + 15: destroy($t0) + 16: goto 6 +} + + +[variant baseline] +public fun option::get_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: vector<#0> + var $t4: vector<#0> + var $t5: bool + var $t6: u64 + var $t7: #0 + 0: $t4 := get_field>.vec($t0) + 1: $t5 := vector::is_empty<#0>($t4) + 2: if ($t5) goto 3 else goto 6 + 3: label L1 + 4: $t2 := $t1 + 5: goto 10 + 6: label L0 + 7: $t6 := 0 + 8: $t7 := vector::borrow<#0>($t4, $t6) + 9: $t2 := $t7 + 10: label L2 + 11: return $t2 +} + + +[variant baseline] +public fun option::is_none<#0>($t0|t: option::Option<#0>): bool { + var $t1: vector<#0> + var $t2: bool + 0: $t1 := get_field>.vec($t0) + 1: $t2 := vector::is_empty<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun option::is_some<#0>($t0|t: option::Option<#0>): bool { + var $t1: vector<#0> + var $t2: bool + var $t3: bool + 0: $t1 := get_field>.vec($t0) + 1: $t2 := vector::is_empty<#0>($t1) + 2: $t3 := !($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::none<#0>(): option::Option<#0> { + var $t0: vector<#0> + var $t1: option::Option<#0> + 0: $t0 := vector::empty<#0>() + 1: $t1 := pack option::Option<#0>($t0) + 2: return $t1 +} + + +[variant baseline] +public fun option::some<#0>($t0|e: #0): option::Option<#0> { + var $t1: vector<#0> + var $t2: option::Option<#0> + 0: $t1 := vector::singleton<#0>($t0) + 1: $t2 := pack option::Option<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun option::swap_or_fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): option::Option<#0> { + var $t2|tmp#$2: option::Option<#0> + var $t3|old_value#1#0: option::Option<#0> + var $t4|vec_ref#1#0: &mut vector<#0> + var $t5: &mut vector<#0> + var $t6: vector<#0> + var $t7: bool + var $t8: #0 + 0: $t5 := borrow_field>.vec($t0) + 1: $t6 := read_ref($t5) + 2: $t7 := vector::is_empty<#0>($t6) + 3: if ($t7) goto 4 else goto 7 + 4: label L1 + 5: $t2 := option::none<#0>() + 6: goto 10 + 7: label L0 + 8: $t8 := vector::pop_back<#0>($t5) + 9: $t2 := option::some<#0>($t8) + 10: label L2 + 11: vector::push_back<#0>($t5, $t1) + 12: trace_local[t]($t0) + 13: return $t2 +} + + +[variant baseline] +public fun option::to_vec<#0>($t0|t: option::Option<#0>): vector<#0> { + var $t1: vector<#0> + 0: $t1 := unpack option::Option<#0>($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::append($t0|string: &mut ascii::String, $t1|other: ascii::String) { + var $t2: &mut vector + var $t3: vector + 0: $t2 := borrow_field.bytes($t0) + 1: $t3 := ascii::into_bytes($t1) + 2: vector::append($t2, $t3) + 3: trace_local[string]($t0) + 4: return () +} + + +[variant baseline] +public fun ascii::index_of($t0|string: ascii::String, $t1|substr: ascii::String): u64 { + var $t2|tmp#$2: bool + var $t3|i#1#0: u64 + var $t4|j#1#0: u64 + var $t5|m#1#0: u64 + var $t6|n#1#0: u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: bool + var $t13: u64 + var $t14: bool + var $t15: vector + var $t16: u64 + var $t17: u8 + var $t18: vector + var $t19: u8 + var $t20: bool + var $t21: u64 + var $t22: bool + var $t23: u64 + 0: $t7 := 0 + 1: $t3 := $t7 + 2: $t8 := ascii::length($t0) + 3: $t9 := ascii::length($t1) + 4: $t10 := <($t8, $t9) + 5: if ($t10) goto 6 else goto 8 + 6: label L1 + 7: return $t8 + 8: label L0 + 9: $t11 := -($t8, $t9) + 10: $t12 := <=($t3, $t11) + 11: if ($t12) goto 12 else goto 45 + 12: label L3 + 13: $t13 := 0 + 14: $t4 := $t13 + 15: label L10 + 16: $t14 := <($t4, $t9) + 17: if ($t14) goto 18 else goto 27 + 18: label L5 + 19: label L6 + 20: $t15 := get_field.bytes($t0) + 21: $t16 := +($t3, $t4) + 22: $t17 := vector::borrow($t15, $t16) + 23: $t18 := get_field.bytes($t1) + 24: $t19 := vector::borrow($t18, $t4) + 25: $t2 := ==($t17, $t19) + 26: goto 30 + 27: label L4 + 28: $t20 := false + 29: $t2 := $t20 + 30: label L7 + 31: if ($t2) goto 32 else goto 36 + 32: label L9 + 33: $t21 := 1 + 34: $t4 := +($t4, $t21) + 35: goto 15 + 36: label L8 + 37: $t22 := ==($t4, $t9) + 38: if ($t22) goto 39 else goto 41 + 39: label L12 + 40: return $t3 + 41: label L11 + 42: $t23 := 1 + 43: $t3 := +($t3, $t23) + 44: goto 8 + 45: label L2 + 46: return $t8 +} + + +[variant baseline] +public fun ascii::insert($t0|s: &mut ascii::String, $t1|at: u64, $t2|o: ascii::String) { + var $t3|e#1#2: u8 + var $t4|v#1#1: vector + var $t5: ascii::String + var $t6: u64 + var $t7: bool + var $t8: u64 + var $t9: vector + var $t10: bool + var $t11: bool + var $t12: &mut vector + var $t13: u8 + var $t14: &mut vector + var $t15: vector + 0: $t5 := read_ref($t0) + 1: $t6 := ascii::length($t5) + 2: $t7 := <=($t1, $t6) + 3: if ($t7) goto 4 else goto 6 + 4: label L1 + 5: goto 10 + 6: label L0 + 7: destroy($t0) + 8: $t8 := 65537 + 9: abort($t8) + 10: label L2 + 11: $t4 := ascii::into_bytes($t2) + 12: label L5 + 13: $t9 := copy($t4) + 14: $t10 := vector::is_empty($t9) + 15: $t11 := !($t10) + 16: if ($t11) goto 17 else goto 23 + 17: label L4 + 18: $t12 := borrow_local($t4) + 19: $t13 := vector::pop_back($t12) + 20: $t14 := borrow_field.bytes($t0) + 21: vector::insert($t14, $t13, $t1) + 22: goto 12 + 23: label L3 + 24: destroy($t0) + 25: $t15 := move($t4) + 26: vector::destroy_empty($t15) + 27: trace_local[s]($t0) + 28: return () +} + + +[variant baseline] +public fun ascii::is_empty($t0|string: ascii::String): bool { + var $t1: vector + var $t2: bool + 0: $t1 := get_field.bytes($t0) + 1: $t2 := vector::is_empty($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::length($t0|string: ascii::String): u64 { + var $t1: vector + var $t2: u64 + 0: $t1 := ascii::as_bytes($t0) + 1: $t2 := vector::length($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::all_characters_printable($t0|string: ascii::String): bool { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|i#1#12: u64 + var $t4|i#1#9: u64 + var $t5|stop#1#9: u64 + var $t6|v#1#3: vector + var $t7: vector + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u8 + var $t12: bool + var $t13: bool + var $t14: bool + var $t15: u64 + var $t16: bool + 0: $t7 := get_field.bytes($t0) + 1: $t8 := vector::length($t7) + 2: $t9 := 0 + 3: $t4 := $t9 + 4: label L5 + 5: $t10 := <($t4, $t8) + 6: if ($t10) goto 7 else goto 20 + 7: label L1 + 8: $t11 := vector::borrow($t7, $t4) + 9: $t12 := ascii::is_printable_char($t11) + 10: $t13 := !($t12) + 11: if ($t13) goto 12 else goto 16 + 12: label L3 + 13: $t14 := false + 14: $t2 := $t14 + 15: goto 23 + 16: label L2 + 17: $t15 := 1 + 18: $t4 := +($t4, $t15) + 19: goto 4 + 20: label L0 + 21: $t16 := true + 22: $t2 := $t16 + 23: label L4 + 24: return $t2 +} + + +[variant baseline] +public fun ascii::string($t0|bytes: vector): ascii::String { + var $t1|x#1#0: option::Option + var $t2: option::Option + var $t3: bool + var $t4: u64 + var $t5: ascii::String + 0: $t2 := ascii::try_string($t0) + 1: $t3 := option::is_some($t2) + 2: if ($t3) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t4 := 65536 + 7: abort($t4) + 8: label L2 + 9: $t5 := option::destroy_some($t2) + 10: return $t5 +} + + +[variant baseline] +public fun ascii::as_bytes($t0|string: ascii::String): vector { + var $t1: vector + 0: $t1 := get_field.bytes($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::byte($t0|char: ascii::Char): u8 { + var $t1: u8 + 0: $t1 := unpack ascii::Char($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::char($t0|byte: u8): ascii::Char { + var $t1: bool + var $t2: u64 + var $t3: ascii::Char + 0: $t1 := ascii::is_valid_char($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 65536 + 6: abort($t2) + 7: label L2 + 8: $t3 := pack ascii::Char($t0) + 9: return $t3 +} + + +[variant baseline] +fun ascii::char_to_lowercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: bool + var $t5: u8 + var $t6: bool + var $t7: u8 + 0: $t3 := 65 + 1: $t4 := >=($t0, $t3) + 2: if ($t4) goto 3 else goto 7 + 3: label L1 + 4: $t5 := 90 + 5: $t1 := <=($t0, $t5) + 6: goto 10 + 7: label L0 + 8: $t6 := false + 9: $t1 := $t6 + 10: label L2 + 11: if ($t1) goto 12 else goto 16 + 12: label L4 + 13: $t7 := 32 + 14: $t2 := +($t0, $t7) + 15: goto 18 + 16: label L3 + 17: $t2 := $t0 + 18: label L5 + 19: return $t2 +} + + +[variant baseline] +fun ascii::char_to_uppercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: bool + var $t5: u8 + var $t6: bool + var $t7: u8 + 0: $t3 := 97 + 1: $t4 := >=($t0, $t3) + 2: if ($t4) goto 3 else goto 7 + 3: label L1 + 4: $t5 := 122 + 5: $t1 := <=($t0, $t5) + 6: goto 10 + 7: label L0 + 8: $t6 := false + 9: $t1 := $t6 + 10: label L2 + 11: if ($t1) goto 12 else goto 16 + 12: label L4 + 13: $t7 := 32 + 14: $t2 := -($t0, $t7) + 15: goto 18 + 16: label L3 + 17: $t2 := $t0 + 18: label L5 + 19: return $t2 +} + + +[variant baseline] +public fun ascii::into_bytes($t0|string: ascii::String): vector { + var $t1: vector + 0: $t1 := unpack ascii::String($t0) + 1: return $t1 +} + + +[variant baseline] +public fun ascii::is_printable_char($t0|byte: u8): bool { + var $t1|tmp#$1: bool + var $t2: u8 + var $t3: bool + var $t4: u8 + var $t5: bool + 0: $t2 := 32 + 1: $t3 := >=($t0, $t2) + 2: if ($t3) goto 3 else goto 7 + 3: label L1 + 4: $t4 := 126 + 5: $t1 := <=($t0, $t4) + 6: goto 10 + 7: label L0 + 8: $t5 := false + 9: $t1 := $t5 + 10: label L2 + 11: return $t1 } [variant baseline] -public native fun vector::destroy_empty<#0>($t0|v: vector<#0>); +public fun ascii::is_valid_char($t0|b: u8): bool { + var $t1: u8 + var $t2: bool + 0: $t1 := 127 + 1: $t2 := <=($t0, $t1) + 2: return $t2 +} [variant baseline] -public native fun vector::empty<#0>(): vector<#0>; +public fun ascii::pop_char($t0|string: &mut ascii::String): ascii::Char { + var $t1: &mut vector + var $t2: u8 + var $t3: ascii::Char + 0: $t1 := borrow_field.bytes($t0) + 1: $t2 := vector::pop_back($t1) + 2: $t3 := pack ascii::Char($t2) + 3: trace_local[string]($t0) + 4: return $t3 +} [variant baseline] -public fun vector::index_of<#0>($t0|v: vector<#0>, $t1|e: #0): (bool, u64) { - var $t2|i#1#0: u64 - var $t3|len#1#0: u64 - var $t4: u64 - var $t5: u64 - var $t6: bool - var $t7: #0 - var $t8: bool - var $t9: bool - var $t10: u64 - var $t11: bool - var $t12: u64 - 0: $t4 := 0 - 1: $t2 := $t4 - 2: $t5 := vector::length<#0>($t0) - 3: label L5 - 4: $t6 := <($t2, $t5) - 5: if ($t6) goto 6 else goto 18 - 6: label L1 - 7: label L2 - 8: $t7 := vector::borrow<#0>($t0, $t2) - 9: $t8 := ==($t7, $t1) - 10: if ($t8) goto 11 else goto 14 - 11: label L4 - 12: $t9 := true - 13: return ($t9, $t2) - 14: label L3 - 15: $t10 := 1 - 16: $t2 := +($t2, $t10) - 17: goto 3 - 18: label L0 - 19: $t11 := false - 20: $t12 := 0 - 21: return ($t11, $t12) +public fun ascii::push_char($t0|string: &mut ascii::String, $t1|char: ascii::Char) { + var $t2: &mut vector + var $t3: u8 + 0: $t2 := borrow_field.bytes($t0) + 1: $t3 := get_field.byte($t1) + 2: vector::push_back($t2, $t3) + 3: trace_local[string]($t0) + 4: return () } [variant baseline] -public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { - var $t3|len#1#0: u64 - var $t4: vector<#0> - var $t5: u64 - var $t6: bool - var $t7: u64 +public fun ascii::substring($t0|string: ascii::String, $t1|i: u64, $t2|j: u64): ascii::String { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|i#1#3: u64 + var $t6|i#1#6: u64 + var $t7|stop#1#3: u64 var $t8: bool var $t9: u64 - 0: $t4 := read_ref($t0) - 1: $t5 := vector::length<#0>($t4) - 2: $t6 := >($t2, $t5) - 3: if ($t6) goto 4 else goto 8 - 4: label L1 - 5: destroy($t0) - 6: $t7 := 131072 - 7: abort($t7) - 8: label L0 - 9: vector::push_back<#0>($t0, $t1) - 10: label L5 - 11: $t8 := <($t2, $t5) - 12: if ($t8) goto 13 else goto 19 + var $t10: bool + var $t11: u64 + var $t12: vector + var $t13: bool + var $t14: &mut vector + var $t15: vector + var $t16: u8 + var $t17: u64 + var $t18: vector + var $t19: ascii::String + 0: $t8 := <=($t1, $t2) + 1: if ($t8) goto 2 else goto 6 + 2: label L1 + 3: $t9 := ascii::length($t0) + 4: $t3 := <=($t2, $t9) + 5: goto 9 + 6: label L0 + 7: $t10 := false + 8: $t3 := $t10 + 9: label L2 + 10: if ($t3) goto 11 else goto 13 + 11: label L4 + 12: goto 16 13: label L3 - 14: label L4 - 15: vector::swap<#0>($t0, $t2, $t5) - 16: $t9 := 1 - 17: $t2 := +($t2, $t9) - 18: goto 10 - 19: label L2 - 20: destroy($t0) - 21: trace_local[v]($t0) - 22: return () + 14: $t11 := 65537 + 15: abort($t11) + 16: label L5 + 17: $t12 := [] + 18: $t4 := $t12 + 19: $t5 := $t1 + 20: label L8 + 21: $t13 := <($t5, $t2) + 22: if ($t13) goto 23 else goto 31 + 23: label L7 + 24: $t14 := borrow_local($t4) + 25: $t15 := get_field.bytes($t0) + 26: $t16 := vector::borrow($t15, $t5) + 27: vector::push_back($t14, $t16) + 28: $t17 := 1 + 29: $t5 := +($t5, $t17) + 30: goto 20 + 31: label L6 + 32: $t18 := move($t4) + 33: $t19 := pack ascii::String($t18) + 34: return $t19 } [variant baseline] -public fun vector::is_empty<#0>($t0|v: vector<#0>): bool { - var $t1: u64 - var $t2: u64 - var $t3: bool - 0: $t1 := vector::length<#0>($t0) - 1: $t2 := 0 - 2: $t3 := ==($t1, $t2) - 3: return $t3 +public fun ascii::to_lowercase($t0|string: ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: vector + var $t10|v#1#3: vector + var $t11: vector + var $t12: vector + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u8 + var $t17: &mut vector + var $t18: u8 + var $t19: u64 + var $t20: vector + var $t21: ascii::String + 0: $t11 := ascii::as_bytes($t0) + 1: $t12 := [] + 2: $t7 := $t12 + 3: $t13 := vector::length($t11) + 4: $t14 := 0 + 5: $t6 := $t14 + 6: label L2 + 7: $t15 := <($t6, $t13) + 8: if ($t15) goto 9 else goto 17 + 9: label L1 + 10: $t16 := vector::borrow($t11, $t6) + 11: $t17 := borrow_local($t7) + 12: $t18 := ascii::char_to_lowercase($t16) + 13: vector::push_back($t17, $t18) + 14: $t19 := 1 + 15: $t6 := +($t6, $t19) + 16: goto 6 + 17: label L0 + 18: $t20 := move($t7) + 19: $t21 := pack ascii::String($t20) + 20: return $t21 } [variant baseline] -public native fun vector::length<#0>($t0|v: vector<#0>): u64; +public fun ascii::to_uppercase($t0|string: ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: vector + var $t10|v#1#3: vector + var $t11: vector + var $t12: vector + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u8 + var $t17: &mut vector + var $t18: u8 + var $t19: u64 + var $t20: vector + var $t21: ascii::String + 0: $t11 := ascii::as_bytes($t0) + 1: $t12 := [] + 2: $t7 := $t12 + 3: $t13 := vector::length($t11) + 4: $t14 := 0 + 5: $t6 := $t14 + 6: label L2 + 7: $t15 := <($t6, $t13) + 8: if ($t15) goto 9 else goto 17 + 9: label L1 + 10: $t16 := vector::borrow($t11, $t6) + 11: $t17 := borrow_local($t7) + 12: $t18 := ascii::char_to_uppercase($t16) + 13: vector::push_back($t17, $t18) + 14: $t19 := 1 + 15: $t6 := +($t6, $t19) + 16: goto 6 + 17: label L0 + 18: $t20 := move($t7) + 19: $t21 := pack ascii::String($t20) + 20: return $t21 +} [variant baseline] -public native fun vector::pop_back<#0>($t0|v: &mut vector<#0>): #0; +public fun ascii::try_string($t0|bytes: vector): option::Option { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|tmp#$3: option::Option + var $t4|i#1#12: u64 + var $t5|i#1#9: u64 + var $t6|stop#1#9: u64 + var $t7|v#1#3: vector + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u8 + var $t12: bool + var $t13: bool + var $t14: bool + var $t15: u64 + var $t16: bool + var $t17: ascii::String + 0: $t8 := vector::length($t0) + 1: $t9 := 0 + 2: $t5 := $t9 + 3: label L5 + 4: $t10 := <($t5, $t8) + 5: if ($t10) goto 6 else goto 19 + 6: label L1 + 7: $t11 := vector::borrow($t0, $t5) + 8: $t12 := ascii::is_valid_char($t11) + 9: $t13 := !($t12) + 10: if ($t13) goto 11 else goto 15 + 11: label L3 + 12: $t14 := false + 13: $t2 := $t14 + 14: goto 22 + 15: label L2 + 16: $t15 := 1 + 17: $t5 := +($t5, $t15) + 18: goto 3 + 19: label L0 + 20: $t16 := true + 21: $t2 := $t16 + 22: label L4 + 23: if ($t2) goto 24 else goto 28 + 24: label L7 + 25: $t17 := pack ascii::String($t0) + 26: $t3 := option::some($t17) + 27: goto 30 + 28: label L6 + 29: $t3 := option::none() + 30: label L8 + 31: return $t3 +} [variant baseline] -public native fun vector::push_back<#0>($t0|v: &mut vector<#0>, $t1|e: #0); +public fun string::append($t0|s: &mut string::String, $t1|r: string::String) { + var $t2: &mut vector + var $t3: vector + 0: $t2 := borrow_field.bytes($t0) + 1: $t3 := get_field.bytes($t1) + 2: vector::append($t2, $t3) + 3: trace_local[s]($t0) + 4: return () +} [variant baseline] -public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { - var $t2|tmp#$2: u64 - var $t3|tmp#$3: &mut vector<#0> - var $t4|len#1#0: u64 - var $t5: vector<#0> - var $t6: u64 - var $t7: bool - var $t8: u64 +public fun string::index_of($t0|s: string::String, $t1|r: string::String): u64 { + var $t2: vector + var $t3: vector + var $t4: u64 + 0: $t2 := get_field.bytes($t0) + 1: $t3 := get_field.bytes($t1) + 2: $t4 := string::internal_index_of($t2, $t3) + 3: return $t4 +} + + +[variant baseline] +public fun string::insert($t0|s: &mut string::String, $t1|at: u64, $t2|o: string::String) { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|end#1#0: string::String + var $t6|front#1#0: string::String + var $t7|l#1#0: u64 + var $t8: vector var $t9: u64 - var $t10: u64 + var $t10: bool var $t11: bool var $t12: u64 - var $t13: u64 + var $t13: string::String var $t14: u64 - var $t15: #0 - 0: $t5 := read_ref($t0) - 1: $t6 := vector::length<#0>($t5) - 2: $t7 := >=($t1, $t6) - 3: if ($t7) goto 4 else goto 8 + var $t15: string::String + var $t16: u64 + var $t17: string::String + var $t18: string::String + var $t19: &mut string::String + var $t20: &mut string::String + var $t21: string::String + 0: $t8 := get_field.bytes($t0) + 1: $t9 := vector::length($t8) + 2: $t10 := <=($t1, $t9) + 3: if ($t10) goto 4 else goto 7 4: label L1 - 5: destroy($t0) - 6: $t8 := 131072 - 7: abort($t8) - 8: label L0 - 9: $t9 := 1 - 10: $t10 := -($t6, $t9) - 11: label L5 - 12: $t11 := <($t1, $t10) - 13: if ($t11) goto 14 else goto 22 + 5: $t3 := string::internal_is_char_boundary($t8, $t1) + 6: goto 10 + 7: label L0 + 8: $t11 := false + 9: $t3 := $t11 + 10: label L2 + 11: if ($t3) goto 12 else goto 14 + 12: label L4 + 13: goto 18 14: label L3 - 15: label L4 - 16: $t12 := copy($t1) - 17: $t13 := 1 - 18: $t14 := +($t1, $t13) - 19: $t1 := $t14 - 20: vector::swap<#0>($t0, $t12, $t14) - 21: goto 11 - 22: label L2 - 23: $t15 := vector::pop_back<#0>($t0) - 24: trace_local[v]($t0) - 25: return $t15 + 15: destroy($t0) + 16: $t12 := 2 + 17: abort($t12) + 18: label L5 + 19: $t13 := read_ref($t0) + 20: $t14 := string::length($t13) + 21: $t15 := read_ref($t0) + 22: $t16 := 0 + 23: $t6 := string::substring($t15, $t16, $t1) + 24: $t17 := read_ref($t0) + 25: $t18 := string::substring($t17, $t1, $t14) + 26: $t19 := borrow_local($t6) + 27: string::append($t19, $t2) + 28: $t20 := borrow_local($t6) + 29: string::append($t20, $t18) + 30: $t21 := move($t6) + 31: write_ref($t0, $t21) + 32: trace_local[s]($t0) + 33: return () } [variant baseline] -public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { - var $t1|back_index#1#0: u64 - var $t2|front_index#1#0: u64 - var $t3|len#1#0: u64 - var $t4: vector<#0> - var $t5: u64 - var $t6: u64 - var $t7: bool - var $t8: u64 - var $t9: u64 - var $t10: bool - var $t11: u64 - var $t12: u64 - 0: $t4 := read_ref($t0) - 1: $t5 := vector::length<#0>($t4) - 2: $t6 := 0 - 3: $t7 := ==($t5, $t6) - 4: if ($t7) goto 5 else goto 9 - 5: label L1 - 6: destroy($t0) - 7: trace_local[v]($t0) - 8: return () - 9: label L0 - 10: $t8 := 0 - 11: $t2 := $t8 - 12: $t9 := 1 - 13: $t1 := -($t5, $t9) - 14: label L5 - 15: $t10 := <($t2, $t1) - 16: if ($t10) goto 17 else goto 25 - 17: label L3 - 18: label L4 - 19: vector::swap<#0>($t0, $t2, $t1) - 20: $t11 := 1 - 21: $t2 := +($t2, $t11) - 22: $t12 := 1 - 23: $t1 := -($t1, $t12) - 24: goto 14 - 25: label L2 - 26: destroy($t0) - 27: trace_local[v]($t0) - 28: return () +public fun string::is_empty($t0|s: string::String): bool { + var $t1: vector + var $t2: bool + 0: $t1 := get_field.bytes($t0) + 1: $t2 := vector::is_empty($t1) + 2: return $t2 } [variant baseline] -public fun vector::singleton<#0>($t0|e: #0): vector<#0> { - var $t1|v#1#0: vector<#0> - var $t2: &mut vector<#0> - var $t3: vector<#0> - 0: $t1 := vector::empty<#0>() - 1: $t2 := borrow_local($t1) - 2: vector::push_back<#0>($t2, $t0) - 3: $t3 := move($t1) - 4: return $t3 +public fun string::length($t0|s: string::String): u64 { + var $t1: vector + var $t2: u64 + 0: $t1 := get_field.bytes($t0) + 1: $t2 := vector::length($t1) + 2: return $t2 } [variant baseline] -public native fun vector::swap<#0>($t0|v: &mut vector<#0>, $t1|i: u64, $t2|j: u64); +public fun string::as_bytes($t0|s: string::String): vector { + var $t1: vector + 0: $t1 := get_field.bytes($t0) + 1: return $t1 +} [variant baseline] -public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { - var $t2|last_idx#1#0: u64 - var $t3: vector<#0> - var $t4: bool - var $t5: bool - var $t6: u64 - var $t7: vector<#0> - var $t8: u64 +public fun string::into_bytes($t0|s: string::String): vector { + var $t1: vector + 0: $t1 := unpack string::String($t0) + 1: return $t1 +} + + +[variant baseline] +public fun string::bytes($t0|s: string::String): vector { + var $t1: vector + 0: $t1 := string::as_bytes($t0) + 1: return $t1 +} + + +[variant baseline] +public fun string::substring($t0|s: string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3|tmp#$3: bool + var $t4|tmp#$4: bool + var $t5|tmp#$5: bool + var $t6|bytes#1#0: vector + var $t7|l#1#0: u64 + var $t8: vector var $t9: u64 - var $t10: u64 - var $t11: #0 - 0: $t3 := read_ref($t0) - 1: $t4 := vector::is_empty<#0>($t3) - 2: $t5 := !($t4) - 3: if ($t5) goto 4 else goto 6 + var $t10: bool + var $t11: bool + var $t12: bool + var $t13: bool + var $t14: u64 + var $t15: vector + var $t16: string::String + 0: $t8 := get_field.bytes($t0) + 1: $t9 := vector::length($t8) + 2: $t10 := <=($t2, $t9) + 3: if ($t10) goto 4 else goto 7 4: label L1 - 5: goto 10 - 6: label L0 - 7: destroy($t0) - 8: $t6 := 131072 - 9: abort($t6) + 5: $t3 := <=($t1, $t2) + 6: goto 10 + 7: label L0 + 8: $t11 := false + 9: $t3 := $t11 10: label L2 - 11: $t7 := read_ref($t0) - 12: $t8 := vector::length<#0>($t7) - 13: $t9 := 1 - 14: $t10 := -($t8, $t9) - 15: vector::swap<#0>($t0, $t1, $t10) - 16: $t11 := vector::pop_back<#0>($t0) - 17: trace_local[v]($t0) - 18: return $t11 + 11: if ($t3) goto 12 else goto 15 + 12: label L4 + 13: $t4 := string::internal_is_char_boundary($t8, $t1) + 14: goto 18 + 15: label L3 + 16: $t12 := false + 17: $t4 := $t12 + 18: label L5 + 19: if ($t4) goto 20 else goto 23 + 20: label L7 + 21: $t5 := string::internal_is_char_boundary($t8, $t2) + 22: goto 26 + 23: label L6 + 24: $t13 := false + 25: $t5 := $t13 + 26: label L8 + 27: if ($t5) goto 28 else goto 30 + 28: label L10 + 29: goto 33 + 30: label L9 + 31: $t14 := 2 + 32: abort($t14) + 33: label L11 + 34: $t15 := string::internal_sub_string($t8, $t1, $t2) + 35: $t16 := pack string::String($t15) + 36: return $t16 +} + + +[variant baseline] +public fun string::append_utf8($t0|s: &mut string::String, $t1|bytes: vector) { + var $t2: string::String + 0: $t2 := string::utf8($t1) + 1: string::append($t0, $t2) + 2: trace_local[s]($t0) + 3: return () +} + + +[variant baseline] +public fun string::from_ascii($t0|s: ascii::String): string::String { + var $t1: vector + var $t2: string::String + 0: $t1 := ascii::into_bytes($t0) + 1: $t2 := pack string::String($t1) + 2: return $t2 +} + + +[variant baseline] +native fun string::internal_check_utf8($t0|v: vector): bool; + + +[variant baseline] +native fun string::internal_index_of($t0|v: vector, $t1|r: vector): u64; + + +[variant baseline] +native fun string::internal_is_char_boundary($t0|v: vector, $t1|i: u64): bool; + + +[variant baseline] +native fun string::internal_sub_string($t0|v: vector, $t1|i: u64, $t2|j: u64): vector; + + +[variant baseline] +public fun string::sub_string($t0|s: string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3: string::String + 0: $t3 := string::substring($t0, $t1, $t2) + 1: return $t3 +} + + +[variant baseline] +public fun string::to_ascii($t0|s: string::String): ascii::String { + var $t1: vector + var $t2: ascii::String + 0: $t1 := unpack string::String($t0) + 1: $t2 := ascii::string($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::try_utf8($t0|bytes: vector): option::Option { + var $t1|tmp#$1: option::Option + var $t2: bool + var $t3: string::String + 0: $t2 := string::internal_check_utf8($t0) + 1: if ($t2) goto 2 else goto 6 + 2: label L1 + 3: $t3 := pack string::String($t0) + 4: $t1 := option::some($t3) + 5: goto 8 + 6: label L0 + 7: $t1 := option::none() + 8: label L2 + 9: return $t1 +} + + +[variant baseline] +public fun string::utf8($t0|bytes: vector): string::String { + var $t1: bool + var $t2: u64 + var $t3: string::String + 0: $t1 := string::internal_check_utf8($t0) + 1: if ($t1) goto 2 else goto 4 + 2: label L1 + 3: goto 7 + 4: label L0 + 5: $t2 := 1 + 6: abort($t2) + 7: label L2 + 8: $t3 := pack string::String($t0) + 9: return $t3 } @@ -925,6 +4439,10 @@ fun vector::borrow_mut[baseline] borrowed_by: Reference($t0) -> {([], Return(0))} borrows_from: Return(0) -> {([], Reference($t0))} +fun option::borrow_mut[baseline] +borrowed_by: Reference($t0) -> {(.vec (vector<#0>)/[], Return(0))} +borrows_from: Return(0) -> {(.vec (vector<#0>)/[], Reference($t0))} + fun Collection::borrow_mut[baseline] borrowed_by: Reference($t0) -> {(.items (vector<#0>)/[], Return(0))} borrows_from: Return(0) -> {(.items (vector<#0>)/[], Reference($t0))} diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.move b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.move index 9aee1d251b47c..a0f97ccdc06d9 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/borrow/hyper_edge.move @@ -1,9 +1,12 @@ +// dep: ../move-stdlib/sources/macros.move +// dep: ../move-stdlib/sources/u64.move +// dep: ../move-stdlib/sources/option.move +// dep: ../move-stdlib/sources/ascii.move +// dep: ../move-stdlib/sources/string.move // dep: ../move-stdlib/sources/vector.move module 0x2::Collection { - use std::vector; - - struct Collection has drop { + public struct Collection has drop { items: vector, owner: address, } @@ -23,10 +26,10 @@ module 0x2::Collection { module 0x2::Test { use 0x2::Collection; - struct Token has drop { value: u64 } + public struct Token has drop { value: u64 } public fun foo(i: u64) { - let c = Collection::make_collection>(); + let mut c = Collection::make_collection>(); let t = Collection::borrow_mut(&mut c, i); t.value = 0; } diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/borrow_strong/basic_test.move b/external-crates/move/crates/move-stackless-bytecode/tests/borrow_strong/basic_test.move index 9b530c7ebec2f..0582dcc24b1c3 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/borrow_strong/basic_test.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/borrow_strong/basic_test.move @@ -1,11 +1,11 @@ module 0x42::TestBorrow { - struct R has copy, drop { + public struct R has copy, drop { x: u64, y: u64 } fun test1() : R { - let r = R {x: 3, y: 4}; + let mut r = R {x: 3, y: 4}; let r_ref = &mut r; let x_ref = &mut r_ref.x; *x_ref = 0; @@ -22,7 +22,7 @@ module 0x42::TestBorrow { } fun test4() : R { - let r = R {x: 3, y: 4}; + let mut r = R {x: 3, y: 4}; let r_ref = &mut r; test3(r_ref, 0); r @@ -33,7 +33,7 @@ module 0x42::TestBorrow { } fun test6() : R { - let r = R {x: 3, y: 4}; + let mut r = R {x: 3, y: 4}; let r_ref = &mut r; let x_ref = test5(r_ref); test2(x_ref, 0); @@ -41,19 +41,19 @@ module 0x42::TestBorrow { } fun test7(b: bool) { - let r1 = R {x: 3, y: 4}; - let r2 = R {x: 4, y: 5}; - let r_ref = &mut r1; + let mut r1 = R {x: 3, y: 4}; + let mut r2 = R {x: 4, y: 5}; + let mut r_ref = &mut r1; if (b) { r_ref = &mut r2; }; test3(r_ref, 0) } - fun test8(b: bool, n: u64, r_ref: &mut R) { - let r1 = R {x: 3, y: 4}; - let r2 = R {x: 4, y: 5}; - let t_ref = &mut r2; + fun test8(b: bool, mut n: u64, r_ref: &mut R) { + let mut r1 = R {x: 3, y: 4}; + let mut r2 = R {x: 4, y: 5}; + let mut t_ref = &mut r2; while (0 < n) { if (n/2 == 0) { t_ref = &mut r1 @@ -70,7 +70,7 @@ module 0x42::TestBorrow { } fun test9(b : bool, r_ref: &mut R) : &mut u64 { - let r_field = &mut r_ref.x; + let mut r_field = &mut r_ref.x; if(b) { r_field = &mut r_ref.y; }; @@ -79,9 +79,9 @@ module 0x42::TestBorrow { } fun test10(b : bool) : R { - let r = R {x: 3, y: 4}; + let mut r = R {x: 3, y: 4}; let r_ref = &mut r; - let r_field = &mut r_ref.x; + let mut r_field = &mut r_ref.x; if(b) { r_field = test9(b, r_ref); }; diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/eliminate_imm_refs/basic_test.move b/external-crates/move/crates/move-stackless-bytecode/tests/eliminate_imm_refs/basic_test.move index 8dada99bc3612..82065de503a20 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/eliminate_imm_refs/basic_test.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/eliminate_imm_refs/basic_test.move @@ -1,11 +1,11 @@ module 0x42::TestEliminateImmRefs { - struct R has copy, drop { + public struct R has copy, drop { x: u64 } fun test1() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; let x_ref = &mut r_ref.x; *x_ref = 0; diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_internal_refs.move b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_internal_refs.move index 9d5d2663d9850..15df8e2cbee95 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_internal_refs.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_internal_refs.move @@ -1,6 +1,6 @@ module 0x1::LeakInternalRefs { - struct S { f: u64, g: u64 } + public struct S { f: u64, g: u64 } fun leak_mut_ref(s: &mut S): &mut u64 { &mut s.f @@ -23,7 +23,7 @@ module 0x1::LeakInternalRefs { } fun leak_in_loop(x: &mut u64, s: &mut S): &mut u64 { - let i = 0; + let mut i = 0; while (i < 10) { if (i == 7) { return &mut s.f diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.exp b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.exp index a5e235909a205..30333879c28e8 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.exp +++ b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.exp @@ -1,5 +1,339 @@ ============ initial translation from Move ================ +[variant baseline] +public fun u64::diff($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 14 + 8: label L1 + 9: $t10 := move($t3) + 10: $t11 := move($t4) + 11: $t12 := -($t10, $t11) + 12: $t2 := $t12 + 13: goto 20 + 14: label L0 + 15: $t13 := move($t4) + 16: $t14 := move($t3) + 17: $t15 := -($t13, $t14) + 18: $t2 := $t15 + 19: goto 20 + 20: label L2 + 21: $t16 := move($t2) + 22: return $t16 +} + + +[variant baseline] +public fun u64::divide_and_round_up($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: bool + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := %($t7, $t8) + 7: $t10 := 0 + 8: $t11 := ==($t9, $t10) + 9: if ($t11) goto 10 else goto 16 + 10: label L1 + 11: $t12 := move($t3) + 12: $t13 := move($t4) + 13: $t14 := /($t12, $t13) + 14: $t2 := $t14 + 15: goto 24 + 16: label L0 + 17: $t15 := move($t3) + 18: $t16 := move($t4) + 19: $t17 := /($t15, $t16) + 20: $t18 := 1 + 21: $t19 := +($t17, $t18) + 22: $t2 := $t19 + 23: goto 24 + 24: label L2 + 25: $t20 := move($t2) + 26: return $t20 +} + + +[variant baseline] +public fun u64::max($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::min($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := <($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::pow($t0|base: u64, $t1|exponent: u8): u64 { + var $t2|base#1#1: u64 + var $t3|exponent#1#1: u8 + var $t4|res#1#1: u64 + var $t5: u64 + var $t6: u8 + var $t7: u64 + var $t8: u8 + var $t9: u8 + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: bool + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u8 + var $t20: u8 + var $t21: u8 + var $t22: u64 + var $t23: u64 + var $t24: u64 + var $t25: u8 + var $t26: u8 + var $t27: u8 + var $t28: u64 + 0: $t5 := move($t0) + 1: $t2 := $t5 + 2: $t6 := move($t1) + 3: $t3 := $t6 + 4: $t7 := 1 + 5: $t4 := $t7 + 6: goto 7 + 7: label L5 + 8: $t8 := copy($t3) + 9: $t9 := 1 + 10: $t10 := >=($t8, $t9) + 11: if ($t10) goto 12 else goto 41 + 12: label L1 + 13: goto 14 + 14: label L2 + 15: $t11 := copy($t3) + 16: $t12 := 2 + 17: $t13 := %($t11, $t12) + 18: $t14 := 0 + 19: $t15 := ==($t13, $t14) + 20: if ($t15) goto 21 else goto 31 + 21: label L4 + 22: $t16 := copy($t2) + 23: $t17 := move($t2) + 24: $t18 := *($t16, $t17) + 25: $t2 := $t18 + 26: $t19 := move($t3) + 27: $t20 := 2 + 28: $t21 := /($t19, $t20) + 29: $t3 := $t21 + 30: goto 7 + 31: label L3 + 32: $t22 := move($t4) + 33: $t23 := copy($t2) + 34: $t24 := *($t22, $t23) + 35: $t4 := $t24 + 36: $t25 := move($t3) + 37: $t26 := 1 + 38: $t27 := -($t25, $t26) + 39: $t3 := $t27 + 40: goto 7 + 41: label L0 + 42: $t28 := move($t4) + 43: return $t28 +} + + +[variant baseline] +public fun u64::sqrt($t0|x: u64): u64 { + var $t1|bit#1#1: u128 + var $t2|res#1#1: u128 + var $t3|x#1#1: u64 + var $t4|x#2#1: u128 + var $t5: u64 + var $t6: u128 + var $t7: u128 + var $t8: u64 + var $t9: u128 + var $t10: u128 + var $t11: u128 + var $t12: bool + var $t13: u128 + var $t14: u128 + var $t15: u128 + var $t16: u128 + var $t17: bool + var $t18: u128 + var $t19: u128 + var $t20: u128 + var $t21: u128 + var $t22: u128 + var $t23: u128 + var $t24: u8 + var $t25: u128 + var $t26: u128 + var $t27: u128 + var $t28: u128 + var $t29: u8 + var $t30: u128 + var $t31: u128 + var $t32: u8 + var $t33: u128 + var $t34: u128 + var $t35: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := 18446744073709551616 + 3: $t1 := $t6 + 4: $t7 := 0 + 5: $t2 := $t7 + 6: $t8 := move($t3) + 7: $t9 := (u128)($t8) + 8: $t4 := $t9 + 9: goto 10 + 10: label L6 + 11: $t10 := copy($t1) + 12: $t11 := 0 + 13: $t12 := !=($t10, $t11) + 14: if ($t12) goto 15 else goto 50 + 15: label L1 + 16: goto 17 + 17: label L2 + 18: $t13 := copy($t4) + 19: $t14 := copy($t2) + 20: $t15 := copy($t1) + 21: $t16 := +($t14, $t15) + 22: $t17 := >=($t13, $t16) + 23: if ($t17) goto 24 else goto 38 + 24: label L4 + 25: $t18 := move($t4) + 26: $t19 := copy($t2) + 27: $t20 := copy($t1) + 28: $t21 := +($t19, $t20) + 29: $t22 := -($t18, $t21) + 30: $t4 := $t22 + 31: $t23 := move($t2) + 32: $t24 := 1 + 33: $t25 := >>($t23, $t24) + 34: $t26 := copy($t1) + 35: $t27 := +($t25, $t26) + 36: $t2 := $t27 + 37: goto 44 + 38: label L3 + 39: $t28 := move($t2) + 40: $t29 := 1 + 41: $t30 := >>($t28, $t29) + 42: $t2 := $t30 + 43: goto 44 + 44: label L5 + 45: $t31 := move($t1) + 46: $t32 := 2 + 47: $t33 := >>($t31, $t32) + 48: $t1 := $t33 + 49: goto 10 + 50: label L0 + 51: $t34 := move($t2) + 52: $t35 := (u64)($t34) + 53: return $t35 +} + + [variant baseline] public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { var $t2: &mut vector<#0> @@ -231,27 +565,25 @@ public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { 15: $t13 := move($t1) 16: vector::push_back<#0>($t12, $t13) 17: goto 18 - 18: label L5 + 18: label L4 19: $t14 := copy($t2) 20: $t15 := copy($t3) 21: $t16 := <($t14, $t15) - 22: if ($t16) goto 23 else goto 35 + 22: if ($t16) goto 23 else goto 33 23: label L3 - 24: goto 25 - 25: label L4 - 26: $t17 := copy($t0) - 27: $t18 := copy($t2) - 28: $t19 := copy($t3) - 29: vector::swap<#0>($t17, $t18, $t19) - 30: $t20 := move($t2) - 31: $t21 := 1 - 32: $t22 := +($t20, $t21) - 33: $t2 := $t22 - 34: goto 18 - 35: label L2 - 36: $t23 := move($t0) - 37: destroy($t23) - 38: return () + 24: $t17 := copy($t0) + 25: $t18 := copy($t2) + 26: $t19 := copy($t3) + 27: vector::swap<#0>($t17, $t18, $t19) + 28: $t20 := move($t2) + 29: $t21 := 1 + 30: $t22 := +($t20, $t21) + 31: $t2 := $t22 + 32: goto 18 + 33: label L2 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: return () } @@ -329,31 +661,29 @@ public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { 16: $t15 := -($t13, $t14) 17: $t4 := $t15 18: goto 19 - 19: label L5 + 19: label L4 20: $t16 := copy($t1) 21: $t17 := copy($t4) 22: $t18 := <($t16, $t17) - 23: if ($t18) goto 24 else goto 40 + 23: if ($t18) goto 24 else goto 38 24: label L3 - 25: goto 26 - 26: label L4 - 27: $t19 := copy($t0) - 28: $t3 := $t19 - 29: $t20 := copy($t1) - 30: $t2 := $t20 - 31: $t21 := move($t1) - 32: $t22 := 1 - 33: $t23 := +($t21, $t22) - 34: $t1 := $t23 - 35: $t24 := move($t3) - 36: $t25 := move($t2) - 37: $t26 := copy($t1) - 38: vector::swap<#0>($t24, $t25, $t26) - 39: goto 19 - 40: label L2 - 41: $t27 := move($t0) - 42: $t28 := vector::pop_back<#0>($t27) - 43: return $t28 + 25: $t19 := copy($t0) + 26: $t3 := $t19 + 27: $t20 := copy($t1) + 28: $t2 := $t20 + 29: $t21 := move($t1) + 30: $t22 := 1 + 31: $t23 := +($t21, $t22) + 32: $t1 := $t23 + 33: $t24 := move($t3) + 34: $t25 := move($t2) + 35: $t26 := copy($t1) + 36: vector::swap<#0>($t24, $t25, $t26) + 37: goto 19 + 38: label L2 + 39: $t27 := move($t0) + 40: $t28 := vector::pop_back<#0>($t27) + 41: return $t28 } @@ -406,31 +736,29 @@ public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { 17: $t14 := -($t12, $t13) 18: $t1 := $t14 19: goto 20 - 20: label L5 + 20: label L4 21: $t15 := copy($t2) 22: $t16 := copy($t1) 23: $t17 := <($t15, $t16) - 24: if ($t17) goto 25 else goto 41 + 24: if ($t17) goto 25 else goto 39 25: label L3 - 26: goto 27 - 27: label L4 - 28: $t18 := copy($t0) - 29: $t19 := copy($t2) - 30: $t20 := copy($t1) - 31: vector::swap<#0>($t18, $t19, $t20) - 32: $t21 := move($t2) - 33: $t22 := 1 - 34: $t23 := +($t21, $t22) - 35: $t2 := $t23 - 36: $t24 := move($t1) - 37: $t25 := 1 - 38: $t26 := -($t24, $t25) - 39: $t1 := $t26 - 40: goto 20 - 41: label L2 - 42: $t27 := move($t0) - 43: destroy($t27) - 44: return () + 26: $t18 := copy($t0) + 27: $t19 := copy($t2) + 28: $t20 := copy($t1) + 29: vector::swap<#0>($t18, $t19, $t20) + 30: $t21 := move($t2) + 31: $t22 := 1 + 32: $t23 := +($t21, $t22) + 33: $t2 := $t23 + 34: $t24 := move($t1) + 35: $t25 := 1 + 36: $t26 := -($t24, $t25) + 37: $t1 := $t26 + 38: goto 20 + 39: label L2 + 40: $t27 := move($t0) + 41: destroy($t27) + 42: return () } @@ -526,530 +854,4518 @@ fun ReturnRefsIntoVec::return_vec_index_mut($t0|v: &mut vector): &mut u64 { 3: return $t3 } -============ after pipeline `escape_analysis` ================ [variant baseline] -public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { - var $t2: &mut vector<#0> - var $t3: &vector<#0> - var $t4: bool - var $t5: bool - var $t6: &mut vector<#0> - var $t7: &mut vector<#0> - var $t8: #0 - var $t9: &mut vector<#0> - var $t10: vector<#0> - 0: $t2 := borrow_local($t1) - 1: vector::reverse<#0>($t2) - 2: goto 3 - 3: label L3 - 4: $t3 := borrow_local($t1) - 5: $t4 := vector::is_empty<#0>($t3) - 6: $t5 := !($t4) - 7: if ($t5) goto 8 else goto 16 - 8: label L1 - 9: goto 10 +public fun option::borrow<#0>($t0|t: &option::Option<#0>): � { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: &option::Option<#0> + var $t4: u64 + var $t5: &option::Option<#0> + var $t6: &vector<#0> + var $t7: u64 + var $t8: � + 0: $t1 := copy($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 10 + 5: label L0 + 6: $t3 := move($t0) + 7: destroy($t3) + 8: $t4 := 262145 + 9: abort($t4) 10: label L2 - 11: $t6 := copy($t0) - 12: $t7 := borrow_local($t1) - 13: $t8 := vector::pop_back<#0>($t7) - 14: vector::push_back<#0>($t6, $t8) - 15: goto 3 - 16: label L0 - 17: $t9 := move($t0) - 18: destroy($t9) - 19: $t10 := move($t1) - 20: vector::destroy_empty<#0>($t10) - 21: return () + 11: $t5 := move($t0) + 12: $t6 := borrow_field>.vec($t5) + 13: $t7 := 0 + 14: $t8 := vector::borrow<#0>($t6, $t7) + 15: return $t8 } [variant baseline] -public native fun vector::borrow<#0>($t0|v: &vector<#0>, $t1|i: u64): � +public fun option::borrow_mut<#0>($t0|t: &mut option::Option<#0>): &mut #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> + var $t5: u64 + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: u64 + var $t9: &mut #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := 0 + 15: $t9 := vector::borrow_mut<#0>($t7, $t8) + 16: return $t9 +} [variant baseline] -public native fun vector::borrow_mut<#0>($t0|v: &mut vector<#0>, $t1|i: u64): &mut #0; +public fun option::contains<#0>($t0|t: &option::Option<#0>, $t1|e_ref: �): bool { + var $t2: &option::Option<#0> + var $t3: &vector<#0> + var $t4: � + var $t5: bool + 0: $t2 := move($t0) + 1: $t3 := borrow_field>.vec($t2) + 2: $t4 := move($t1) + 3: $t5 := vector::contains<#0>($t3, $t4) + 4: return $t5 +} [variant baseline] -public fun vector::contains<#0>($t0|v: &vector<#0>, $t1|e: �): bool { - var $t2|i#1#0: u64 - var $t3|len#1#0: u64 - var $t4: u64 - var $t5: &vector<#0> - var $t6: u64 - var $t7: u64 +public fun option::swap<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): #0 { + var $t2|old_value#1#0: #0 + var $t3|vec_ref#1#0: &mut vector<#0> + var $t4: &mut option::Option<#0> + var $t5: &option::Option<#0> + var $t6: bool + var $t7: &mut option::Option<#0> var $t8: u64 - var $t9: bool - var $t10: &vector<#0> - var $t11: u64 - var $t12: � + var $t9: &mut option::Option<#0> + var $t10: &mut vector<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: &mut vector<#0> + var $t14: #0 + var $t15: #0 + 0: $t4 := copy($t0) + 1: $t5 := freeze_ref($t4) + 2: $t6 := option::is_some<#0>($t5) + 3: if ($t6) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t7 := move($t0) + 8: destroy($t7) + 9: $t8 := 262145 + 10: abort($t8) + 11: label L2 + 12: $t9 := move($t0) + 13: $t10 := borrow_field>.vec($t9) + 14: $t3 := $t10 + 15: $t11 := copy($t3) + 16: $t12 := vector::pop_back<#0>($t11) + 17: $t2 := $t12 + 18: $t13 := move($t3) + 19: $t14 := move($t1) + 20: vector::push_back<#0>($t13, $t14) + 21: $t15 := move($t2) + 22: return $t15 +} + + +[variant baseline] +public fun option::borrow_with_default<#0>($t0|t: &option::Option<#0>, $t1|default_ref: �): � { + var $t2|tmp#$2: � + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: � + var $t10: � + var $t11: &vector<#0> + var $t12: u64 var $t13: � - var $t14: bool - var $t15: &vector<#0> - var $t16: � - var $t17: bool - var $t18: u64 - var $t19: u64 - var $t20: u64 - var $t21: &vector<#0> - var $t22: � - var $t23: bool - 0: $t4 := 0 - 1: $t2 := $t4 - 2: $t5 := copy($t0) - 3: $t6 := vector::length<#0>($t5) - 4: $t3 := $t6 - 5: goto 6 - 6: label L5 - 7: $t7 := copy($t2) - 8: $t8 := copy($t3) - 9: $t9 := <($t7, $t8) - 10: if ($t9) goto 11 else goto 33 - 11: label L1 - 12: goto 13 - 13: label L2 - 14: $t10 := copy($t0) - 15: $t11 := copy($t2) - 16: $t12 := vector::borrow<#0>($t10, $t11) - 17: $t13 := copy($t1) - 18: $t14 := ==($t12, $t13) - 19: if ($t14) goto 20 else goto 27 - 20: label L4 - 21: $t15 := move($t0) - 22: destroy($t15) - 23: $t16 := move($t1) - 24: destroy($t16) - 25: $t17 := true - 26: return $t17 - 27: label L3 - 28: $t18 := move($t2) - 29: $t19 := 1 - 30: $t20 := +($t18, $t19) - 31: $t2 := $t20 - 32: goto 6 - 33: label L0 - 34: $t21 := move($t0) - 35: destroy($t21) - 36: $t22 := move($t1) - 37: destroy($t22) - 38: $t23 := false - 39: return $t23 + var $t14: � + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 20 + 12: label L0 + 13: $t10 := move($t1) + 14: destroy($t10) + 15: $t11 := move($t3) + 16: $t12 := 0 + 17: $t13 := vector::borrow<#0>($t11, $t12) + 18: $t2 := $t13 + 19: goto 20 + 20: label L2 + 21: $t14 := move($t2) + 22: return $t14 } [variant baseline] -public native fun vector::destroy_empty<#0>($t0|v: vector<#0>); +public fun option::destroy_none<#0>($t0|t: option::Option<#0>) { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: option::Option<#0> + var $t5: vector<#0> + 0: $t1 := borrow_local($t0) + 1: $t2 := option::is_none<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 262144 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := unpack option::Option<#0>($t4) + 11: vector::destroy_empty<#0>($t5) + 12: return () +} [variant baseline] -public native fun vector::empty<#0>(): vector<#0>; +public fun option::destroy_some<#0>($t0|t: option::Option<#0>): #0 { + var $t1|elem#1#0: #0 + var $t2|vec#1#0: vector<#0> + var $t3: &option::Option<#0> + var $t4: bool + var $t5: u64 + var $t6: option::Option<#0> + var $t7: vector<#0> + var $t8: &mut vector<#0> + var $t9: #0 + var $t10: vector<#0> + var $t11: #0 + 0: $t3 := borrow_local($t0) + 1: $t4 := option::is_some<#0>($t3) + 2: if ($t4) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t5 := 262145 + 7: abort($t5) + 8: label L2 + 9: $t6 := move($t0) + 10: $t7 := unpack option::Option<#0>($t6) + 11: $t2 := $t7 + 12: $t8 := borrow_local($t2) + 13: $t9 := vector::pop_back<#0>($t8) + 14: $t1 := $t9 + 15: $t10 := move($t2) + 16: vector::destroy_empty<#0>($t10) + 17: $t11 := move($t1) + 18: return $t11 +} [variant baseline] -public fun vector::index_of<#0>($t0|v: &vector<#0>, $t1|e: �): (bool, u64) { - var $t2|i#1#0: u64 - var $t3|len#1#0: u64 - var $t4: u64 +public fun option::destroy_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec#1#0: vector<#0> + var $t4: option::Option<#0> + var $t5: vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: #0 + var $t9: &mut vector<#0> + var $t10: #0 + var $t11: #0 + 0: $t4 := move($t0) + 1: $t5 := unpack option::Option<#0>($t4) + 2: $t3 := $t5 + 3: $t6 := borrow_local($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 10 + 6: label L1 + 7: $t8 := move($t1) + 8: $t2 := $t8 + 9: goto 15 + 10: label L0 + 11: $t9 := borrow_local($t3) + 12: $t10 := vector::pop_back<#0>($t9) + 13: $t2 := $t10 + 14: goto 15 + 15: label L2 + 16: $t11 := move($t2) + 17: return $t11 +} + + +[variant baseline] +public fun option::extract<#0>($t0|t: &mut option::Option<#0>): #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> + var $t5: u64 + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := vector::pop_back<#0>($t7) + 15: return $t8 +} + + +[variant baseline] +public fun option::fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0) { + var $t2|vec_ref#1#0: &mut vector<#0> + var $t3: &mut option::Option<#0> + var $t4: &mut vector<#0> + var $t5: &mut vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &mut vector<#0> + var $t9: u64 + var $t10: &mut vector<#0> + var $t11: #0 + 0: $t3 := move($t0) + 1: $t4 := borrow_field>.vec($t3) + 2: $t2 := $t4 + 3: $t5 := copy($t2) + 4: $t6 := freeze_ref($t5) + 5: $t7 := vector::is_empty<#0>($t6) + 6: if ($t7) goto 7 else goto 9 + 7: label L1 + 8: goto 14 + 9: label L0 + 10: $t8 := move($t2) + 11: destroy($t8) + 12: $t9 := 262144 + 13: abort($t9) + 14: label L2 + 15: $t10 := move($t2) + 16: $t11 := move($t1) + 17: vector::push_back<#0>($t10, $t11) + 18: return () +} + + +[variant baseline] +public fun option::get_with_default<#0>($t0|t: &option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: #0 + var $t10: &vector<#0> + var $t11: u64 + var $t12: � + var $t13: #0 + var $t14: #0 + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 19 + 12: label L0 + 13: $t10 := move($t3) + 14: $t11 := 0 + 15: $t12 := vector::borrow<#0>($t10, $t11) + 16: $t13 := read_ref($t12) + 17: $t2 := $t13 + 18: goto 19 + 19: label L2 + 20: $t14 := move($t2) + 21: return $t14 +} + + +[variant baseline] +public fun option::is_none<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::is_some<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + var $t4: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: $t4 := !($t3) + 4: return $t4 +} + + +[variant baseline] +public fun option::none<#0>(): option::Option<#0> { + var $t0: vector<#0> + var $t1: option::Option<#0> + 0: $t0 := vector::empty<#0>() + 1: $t1 := pack option::Option<#0>($t0) + 2: return $t1 +} + + +[variant baseline] +public fun option::some<#0>($t0|e: #0): option::Option<#0> { + var $t1: #0 + var $t2: vector<#0> + var $t3: option::Option<#0> + 0: $t1 := move($t0) + 1: $t2 := vector::singleton<#0>($t1) + 2: $t3 := pack option::Option<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::swap_or_fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): option::Option<#0> { + var $t2|tmp#$2: option::Option<#0> + var $t3|old_value#1#0: option::Option<#0> + var $t4|vec_ref#1#0: &mut vector<#0> + var $t5: &mut option::Option<#0> + var $t6: &mut vector<#0> + var $t7: &mut vector<#0> + var $t8: &vector<#0> + var $t9: bool + var $t10: option::Option<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: option::Option<#0> + var $t14: option::Option<#0> + var $t15: &mut vector<#0> + var $t16: #0 + var $t17: option::Option<#0> + 0: $t5 := move($t0) + 1: $t6 := borrow_field>.vec($t5) + 2: $t4 := $t6 + 3: $t7 := copy($t4) + 4: $t8 := freeze_ref($t7) + 5: $t9 := vector::is_empty<#0>($t8) + 6: if ($t9) goto 7 else goto 11 + 7: label L1 + 8: $t10 := option::none<#0>() + 9: $t2 := $t10 + 10: goto 17 + 11: label L0 + 12: $t11 := copy($t4) + 13: $t12 := vector::pop_back<#0>($t11) + 14: $t13 := option::some<#0>($t12) + 15: $t2 := $t13 + 16: goto 17 + 17: label L2 + 18: $t14 := move($t2) + 19: $t3 := $t14 + 20: $t15 := move($t4) + 21: $t16 := move($t1) + 22: vector::push_back<#0>($t15, $t16) + 23: $t17 := move($t3) + 24: return $t17 +} + + +[variant baseline] +public fun option::to_vec<#0>($t0|t: option::Option<#0>): vector<#0> { + var $t1: option::Option<#0> + var $t2: vector<#0> + 0: $t1 := move($t0) + 1: $t2 := unpack option::Option<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::append($t0|string: &mut ascii::String, $t1|other: ascii::String) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: ascii::String + var $t5: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := ascii::into_bytes($t4) + 4: vector::append($t3, $t5) + 5: return () +} + + +[variant baseline] +public fun ascii::index_of($t0|string: &ascii::String, $t1|substr: &ascii::String): u64 { + var $t2|tmp#$2: bool + var $t3|i#1#0: u64 + var $t4|j#1#0: u64 + var $t5|m#1#0: u64 + var $t6|n#1#0: u64 + var $t7: u64 + var $t8: &ascii::String + var $t9: u64 + var $t10: &ascii::String + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: bool + var $t15: &ascii::String + var $t16: &ascii::String + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: u64 + var $t22: bool + var $t23: u64 + var $t24: u64 + var $t25: u64 + var $t26: bool + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: u64 + var $t31: u64 + var $t32: &u8 + var $t33: u8 + var $t34: &ascii::String + var $t35: &vector + var $t36: u64 + var $t37: &u8 + var $t38: u8 + var $t39: bool + var $t40: bool + var $t41: bool + var $t42: u64 + var $t43: u64 + var $t44: u64 + var $t45: u64 + var $t46: u64 + var $t47: bool + var $t48: &ascii::String + var $t49: &ascii::String + var $t50: u64 + var $t51: u64 + var $t52: u64 + var $t53: u64 + var $t54: &ascii::String + var $t55: &ascii::String + var $t56: u64 + 0: $t7 := 0 + 1: $t3 := $t7 + 2: $t8 := copy($t0) + 3: $t9 := ascii::length($t8) + 4: $t10 := copy($t1) + 5: $t11 := ascii::length($t10) + 6: $t5 := $t11 + 7: $t6 := $t9 + 8: $t12 := copy($t6) + 9: $t13 := copy($t5) + 10: $t14 := <($t12, $t13) + 11: if ($t14) goto 12 else goto 19 + 12: label L1 + 13: $t15 := move($t1) + 14: destroy($t15) + 15: $t16 := move($t0) + 16: destroy($t16) + 17: $t17 := move($t6) + 18: return $t17 + 19: label L0 + 20: $t18 := copy($t3) + 21: $t19 := copy($t6) + 22: $t20 := copy($t5) + 23: $t21 := -($t19, $t20) + 24: $t22 := <=($t18, $t21) + 25: if ($t22) goto 26 else goto 84 + 26: label L3 + 27: $t23 := 0 + 28: $t4 := $t23 + 29: goto 30 + 30: label L10 + 31: $t24 := copy($t4) + 32: $t25 := copy($t5) + 33: $t26 := <($t24, $t25) + 34: if ($t26) goto 35 else goto 53 + 35: label L5 + 36: goto 37 + 37: label L6 + 38: $t27 := copy($t0) + 39: $t28 := borrow_field.bytes($t27) + 40: $t29 := copy($t3) + 41: $t30 := copy($t4) + 42: $t31 := +($t29, $t30) + 43: $t32 := vector::borrow($t28, $t31) + 44: $t33 := read_ref($t32) + 45: $t34 := copy($t1) + 46: $t35 := borrow_field.bytes($t34) + 47: $t36 := copy($t4) + 48: $t37 := vector::borrow($t35, $t36) + 49: $t38 := read_ref($t37) + 50: $t39 := ==($t33, $t38) + 51: $t2 := $t39 + 52: goto 57 + 53: label L4 + 54: $t40 := false + 55: $t2 := $t40 + 56: goto 57 + 57: label L7 + 58: $t41 := move($t2) + 59: if ($t41) goto 60 else goto 66 + 60: label L9 + 61: $t42 := move($t4) + 62: $t43 := 1 + 63: $t44 := +($t42, $t43) + 64: $t4 := $t44 + 65: goto 30 + 66: label L8 + 67: $t45 := move($t4) + 68: $t46 := copy($t5) + 69: $t47 := ==($t45, $t46) + 70: if ($t47) goto 71 else goto 78 + 71: label L12 + 72: $t48 := move($t1) + 73: destroy($t48) + 74: $t49 := move($t0) + 75: destroy($t49) + 76: $t50 := move($t3) + 77: return $t50 + 78: label L11 + 79: $t51 := move($t3) + 80: $t52 := 1 + 81: $t53 := +($t51, $t52) + 82: $t3 := $t53 + 83: goto 19 + 84: label L2 + 85: $t54 := move($t1) + 86: destroy($t54) + 87: $t55 := move($t0) + 88: destroy($t55) + 89: $t56 := move($t6) + 90: return $t56 +} + + +[variant baseline] +public fun ascii::insert($t0|s: &mut ascii::String, $t1|at: u64, $t2|o: ascii::String) { + var $t3|e#1#2: u8 + var $t4|v#1#1: vector + var $t5: u64 + var $t6: &mut ascii::String + var $t7: &ascii::String + var $t8: u64 + var $t9: bool + var $t10: &mut ascii::String + var $t11: u64 + var $t12: ascii::String + var $t13: vector + var $t14: &vector + var $t15: bool + var $t16: bool + var $t17: &mut vector + var $t18: u8 + var $t19: &mut ascii::String + var $t20: &mut vector + var $t21: u8 + var $t22: u64 + var $t23: &mut ascii::String + var $t24: vector + 0: $t5 := copy($t1) + 1: $t6 := copy($t0) + 2: $t7 := freeze_ref($t6) + 3: $t8 := ascii::length($t7) + 4: $t9 := <=($t5, $t8) + 5: if ($t9) goto 6 else goto 8 + 6: label L1 + 7: goto 13 + 8: label L0 + 9: $t10 := move($t0) + 10: destroy($t10) + 11: $t11 := 65537 + 12: abort($t11) + 13: label L2 + 14: $t12 := move($t2) + 15: $t13 := ascii::into_bytes($t12) + 16: $t4 := $t13 + 17: goto 18 + 18: label L5 + 19: $t14 := borrow_local($t4) + 20: $t15 := vector::is_empty($t14) + 21: $t16 := !($t15) + 22: if ($t16) goto 23 else goto 33 + 23: label L4 + 24: $t17 := borrow_local($t4) + 25: $t18 := vector::pop_back($t17) + 26: $t3 := $t18 + 27: $t19 := copy($t0) + 28: $t20 := borrow_field.bytes($t19) + 29: $t21 := move($t3) + 30: $t22 := copy($t1) + 31: vector::insert($t20, $t21, $t22) + 32: goto 18 + 33: label L3 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: $t24 := move($t4) + 37: vector::destroy_empty($t24) + 38: return () +} + + +[variant baseline] +public fun ascii::is_empty($t0|string: &ascii::String): bool { + var $t1: &ascii::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::length($t0|string: &ascii::String): u64 { + var $t1: &ascii::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := ascii::as_bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::all_characters_printable($t0|string: &ascii::String): bool { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|i#1#12: u64 + var $t4|i#1#9: u64 + var $t5|stop#1#9: u64 + var $t6|v#1#3: &vector + var $t7: &ascii::String + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u64 + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool + var $t25: u64 + var $t26: u64 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + 0: $t7 := move($t0) + 1: $t8 := borrow_field.bytes($t7) + 2: $t6 := $t8 + 3: $t9 := copy($t6) + 4: $t10 := vector::length($t9) + 5: $t1 := $t10 + 6: $t11 := 0 + 7: $t4 := $t11 + 8: $t12 := move($t1) + 9: $t5 := $t12 + 10: goto 11 + 11: label L5 + 12: $t13 := copy($t4) + 13: $t14 := copy($t5) + 14: $t15 := <($t13, $t14) + 15: if ($t15) goto 16 else goto 38 + 16: label L1 + 17: $t16 := copy($t4) + 18: $t3 := $t16 + 19: $t17 := copy($t6) + 20: $t18 := move($t3) + 21: $t19 := vector::borrow($t17, $t18) + 22: $t20 := read_ref($t19) + 23: $t21 := ascii::is_printable_char($t20) + 24: $t22 := !($t21) + 25: if ($t22) goto 26 else goto 32 + 26: label L3 + 27: $t23 := move($t6) + 28: destroy($t23) + 29: $t24 := false + 30: $t2 := $t24 + 31: goto 44 + 32: label L2 + 33: $t25 := move($t4) + 34: $t26 := 1 + 35: $t27 := +($t25, $t26) + 36: $t4 := $t27 + 37: goto 11 + 38: label L0 + 39: $t28 := move($t6) + 40: destroy($t28) + 41: $t29 := true + 42: $t2 := $t29 + 43: goto 44 + 44: label L4 + 45: $t30 := move($t2) + 46: return $t30 +} + + +[variant baseline] +public fun ascii::string($t0|bytes: vector): ascii::String { + var $t1|x#1#0: option::Option + var $t2: vector + var $t3: option::Option + var $t4: &option::Option + var $t5: bool + var $t6: u64 + var $t7: option::Option + var $t8: ascii::String + 0: $t2 := move($t0) + 1: $t3 := ascii::try_string($t2) + 2: $t1 := $t3 + 3: $t4 := borrow_local($t1) + 4: $t5 := option::is_some($t4) + 5: if ($t5) goto 6 else goto 8 + 6: label L1 + 7: goto 11 + 8: label L0 + 9: $t6 := 65536 + 10: abort($t6) + 11: label L2 + 12: $t7 := move($t1) + 13: $t8 := option::destroy_some($t7) + 14: return $t8 +} + + +[variant baseline] +public fun ascii::as_bytes($t0|string: &ascii::String): &vector { + var $t1: &ascii::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::byte($t0|char: ascii::Char): u8 { + var $t1: ascii::Char + var $t2: u8 + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::Char($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::char($t0|byte: u8): ascii::Char { + var $t1: u8 + var $t2: bool + var $t3: u64 + var $t4: u8 + var $t5: ascii::Char + 0: $t1 := copy($t0) + 1: $t2 := ascii::is_valid_char($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 65536 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack ascii::Char($t4) + 11: return $t5 +} + + +[variant baseline] +fun ascii::char_to_lowercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 65 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 90 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := +($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +fun ascii::char_to_uppercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 97 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 122 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := -($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +public fun ascii::into_bytes($t0|string: ascii::String): vector { + var $t1: ascii::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::is_printable_char($t0|byte: u8): bool { + var $t1|tmp#$1: bool + var $t2: u8 + var $t3: u8 + var $t4: bool + var $t5: u8 + var $t6: u8 + var $t7: bool + var $t8: bool + var $t9: bool + 0: $t2 := copy($t0) + 1: $t3 := 32 + 2: $t4 := >=($t2, $t3) + 3: if ($t4) goto 4 else goto 10 + 4: label L1 + 5: $t5 := move($t0) + 6: $t6 := 126 + 7: $t7 := <=($t5, $t6) + 8: $t1 := $t7 + 9: goto 14 + 10: label L0 + 11: $t8 := false + 12: $t1 := $t8 + 13: goto 14 + 14: label L2 + 15: $t9 := move($t1) + 16: return $t9 +} + + +[variant baseline] +public fun ascii::is_valid_char($t0|b: u8): bool { + var $t1: u8 + var $t2: u8 + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := 127 + 2: $t3 := <=($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::pop_char($t0|string: &mut ascii::String): ascii::Char { + var $t1: &mut ascii::String + var $t2: &mut vector + var $t3: u8 + var $t4: ascii::Char + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::pop_back($t2) + 3: $t4 := pack ascii::Char($t3) + 4: return $t4 +} + + +[variant baseline] +public fun ascii::push_char($t0|string: &mut ascii::String, $t1|char: ascii::Char) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: &ascii::Char + var $t5: &u8 + var $t6: u8 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.byte($t4) + 4: $t6 := read_ref($t5) + 5: vector::push_back($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun ascii::substring($t0|string: &ascii::String, $t1|i: u64, $t2|j: u64): ascii::String { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|i#1#3: u64 + var $t6|i#1#6: u64 + var $t7|stop#1#3: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: &ascii::String + var $t13: u64 + var $t14: bool + var $t15: bool + var $t16: bool + var $t17: &ascii::String + var $t18: u64 + var $t19: vector + var $t20: u64 + var $t21: u64 + var $t22: u64 + var $t23: u64 + var $t24: bool + var $t25: u64 + var $t26: &mut vector + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: &u8 + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &ascii::String + var $t36: vector + var $t37: ascii::String + 0: $t8 := copy($t1) + 1: $t9 := copy($t2) + 2: $t10 := <=($t8, $t9) + 3: if ($t10) goto 4 else goto 11 + 4: label L1 + 5: $t11 := copy($t2) + 6: $t12 := copy($t0) + 7: $t13 := ascii::length($t12) + 8: $t14 := <=($t11, $t13) + 9: $t3 := $t14 + 10: goto 15 + 11: label L0 + 12: $t15 := false + 13: $t3 := $t15 + 14: goto 15 + 15: label L2 + 16: $t16 := move($t3) + 17: if ($t16) goto 18 else goto 20 + 18: label L4 + 19: goto 25 + 20: label L3 + 21: $t17 := move($t0) + 22: destroy($t17) + 23: $t18 := 65537 + 24: abort($t18) + 25: label L5 + 26: $t19 := [] + 27: $t4 := $t19 + 28: $t20 := move($t1) + 29: $t5 := $t20 + 30: $t21 := move($t2) + 31: $t7 := $t21 + 32: goto 33 + 33: label L8 + 34: $t22 := copy($t5) + 35: $t23 := copy($t7) + 36: $t24 := <($t22, $t23) + 37: if ($t24) goto 38 else goto 53 + 38: label L7 + 39: $t25 := copy($t5) + 40: $t6 := $t25 + 41: $t26 := borrow_local($t4) + 42: $t27 := copy($t0) + 43: $t28 := borrow_field.bytes($t27) + 44: $t29 := move($t6) + 45: $t30 := vector::borrow($t28, $t29) + 46: $t31 := read_ref($t30) + 47: vector::push_back($t26, $t31) + 48: $t32 := move($t5) + 49: $t33 := 1 + 50: $t34 := +($t32, $t33) + 51: $t5 := $t34 + 52: goto 33 + 53: label L6 + 54: $t35 := move($t0) + 55: destroy($t35) + 56: $t36 := move($t4) + 57: $t37 := pack ascii::String($t36) + 58: return $t37 +} + + +[variant baseline] +public fun ascii::to_lowercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_lowercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} + + +[variant baseline] +public fun ascii::to_uppercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_uppercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} + + +[variant baseline] +public fun ascii::try_string($t0|bytes: vector): option::Option { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|tmp#$3: option::Option + var $t4|i#1#12: u64 + var $t5|i#1#9: u64 + var $t6|stop#1#9: u64 + var $t7|v#1#3: &vector + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u64 + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool + var $t25: u64 + var $t26: u64 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + var $t31: vector + var $t32: ascii::String + var $t33: option::Option + var $t34: option::Option + var $t35: option::Option + 0: $t8 := borrow_local($t0) + 1: $t7 := $t8 + 2: $t9 := copy($t7) + 3: $t10 := vector::length($t9) + 4: $t1 := $t10 + 5: $t11 := 0 + 6: $t5 := $t11 + 7: $t12 := move($t1) + 8: $t6 := $t12 + 9: goto 10 + 10: label L5 + 11: $t13 := copy($t5) + 12: $t14 := copy($t6) + 13: $t15 := <($t13, $t14) + 14: if ($t15) goto 15 else goto 37 + 15: label L1 + 16: $t16 := copy($t5) + 17: $t4 := $t16 + 18: $t17 := copy($t7) + 19: $t18 := move($t4) + 20: $t19 := vector::borrow($t17, $t18) + 21: $t20 := read_ref($t19) + 22: $t21 := ascii::is_valid_char($t20) + 23: $t22 := !($t21) + 24: if ($t22) goto 25 else goto 31 + 25: label L3 + 26: $t23 := move($t7) + 27: destroy($t23) + 28: $t24 := false + 29: $t2 := $t24 + 30: goto 43 + 31: label L2 + 32: $t25 := move($t5) + 33: $t26 := 1 + 34: $t27 := +($t25, $t26) + 35: $t5 := $t27 + 36: goto 10 + 37: label L0 + 38: $t28 := move($t7) + 39: destroy($t28) + 40: $t29 := true + 41: $t2 := $t29 + 42: goto 43 + 43: label L4 + 44: $t30 := move($t2) + 45: if ($t30) goto 46 else goto 52 + 46: label L7 + 47: $t31 := move($t0) + 48: $t32 := pack ascii::String($t31) + 49: $t33 := option::some($t32) + 50: $t3 := $t33 + 51: goto 56 + 52: label L6 + 53: $t34 := option::none() + 54: $t3 := $t34 + 55: goto 56 + 56: label L8 + 57: $t35 := move($t3) + 58: return $t35 +} + + +[variant baseline] +public fun string::append($t0|s: &mut string::String, $t1|r: string::String) { + var $t2: &mut string::String + var $t3: &mut vector + var $t4: &string::String + var $t5: &vector + var $t6: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := read_ref($t5) + 5: vector::append($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun string::index_of($t0|s: &string::String, $t1|r: &string::String): u64 { + var $t2: &string::String + var $t3: &vector + var $t4: &string::String + var $t5: &vector + var $t6: u64 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := string::internal_index_of($t3, $t5) + 5: return $t6 +} + + +[variant baseline] +public fun string::insert($t0|s: &mut string::String, $t1|at: u64, $t2|o: string::String) { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: &vector + var $t5|end#1#0: string::String + var $t6|front#1#0: string::String + var $t7|l#1#0: u64 + var $t8: &mut string::String + var $t9: &vector + var $t10: u64 + var $t11: &vector + var $t12: u64 + var $t13: bool + var $t14: &vector + var $t15: u64 + var $t16: bool + var $t17: &vector + var $t18: bool + var $t19: bool + var $t20: &mut string::String + var $t21: u64 + var $t22: &mut string::String + var $t23: &string::String + var $t24: u64 + var $t25: &mut string::String + var $t26: &string::String + var $t27: u64 + var $t28: u64 + var $t29: string::String + var $t30: &mut string::String + var $t31: &string::String + var $t32: u64 + var $t33: u64 + var $t34: string::String + var $t35: &mut string::String + var $t36: string::String + var $t37: &mut string::String + var $t38: string::String + var $t39: string::String + var $t40: &mut string::String + 0: $t8 := copy($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t4 := $t9 + 3: $t10 := copy($t1) + 4: $t11 := copy($t4) + 5: $t12 := vector::length($t11) + 6: $t13 := <=($t10, $t12) + 7: if ($t13) goto 8 else goto 14 + 8: label L1 + 9: $t14 := move($t4) + 10: $t15 := copy($t1) + 11: $t16 := string::internal_is_char_boundary($t14, $t15) + 12: $t3 := $t16 + 13: goto 20 + 14: label L0 + 15: $t17 := move($t4) + 16: destroy($t17) + 17: $t18 := false + 18: $t3 := $t18 + 19: goto 20 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 25 + 23: label L4 + 24: goto 30 + 25: label L3 + 26: $t20 := move($t0) + 27: destroy($t20) + 28: $t21 := 2 + 29: abort($t21) + 30: label L5 + 31: $t22 := copy($t0) + 32: $t23 := freeze_ref($t22) + 33: $t24 := string::length($t23) + 34: $t7 := $t24 + 35: $t25 := copy($t0) + 36: $t26 := freeze_ref($t25) + 37: $t27 := 0 + 38: $t28 := copy($t1) + 39: $t29 := string::substring($t26, $t27, $t28) + 40: $t6 := $t29 + 41: $t30 := copy($t0) + 42: $t31 := freeze_ref($t30) + 43: $t32 := move($t1) + 44: $t33 := move($t7) + 45: $t34 := string::substring($t31, $t32, $t33) + 46: $t5 := $t34 + 47: $t35 := borrow_local($t6) + 48: $t36 := move($t2) + 49: string::append($t35, $t36) + 50: $t37 := borrow_local($t6) + 51: $t38 := move($t5) + 52: string::append($t37, $t38) + 53: $t39 := move($t6) + 54: $t40 := move($t0) + 55: write_ref($t40, $t39) + 56: return () +} + + +[variant baseline] +public fun string::is_empty($t0|s: &string::String): bool { + var $t1: &string::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::length($t0|s: &string::String): u64 { + var $t1: &string::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::as_bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::into_bytes($t0|s: string::String): vector { + var $t1: string::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack string::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := string::as_bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::substring($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3|tmp#$3: bool + var $t4|tmp#$4: bool + var $t5|tmp#$5: bool + var $t6|bytes#1#0: &vector + var $t7|l#1#0: u64 + var $t8: &string::String + var $t9: &vector + var $t10: &vector + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: bool + var $t15: u64 + var $t16: u64 + var $t17: bool + var $t18: bool + var $t19: bool + var $t20: &vector + var $t21: u64 + var $t22: bool + var $t23: bool + var $t24: bool + var $t25: &vector + var $t26: u64 + var $t27: bool + var $t28: bool + var $t29: bool + var $t30: &vector + var $t31: u64 + var $t32: &vector + var $t33: u64 + var $t34: u64 + var $t35: vector + var $t36: string::String + 0: $t8 := move($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t6 := $t9 + 3: $t10 := copy($t6) + 4: $t11 := vector::length($t10) + 5: $t7 := $t11 + 6: $t12 := copy($t2) + 7: $t13 := move($t7) + 8: $t14 := <=($t12, $t13) + 9: if ($t14) goto 10 else goto 16 + 10: label L1 + 11: $t15 := copy($t1) + 12: $t16 := copy($t2) + 13: $t17 := <=($t15, $t16) + 14: $t3 := $t17 + 15: goto 20 + 16: label L0 + 17: $t18 := false + 18: $t3 := $t18 + 19: goto 20 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 29 + 23: label L4 + 24: $t20 := copy($t6) + 25: $t21 := copy($t1) + 26: $t22 := string::internal_is_char_boundary($t20, $t21) + 27: $t4 := $t22 + 28: goto 33 + 29: label L3 + 30: $t23 := false + 31: $t4 := $t23 + 32: goto 33 + 33: label L5 + 34: $t24 := move($t4) + 35: if ($t24) goto 36 else goto 42 + 36: label L7 + 37: $t25 := copy($t6) + 38: $t26 := copy($t2) + 39: $t27 := string::internal_is_char_boundary($t25, $t26) + 40: $t5 := $t27 + 41: goto 46 + 42: label L6 + 43: $t28 := false + 44: $t5 := $t28 + 45: goto 46 + 46: label L8 + 47: $t29 := move($t5) + 48: if ($t29) goto 49 else goto 51 + 49: label L10 + 50: goto 56 + 51: label L9 + 52: $t30 := move($t6) + 53: destroy($t30) + 54: $t31 := 2 + 55: abort($t31) + 56: label L11 + 57: $t32 := move($t6) + 58: $t33 := move($t1) + 59: $t34 := move($t2) + 60: $t35 := string::internal_sub_string($t32, $t33, $t34) + 61: $t36 := pack string::String($t35) + 62: return $t36 +} + + +[variant baseline] +public fun string::append_utf8($t0|s: &mut string::String, $t1|bytes: vector) { + var $t2: &mut string::String + var $t3: vector + var $t4: string::String + 0: $t2 := move($t0) + 1: $t3 := move($t1) + 2: $t4 := string::utf8($t3) + 3: string::append($t2, $t4) + 4: return () +} + + +[variant baseline] +public fun string::from_ascii($t0|s: ascii::String): string::String { + var $t1: ascii::String + var $t2: vector + var $t3: string::String + 0: $t1 := move($t0) + 1: $t2 := ascii::into_bytes($t1) + 2: $t3 := pack string::String($t2) + 3: return $t3 +} + + +[variant baseline] +native fun string::internal_check_utf8($t0|v: &vector): bool; + + +[variant baseline] +native fun string::internal_index_of($t0|v: &vector, $t1|r: &vector): u64; + + +[variant baseline] +native fun string::internal_is_char_boundary($t0|v: &vector, $t1|i: u64): bool; + + +[variant baseline] +native fun string::internal_sub_string($t0|v: &vector, $t1|i: u64, $t2|j: u64): vector; + + +[variant baseline] +public fun string::sub_string($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3: &string::String + var $t4: u64 + var $t5: u64 + var $t6: string::String + 0: $t3 := move($t0) + 1: $t4 := move($t1) + 2: $t5 := move($t2) + 3: $t6 := string::substring($t3, $t4, $t5) + 4: return $t6 +} + + +[variant baseline] +public fun string::to_ascii($t0|s: string::String): ascii::String { + var $t1: string::String + var $t2: vector + var $t3: ascii::String + 0: $t1 := move($t0) + 1: $t2 := unpack string::String($t1) + 2: $t3 := ascii::string($t2) + 3: return $t3 +} + + +[variant baseline] +public fun string::try_utf8($t0|bytes: vector): option::Option { + var $t1|tmp#$1: option::Option + var $t2: &vector + var $t3: bool + var $t4: vector + var $t5: string::String + var $t6: option::Option + var $t7: option::Option + var $t8: option::Option + 0: $t2 := borrow_local($t0) + 1: $t3 := string::internal_check_utf8($t2) + 2: if ($t3) goto 3 else goto 9 + 3: label L1 + 4: $t4 := move($t0) + 5: $t5 := pack string::String($t4) + 6: $t6 := option::some($t5) + 7: $t1 := $t6 + 8: goto 13 + 9: label L0 + 10: $t7 := option::none() + 11: $t1 := $t7 + 12: goto 13 + 13: label L2 + 14: $t8 := move($t1) + 15: return $t8 +} + + +[variant baseline] +public fun string::utf8($t0|bytes: vector): string::String { + var $t1: &vector + var $t2: bool + var $t3: u64 + var $t4: vector + var $t5: string::String + 0: $t1 := borrow_local($t0) + 1: $t2 := string::internal_check_utf8($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 1 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack string::String($t4) + 11: return $t5 +} + +============ after pipeline `escape_analysis` ================ + +[variant baseline] +public fun u64::diff($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 14 + 8: label L1 + 9: $t10 := move($t3) + 10: $t11 := move($t4) + 11: $t12 := -($t10, $t11) + 12: $t2 := $t12 + 13: goto 20 + 14: label L0 + 15: $t13 := move($t4) + 16: $t14 := move($t3) + 17: $t15 := -($t13, $t14) + 18: $t2 := $t15 + 19: goto 20 + 20: label L2 + 21: $t16 := move($t2) + 22: return $t16 +} + + +[variant baseline] +public fun u64::divide_and_round_up($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: u64 + var $t11: bool + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := %($t7, $t8) + 7: $t10 := 0 + 8: $t11 := ==($t9, $t10) + 9: if ($t11) goto 10 else goto 16 + 10: label L1 + 11: $t12 := move($t3) + 12: $t13 := move($t4) + 13: $t14 := /($t12, $t13) + 14: $t2 := $t14 + 15: goto 24 + 16: label L0 + 17: $t15 := move($t3) + 18: $t16 := move($t4) + 19: $t17 := /($t15, $t16) + 20: $t18 := 1 + 21: $t19 := +($t17, $t18) + 22: $t2 := $t19 + 23: goto 24 + 24: label L2 + 25: $t20 := move($t2) + 26: return $t20 +} + + +[variant baseline] +public fun u64::max($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::min($t0|x: u64, $t1|y: u64): u64 { + var $t2|tmp#$2: u64 + var $t3|x#1#1: u64 + var $t4|y#1#1: u64 + var $t5: u64 + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: u64 + var $t11: u64 + var $t12: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := move($t1) + 3: $t4 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := copy($t4) + 6: $t9 := <($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t3) + 10: $t2 := $t10 + 11: goto 16 + 12: label L0 + 13: $t11 := move($t4) + 14: $t2 := $t11 + 15: goto 16 + 16: label L2 + 17: $t12 := move($t2) + 18: return $t12 +} + + +[variant baseline] +public fun u64::pow($t0|base: u64, $t1|exponent: u8): u64 { + var $t2|base#1#1: u64 + var $t3|exponent#1#1: u8 + var $t4|res#1#1: u64 + var $t5: u64 + var $t6: u8 + var $t7: u64 + var $t8: u8 + var $t9: u8 + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: bool + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u8 + var $t20: u8 + var $t21: u8 + var $t22: u64 + var $t23: u64 + var $t24: u64 + var $t25: u8 + var $t26: u8 + var $t27: u8 + var $t28: u64 + 0: $t5 := move($t0) + 1: $t2 := $t5 + 2: $t6 := move($t1) + 3: $t3 := $t6 + 4: $t7 := 1 + 5: $t4 := $t7 + 6: goto 7 + 7: label L5 + 8: $t8 := copy($t3) + 9: $t9 := 1 + 10: $t10 := >=($t8, $t9) + 11: if ($t10) goto 12 else goto 41 + 12: label L1 + 13: goto 14 + 14: label L2 + 15: $t11 := copy($t3) + 16: $t12 := 2 + 17: $t13 := %($t11, $t12) + 18: $t14 := 0 + 19: $t15 := ==($t13, $t14) + 20: if ($t15) goto 21 else goto 31 + 21: label L4 + 22: $t16 := copy($t2) + 23: $t17 := move($t2) + 24: $t18 := *($t16, $t17) + 25: $t2 := $t18 + 26: $t19 := move($t3) + 27: $t20 := 2 + 28: $t21 := /($t19, $t20) + 29: $t3 := $t21 + 30: goto 7 + 31: label L3 + 32: $t22 := move($t4) + 33: $t23 := copy($t2) + 34: $t24 := *($t22, $t23) + 35: $t4 := $t24 + 36: $t25 := move($t3) + 37: $t26 := 1 + 38: $t27 := -($t25, $t26) + 39: $t3 := $t27 + 40: goto 7 + 41: label L0 + 42: $t28 := move($t4) + 43: return $t28 +} + + +[variant baseline] +public fun u64::sqrt($t0|x: u64): u64 { + var $t1|bit#1#1: u128 + var $t2|res#1#1: u128 + var $t3|x#1#1: u64 + var $t4|x#2#1: u128 + var $t5: u64 + var $t6: u128 + var $t7: u128 + var $t8: u64 + var $t9: u128 + var $t10: u128 + var $t11: u128 + var $t12: bool + var $t13: u128 + var $t14: u128 + var $t15: u128 + var $t16: u128 + var $t17: bool + var $t18: u128 + var $t19: u128 + var $t20: u128 + var $t21: u128 + var $t22: u128 + var $t23: u128 + var $t24: u8 + var $t25: u128 + var $t26: u128 + var $t27: u128 + var $t28: u128 + var $t29: u8 + var $t30: u128 + var $t31: u128 + var $t32: u8 + var $t33: u128 + var $t34: u128 + var $t35: u64 + 0: $t5 := move($t0) + 1: $t3 := $t5 + 2: $t6 := 18446744073709551616 + 3: $t1 := $t6 + 4: $t7 := 0 + 5: $t2 := $t7 + 6: $t8 := move($t3) + 7: $t9 := (u128)($t8) + 8: $t4 := $t9 + 9: goto 10 + 10: label L6 + 11: $t10 := copy($t1) + 12: $t11 := 0 + 13: $t12 := !=($t10, $t11) + 14: if ($t12) goto 15 else goto 50 + 15: label L1 + 16: goto 17 + 17: label L2 + 18: $t13 := copy($t4) + 19: $t14 := copy($t2) + 20: $t15 := copy($t1) + 21: $t16 := +($t14, $t15) + 22: $t17 := >=($t13, $t16) + 23: if ($t17) goto 24 else goto 38 + 24: label L4 + 25: $t18 := move($t4) + 26: $t19 := copy($t2) + 27: $t20 := copy($t1) + 28: $t21 := +($t19, $t20) + 29: $t22 := -($t18, $t21) + 30: $t4 := $t22 + 31: $t23 := move($t2) + 32: $t24 := 1 + 33: $t25 := >>($t23, $t24) + 34: $t26 := copy($t1) + 35: $t27 := +($t25, $t26) + 36: $t2 := $t27 + 37: goto 44 + 38: label L3 + 39: $t28 := move($t2) + 40: $t29 := 1 + 41: $t30 := >>($t28, $t29) + 42: $t2 := $t30 + 43: goto 44 + 44: label L5 + 45: $t31 := move($t1) + 46: $t32 := 2 + 47: $t33 := >>($t31, $t32) + 48: $t1 := $t33 + 49: goto 10 + 50: label L0 + 51: $t34 := move($t2) + 52: $t35 := (u64)($t34) + 53: return $t35 +} + + +[variant baseline] +public fun vector::append<#0>($t0|lhs: &mut vector<#0>, $t1|other: vector<#0>) { + var $t2: &mut vector<#0> + var $t3: &vector<#0> + var $t4: bool + var $t5: bool + var $t6: &mut vector<#0> + var $t7: &mut vector<#0> + var $t8: #0 + var $t9: &mut vector<#0> + var $t10: vector<#0> + 0: $t2 := borrow_local($t1) + 1: vector::reverse<#0>($t2) + 2: goto 3 + 3: label L3 + 4: $t3 := borrow_local($t1) + 5: $t4 := vector::is_empty<#0>($t3) + 6: $t5 := !($t4) + 7: if ($t5) goto 8 else goto 16 + 8: label L1 + 9: goto 10 + 10: label L2 + 11: $t6 := copy($t0) + 12: $t7 := borrow_local($t1) + 13: $t8 := vector::pop_back<#0>($t7) + 14: vector::push_back<#0>($t6, $t8) + 15: goto 3 + 16: label L0 + 17: $t9 := move($t0) + 18: destroy($t9) + 19: $t10 := move($t1) + 20: vector::destroy_empty<#0>($t10) + 21: return () +} + + +[variant baseline] +public native fun vector::borrow<#0>($t0|v: &vector<#0>, $t1|i: u64): � + + +[variant baseline] +public native fun vector::borrow_mut<#0>($t0|v: &mut vector<#0>, $t1|i: u64): &mut #0; + + +[variant baseline] +public fun vector::contains<#0>($t0|v: &vector<#0>, $t1|e: �): bool { + var $t2|i#1#0: u64 + var $t3|len#1#0: u64 + var $t4: u64 + var $t5: &vector<#0> + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: &vector<#0> + var $t11: u64 + var $t12: � + var $t13: � + var $t14: bool + var $t15: &vector<#0> + var $t16: � + var $t17: bool + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: &vector<#0> + var $t22: � + var $t23: bool + 0: $t4 := 0 + 1: $t2 := $t4 + 2: $t5 := copy($t0) + 3: $t6 := vector::length<#0>($t5) + 4: $t3 := $t6 + 5: goto 6 + 6: label L5 + 7: $t7 := copy($t2) + 8: $t8 := copy($t3) + 9: $t9 := <($t7, $t8) + 10: if ($t9) goto 11 else goto 33 + 11: label L1 + 12: goto 13 + 13: label L2 + 14: $t10 := copy($t0) + 15: $t11 := copy($t2) + 16: $t12 := vector::borrow<#0>($t10, $t11) + 17: $t13 := copy($t1) + 18: $t14 := ==($t12, $t13) + 19: if ($t14) goto 20 else goto 27 + 20: label L4 + 21: $t15 := move($t0) + 22: destroy($t15) + 23: $t16 := move($t1) + 24: destroy($t16) + 25: $t17 := true + 26: return $t17 + 27: label L3 + 28: $t18 := move($t2) + 29: $t19 := 1 + 30: $t20 := +($t18, $t19) + 31: $t2 := $t20 + 32: goto 6 + 33: label L0 + 34: $t21 := move($t0) + 35: destroy($t21) + 36: $t22 := move($t1) + 37: destroy($t22) + 38: $t23 := false + 39: return $t23 +} + + +[variant baseline] +public native fun vector::destroy_empty<#0>($t0|v: vector<#0>); + + +[variant baseline] +public native fun vector::empty<#0>(): vector<#0>; + + +[variant baseline] +public fun vector::index_of<#0>($t0|v: &vector<#0>, $t1|e: �): (bool, u64) { + var $t2|i#1#0: u64 + var $t3|len#1#0: u64 + var $t4: u64 + var $t5: &vector<#0> + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: &vector<#0> + var $t11: u64 + var $t12: � + var $t13: � + var $t14: bool + var $t15: &vector<#0> + var $t16: � + var $t17: bool + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: u64 + var $t22: &vector<#0> + var $t23: � + var $t24: bool + var $t25: u64 + 0: $t4 := 0 + 1: $t2 := $t4 + 2: $t5 := copy($t0) + 3: $t6 := vector::length<#0>($t5) + 4: $t3 := $t6 + 5: goto 6 + 6: label L5 + 7: $t7 := copy($t2) + 8: $t8 := copy($t3) + 9: $t9 := <($t7, $t8) + 10: if ($t9) goto 11 else goto 34 + 11: label L1 + 12: goto 13 + 13: label L2 + 14: $t10 := copy($t0) + 15: $t11 := copy($t2) + 16: $t12 := vector::borrow<#0>($t10, $t11) + 17: $t13 := copy($t1) + 18: $t14 := ==($t12, $t13) + 19: if ($t14) goto 20 else goto 28 + 20: label L4 + 21: $t15 := move($t0) + 22: destroy($t15) + 23: $t16 := move($t1) + 24: destroy($t16) + 25: $t17 := true + 26: $t18 := move($t2) + 27: return ($t17, $t18) + 28: label L3 + 29: $t19 := move($t2) + 30: $t20 := 1 + 31: $t21 := +($t19, $t20) + 32: $t2 := $t21 + 33: goto 6 + 34: label L0 + 35: $t22 := move($t0) + 36: destroy($t22) + 37: $t23 := move($t1) + 38: destroy($t23) + 39: $t24 := false + 40: $t25 := 0 + 41: return ($t24, $t25) +} + + +[variant baseline] +public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { + var $t3|len#1#0: u64 + var $t4: &mut vector<#0> + var $t5: &vector<#0> + var $t6: u64 + var $t7: u64 + var $t8: u64 + var $t9: bool + var $t10: &mut vector<#0> + var $t11: u64 + var $t12: &mut vector<#0> + var $t13: #0 + var $t14: u64 + var $t15: u64 + var $t16: bool + var $t17: &mut vector<#0> + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: u64 + var $t22: u64 + var $t23: &mut vector<#0> + 0: $t4 := copy($t0) + 1: $t5 := freeze_ref($t4) + 2: $t6 := vector::length<#0>($t5) + 3: $t3 := $t6 + 4: $t7 := copy($t2) + 5: $t8 := copy($t3) + 6: $t9 := >($t7, $t8) + 7: if ($t9) goto 8 else goto 13 + 8: label L1 + 9: $t10 := move($t0) + 10: destroy($t10) + 11: $t11 := 131072 + 12: abort($t11) + 13: label L0 + 14: $t12 := copy($t0) + 15: $t13 := move($t1) + 16: vector::push_back<#0>($t12, $t13) + 17: goto 18 + 18: label L4 + 19: $t14 := copy($t2) + 20: $t15 := copy($t3) + 21: $t16 := <($t14, $t15) + 22: if ($t16) goto 23 else goto 33 + 23: label L3 + 24: $t17 := copy($t0) + 25: $t18 := copy($t2) + 26: $t19 := copy($t3) + 27: vector::swap<#0>($t17, $t18, $t19) + 28: $t20 := move($t2) + 29: $t21 := 1 + 30: $t22 := +($t20, $t21) + 31: $t2 := $t22 + 32: goto 18 + 33: label L2 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: return () +} + + +[variant baseline] +public fun vector::is_empty<#0>($t0|v: &vector<#0>): bool { + var $t1: &vector<#0> + var $t2: u64 + var $t3: u64 + var $t4: bool + 0: $t1 := move($t0) + 1: $t2 := vector::length<#0>($t1) + 2: $t3 := 0 + 3: $t4 := ==($t2, $t3) + 4: return $t4 +} + + +[variant baseline] +public native fun vector::length<#0>($t0|v: &vector<#0>): u64; + + +[variant baseline] +public native fun vector::pop_back<#0>($t0|v: &mut vector<#0>): #0; + + +[variant baseline] +public native fun vector::push_back<#0>($t0|v: &mut vector<#0>, $t1|e: #0); + + +[variant baseline] +public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { + var $t2|tmp#$2: u64 + var $t3|tmp#$3: &mut vector<#0> + var $t4|len#1#0: u64 + var $t5: &mut vector<#0> + var $t6: &vector<#0> + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: &mut vector<#0> + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + var $t17: u64 + var $t18: bool + var $t19: &mut vector<#0> + var $t20: u64 + var $t21: u64 + var $t22: u64 + var $t23: u64 + var $t24: &mut vector<#0> + var $t25: u64 + var $t26: u64 + var $t27: &mut vector<#0> + var $t28: #0 + 0: $t5 := copy($t0) + 1: $t6 := freeze_ref($t5) + 2: $t7 := vector::length<#0>($t6) + 3: $t4 := $t7 + 4: $t8 := copy($t1) + 5: $t9 := copy($t4) + 6: $t10 := >=($t8, $t9) + 7: if ($t10) goto 8 else goto 13 + 8: label L1 + 9: $t11 := move($t0) + 10: destroy($t11) + 11: $t12 := 131072 + 12: abort($t12) + 13: label L0 + 14: $t13 := move($t4) + 15: $t14 := 1 + 16: $t15 := -($t13, $t14) + 17: $t4 := $t15 + 18: goto 19 + 19: label L4 + 20: $t16 := copy($t1) + 21: $t17 := copy($t4) + 22: $t18 := <($t16, $t17) + 23: if ($t18) goto 24 else goto 38 + 24: label L3 + 25: $t19 := copy($t0) + 26: $t3 := $t19 + 27: $t20 := copy($t1) + 28: $t2 := $t20 + 29: $t21 := move($t1) + 30: $t22 := 1 + 31: $t23 := +($t21, $t22) + 32: $t1 := $t23 + 33: $t24 := move($t3) + 34: $t25 := move($t2) + 35: $t26 := copy($t1) + 36: vector::swap<#0>($t24, $t25, $t26) + 37: goto 19 + 38: label L2 + 39: $t27 := move($t0) + 40: $t28 := vector::pop_back<#0>($t27) + 41: return $t28 +} + + +[variant baseline] +public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { + var $t1|back_index#1#0: u64 + var $t2|front_index#1#0: u64 + var $t3|len#1#0: u64 + var $t4: &mut vector<#0> var $t5: &vector<#0> var $t6: u64 var $t7: u64 var $t8: u64 var $t9: bool + var $t10: &mut vector<#0> + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: u64 + var $t16: u64 + var $t17: bool + var $t18: &mut vector<#0> + var $t19: u64 + var $t20: u64 + var $t21: u64 + var $t22: u64 + var $t23: u64 + var $t24: u64 + var $t25: u64 + var $t26: u64 + var $t27: &mut vector<#0> + 0: $t4 := copy($t0) + 1: $t5 := freeze_ref($t4) + 2: $t6 := vector::length<#0>($t5) + 3: $t3 := $t6 + 4: $t7 := copy($t3) + 5: $t8 := 0 + 6: $t9 := ==($t7, $t8) + 7: if ($t9) goto 8 else goto 12 + 8: label L1 + 9: $t10 := move($t0) + 10: destroy($t10) + 11: return () + 12: label L0 + 13: $t11 := 0 + 14: $t2 := $t11 + 15: $t12 := move($t3) + 16: $t13 := 1 + 17: $t14 := -($t12, $t13) + 18: $t1 := $t14 + 19: goto 20 + 20: label L4 + 21: $t15 := copy($t2) + 22: $t16 := copy($t1) + 23: $t17 := <($t15, $t16) + 24: if ($t17) goto 25 else goto 39 + 25: label L3 + 26: $t18 := copy($t0) + 27: $t19 := copy($t2) + 28: $t20 := copy($t1) + 29: vector::swap<#0>($t18, $t19, $t20) + 30: $t21 := move($t2) + 31: $t22 := 1 + 32: $t23 := +($t21, $t22) + 33: $t2 := $t23 + 34: $t24 := move($t1) + 35: $t25 := 1 + 36: $t26 := -($t24, $t25) + 37: $t1 := $t26 + 38: goto 20 + 39: label L2 + 40: $t27 := move($t0) + 41: destroy($t27) + 42: return () +} + + +[variant baseline] +public fun vector::singleton<#0>($t0|e: #0): vector<#0> { + var $t1|v#1#0: vector<#0> + var $t2: vector<#0> + var $t3: &mut vector<#0> + var $t4: #0 + var $t5: vector<#0> + 0: $t2 := vector::empty<#0>() + 1: $t1 := $t2 + 2: $t3 := borrow_local($t1) + 3: $t4 := move($t0) + 4: vector::push_back<#0>($t3, $t4) + 5: $t5 := move($t1) + 6: return $t5 +} + + +[variant baseline] +public native fun vector::swap<#0>($t0|v: &mut vector<#0>, $t1|i: u64, $t2|j: u64); + + +[variant baseline] +public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { + var $t2|last_idx#1#0: u64 + var $t3: &mut vector<#0> + var $t4: &vector<#0> + var $t5: bool + var $t6: bool + var $t7: &mut vector<#0> + var $t8: u64 + var $t9: &mut vector<#0> + var $t10: &vector<#0> + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: &mut vector<#0> + var $t15: u64 + var $t16: u64 + var $t17: &mut vector<#0> + var $t18: #0 + 0: $t3 := copy($t0) + 1: $t4 := freeze_ref($t3) + 2: $t5 := vector::is_empty<#0>($t4) + 3: $t6 := !($t5) + 4: if ($t6) goto 5 else goto 7 + 5: label L1 + 6: goto 12 + 7: label L0 + 8: $t7 := move($t0) + 9: destroy($t7) + 10: $t8 := 131072 + 11: abort($t8) + 12: label L2 + 13: $t9 := copy($t0) + 14: $t10 := freeze_ref($t9) + 15: $t11 := vector::length<#0>($t10) + 16: $t12 := 1 + 17: $t13 := -($t11, $t12) + 18: $t2 := $t13 + 19: $t14 := copy($t0) + 20: $t15 := move($t1) + 21: $t16 := move($t2) + 22: vector::swap<#0>($t14, $t15, $t16) + 23: $t17 := move($t0) + 24: $t18 := vector::pop_back<#0>($t17) + 25: return $t18 +} + + +[variant baseline] +fun ReturnRefsIntoVec::return_vec_index_immut($t0|v: &vector): &u64 { + var $t1: &vector + var $t2: u64 + var $t3: &u64 + 0: $t1 := move($t0) + 1: $t2 := 0 + 2: $t3 := vector::borrow($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +fun ReturnRefsIntoVec::return_vec_index_mut($t0|v: &mut vector): &mut u64 { + var $t1: &mut vector + var $t2: u64 + var $t3: &mut u64 + 0: $t1 := move($t0) + 1: $t2 := 0 + 2: $t3 := vector::borrow_mut($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::borrow<#0>($t0|t: &option::Option<#0>): � { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: &option::Option<#0> + var $t4: u64 + var $t5: &option::Option<#0> + var $t6: &vector<#0> + var $t7: u64 + var $t8: � + 0: $t1 := copy($t0) + 1: $t2 := option::is_some<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 10 + 5: label L0 + 6: $t3 := move($t0) + 7: destroy($t3) + 8: $t4 := 262145 + 9: abort($t4) + 10: label L2 + 11: $t5 := move($t0) + 12: $t6 := borrow_field>.vec($t5) + 13: $t7 := 0 + 14: $t8 := vector::borrow<#0>($t6, $t7) + 15: return $t8 +} + + +[variant baseline] +public fun option::borrow_mut<#0>($t0|t: &mut option::Option<#0>): &mut #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> + var $t5: u64 + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: u64 + var $t9: &mut #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := 0 + 15: $t9 := vector::borrow_mut<#0>($t7, $t8) + 16: return $t9 +} + + +[variant baseline] +public fun option::contains<#0>($t0|t: &option::Option<#0>, $t1|e_ref: �): bool { + var $t2: &option::Option<#0> + var $t3: &vector<#0> + var $t4: � + var $t5: bool + 0: $t2 := move($t0) + 1: $t3 := borrow_field>.vec($t2) + 2: $t4 := move($t1) + 3: $t5 := vector::contains<#0>($t3, $t4) + 4: return $t5 +} + + +[variant baseline] +public fun option::swap<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): #0 { + var $t2|old_value#1#0: #0 + var $t3|vec_ref#1#0: &mut vector<#0> + var $t4: &mut option::Option<#0> + var $t5: &option::Option<#0> + var $t6: bool + var $t7: &mut option::Option<#0> + var $t8: u64 + var $t9: &mut option::Option<#0> + var $t10: &mut vector<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: &mut vector<#0> + var $t14: #0 + var $t15: #0 + 0: $t4 := copy($t0) + 1: $t5 := freeze_ref($t4) + 2: $t6 := option::is_some<#0>($t5) + 3: if ($t6) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t7 := move($t0) + 8: destroy($t7) + 9: $t8 := 262145 + 10: abort($t8) + 11: label L2 + 12: $t9 := move($t0) + 13: $t10 := borrow_field>.vec($t9) + 14: $t3 := $t10 + 15: $t11 := copy($t3) + 16: $t12 := vector::pop_back<#0>($t11) + 17: $t2 := $t12 + 18: $t13 := move($t3) + 19: $t14 := move($t1) + 20: vector::push_back<#0>($t13, $t14) + 21: $t15 := move($t2) + 22: return $t15 +} + + +[variant baseline] +public fun option::borrow_with_default<#0>($t0|t: &option::Option<#0>, $t1|default_ref: �): � { + var $t2|tmp#$2: � + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: � + var $t10: � + var $t11: &vector<#0> + var $t12: u64 + var $t13: � + var $t14: � + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 20 + 12: label L0 + 13: $t10 := move($t1) + 14: destroy($t10) + 15: $t11 := move($t3) + 16: $t12 := 0 + 17: $t13 := vector::borrow<#0>($t11, $t12) + 18: $t2 := $t13 + 19: goto 20 + 20: label L2 + 21: $t14 := move($t2) + 22: return $t14 +} + + +[variant baseline] +public fun option::destroy_none<#0>($t0|t: option::Option<#0>) { + var $t1: &option::Option<#0> + var $t2: bool + var $t3: u64 + var $t4: option::Option<#0> + var $t5: vector<#0> + 0: $t1 := borrow_local($t0) + 1: $t2 := option::is_none<#0>($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 262144 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := unpack option::Option<#0>($t4) + 11: vector::destroy_empty<#0>($t5) + 12: return () +} + + +[variant baseline] +public fun option::destroy_some<#0>($t0|t: option::Option<#0>): #0 { + var $t1|elem#1#0: #0 + var $t2|vec#1#0: vector<#0> + var $t3: &option::Option<#0> + var $t4: bool + var $t5: u64 + var $t6: option::Option<#0> + var $t7: vector<#0> + var $t8: &mut vector<#0> + var $t9: #0 + var $t10: vector<#0> + var $t11: #0 + 0: $t3 := borrow_local($t0) + 1: $t4 := option::is_some<#0>($t3) + 2: if ($t4) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t5 := 262145 + 7: abort($t5) + 8: label L2 + 9: $t6 := move($t0) + 10: $t7 := unpack option::Option<#0>($t6) + 11: $t2 := $t7 + 12: $t8 := borrow_local($t2) + 13: $t9 := vector::pop_back<#0>($t8) + 14: $t1 := $t9 + 15: $t10 := move($t2) + 16: vector::destroy_empty<#0>($t10) + 17: $t11 := move($t1) + 18: return $t11 +} + + +[variant baseline] +public fun option::destroy_with_default<#0>($t0|t: option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec#1#0: vector<#0> + var $t4: option::Option<#0> + var $t5: vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: #0 + var $t9: &mut vector<#0> + var $t10: #0 + var $t11: #0 + 0: $t4 := move($t0) + 1: $t5 := unpack option::Option<#0>($t4) + 2: $t3 := $t5 + 3: $t6 := borrow_local($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 10 + 6: label L1 + 7: $t8 := move($t1) + 8: $t2 := $t8 + 9: goto 15 + 10: label L0 + 11: $t9 := borrow_local($t3) + 12: $t10 := vector::pop_back<#0>($t9) + 13: $t2 := $t10 + 14: goto 15 + 15: label L2 + 16: $t11 := move($t2) + 17: return $t11 +} + + +[variant baseline] +public fun option::extract<#0>($t0|t: &mut option::Option<#0>): #0 { + var $t1: &mut option::Option<#0> + var $t2: &option::Option<#0> + var $t3: bool + var $t4: &mut option::Option<#0> + var $t5: u64 + var $t6: &mut option::Option<#0> + var $t7: &mut vector<#0> + var $t8: #0 + 0: $t1 := copy($t0) + 1: $t2 := freeze_ref($t1) + 2: $t3 := option::is_some<#0>($t2) + 3: if ($t3) goto 4 else goto 6 + 4: label L1 + 5: goto 11 + 6: label L0 + 7: $t4 := move($t0) + 8: destroy($t4) + 9: $t5 := 262145 + 10: abort($t5) + 11: label L2 + 12: $t6 := move($t0) + 13: $t7 := borrow_field>.vec($t6) + 14: $t8 := vector::pop_back<#0>($t7) + 15: return $t8 +} + + +[variant baseline] +public fun option::fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0) { + var $t2|vec_ref#1#0: &mut vector<#0> + var $t3: &mut option::Option<#0> + var $t4: &mut vector<#0> + var $t5: &mut vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &mut vector<#0> + var $t9: u64 + var $t10: &mut vector<#0> + var $t11: #0 + 0: $t3 := move($t0) + 1: $t4 := borrow_field>.vec($t3) + 2: $t2 := $t4 + 3: $t5 := copy($t2) + 4: $t6 := freeze_ref($t5) + 5: $t7 := vector::is_empty<#0>($t6) + 6: if ($t7) goto 7 else goto 9 + 7: label L1 + 8: goto 14 + 9: label L0 + 10: $t8 := move($t2) + 11: destroy($t8) + 12: $t9 := 262144 + 13: abort($t9) + 14: label L2 + 15: $t10 := move($t2) + 16: $t11 := move($t1) + 17: vector::push_back<#0>($t10, $t11) + 18: return () +} + + +[variant baseline] +public fun option::get_with_default<#0>($t0|t: &option::Option<#0>, $t1|default: #0): #0 { + var $t2|tmp#$2: #0 + var $t3|vec_ref#1#0: &vector<#0> + var $t4: &option::Option<#0> + var $t5: &vector<#0> + var $t6: &vector<#0> + var $t7: bool + var $t8: &vector<#0> + var $t9: #0 var $t10: &vector<#0> var $t11: u64 var $t12: � - var $t13: � + var $t13: #0 + var $t14: #0 + 0: $t4 := move($t0) + 1: $t5 := borrow_field>.vec($t4) + 2: $t3 := $t5 + 3: $t6 := copy($t3) + 4: $t7 := vector::is_empty<#0>($t6) + 5: if ($t7) goto 6 else goto 12 + 6: label L1 + 7: $t8 := move($t3) + 8: destroy($t8) + 9: $t9 := move($t1) + 10: $t2 := $t9 + 11: goto 19 + 12: label L0 + 13: $t10 := move($t3) + 14: $t11 := 0 + 15: $t12 := vector::borrow<#0>($t10, $t11) + 16: $t13 := read_ref($t12) + 17: $t2 := $t13 + 18: goto 19 + 19: label L2 + 20: $t14 := move($t2) + 21: return $t14 +} + + +[variant baseline] +public fun option::is_none<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::is_some<#0>($t0|t: &option::Option<#0>): bool { + var $t1: &option::Option<#0> + var $t2: &vector<#0> + var $t3: bool + var $t4: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field>.vec($t1) + 2: $t3 := vector::is_empty<#0>($t2) + 3: $t4 := !($t3) + 4: return $t4 +} + + +[variant baseline] +public fun option::none<#0>(): option::Option<#0> { + var $t0: vector<#0> + var $t1: option::Option<#0> + 0: $t0 := vector::empty<#0>() + 1: $t1 := pack option::Option<#0>($t0) + 2: return $t1 +} + + +[variant baseline] +public fun option::some<#0>($t0|e: #0): option::Option<#0> { + var $t1: #0 + var $t2: vector<#0> + var $t3: option::Option<#0> + 0: $t1 := move($t0) + 1: $t2 := vector::singleton<#0>($t1) + 2: $t3 := pack option::Option<#0>($t2) + 3: return $t3 +} + + +[variant baseline] +public fun option::swap_or_fill<#0>($t0|t: &mut option::Option<#0>, $t1|e: #0): option::Option<#0> { + var $t2|tmp#$2: option::Option<#0> + var $t3|old_value#1#0: option::Option<#0> + var $t4|vec_ref#1#0: &mut vector<#0> + var $t5: &mut option::Option<#0> + var $t6: &mut vector<#0> + var $t7: &mut vector<#0> + var $t8: &vector<#0> + var $t9: bool + var $t10: option::Option<#0> + var $t11: &mut vector<#0> + var $t12: #0 + var $t13: option::Option<#0> + var $t14: option::Option<#0> + var $t15: &mut vector<#0> + var $t16: #0 + var $t17: option::Option<#0> + 0: $t5 := move($t0) + 1: $t6 := borrow_field>.vec($t5) + 2: $t4 := $t6 + 3: $t7 := copy($t4) + 4: $t8 := freeze_ref($t7) + 5: $t9 := vector::is_empty<#0>($t8) + 6: if ($t9) goto 7 else goto 11 + 7: label L1 + 8: $t10 := option::none<#0>() + 9: $t2 := $t10 + 10: goto 17 + 11: label L0 + 12: $t11 := copy($t4) + 13: $t12 := vector::pop_back<#0>($t11) + 14: $t13 := option::some<#0>($t12) + 15: $t2 := $t13 + 16: goto 17 + 17: label L2 + 18: $t14 := move($t2) + 19: $t3 := $t14 + 20: $t15 := move($t4) + 21: $t16 := move($t1) + 22: vector::push_back<#0>($t15, $t16) + 23: $t17 := move($t3) + 24: return $t17 +} + + +[variant baseline] +public fun option::to_vec<#0>($t0|t: option::Option<#0>): vector<#0> { + var $t1: option::Option<#0> + var $t2: vector<#0> + 0: $t1 := move($t0) + 1: $t2 := unpack option::Option<#0>($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::append($t0|string: &mut ascii::String, $t1|other: ascii::String) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: ascii::String + var $t5: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := ascii::into_bytes($t4) + 4: vector::append($t3, $t5) + 5: return () +} + + +[variant baseline] +public fun ascii::index_of($t0|string: &ascii::String, $t1|substr: &ascii::String): u64 { + var $t2|tmp#$2: bool + var $t3|i#1#0: u64 + var $t4|j#1#0: u64 + var $t5|m#1#0: u64 + var $t6|n#1#0: u64 + var $t7: u64 + var $t8: &ascii::String + var $t9: u64 + var $t10: &ascii::String + var $t11: u64 + var $t12: u64 + var $t13: u64 var $t14: bool - var $t15: &vector<#0> - var $t16: � - var $t17: bool + var $t15: &ascii::String + var $t16: &ascii::String + var $t17: u64 var $t18: u64 var $t19: u64 var $t20: u64 var $t21: u64 - var $t22: &vector<#0> - var $t23: � - var $t24: bool + var $t22: bool + var $t23: u64 + var $t24: u64 var $t25: u64 - 0: $t4 := 0 - 1: $t2 := $t4 - 2: $t5 := copy($t0) - 3: $t6 := vector::length<#0>($t5) - 4: $t3 := $t6 - 5: goto 6 - 6: label L5 - 7: $t7 := copy($t2) - 8: $t8 := copy($t3) - 9: $t9 := <($t7, $t8) - 10: if ($t9) goto 11 else goto 34 - 11: label L1 - 12: goto 13 - 13: label L2 - 14: $t10 := copy($t0) - 15: $t11 := copy($t2) - 16: $t12 := vector::borrow<#0>($t10, $t11) - 17: $t13 := copy($t1) - 18: $t14 := ==($t12, $t13) - 19: if ($t14) goto 20 else goto 28 - 20: label L4 - 21: $t15 := move($t0) - 22: destroy($t15) - 23: $t16 := move($t1) - 24: destroy($t16) - 25: $t17 := true - 26: $t18 := move($t2) - 27: return ($t17, $t18) - 28: label L3 - 29: $t19 := move($t2) - 30: $t20 := 1 - 31: $t21 := +($t19, $t20) - 32: $t2 := $t21 - 33: goto 6 - 34: label L0 - 35: $t22 := move($t0) - 36: destroy($t22) - 37: $t23 := move($t1) - 38: destroy($t23) - 39: $t24 := false - 40: $t25 := 0 - 41: return ($t24, $t25) + var $t26: bool + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: u64 + var $t31: u64 + var $t32: &u8 + var $t33: u8 + var $t34: &ascii::String + var $t35: &vector + var $t36: u64 + var $t37: &u8 + var $t38: u8 + var $t39: bool + var $t40: bool + var $t41: bool + var $t42: u64 + var $t43: u64 + var $t44: u64 + var $t45: u64 + var $t46: u64 + var $t47: bool + var $t48: &ascii::String + var $t49: &ascii::String + var $t50: u64 + var $t51: u64 + var $t52: u64 + var $t53: u64 + var $t54: &ascii::String + var $t55: &ascii::String + var $t56: u64 + 0: $t7 := 0 + 1: $t3 := $t7 + 2: $t8 := copy($t0) + 3: $t9 := ascii::length($t8) + 4: $t10 := copy($t1) + 5: $t11 := ascii::length($t10) + 6: $t5 := $t11 + 7: $t6 := $t9 + 8: $t12 := copy($t6) + 9: $t13 := copy($t5) + 10: $t14 := <($t12, $t13) + 11: if ($t14) goto 12 else goto 19 + 12: label L1 + 13: $t15 := move($t1) + 14: destroy($t15) + 15: $t16 := move($t0) + 16: destroy($t16) + 17: $t17 := move($t6) + 18: return $t17 + 19: label L0 + 20: $t18 := copy($t3) + 21: $t19 := copy($t6) + 22: $t20 := copy($t5) + 23: $t21 := -($t19, $t20) + 24: $t22 := <=($t18, $t21) + 25: if ($t22) goto 26 else goto 84 + 26: label L3 + 27: $t23 := 0 + 28: $t4 := $t23 + 29: goto 30 + 30: label L10 + 31: $t24 := copy($t4) + 32: $t25 := copy($t5) + 33: $t26 := <($t24, $t25) + 34: if ($t26) goto 35 else goto 53 + 35: label L5 + 36: goto 37 + 37: label L6 + 38: $t27 := copy($t0) + 39: $t28 := borrow_field.bytes($t27) + 40: $t29 := copy($t3) + 41: $t30 := copy($t4) + 42: $t31 := +($t29, $t30) + 43: $t32 := vector::borrow($t28, $t31) + 44: $t33 := read_ref($t32) + 45: $t34 := copy($t1) + 46: $t35 := borrow_field.bytes($t34) + 47: $t36 := copy($t4) + 48: $t37 := vector::borrow($t35, $t36) + 49: $t38 := read_ref($t37) + 50: $t39 := ==($t33, $t38) + 51: $t2 := $t39 + 52: goto 57 + 53: label L4 + 54: $t40 := false + 55: $t2 := $t40 + 56: goto 57 + 57: label L7 + 58: $t41 := move($t2) + 59: if ($t41) goto 60 else goto 66 + 60: label L9 + 61: $t42 := move($t4) + 62: $t43 := 1 + 63: $t44 := +($t42, $t43) + 64: $t4 := $t44 + 65: goto 30 + 66: label L8 + 67: $t45 := move($t4) + 68: $t46 := copy($t5) + 69: $t47 := ==($t45, $t46) + 70: if ($t47) goto 71 else goto 78 + 71: label L12 + 72: $t48 := move($t1) + 73: destroy($t48) + 74: $t49 := move($t0) + 75: destroy($t49) + 76: $t50 := move($t3) + 77: return $t50 + 78: label L11 + 79: $t51 := move($t3) + 80: $t52 := 1 + 81: $t53 := +($t51, $t52) + 82: $t3 := $t53 + 83: goto 19 + 84: label L2 + 85: $t54 := move($t1) + 86: destroy($t54) + 87: $t55 := move($t0) + 88: destroy($t55) + 89: $t56 := move($t6) + 90: return $t56 } [variant baseline] -public fun vector::insert<#0>($t0|v: &mut vector<#0>, $t1|e: #0, $t2|i: u64) { - var $t3|len#1#0: u64 - var $t4: &mut vector<#0> - var $t5: &vector<#0> - var $t6: u64 - var $t7: u64 +public fun ascii::insert($t0|s: &mut ascii::String, $t1|at: u64, $t2|o: ascii::String) { + var $t3|e#1#2: u8 + var $t4|v#1#1: vector + var $t5: u64 + var $t6: &mut ascii::String + var $t7: &ascii::String var $t8: u64 var $t9: bool - var $t10: &mut vector<#0> + var $t10: &mut ascii::String var $t11: u64 - var $t12: &mut vector<#0> - var $t13: #0 - var $t14: u64 - var $t15: u64 + var $t12: ascii::String + var $t13: vector + var $t14: &vector + var $t15: bool var $t16: bool - var $t17: &mut vector<#0> - var $t18: u64 - var $t19: u64 - var $t20: u64 - var $t21: u64 + var $t17: &mut vector + var $t18: u8 + var $t19: &mut ascii::String + var $t20: &mut vector + var $t21: u8 var $t22: u64 - var $t23: &mut vector<#0> - 0: $t4 := copy($t0) - 1: $t5 := freeze_ref($t4) - 2: $t6 := vector::length<#0>($t5) - 3: $t3 := $t6 - 4: $t7 := copy($t2) - 5: $t8 := copy($t3) - 6: $t9 := >($t7, $t8) - 7: if ($t9) goto 8 else goto 13 - 8: label L1 + var $t23: &mut ascii::String + var $t24: vector + 0: $t5 := copy($t1) + 1: $t6 := copy($t0) + 2: $t7 := freeze_ref($t6) + 3: $t8 := ascii::length($t7) + 4: $t9 := <=($t5, $t8) + 5: if ($t9) goto 6 else goto 8 + 6: label L1 + 7: goto 13 + 8: label L0 9: $t10 := move($t0) 10: destroy($t10) - 11: $t11 := 131072 + 11: $t11 := 65537 12: abort($t11) - 13: label L0 - 14: $t12 := copy($t0) - 15: $t13 := move($t1) - 16: vector::push_back<#0>($t12, $t13) + 13: label L2 + 14: $t12 := move($t2) + 15: $t13 := ascii::into_bytes($t12) + 16: $t4 := $t13 17: goto 18 18: label L5 - 19: $t14 := copy($t2) - 20: $t15 := copy($t3) - 21: $t16 := <($t14, $t15) - 22: if ($t16) goto 23 else goto 35 - 23: label L3 - 24: goto 25 - 25: label L4 - 26: $t17 := copy($t0) - 27: $t18 := copy($t2) - 28: $t19 := copy($t3) - 29: vector::swap<#0>($t17, $t18, $t19) - 30: $t20 := move($t2) - 31: $t21 := 1 - 32: $t22 := +($t20, $t21) - 33: $t2 := $t22 - 34: goto 18 - 35: label L2 - 36: $t23 := move($t0) - 37: destroy($t23) + 19: $t14 := borrow_local($t4) + 20: $t15 := vector::is_empty($t14) + 21: $t16 := !($t15) + 22: if ($t16) goto 23 else goto 33 + 23: label L4 + 24: $t17 := borrow_local($t4) + 25: $t18 := vector::pop_back($t17) + 26: $t3 := $t18 + 27: $t19 := copy($t0) + 28: $t20 := borrow_field.bytes($t19) + 29: $t21 := move($t3) + 30: $t22 := copy($t1) + 31: vector::insert($t20, $t21, $t22) + 32: goto 18 + 33: label L3 + 34: $t23 := move($t0) + 35: destroy($t23) + 36: $t24 := move($t4) + 37: vector::destroy_empty($t24) 38: return () } [variant baseline] -public fun vector::is_empty<#0>($t0|v: &vector<#0>): bool { - var $t1: &vector<#0> - var $t2: u64 +public fun ascii::is_empty($t0|string: &ascii::String): bool { + var $t1: &ascii::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::length($t0|string: &ascii::String): u64 { + var $t1: &ascii::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := ascii::as_bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::all_characters_printable($t0|string: &ascii::String): bool { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|i#1#12: u64 + var $t4|i#1#9: u64 + var $t5|stop#1#9: u64 + var $t6|v#1#3: &vector + var $t7: &ascii::String + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 + var $t12: u64 + var $t13: u64 + var $t14: u64 + var $t15: bool + var $t16: u64 + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool + var $t25: u64 + var $t26: u64 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + 0: $t7 := move($t0) + 1: $t8 := borrow_field.bytes($t7) + 2: $t6 := $t8 + 3: $t9 := copy($t6) + 4: $t10 := vector::length($t9) + 5: $t1 := $t10 + 6: $t11 := 0 + 7: $t4 := $t11 + 8: $t12 := move($t1) + 9: $t5 := $t12 + 10: goto 11 + 11: label L5 + 12: $t13 := copy($t4) + 13: $t14 := copy($t5) + 14: $t15 := <($t13, $t14) + 15: if ($t15) goto 16 else goto 38 + 16: label L1 + 17: $t16 := copy($t4) + 18: $t3 := $t16 + 19: $t17 := copy($t6) + 20: $t18 := move($t3) + 21: $t19 := vector::borrow($t17, $t18) + 22: $t20 := read_ref($t19) + 23: $t21 := ascii::is_printable_char($t20) + 24: $t22 := !($t21) + 25: if ($t22) goto 26 else goto 32 + 26: label L3 + 27: $t23 := move($t6) + 28: destroy($t23) + 29: $t24 := false + 30: $t2 := $t24 + 31: goto 44 + 32: label L2 + 33: $t25 := move($t4) + 34: $t26 := 1 + 35: $t27 := +($t25, $t26) + 36: $t4 := $t27 + 37: goto 11 + 38: label L0 + 39: $t28 := move($t6) + 40: destroy($t28) + 41: $t29 := true + 42: $t2 := $t29 + 43: goto 44 + 44: label L4 + 45: $t30 := move($t2) + 46: return $t30 +} + + +[variant baseline] +public fun ascii::string($t0|bytes: vector): ascii::String { + var $t1|x#1#0: option::Option + var $t2: vector + var $t3: option::Option + var $t4: &option::Option + var $t5: bool + var $t6: u64 + var $t7: option::Option + var $t8: ascii::String + 0: $t2 := move($t0) + 1: $t3 := ascii::try_string($t2) + 2: $t1 := $t3 + 3: $t4 := borrow_local($t1) + 4: $t5 := option::is_some($t4) + 5: if ($t5) goto 6 else goto 8 + 6: label L1 + 7: goto 11 + 8: label L0 + 9: $t6 := 65536 + 10: abort($t6) + 11: label L2 + 12: $t7 := move($t1) + 13: $t8 := option::destroy_some($t7) + 14: return $t8 +} + + +[variant baseline] +public fun ascii::as_bytes($t0|string: &ascii::String): &vector { + var $t1: &ascii::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::byte($t0|char: ascii::Char): u8 { + var $t1: ascii::Char + var $t2: u8 + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::Char($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::char($t0|byte: u8): ascii::Char { + var $t1: u8 + var $t2: bool var $t3: u64 + var $t4: u8 + var $t5: ascii::Char + 0: $t1 := copy($t0) + 1: $t2 := ascii::is_valid_char($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 65536 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack ascii::Char($t4) + 11: return $t5 +} + + +[variant baseline] +fun ascii::char_to_lowercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 65 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 90 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := +($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +fun ascii::char_to_uppercase($t0|byte: u8): u8 { + var $t1|tmp#$1: bool + var $t2|tmp#$2: u8 + var $t3: u8 + var $t4: u8 + var $t5: bool + var $t6: u8 + var $t7: u8 + var $t8: bool + var $t9: bool + var $t10: bool + var $t11: u8 + var $t12: u8 + var $t13: u8 + var $t14: u8 + var $t15: u8 + 0: $t3 := copy($t0) + 1: $t4 := 97 + 2: $t5 := >=($t3, $t4) + 3: if ($t5) goto 4 else goto 10 + 4: label L1 + 5: $t6 := copy($t0) + 6: $t7 := 122 + 7: $t8 := <=($t6, $t7) + 8: $t1 := $t8 + 9: goto 14 + 10: label L0 + 11: $t9 := false + 12: $t1 := $t9 + 13: goto 14 + 14: label L2 + 15: $t10 := move($t1) + 16: if ($t10) goto 17 else goto 23 + 17: label L4 + 18: $t11 := move($t0) + 19: $t12 := 32 + 20: $t13 := -($t11, $t12) + 21: $t2 := $t13 + 22: goto 27 + 23: label L3 + 24: $t14 := move($t0) + 25: $t2 := $t14 + 26: goto 27 + 27: label L5 + 28: $t15 := move($t2) + 29: return $t15 +} + + +[variant baseline] +public fun ascii::into_bytes($t0|string: ascii::String): vector { + var $t1: ascii::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack ascii::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun ascii::is_printable_char($t0|byte: u8): bool { + var $t1|tmp#$1: bool + var $t2: u8 + var $t3: u8 var $t4: bool + var $t5: u8 + var $t6: u8 + var $t7: bool + var $t8: bool + var $t9: bool + 0: $t2 := copy($t0) + 1: $t3 := 32 + 2: $t4 := >=($t2, $t3) + 3: if ($t4) goto 4 else goto 10 + 4: label L1 + 5: $t5 := move($t0) + 6: $t6 := 126 + 7: $t7 := <=($t5, $t6) + 8: $t1 := $t7 + 9: goto 14 + 10: label L0 + 11: $t8 := false + 12: $t1 := $t8 + 13: goto 14 + 14: label L2 + 15: $t9 := move($t1) + 16: return $t9 +} + + +[variant baseline] +public fun ascii::is_valid_char($t0|b: u8): bool { + var $t1: u8 + var $t2: u8 + var $t3: bool 0: $t1 := move($t0) - 1: $t2 := vector::length<#0>($t1) - 2: $t3 := 0 - 3: $t4 := ==($t2, $t3) + 1: $t2 := 127 + 2: $t3 := <=($t1, $t2) + 3: return $t3 +} + + +[variant baseline] +public fun ascii::pop_char($t0|string: &mut ascii::String): ascii::Char { + var $t1: &mut ascii::String + var $t2: &mut vector + var $t3: u8 + var $t4: ascii::Char + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::pop_back($t2) + 3: $t4 := pack ascii::Char($t3) 4: return $t4 } [variant baseline] -public native fun vector::length<#0>($t0|v: &vector<#0>): u64; - - -[variant baseline] -public native fun vector::pop_back<#0>($t0|v: &mut vector<#0>): #0; +public fun ascii::push_char($t0|string: &mut ascii::String, $t1|char: ascii::Char) { + var $t2: &mut ascii::String + var $t3: &mut vector + var $t4: &ascii::Char + var $t5: &u8 + var $t6: u8 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.byte($t4) + 4: $t6 := read_ref($t5) + 5: vector::push_back($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun ascii::substring($t0|string: &ascii::String, $t1|i: u64, $t2|j: u64): ascii::String { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: vector + var $t5|i#1#3: u64 + var $t6|i#1#6: u64 + var $t7|stop#1#3: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: u64 + var $t12: &ascii::String + var $t13: u64 + var $t14: bool + var $t15: bool + var $t16: bool + var $t17: &ascii::String + var $t18: u64 + var $t19: vector + var $t20: u64 + var $t21: u64 + var $t22: u64 + var $t23: u64 + var $t24: bool + var $t25: u64 + var $t26: &mut vector + var $t27: &ascii::String + var $t28: &vector + var $t29: u64 + var $t30: &u8 + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &ascii::String + var $t36: vector + var $t37: ascii::String + 0: $t8 := copy($t1) + 1: $t9 := copy($t2) + 2: $t10 := <=($t8, $t9) + 3: if ($t10) goto 4 else goto 11 + 4: label L1 + 5: $t11 := copy($t2) + 6: $t12 := copy($t0) + 7: $t13 := ascii::length($t12) + 8: $t14 := <=($t11, $t13) + 9: $t3 := $t14 + 10: goto 15 + 11: label L0 + 12: $t15 := false + 13: $t3 := $t15 + 14: goto 15 + 15: label L2 + 16: $t16 := move($t3) + 17: if ($t16) goto 18 else goto 20 + 18: label L4 + 19: goto 25 + 20: label L3 + 21: $t17 := move($t0) + 22: destroy($t17) + 23: $t18 := 65537 + 24: abort($t18) + 25: label L5 + 26: $t19 := [] + 27: $t4 := $t19 + 28: $t20 := move($t1) + 29: $t5 := $t20 + 30: $t21 := move($t2) + 31: $t7 := $t21 + 32: goto 33 + 33: label L8 + 34: $t22 := copy($t5) + 35: $t23 := copy($t7) + 36: $t24 := <($t22, $t23) + 37: if ($t24) goto 38 else goto 53 + 38: label L7 + 39: $t25 := copy($t5) + 40: $t6 := $t25 + 41: $t26 := borrow_local($t4) + 42: $t27 := copy($t0) + 43: $t28 := borrow_field.bytes($t27) + 44: $t29 := move($t6) + 45: $t30 := vector::borrow($t28, $t29) + 46: $t31 := read_ref($t30) + 47: vector::push_back($t26, $t31) + 48: $t32 := move($t5) + 49: $t33 := 1 + 50: $t34 := +($t32, $t33) + 51: $t5 := $t34 + 52: goto 33 + 53: label L6 + 54: $t35 := move($t0) + 55: destroy($t35) + 56: $t36 := move($t4) + 57: $t37 := pack ascii::String($t36) + 58: return $t37 +} + + +[variant baseline] +public fun ascii::to_lowercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_lowercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} [variant baseline] -public native fun vector::push_back<#0>($t0|v: &mut vector<#0>, $t1|e: #0); +public fun ascii::to_uppercase($t0|string: &ascii::String): ascii::String { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: u8 + var $t3|tmp#$3: &mut vector + var $t4|e#1#13: &u8 + var $t5|i#1#12: u64 + var $t6|i#1#9: u64 + var $t7|r#1#1: vector + var $t8|stop#1#9: u64 + var $t9|v#1#1: &vector + var $t10|v#1#3: &vector + var $t11: &ascii::String + var $t12: &vector + var $t13: vector + var $t14: &vector + var $t15: &vector + var $t16: u64 + var $t17: u64 + var $t18: u64 + var $t19: u64 + var $t20: u64 + var $t21: bool + var $t22: u64 + var $t23: &vector + var $t24: u64 + var $t25: &u8 + var $t26: &mut vector + var $t27: &u8 + var $t28: u8 + var $t29: u8 + var $t30: &mut vector + var $t31: u8 + var $t32: u64 + var $t33: u64 + var $t34: u64 + var $t35: &vector + var $t36: vector + var $t37: ascii::String + 0: $t11 := move($t0) + 1: $t12 := ascii::as_bytes($t11) + 2: $t9 := $t12 + 3: $t13 := [] + 4: $t7 := $t13 + 5: $t14 := move($t9) + 6: $t10 := $t14 + 7: $t15 := copy($t10) + 8: $t16 := vector::length($t15) + 9: $t1 := $t16 + 10: $t17 := 0 + 11: $t6 := $t17 + 12: $t18 := move($t1) + 13: $t8 := $t18 + 14: goto 15 + 15: label L2 + 16: $t19 := copy($t6) + 17: $t20 := copy($t8) + 18: $t21 := <($t19, $t20) + 19: if ($t21) goto 20 else goto 41 + 20: label L1 + 21: $t22 := copy($t6) + 22: $t5 := $t22 + 23: $t23 := copy($t10) + 24: $t24 := move($t5) + 25: $t25 := vector::borrow($t23, $t24) + 26: $t4 := $t25 + 27: $t26 := borrow_local($t7) + 28: $t3 := $t26 + 29: $t27 := move($t4) + 30: $t28 := read_ref($t27) + 31: $t29 := ascii::char_to_uppercase($t28) + 32: $t2 := $t29 + 33: $t30 := move($t3) + 34: $t31 := move($t2) + 35: vector::push_back($t30, $t31) + 36: $t32 := move($t6) + 37: $t33 := 1 + 38: $t34 := +($t32, $t33) + 39: $t6 := $t34 + 40: goto 15 + 41: label L0 + 42: $t35 := move($t10) + 43: destroy($t35) + 44: $t36 := move($t7) + 45: $t37 := pack ascii::String($t36) + 46: return $t37 +} [variant baseline] -public fun vector::remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { - var $t2|tmp#$2: u64 - var $t3|tmp#$3: &mut vector<#0> - var $t4|len#1#0: u64 - var $t5: &mut vector<#0> - var $t6: &vector<#0> - var $t7: u64 - var $t8: u64 - var $t9: u64 - var $t10: bool - var $t11: &mut vector<#0> +public fun ascii::try_string($t0|bytes: vector): option::Option { + var $t1|$stop#0#6: u64 + var $t2|tmp#$2: bool + var $t3|tmp#$3: option::Option + var $t4|i#1#12: u64 + var $t5|i#1#9: u64 + var $t6|stop#1#9: u64 + var $t7|v#1#3: &vector + var $t8: &vector + var $t9: &vector + var $t10: u64 + var $t11: u64 var $t12: u64 var $t13: u64 var $t14: u64 - var $t15: u64 + var $t15: bool var $t16: u64 - var $t17: u64 - var $t18: bool - var $t19: &mut vector<#0> - var $t20: u64 - var $t21: u64 - var $t22: u64 - var $t23: u64 - var $t24: &mut vector<#0> + var $t17: &vector + var $t18: u64 + var $t19: &u8 + var $t20: u8 + var $t21: bool + var $t22: bool + var $t23: &vector + var $t24: bool var $t25: u64 var $t26: u64 - var $t27: &mut vector<#0> - var $t28: #0 - 0: $t5 := copy($t0) - 1: $t6 := freeze_ref($t5) - 2: $t7 := vector::length<#0>($t6) - 3: $t4 := $t7 - 4: $t8 := copy($t1) - 5: $t9 := copy($t4) - 6: $t10 := >=($t8, $t9) - 7: if ($t10) goto 8 else goto 13 - 8: label L1 - 9: $t11 := move($t0) - 10: destroy($t11) - 11: $t12 := 131072 - 12: abort($t12) - 13: label L0 - 14: $t13 := move($t4) - 15: $t14 := 1 - 16: $t15 := -($t13, $t14) - 17: $t4 := $t15 - 18: goto 19 - 19: label L5 - 20: $t16 := copy($t1) - 21: $t17 := copy($t4) - 22: $t18 := <($t16, $t17) - 23: if ($t18) goto 24 else goto 40 - 24: label L3 - 25: goto 26 - 26: label L4 - 27: $t19 := copy($t0) - 28: $t3 := $t19 - 29: $t20 := copy($t1) - 30: $t2 := $t20 - 31: $t21 := move($t1) - 32: $t22 := 1 - 33: $t23 := +($t21, $t22) - 34: $t1 := $t23 - 35: $t24 := move($t3) - 36: $t25 := move($t2) - 37: $t26 := copy($t1) - 38: vector::swap<#0>($t24, $t25, $t26) - 39: goto 19 - 40: label L2 - 41: $t27 := move($t0) - 42: $t28 := vector::pop_back<#0>($t27) - 43: return $t28 + var $t27: u64 + var $t28: &vector + var $t29: bool + var $t30: bool + var $t31: vector + var $t32: ascii::String + var $t33: option::Option + var $t34: option::Option + var $t35: option::Option + 0: $t8 := borrow_local($t0) + 1: $t7 := $t8 + 2: $t9 := copy($t7) + 3: $t10 := vector::length($t9) + 4: $t1 := $t10 + 5: $t11 := 0 + 6: $t5 := $t11 + 7: $t12 := move($t1) + 8: $t6 := $t12 + 9: goto 10 + 10: label L5 + 11: $t13 := copy($t5) + 12: $t14 := copy($t6) + 13: $t15 := <($t13, $t14) + 14: if ($t15) goto 15 else goto 37 + 15: label L1 + 16: $t16 := copy($t5) + 17: $t4 := $t16 + 18: $t17 := copy($t7) + 19: $t18 := move($t4) + 20: $t19 := vector::borrow($t17, $t18) + 21: $t20 := read_ref($t19) + 22: $t21 := ascii::is_valid_char($t20) + 23: $t22 := !($t21) + 24: if ($t22) goto 25 else goto 31 + 25: label L3 + 26: $t23 := move($t7) + 27: destroy($t23) + 28: $t24 := false + 29: $t2 := $t24 + 30: goto 43 + 31: label L2 + 32: $t25 := move($t5) + 33: $t26 := 1 + 34: $t27 := +($t25, $t26) + 35: $t5 := $t27 + 36: goto 10 + 37: label L0 + 38: $t28 := move($t7) + 39: destroy($t28) + 40: $t29 := true + 41: $t2 := $t29 + 42: goto 43 + 43: label L4 + 44: $t30 := move($t2) + 45: if ($t30) goto 46 else goto 52 + 46: label L7 + 47: $t31 := move($t0) + 48: $t32 := pack ascii::String($t31) + 49: $t33 := option::some($t32) + 50: $t3 := $t33 + 51: goto 56 + 52: label L6 + 53: $t34 := option::none() + 54: $t3 := $t34 + 55: goto 56 + 56: label L8 + 57: $t35 := move($t3) + 58: return $t35 } [variant baseline] -public fun vector::reverse<#0>($t0|v: &mut vector<#0>) { - var $t1|back_index#1#0: u64 - var $t2|front_index#1#0: u64 - var $t3|len#1#0: u64 - var $t4: &mut vector<#0> - var $t5: &vector<#0> +public fun string::append($t0|s: &mut string::String, $t1|r: string::String) { + var $t2: &mut string::String + var $t3: &mut vector + var $t4: &string::String + var $t5: &vector + var $t6: vector + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := borrow_local($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := read_ref($t5) + 5: vector::append($t3, $t6) + 6: return () +} + + +[variant baseline] +public fun string::index_of($t0|s: &string::String, $t1|r: &string::String): u64 { + var $t2: &string::String + var $t3: &vector + var $t4: &string::String + var $t5: &vector var $t6: u64 - var $t7: u64 - var $t8: u64 - var $t9: bool - var $t10: &mut vector<#0> - var $t11: u64 + 0: $t2 := move($t0) + 1: $t3 := borrow_field.bytes($t2) + 2: $t4 := move($t1) + 3: $t5 := borrow_field.bytes($t4) + 4: $t6 := string::internal_index_of($t3, $t5) + 5: return $t6 +} + + +[variant baseline] +public fun string::insert($t0|s: &mut string::String, $t1|at: u64, $t2|o: string::String) { + var $t3|tmp#$3: bool + var $t4|bytes#1#0: &vector + var $t5|end#1#0: string::String + var $t6|front#1#0: string::String + var $t7|l#1#0: u64 + var $t8: &mut string::String + var $t9: &vector + var $t10: u64 + var $t11: &vector var $t12: u64 - var $t13: u64 - var $t14: u64 + var $t13: bool + var $t14: &vector var $t15: u64 - var $t16: u64 - var $t17: bool - var $t18: &mut vector<#0> - var $t19: u64 - var $t20: u64 + var $t16: bool + var $t17: &vector + var $t18: bool + var $t19: bool + var $t20: &mut string::String var $t21: u64 - var $t22: u64 - var $t23: u64 + var $t22: &mut string::String + var $t23: &string::String var $t24: u64 - var $t25: u64 - var $t26: u64 - var $t27: &mut vector<#0> - 0: $t4 := copy($t0) - 1: $t5 := freeze_ref($t4) - 2: $t6 := vector::length<#0>($t5) - 3: $t3 := $t6 - 4: $t7 := copy($t3) - 5: $t8 := 0 - 6: $t9 := ==($t7, $t8) - 7: if ($t9) goto 8 else goto 12 + var $t25: &mut string::String + var $t26: &string::String + var $t27: u64 + var $t28: u64 + var $t29: string::String + var $t30: &mut string::String + var $t31: &string::String + var $t32: u64 + var $t33: u64 + var $t34: string::String + var $t35: &mut string::String + var $t36: string::String + var $t37: &mut string::String + var $t38: string::String + var $t39: string::String + var $t40: &mut string::String + 0: $t8 := copy($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t4 := $t9 + 3: $t10 := copy($t1) + 4: $t11 := copy($t4) + 5: $t12 := vector::length($t11) + 6: $t13 := <=($t10, $t12) + 7: if ($t13) goto 8 else goto 14 8: label L1 - 9: $t10 := move($t0) - 10: destroy($t10) - 11: return () - 12: label L0 - 13: $t11 := 0 - 14: $t2 := $t11 - 15: $t12 := move($t3) - 16: $t13 := 1 - 17: $t14 := -($t12, $t13) - 18: $t1 := $t14 + 9: $t14 := move($t4) + 10: $t15 := copy($t1) + 11: $t16 := string::internal_is_char_boundary($t14, $t15) + 12: $t3 := $t16 + 13: goto 20 + 14: label L0 + 15: $t17 := move($t4) + 16: destroy($t17) + 17: $t18 := false + 18: $t3 := $t18 19: goto 20 - 20: label L5 - 21: $t15 := copy($t2) - 22: $t16 := copy($t1) - 23: $t17 := <($t15, $t16) - 24: if ($t17) goto 25 else goto 41 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 25 + 23: label L4 + 24: goto 30 25: label L3 - 26: goto 27 - 27: label L4 - 28: $t18 := copy($t0) - 29: $t19 := copy($t2) - 30: $t20 := copy($t1) - 31: vector::swap<#0>($t18, $t19, $t20) - 32: $t21 := move($t2) - 33: $t22 := 1 - 34: $t23 := +($t21, $t22) - 35: $t2 := $t23 - 36: $t24 := move($t1) - 37: $t25 := 1 - 38: $t26 := -($t24, $t25) - 39: $t1 := $t26 - 40: goto 20 - 41: label L2 - 42: $t27 := move($t0) - 43: destroy($t27) - 44: return () + 26: $t20 := move($t0) + 27: destroy($t20) + 28: $t21 := 2 + 29: abort($t21) + 30: label L5 + 31: $t22 := copy($t0) + 32: $t23 := freeze_ref($t22) + 33: $t24 := string::length($t23) + 34: $t7 := $t24 + 35: $t25 := copy($t0) + 36: $t26 := freeze_ref($t25) + 37: $t27 := 0 + 38: $t28 := copy($t1) + 39: $t29 := string::substring($t26, $t27, $t28) + 40: $t6 := $t29 + 41: $t30 := copy($t0) + 42: $t31 := freeze_ref($t30) + 43: $t32 := move($t1) + 44: $t33 := move($t7) + 45: $t34 := string::substring($t31, $t32, $t33) + 46: $t5 := $t34 + 47: $t35 := borrow_local($t6) + 48: $t36 := move($t2) + 49: string::append($t35, $t36) + 50: $t37 := borrow_local($t6) + 51: $t38 := move($t5) + 52: string::append($t37, $t38) + 53: $t39 := move($t6) + 54: $t40 := move($t0) + 55: write_ref($t40, $t39) + 56: return () } [variant baseline] -public fun vector::singleton<#0>($t0|e: #0): vector<#0> { - var $t1|v#1#0: vector<#0> - var $t2: vector<#0> - var $t3: &mut vector<#0> - var $t4: #0 - var $t5: vector<#0> - 0: $t2 := vector::empty<#0>() - 1: $t1 := $t2 - 2: $t3 := borrow_local($t1) - 3: $t4 := move($t0) - 4: vector::push_back<#0>($t3, $t4) - 5: $t5 := move($t1) - 6: return $t5 +public fun string::is_empty($t0|s: &string::String): bool { + var $t1: &string::String + var $t2: &vector + var $t3: bool + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::is_empty($t2) + 3: return $t3 } [variant baseline] -public native fun vector::swap<#0>($t0|v: &mut vector<#0>, $t1|i: u64, $t2|j: u64); +public fun string::length($t0|s: &string::String): u64 { + var $t1: &string::String + var $t2: &vector + var $t3: u64 + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: $t3 := vector::length($t2) + 3: return $t3 +} [variant baseline] -public fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64): #0 { - var $t2|last_idx#1#0: u64 - var $t3: &mut vector<#0> - var $t4: &vector<#0> - var $t5: bool - var $t6: bool - var $t7: &mut vector<#0> - var $t8: u64 - var $t9: &mut vector<#0> - var $t10: &vector<#0> +public fun string::as_bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := borrow_field.bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::into_bytes($t0|s: string::String): vector { + var $t1: string::String + var $t2: vector + 0: $t1 := move($t0) + 1: $t2 := unpack string::String($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::bytes($t0|s: &string::String): &vector { + var $t1: &string::String + var $t2: &vector + 0: $t1 := move($t0) + 1: $t2 := string::as_bytes($t1) + 2: return $t2 +} + + +[variant baseline] +public fun string::substring($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3|tmp#$3: bool + var $t4|tmp#$4: bool + var $t5|tmp#$5: bool + var $t6|bytes#1#0: &vector + var $t7|l#1#0: u64 + var $t8: &string::String + var $t9: &vector + var $t10: &vector var $t11: u64 var $t12: u64 var $t13: u64 - var $t14: &mut vector<#0> + var $t14: bool var $t15: u64 var $t16: u64 - var $t17: &mut vector<#0> - var $t18: #0 - 0: $t3 := copy($t0) - 1: $t4 := freeze_ref($t3) - 2: $t5 := vector::is_empty<#0>($t4) - 3: $t6 := !($t5) - 4: if ($t6) goto 5 else goto 7 - 5: label L1 - 6: goto 12 - 7: label L0 - 8: $t7 := move($t0) - 9: destroy($t7) - 10: $t8 := 131072 - 11: abort($t8) - 12: label L2 - 13: $t9 := copy($t0) - 14: $t10 := freeze_ref($t9) - 15: $t11 := vector::length<#0>($t10) - 16: $t12 := 1 - 17: $t13 := -($t11, $t12) - 18: $t2 := $t13 - 19: $t14 := copy($t0) - 20: $t15 := move($t1) - 21: $t16 := move($t2) - 22: vector::swap<#0>($t14, $t15, $t16) - 23: $t17 := move($t0) - 24: $t18 := vector::pop_back<#0>($t17) - 25: return $t18 + var $t17: bool + var $t18: bool + var $t19: bool + var $t20: &vector + var $t21: u64 + var $t22: bool + var $t23: bool + var $t24: bool + var $t25: &vector + var $t26: u64 + var $t27: bool + var $t28: bool + var $t29: bool + var $t30: &vector + var $t31: u64 + var $t32: &vector + var $t33: u64 + var $t34: u64 + var $t35: vector + var $t36: string::String + 0: $t8 := move($t0) + 1: $t9 := borrow_field.bytes($t8) + 2: $t6 := $t9 + 3: $t10 := copy($t6) + 4: $t11 := vector::length($t10) + 5: $t7 := $t11 + 6: $t12 := copy($t2) + 7: $t13 := move($t7) + 8: $t14 := <=($t12, $t13) + 9: if ($t14) goto 10 else goto 16 + 10: label L1 + 11: $t15 := copy($t1) + 12: $t16 := copy($t2) + 13: $t17 := <=($t15, $t16) + 14: $t3 := $t17 + 15: goto 20 + 16: label L0 + 17: $t18 := false + 18: $t3 := $t18 + 19: goto 20 + 20: label L2 + 21: $t19 := move($t3) + 22: if ($t19) goto 23 else goto 29 + 23: label L4 + 24: $t20 := copy($t6) + 25: $t21 := copy($t1) + 26: $t22 := string::internal_is_char_boundary($t20, $t21) + 27: $t4 := $t22 + 28: goto 33 + 29: label L3 + 30: $t23 := false + 31: $t4 := $t23 + 32: goto 33 + 33: label L5 + 34: $t24 := move($t4) + 35: if ($t24) goto 36 else goto 42 + 36: label L7 + 37: $t25 := copy($t6) + 38: $t26 := copy($t2) + 39: $t27 := string::internal_is_char_boundary($t25, $t26) + 40: $t5 := $t27 + 41: goto 46 + 42: label L6 + 43: $t28 := false + 44: $t5 := $t28 + 45: goto 46 + 46: label L8 + 47: $t29 := move($t5) + 48: if ($t29) goto 49 else goto 51 + 49: label L10 + 50: goto 56 + 51: label L9 + 52: $t30 := move($t6) + 53: destroy($t30) + 54: $t31 := 2 + 55: abort($t31) + 56: label L11 + 57: $t32 := move($t6) + 58: $t33 := move($t1) + 59: $t34 := move($t2) + 60: $t35 := string::internal_sub_string($t32, $t33, $t34) + 61: $t36 := pack string::String($t35) + 62: return $t36 } [variant baseline] -fun ReturnRefsIntoVec::return_vec_index_immut($t0|v: &vector): &u64 { - var $t1: &vector - var $t2: u64 - var $t3: &u64 +public fun string::append_utf8($t0|s: &mut string::String, $t1|bytes: vector) { + var $t2: &mut string::String + var $t3: vector + var $t4: string::String + 0: $t2 := move($t0) + 1: $t3 := move($t1) + 2: $t4 := string::utf8($t3) + 3: string::append($t2, $t4) + 4: return () +} + + +[variant baseline] +public fun string::from_ascii($t0|s: ascii::String): string::String { + var $t1: ascii::String + var $t2: vector + var $t3: string::String 0: $t1 := move($t0) - 1: $t2 := 0 - 2: $t3 := vector::borrow($t1, $t2) + 1: $t2 := ascii::into_bytes($t1) + 2: $t3 := pack string::String($t2) 3: return $t3 } [variant baseline] -fun ReturnRefsIntoVec::return_vec_index_mut($t0|v: &mut vector): &mut u64 { - var $t1: &mut vector - var $t2: u64 - var $t3: &mut u64 +native fun string::internal_check_utf8($t0|v: &vector): bool; + + +[variant baseline] +native fun string::internal_index_of($t0|v: &vector, $t1|r: &vector): u64; + + +[variant baseline] +native fun string::internal_is_char_boundary($t0|v: &vector, $t1|i: u64): bool; + + +[variant baseline] +native fun string::internal_sub_string($t0|v: &vector, $t1|i: u64, $t2|j: u64): vector; + + +[variant baseline] +public fun string::sub_string($t0|s: &string::String, $t1|i: u64, $t2|j: u64): string::String { + var $t3: &string::String + var $t4: u64 + var $t5: u64 + var $t6: string::String + 0: $t3 := move($t0) + 1: $t4 := move($t1) + 2: $t5 := move($t2) + 3: $t6 := string::substring($t3, $t4, $t5) + 4: return $t6 +} + + +[variant baseline] +public fun string::to_ascii($t0|s: string::String): ascii::String { + var $t1: string::String + var $t2: vector + var $t3: ascii::String 0: $t1 := move($t0) - 1: $t2 := 0 - 2: $t3 := vector::borrow_mut($t1, $t2) + 1: $t2 := unpack string::String($t1) + 2: $t3 := ascii::string($t2) 3: return $t3 } + + +[variant baseline] +public fun string::try_utf8($t0|bytes: vector): option::Option { + var $t1|tmp#$1: option::Option + var $t2: &vector + var $t3: bool + var $t4: vector + var $t5: string::String + var $t6: option::Option + var $t7: option::Option + var $t8: option::Option + 0: $t2 := borrow_local($t0) + 1: $t3 := string::internal_check_utf8($t2) + 2: if ($t3) goto 3 else goto 9 + 3: label L1 + 4: $t4 := move($t0) + 5: $t5 := pack string::String($t4) + 6: $t6 := option::some($t5) + 7: $t1 := $t6 + 8: goto 13 + 9: label L0 + 10: $t7 := option::none() + 11: $t1 := $t7 + 12: goto 13 + 13: label L2 + 14: $t8 := move($t1) + 15: return $t8 +} + + +[variant baseline] +public fun string::utf8($t0|bytes: vector): string::String { + var $t1: &vector + var $t2: bool + var $t3: u64 + var $t4: vector + var $t5: string::String + 0: $t1 := borrow_local($t0) + 1: $t2 := string::internal_check_utf8($t1) + 2: if ($t2) goto 3 else goto 5 + 3: label L1 + 4: goto 8 + 5: label L0 + 6: $t3 := 1 + 7: abort($t3) + 8: label L2 + 9: $t4 := move($t0) + 10: $t5 := pack string::String($t4) + 11: return $t5 +} diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.move b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.move index f6518eabc4402..7c6ac51c5377a 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/return_refs_into_vec.move @@ -1,7 +1,11 @@ +// dep: ../move-stdlib/sources/macros.move +// dep: ../move-stdlib/sources/u64.move +// dep: ../move-stdlib/sources/option.move +// dep: ../move-stdlib/sources/ascii.move +// dep: ../move-stdlib/sources/string.move // dep: ../move-stdlib/sources/vector.move module 0x1::ReturnRefsIntoVec { - use std::vector; // should not complain fun return_vec_index_immut(v: &vector): &u64 { diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.exp b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.exp index 5b40517253203..a54b79a43f823 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.exp +++ b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.exp @@ -39,10 +39,3 @@ public fun StructEq::new(): StructEq::S { 1: $t1 := pack StructEq::S($t0) 2: return $t1 } - -============ Diagnostics ================ -warning: DEPRECATED. will be removed - ┌─ tests/escape_analysis/struct_eq.move:5:5 - │ -5 │ invariant forall s: S: s == S { f: 10 }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.move b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.move index 33b9ff48059ee..216c7b3074f1a 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/escape_analysis/struct_eq.move @@ -1,8 +1,6 @@ module 0x1::StructEq { - struct S { f: u64 } - - invariant forall s: S: s == S { f: 10 }; + public struct S { f: u64 } public fun new(): S { S { f: 10 } diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.exp b/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.exp index 7c4c9b025d777..5f67678cfb725 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.exp +++ b/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.exp @@ -1,21 +1,13 @@ ============ initial translation from Move ================ [variant baseline] -public fun signer::address_of($t0|s: &signer): address { - var $t1: &signer - var $t2: &address - var $t3: address - 0: $t1 := move($t0) - 1: $t2 := signer::borrow_address($t1) - 2: $t3 := read_ref($t2) - 3: return $t3 +public fun address::length(): u64 { + var $t0: u64 + 0: $t0 := 32 + 1: return $t0 } -[variant baseline] -public native fun signer::borrow_address($t0|s: &signer): &address; - - [variant baseline] fun SmokeTest::arithmetic_ops($t0|a: u64): (u64, u64) { var $t1|c#1#0: u64 diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.move b/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.move index 92acb6be19f0a..a4a211a59f280 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/from_move/smoke_test.move @@ -1,7 +1,7 @@ // This module contains just some arbitrary code to smoke test the basic functionality of translation from Move // to stackless bytecode. Coverage for byte code translation is achieved by many more tests in the prover. -// dep: ../move-stdlib/sources/signer.move +// dep: ../move-stdlib/sources/address.move module 0x42::SmokeTest { // ----------------- @@ -24,17 +24,17 @@ module 0x42::SmokeTest { (c, a) } - struct A { + public struct A { addr: address, val: u64, } - struct B { + public struct B { val: u64, a: A, } - struct C { + public struct C { val: u64, b: B, } diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/livevar/basic_test.move b/external-crates/move/crates/move-stackless-bytecode/tests/livevar/basic_test.move index 9f0c3f241ef16..5d3373fa01e66 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/livevar/basic_test.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/livevar/basic_test.move @@ -1,5 +1,5 @@ module 0x42::TestLiveVars { - struct R has copy, drop { + public struct R has copy, drop { x: u64 } @@ -11,14 +11,14 @@ module 0x42::TestLiveVars { fun test2(b: bool) : u64 { let r1 = R {x: 3}; let r2 = R {x: 4}; - let r_ref = &r1; + let mut r_ref = &r1; if (b) { r_ref = &r2; }; test1(r_ref) } - fun test3(n: u64, r_ref: &R) : u64 { + fun test3(mut n: u64, mut r_ref: &R) : u64 { let r1 = R {x: 3}; let r2 = R {x: 4}; while (0 < n) { diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/memory_instr/basic_test.move b/external-crates/move/crates/move-stackless-bytecode/tests/memory_instr/basic_test.move index bacf2b4f7fd61..2f85281358bc4 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/memory_instr/basic_test.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/memory_instr/basic_test.move @@ -1,10 +1,10 @@ module 0x42::TestPackref { - struct R has copy, drop { + public struct R has copy, drop { x: u64 } fun test1() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; let x_ref = &mut r_ref.x; *x_ref = 0; @@ -21,7 +21,7 @@ module 0x42::TestPackref { } fun test4() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; test3(r_ref, 0); r @@ -32,7 +32,7 @@ module 0x42::TestPackref { } fun test6() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; let x_ref = test5(r_ref); test2(x_ref, 0); @@ -40,19 +40,19 @@ module 0x42::TestPackref { } fun test7(b: bool) { - let r1 = R {x: 3}; - let r2 = R {x: 4}; - let r_ref = &mut r1; + let mut r1 = R {x: 3}; + let mut r2 = R {x: 4}; + let mut r_ref = &mut r1; if (b) { r_ref = &mut r2; }; test3(r_ref, 0) } - fun test8(b: bool, n: u64, r_ref: &mut R) { - let r1 = R {x: 3}; - let r2 = R {x: 4}; - let t_ref = &mut r2; + fun test8(b: bool, mut n: u64, r_ref: &mut R) { + let mut r1 = R {x: 3}; + let mut r2 = R {x: 4}; + let mut t_ref = &mut r2; while (0 < n) { if (n/2 == 0) { t_ref = &mut r1 diff --git a/external-crates/move/crates/move-stackless-bytecode/tests/mut_ref_instrumentation/basic_test.move b/external-crates/move/crates/move-stackless-bytecode/tests/mut_ref_instrumentation/basic_test.move index 5133d72e27845..62ce5ab86038f 100644 --- a/external-crates/move/crates/move-stackless-bytecode/tests/mut_ref_instrumentation/basic_test.move +++ b/external-crates/move/crates/move-stackless-bytecode/tests/mut_ref_instrumentation/basic_test.move @@ -1,11 +1,11 @@ module 0x42::TestEliminateMutRefs { - struct R has copy, drop { + public struct R has copy, drop { x: u64 } fun test1() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; let x_ref = &mut r_ref.x; *x_ref = 0; @@ -22,7 +22,7 @@ module 0x42::TestEliminateMutRefs { } fun test4() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; test3(r_ref, 0); r @@ -33,7 +33,7 @@ module 0x42::TestEliminateMutRefs { } fun test6() : R { - let r = R {x: 3}; + let mut r = R {x: 3}; let r_ref = &mut r; let x_ref = test5(r_ref); test2(x_ref, 0); @@ -41,19 +41,19 @@ module 0x42::TestEliminateMutRefs { } fun test7(b: bool) { - let r1 = R {x: 3}; - let r2 = R {x: 4}; - let r_ref = &mut r1; + let mut r1 = R {x: 3}; + let mut r2 = R {x: 4}; + let mut r_ref = &mut r1; if (b) { r_ref = &mut r2; }; test3(r_ref, 0) } - fun test8(b: bool, n: u64, r_ref: &mut R) { - let r1 = R {x: 3}; - let r2 = R {x: 4}; - let t_ref = &mut r2; + fun test8(b: bool, mut n: u64, r_ref: &mut R) { + let mut r1 = R {x: 3}; + let mut r2 = R {x: 4}; + let mut t_ref = &mut r2; while (0 < n) { if (n/2 == 0) { t_ref = &mut r1 diff --git a/external-crates/move/crates/move-stdlib-natives/src/lib.rs b/external-crates/move/crates/move-stdlib-natives/src/lib.rs index 0a49187cb9623..4859724018619 100644 --- a/external-crates/move/crates/move-stdlib-natives/src/lib.rs +++ b/external-crates/move/crates/move-stdlib-natives/src/lib.rs @@ -20,6 +20,7 @@ use move_vm_runtime::native_functions::{make_table_from_iter, NativeFunctionTabl #[derive(Debug, Clone)] pub struct GasParameters { pub bcs: bcs::GasParameters, + pub debug: debug::GasParameters, pub hash: hash::GasParameters, pub signer: signer::GasParameters, pub string: string::GasParameters, @@ -40,7 +41,14 @@ impl GasParameters { failure: 0.into(), }, }, - + debug: debug::GasParameters { + print: debug::PrintGasParameters { + base_cost: 0.into(), + }, + print_stack_trace: debug::PrintStackTraceGasParameters { + base_cost: 0.into(), + }, + }, hash: hash::GasParameters { sha2_256: hash::Sha2_256GasParameters { base: 0.into(), @@ -102,49 +110,32 @@ impl GasParameters { }, } } -} - -pub fn all_natives( - move_std_addr: AccountAddress, - gas_params: GasParameters, -) -> NativeFunctionTable { - let mut natives = vec![]; - macro_rules! add_natives { - ($module_name: expr, $natives: expr) => { - natives.extend( - $natives.map(|(func_name, func)| ($module_name.to_string(), func_name, func)), - ); - }; - } - - add_natives!("bcs", bcs::make_all(gas_params.bcs)); - add_natives!("hash", hash::make_all(gas_params.hash)); - add_natives!("signer", signer::make_all(gas_params.signer)); - add_natives!("string", string::make_all(gas_params.string)); - add_natives!("type_name", type_name::make_all(gas_params.type_name)); - add_natives!("vector", vector::make_all(gas_params.vector)); - #[cfg(feature = "testing")] - { - add_natives!("unit_test", unit_test::make_all(gas_params.unit_test)); - } - - make_table_from_iter(move_std_addr, natives) -} - -#[derive(Debug, Clone)] -pub struct NurseryGasParameters { - debug: debug::GasParameters, -} - -impl NurseryGasParameters { - pub fn zeros() -> Self { + pub fn new( + bcs: bcs::GasParameters, + debug: debug::GasParameters, + hash: hash::GasParameters, + string: string::GasParameters, + type_name: type_name::GasParameters, + vector: vector::GasParameters, + ) -> Self { Self { - debug: debug::GasParameters { - print: debug::PrintGasParameters { + bcs, + debug, + hash, + string, + type_name, + vector, + signer: signer::GasParameters { + borrow_address: signer::BorrowAddressGasParameters { base: 0.into() }, + }, + #[cfg(feature = "testing")] + unit_test: unit_test::GasParameters { + create_signers_for_testing: unit_test::CreateSignersForTestingGasParameters { base_cost: 0.into(), + unit_cost: 0.into(), }, - print_stack_trace: debug::PrintStackTraceGasParameters { + poison: unit_test::PoisonGasParameters { base_cost: 0.into(), }, }, @@ -152,10 +143,10 @@ impl NurseryGasParameters { } } -pub fn nursery_natives( - silent: bool, +pub fn all_natives( move_std_addr: AccountAddress, - gas_params: NurseryGasParameters, + gas_params: GasParameters, + debug_is_silent: bool, ) -> NativeFunctionTable { let mut natives = vec![]; @@ -167,10 +158,20 @@ pub fn nursery_natives( }; } + add_natives!("bcs", bcs::make_all(gas_params.bcs)); + add_natives!("hash", hash::make_all(gas_params.hash)); + add_natives!("signer", signer::make_all(gas_params.signer)); + add_natives!("string", string::make_all(gas_params.string)); + add_natives!("type_name", type_name::make_all(gas_params.type_name)); + add_natives!("vector", vector::make_all(gas_params.vector)); add_natives!( "debug", - debug::make_all(silent, gas_params.debug, move_std_addr) + debug::make_all(debug_is_silent, gas_params.debug, move_std_addr) ); + #[cfg(feature = "testing")] + { + add_natives!("unit_test", unit_test::make_all(gas_params.unit_test)); + } make_table_from_iter(move_std_addr, natives) } diff --git a/external-crates/move/crates/move-stdlib/Move.toml b/external-crates/move/crates/move-stdlib/Move.toml index 8ea2f565bf829..43c2eb345a90b 100644 --- a/external-crates/move/crates/move-stdlib/Move.toml +++ b/external-crates/move/crates/move-stdlib/Move.toml @@ -1,5 +1,6 @@ [package] name = "MoveStdlib" +edition = "2024.beta" [addresses] std = "_" diff --git a/external-crates/move/crates/move-stdlib/docs/address.md b/external-crates/move/crates/move-stdlib/docs/address.md new file mode 100644 index 0000000000000..830fada18e886 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/address.md @@ -0,0 +1,44 @@ + + + +# Module `0x1::address` + +Provides a way to get address length since it's a +platform-specific parameter. + + +- [Function `length`](#0x1_address_length) + + +

+ + + + + +## Function `length` + +Should be converted to a native function. +Current implementation only works for Sui. + + +
public fun length(): u64
+
+ + + +
+Implementation + + +
public fun length(): u64 {
+    32
+}
+
+ + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/ascii.md b/external-crates/move/crates/move-stdlib/docs/ascii.md index 5430a4e361c65..92cb66877a162 100644 --- a/external-crates/move/crates/move-stdlib/docs/ascii.md +++ b/external-crates/move/crates/move-stdlib/docs/ascii.md @@ -17,14 +17,24 @@ that characters are valid ASCII, and that strings consist of only valid ASCII ch - [Function `push_char`](#0x1_ascii_push_char) - [Function `pop_char`](#0x1_ascii_pop_char) - [Function `length`](#0x1_ascii_length) +- [Function `append`](#0x1_ascii_append) +- [Function `insert`](#0x1_ascii_insert) +- [Function `substring`](#0x1_ascii_substring) - [Function `as_bytes`](#0x1_ascii_as_bytes) - [Function `into_bytes`](#0x1_ascii_into_bytes) - [Function `byte`](#0x1_ascii_byte) - [Function `is_valid_char`](#0x1_ascii_is_valid_char) - [Function `is_printable_char`](#0x1_ascii_is_printable_char) +- [Function `is_empty`](#0x1_ascii_is_empty) +- [Function `to_uppercase`](#0x1_ascii_to_uppercase) +- [Function `to_lowercase`](#0x1_ascii_to_lowercase) +- [Function `index_of`](#0x1_ascii_index_of) +- [Function `char_to_uppercase`](#0x1_ascii_char_to_uppercase) +- [Function `char_to_lowercase`](#0x1_ascii_char_to_lowercase)
use 0x1::option;
+use 0x1::vector;
 
@@ -51,7 +61,7 @@ defined in this module.
-bytes: vector<u8> +bytes: vector<u8>
@@ -79,7 +89,7 @@ An ASCII character.
-byte: u8 +byte: u8
@@ -94,12 +104,22 @@ An ASCII character. ## Constants - + An invalid ASCII character was encountered when creating an ASCII string. -
const EINVALID_ASCII_CHARACTER: u64 = 65536;
+
const EInvalidASCIICharacter: u64 = 65536;
+
+ + + + + +An invalid index was encountered when creating a substring. + + +
const EInvalidIndex: u64 = 65537;
 
@@ -111,7 +131,7 @@ An invalid ASCII character was encountered when creating an ASCII string. Convert a byte into a Char that is checked to make sure it is valid ASCII. -
public fun char(byte: u8): ascii::Char
+
public fun char(byte: u8): ascii::Char
 
@@ -120,8 +140,8 @@ Convert a byte into a Char< Implementation -
public fun char(byte: u8): Char {
-    assert!(is_valid_char(byte), EINVALID_ASCII_CHARACTER);
+
public fun char(byte: u8): Char {
+    assert!(is_valid_char(byte), EInvalidASCIICharacter);
     Char { byte }
 }
 
@@ -138,7 +158,7 @@ Convert a vector of bytes bytes into an string(bytes: vector<u8>): ascii::String +
public fun string(bytes: vector<u8>): ascii::String
 
@@ -147,13 +167,10 @@ Convert a vector of bytes bytes into an string(bytes: vector<u8>): String { - let x = try_string(bytes); - assert!( - option::is_some(&x), - EINVALID_ASCII_CHARACTER - ); - option::destroy_some(x) +
public fun string(bytes: vector<u8>): String {
+    let x = try_string(bytes);
+    assert!(x.is_some(), EInvalidASCIICharacter);
+    x.destroy_some()
 }
 
@@ -170,7 +187,7 @@ Convert a vector of bytes bytes into an try_string(bytes: vector<u8>): option::Option<ascii::String> +
public fun try_string(bytes: vector<u8>): option::Option<ascii::String>
 
@@ -179,15 +196,10 @@ characters. Otherwise returns None. Implementation -
public fun try_string(bytes: vector<u8>): Option<String> {
-    let len = vector::length(&bytes);
-    let i = 0;
-    while (i < len) {
-        let possible_byte = *vector::borrow(&bytes, i);
-        if (!is_valid_char(possible_byte)) return option::none();
-        i = i + 1;
-    };
-    option::some(String { bytes })
+
public fun try_string(bytes: vector<u8>): Option<String> {
+    let is_valid = bytes.all!(|byte| is_valid_char(*byte));
+    if (is_valid) option::some(String { bytes })
+    else option::none()
 }
 
@@ -213,14 +225,7 @@ Returns false otherwise. Not all all_characters_printable(string: &String): bool { - let len = vector::length(&string.bytes); - let i = 0; - while (i < len) { - let byte = *vector::borrow(&string.bytes, i); - if (!is_printable_char(byte)) return false; - i = i + 1; - }; - true + string.bytes.all!(|byte| is_printable_char(*byte)) }
@@ -232,6 +237,7 @@ Returns false otherwise. Not all Char to the end of the string.
public fun push_char(string: &mut ascii::String, char: ascii::Char)
@@ -244,7 +250,7 @@ Returns false otherwise. Not all push_char(string: &mut String, char: Char) {
-    vector::push_back(&mut string.bytes, char.byte);
+    string.bytes.push_back(char.byte);
 }
 
@@ -256,6 +262,7 @@ Returns false otherwise. Not all Char from the end of the string.
public fun pop_char(string: &mut ascii::String): ascii::Char
@@ -268,7 +275,7 @@ Returns false otherwise. Not all pop_char(string: &mut String): Char {
-    Char { byte: vector::pop_back(&mut string.bytes) }
+    Char { byte: string.bytes.pop_back() }
 }
 
@@ -280,9 +287,60 @@ Returns false otherwise. Not all string in bytes. + + +
public fun length(string: &ascii::String): u64
+
+ + + +
+Implementation + + +
public fun length(string: &String): u64 {
+    string.as_bytes().length()
+}
+
+ + + +
+ + + +## Function `append` + +Append the other string to the end of string. + + +
public fun append(string: &mut ascii::String, other: ascii::String)
+
+ + + +
+Implementation + + +
public fun append(string: &mut String, other: String) {
+    string.bytes.append(other.into_bytes())
+}
+
+ + + +
+ + + +## Function `insert` + +Insert the other string at the at index of string. -
public fun length(string: &ascii::String): u64
+
public fun insert(s: &mut ascii::String, at: u64, o: ascii::String)
 
@@ -291,8 +349,37 @@ Returns false otherwise. Not all length(string: &String): u64 { - vector::length(as_bytes(string)) +
public fun insert(s: &mut String, at: u64, o: String) {
+    assert!(at <= s.length(), EInvalidIndex);
+    o.into_bytes().destroy!(|e| s.bytes.insert(e, at));
+}
+
+ + + + + + + +## Function `substring` + +Copy the slice of the string from i to j into a new String. + + +
public fun substring(string: &ascii::String, i: u64, j: u64): ascii::String
+
+ + + +
+Implementation + + +
public fun substring(string: &String, i: u64, j: u64): String {
+    assert!(i <= j && j <= string.length(), EInvalidIndex);
+    let mut bytes = vector[];
+    i.range_do!(j, |i| bytes.push_back(string.bytes[i]));
+    String { bytes }
 }
 
@@ -307,7 +394,7 @@ Returns false otherwise. Not all string as a reference -
public fun as_bytes(string: &ascii::String): &vector<u8>
+
public fun as_bytes(string: &ascii::String): &vector<u8>
 
@@ -316,8 +403,8 @@ Get the inner bytes of the stringImplementation -
public fun as_bytes(string: &String): &vector<u8> {
-   &string.bytes
+
public fun as_bytes(string: &String): &vector<u8> {
+    &string.bytes
 }
 
@@ -332,7 +419,7 @@ Get the inner bytes of the stringstring
to get its backing bytes -
public fun into_bytes(string: ascii::String): vector<u8>
+
public fun into_bytes(string: ascii::String): vector<u8>
 
@@ -341,9 +428,9 @@ Unpack the string to get its bac Implementation -
public fun into_bytes(string: String): vector<u8> {
-   let String { bytes } = string;
-   bytes
+
public fun into_bytes(string: String): vector<u8> {
+    let String { bytes } = string;
+    bytes
 }
 
@@ -355,10 +442,10 @@ Unpack the string to get its bac ## Function `byte` -Unpack the char into its underlying byte. +Unpack the char into its underlying bytes. -
public fun byte(char: ascii::Char): u8
+
public fun byte(char: ascii::Char): u8
 
@@ -367,9 +454,9 @@ Unpack the char into its underlying byte. Implementation -
public fun byte(char: Char): u8 {
-   let Char { byte } = char;
-   byte
+
public fun byte(char: Char): u8 {
+    let Char { byte } = char;
+    byte
 }
 
@@ -381,10 +468,11 @@ Unpack the char into its underlying byte. ## Function `is_valid_char` -Returns true if b is a valid ASCII character. Returns false otherwise. +Returns true if b is a valid ASCII character. +Returns false otherwise. -
public fun is_valid_char(b: u8): bool
+
public fun is_valid_char(b: u8): bool
 
@@ -393,8 +481,8 @@ Returns true if b is a valid ASCII character. R Implementation -
public fun is_valid_char(b: u8): bool {
-   b <= 0x7F
+
public fun is_valid_char(b: u8): bool {
+    b <= 0x7F
 }
 
@@ -406,10 +494,176 @@ Returns true if b is a valid ASCII character. R ## Function `is_printable_char` -Returns true if byte is an printable ASCII character. Returns false otherwise. +Returns true if byte is an printable ASCII character. +Returns false otherwise. + + +
public fun is_printable_char(byte: u8): bool
+
+ + + +
+Implementation + + +
public fun is_printable_char(byte: u8): bool {
+    byte >= 0x20 && // Disallow metacharacters
+    byte <= 0x7E // Don't allow DEL metacharacter
+}
+
+ + + +
+ + + +## Function `is_empty` + +Returns true if string is empty. + + +
public fun is_empty(string: &ascii::String): bool
+
+ + + +
+Implementation + + +
public fun is_empty(string: &String): bool {
+    string.bytes.is_empty()
+}
+
+ + + +
+ + + +## Function `to_uppercase` + +Convert a string to its uppercase equivalent. + + +
public fun to_uppercase(string: &ascii::String): ascii::String
+
+ + + +
+Implementation + + +
public fun to_uppercase(string: &String): String {
+    let bytes = string.as_bytes().map_ref!(|byte| char_to_uppercase(*byte));
+    String { bytes }
+}
+
+ + + +
+ + + +## Function `to_lowercase` + +Convert a string to its lowercase equivalent. + + +
public fun to_lowercase(string: &ascii::String): ascii::String
+
+ + + +
+Implementation + + +
public fun to_lowercase(string: &String): String {
+    let bytes = string.as_bytes().map_ref!(|byte| char_to_lowercase(*byte));
+    String { bytes }
+}
+
+ + + +
+ + + +## Function `index_of` + +Computes the index of the first occurrence of the substr in the string. +Returns the length of the string if the substr is not found. +Returns 0 if the substr is empty. + + +
public fun index_of(string: &ascii::String, substr: &ascii::String): u64
+
+ + + +
+Implementation + + +
public fun index_of(string: &String, substr: &String): u64 {
+    let mut i = 0;
+    let (n, m) = (string.length(), substr.length());
+    if (n < m) return n;
+    while (i <= n - m) {
+        let mut j = 0;
+        while (j < m && string.bytes[i + j] == substr.bytes[j]) j = j + 1;
+        if (j == m) return i;
+        i = i + 1;
+    };
+    n
+}
+
+ + + +
+ + + +## Function `char_to_uppercase` + +Convert a char to its lowercase equivalent. + + +
fun char_to_uppercase(byte: u8): u8
+
+ + + +
+Implementation + + +
fun char_to_uppercase(byte: u8): u8 {
+    if (byte >= 0x61 && byte <= 0x7A) byte - 0x20
+    else byte
+}
+
+ + + +
+ + + +## Function `char_to_lowercase` + +Convert a char to its lowercase equivalent. -
public fun is_printable_char(byte: u8): bool
+
fun char_to_lowercase(byte: u8): u8
 
@@ -418,9 +672,9 @@ Returns true if byte is an printable ASCII char Implementation -
public fun is_printable_char(byte: u8): bool {
-   byte >= 0x20 && // Disallow metacharacters
-   byte <= 0x7E // Don't allow DEL metacharacter
+
fun char_to_lowercase(byte: u8): u8 {
+    if (byte >= 0x41 && byte <= 0x5A) byte + 0x20
+    else byte
 }
 
diff --git a/external-crates/move/crates/move-stdlib/docs/bcs.md b/external-crates/move/crates/move-stdlib/docs/bcs.md index 1b89050bb7799..3497986f00b38 100644 --- a/external-crates/move/crates/move-stdlib/docs/bcs.md +++ b/external-crates/move/crates/move-stdlib/docs/bcs.md @@ -23,7 +23,7 @@ details on BCS. Return the binary representation of v in BCS (Binary Canonical Serialization) format -
public fun to_bytes<MoveValue>(v: &MoveValue): vector<u8>
+
public fun to_bytes<MoveValue>(v: &MoveValue): vector<u8>
 
@@ -32,7 +32,7 @@ Return the binary representation of v in BCS (Binary Canonical Seri Implementation -
native public fun to_bytes<MoveValue>(v: &MoveValue): vector<u8>;
+
native public fun to_bytes<MoveValue>(v: &MoveValue): vector<u8>;
 
diff --git a/external-crates/move/crates/move-stdlib/docs/bit_vector.md b/external-crates/move/crates/move-stdlib/docs/bit_vector.md index 30e0a7496901b..465aa95a26ff6 100644 --- a/external-crates/move/crates/move-stdlib/docs/bit_vector.md +++ b/external-crates/move/crates/move-stdlib/docs/bit_vector.md @@ -37,7 +37,7 @@
-length: u64 +length: u64
@@ -63,7 +63,7 @@ The provided index is out of bounds -
const EINDEX: u64 = 131072;
+
const EINDEX: u64 = 131072;
 
@@ -73,7 +73,7 @@ The provided index is out of bounds An invalid length of bitvector was given -
const ELENGTH: u64 = 131073;
+
const ELENGTH: u64 = 131073;
 
@@ -83,7 +83,16 @@ An invalid length of bitvector was given The maximum allowed bitvector size -
const MAX_SIZE: u64 = 1024;
+
const MAX_SIZE: u64 = 1024;
+
+ + + + + + + +
const WORD_SIZE: u64 = 1;
 
@@ -94,7 +103,7 @@ The maximum allowed bitvector size -
public fun new(length: u64): bit_vector::BitVector
+
public fun new(length: u64): bit_vector::BitVector
 
@@ -103,13 +112,13 @@ The maximum allowed bitvector size Implementation -
public fun new(length: u64): BitVector {
+
public fun new(length: u64): BitVector {
     assert!(length > 0, ELENGTH);
     assert!(length < MAX_SIZE, ELENGTH);
-    let counter = 0;
-    let bit_field = vector::empty();
+    let mut counter = 0;
+    let mut bit_field = vector::empty();
     while (counter < length) {
-        vector::push_back(&mut bit_field, false);
+        bit_field.push_back(false);
         counter = counter + 1;
     };
 
@@ -131,7 +140,7 @@ The maximum allowed bitvector size
 Set the bit at bit_index in the bitvector regardless of its previous state.
 
 
-
public fun set(bitvector: &mut bit_vector::BitVector, bit_index: u64)
+
public fun set(bitvector: &mut bit_vector::BitVector, bit_index: u64)
 
@@ -140,9 +149,9 @@ Set the bit at bit_index in the bitvector regardless o Implementation -
public fun set(bitvector: &mut BitVector, bit_index: u64) {
-    assert!(bit_index < vector::length(&bitvector.bit_field), EINDEX);
-    let x = vector::borrow_mut(&mut bitvector.bit_field, bit_index);
+
public fun set(bitvector: &mut BitVector, bit_index: u64) {
+    assert!(bit_index < bitvector.bit_field.length(), EINDEX);
+    let x = &mut bitvector.bit_field[bit_index];
     *x = true;
 }
 
@@ -158,7 +167,7 @@ Set the bit at bit_index in the bitvector regardless o Unset the bit at bit_index in the bitvector regardless of its previous state. -
public fun unset(bitvector: &mut bit_vector::BitVector, bit_index: u64)
+
public fun unset(bitvector: &mut bit_vector::BitVector, bit_index: u64)
 
@@ -167,9 +176,9 @@ Unset the bit at bit_index in the bitvector regardless Implementation -
public fun unset(bitvector: &mut BitVector, bit_index: u64) {
-    assert!(bit_index < vector::length(&bitvector.bit_field), EINDEX);
-    let x = vector::borrow_mut(&mut bitvector.bit_field, bit_index);
+
public fun unset(bitvector: &mut BitVector, bit_index: u64) {
+    assert!(bit_index < bitvector.bit_field.length(), EINDEX);
+    let x = &mut bitvector.bit_field[bit_index];
     *x = false;
 }
 
@@ -186,7 +195,7 @@ Shift the bitvector left by amount. If amountpublic fun shift_left(bitvector: &mut bit_vector::BitVector, amount: u64) +
public fun shift_left(bitvector: &mut bit_vector::BitVector, amount: u64)
 
@@ -195,21 +204,21 @@ bitvector's length the bitvector will be zeroed out. Implementation -
public fun shift_left(bitvector: &mut BitVector, amount: u64) {
+
public fun shift_left(bitvector: &mut BitVector, amount: u64) {
     if (amount >= bitvector.length) {
-       let len = vector::length(&bitvector.bit_field);
-       let i = 0;
+       let len = bitvector.bit_field.length();
+       let mut i = 0;
        while (i < len) {
-           let elem = vector::borrow_mut(&mut bitvector.bit_field, i);
+           let elem = &mut bitvector.bit_field[i];
            *elem = false;
            i = i + 1;
        };
     } else {
-        let i = amount;
+        let mut i = amount;
 
         while (i < bitvector.length) {
-            if (is_index_set(bitvector, i)) set(bitvector, i - amount)
-            else unset(bitvector, i - amount);
+            if (bitvector.is_index_set(i)) bitvector.set(i - amount)
+            else bitvector.unset(i - amount);
             i = i + 1;
         };
 
@@ -235,7 +244,7 @@ Return the value of the bit at bit_index in the bitvectorfalse represents a 0
 
 
-
public fun is_index_set(bitvector: &bit_vector::BitVector, bit_index: u64): bool
+
public fun is_index_set(bitvector: &bit_vector::BitVector, bit_index: u64): bool
 
@@ -244,9 +253,9 @@ represents "1" and false represents a 0 Implementation -
public fun is_index_set(bitvector: &BitVector, bit_index: u64): bool {
-    assert!(bit_index < vector::length(&bitvector.bit_field), EINDEX);
-    *vector::borrow(&bitvector.bit_field, bit_index)
+
public fun is_index_set(bitvector: &BitVector, bit_index: u64): bool {
+    assert!(bit_index < bitvector.bit_field.length(), EINDEX);
+    bitvector.bit_field[bit_index]
 }
 
@@ -261,7 +270,7 @@ represents "1" and false represents a 0 Return the length (number of usable bits) of this bitvector -
public fun length(bitvector: &bit_vector::BitVector): u64
+
public fun length(bitvector: &bit_vector::BitVector): u64
 
@@ -270,8 +279,8 @@ Return the length (number of usable bits) of this bitvector Implementation -
public fun length(bitvector: &BitVector): u64 {
-    vector::length(&bitvector.bit_field)
+
public fun length(bitvector: &BitVector): u64 {
+    bitvector.bit_field.length()
 }
 
@@ -288,7 +297,7 @@ including) start_index in the bitvector. If there is n sequence, then 0 is returned. -
public fun longest_set_sequence_starting_at(bitvector: &bit_vector::BitVector, start_index: u64): u64
+
public fun longest_set_sequence_starting_at(bitvector: &bit_vector::BitVector, start_index: u64): u64
 
@@ -297,13 +306,13 @@ sequence, then 0 is returned. Implementation -
public fun longest_set_sequence_starting_at(bitvector: &BitVector, start_index: u64): u64 {
+
public fun longest_set_sequence_starting_at(bitvector: &BitVector, start_index: u64): u64 {
     assert!(start_index < bitvector.length, EINDEX);
-    let index = start_index;
+    let mut index = start_index;
 
     // Find the greatest index in the vector such that all indices less than it are set.
     while (index < bitvector.length) {
-        if (!is_index_set(bitvector, index)) break;
+        if (!bitvector.is_index_set(index)) break;
         index = index + 1;
     };
 
diff --git a/external-crates/move/crates/move-stdlib/nursery/docs/debug.md b/external-crates/move/crates/move-stdlib/docs/debug.md
similarity index 86%
rename from external-crates/move/crates/move-stdlib/nursery/docs/debug.md
rename to external-crates/move/crates/move-stdlib/docs/debug.md
index 33bd18df12f6f..8cd525b3ea6ef 100644
--- a/external-crates/move/crates/move-stdlib/nursery/docs/debug.md
+++ b/external-crates/move/crates/move-stdlib/docs/debug.md
@@ -18,7 +18,6 @@ Module providing debug functionality.
 
 ## Function `print`
 
-Pretty-prints any Move value. For a Move struct, includes its field names, their types and their values.
 
 
 
public fun print<T>(x: &T)
@@ -41,7 +40,6 @@ Pretty-prints any Move value. For a Move struct, includes its field names, their
 
 ## Function `print_stack_trace`
 
-Prints the calling function's stack trace.
 
 
 
public fun print_stack_trace()
@@ -59,3 +57,6 @@ Prints the calling function's stack trace.
 
 
 
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/error.md b/external-crates/move/crates/move-stdlib/docs/error.md deleted file mode 100644 index 0cc2487da9611..0000000000000 --- a/external-crates/move/crates/move-stdlib/docs/error.md +++ /dev/null @@ -1,475 +0,0 @@ - - - -# Module `0x1::error` - -This module defines a set of canonical error codes which are optional to use by applications for the -abort and assert! features. - -Canonical error codes use the 3 lowest bytes of the u64 abort code range (the upper 5 bytes are free for other use). -Of those, the highest byte represents the *error category* and the lower two bytes the *error reason*. -Given an error category 0x1 and a reason 0x3, a canonical abort code looks as 0x10003. - -A module can use a canonical code with a constant declaration of the following form: - -``` -/// An invalid ASCII character was encountered when creating a string. -const EINVALID_CHARACTER: u64 = 0x010003; -``` - -This code is both valid in the worlds with and without canonical errors. It can be used as a plain module local -error reason understand by the existing error map tooling, or as a canonical code. - -The actual canonical categories have been adopted from Google's canonical error codes, which in turn are derived -from Unix error codes [see here](https://cloud.google.com/apis/design/errors#handling_errors). Each code has an -associated HTTP error code which can be used in REST apis. The mapping from error code to http code is not 1:1; -error codes here are a bit richer than HTTP codes. - - -- [Constants](#@Constants_0) -- [Function `canonical`](#0x1_error_canonical) -- [Function `invalid_argument`](#0x1_error_invalid_argument) -- [Function `out_of_range`](#0x1_error_out_of_range) -- [Function `invalid_state`](#0x1_error_invalid_state) -- [Function `unauthenticated`](#0x1_error_unauthenticated) -- [Function `permission_denied`](#0x1_error_permission_denied) -- [Function `not_found`](#0x1_error_not_found) -- [Function `aborted`](#0x1_error_aborted) -- [Function `already_exists`](#0x1_error_already_exists) -- [Function `resource_exhausted`](#0x1_error_resource_exhausted) -- [Function `internal`](#0x1_error_internal) -- [Function `not_implemented`](#0x1_error_not_implemented) -- [Function `unavailable`](#0x1_error_unavailable) - - -
- - - - - -## Constants - - - - -Concurrency conflict, such as read-modify-write conflict (http: 409) - - -
const ABORTED: u64 = 7;
-
- - - - - -The resource that a client tried to create already exists (http: 409) - - -
const ALREADY_EXISTS: u64 = 8;
-
- - - - - -Request cancelled by the client (http: 499) - - -
const CANCELLED: u64 = 10;
-
- - - - - -Internal error (http: 500) - - -
const INTERNAL: u64 = 11;
-
- - - - - -Caller specified an invalid argument (http: 400) - - -
const INVALID_ARGUMENT: u64 = 1;
-
- - - - - -The system is not in a state where the operation can be performed (http: 400) - - -
const INVALID_STATE: u64 = 3;
-
- - - - - -A specified resource is not found (http: 404) - - -
const NOT_FOUND: u64 = 6;
-
- - - - - -Feature not implemented (http: 501) - - -
const NOT_IMPLEMENTED: u64 = 12;
-
- - - - - -An input or result of a computation is out of range (http: 400) - - -
const OUT_OF_RANGE: u64 = 2;
-
- - - - - -client does not have sufficient permission (http: 403) - - -
const PERMISSION_DENIED: u64 = 5;
-
- - - - - -Out of gas or other forms of quota (http: 429) - - -
const RESOURCE_EXHAUSTED: u64 = 9;
-
- - - - - -Request not authenticated due to missing, invalid, or expired auth token (http: 401) - - -
const UNAUTHENTICATED: u64 = 4;
-
- - - - - -The service is currently unavailable. Indicates that a retry could solve the issue (http: 503) - - -
const UNAVAILABLE: u64 = 13;
-
- - - - - -## Function `canonical` - -Construct a canonical error code from a category and a reason. - - -
public fun canonical(category: u64, reason: u64): u64
-
- - - -
-Implementation - - -
public fun canonical(category: u64, reason: u64): u64 {
-  (category << 16) + reason
-}
-
- - - -
- - - -## Function `invalid_argument` - -Functions to construct a canonical error code of the given category. - - -
public fun invalid_argument(r: u64): u64
-
- - - -
-Implementation - - -
public fun invalid_argument(r: u64): u64 {  canonical(INVALID_ARGUMENT, r) }
-
- - - -
- - - -## Function `out_of_range` - - - -
public fun out_of_range(r: u64): u64
-
- - - -
-Implementation - - -
public fun out_of_range(r: u64): u64 {  canonical(OUT_OF_RANGE, r) }
-
- - - -
- - - -## Function `invalid_state` - - - -
public fun invalid_state(r: u64): u64
-
- - - -
-Implementation - - -
public fun invalid_state(r: u64): u64 {  canonical(INVALID_STATE, r) }
-
- - - -
- - - -## Function `unauthenticated` - - - -
public fun unauthenticated(r: u64): u64
-
- - - -
-Implementation - - -
public fun unauthenticated(r: u64): u64 { canonical(UNAUTHENTICATED, r) }
-
- - - -
- - - -## Function `permission_denied` - - - -
public fun permission_denied(r: u64): u64
-
- - - -
-Implementation - - -
public fun permission_denied(r: u64): u64 { canonical(PERMISSION_DENIED, r) }
-
- - - -
- - - -## Function `not_found` - - - -
public fun not_found(r: u64): u64
-
- - - -
-Implementation - - -
public fun not_found(r: u64): u64 { canonical(NOT_FOUND, r) }
-
- - - -
- - - -## Function `aborted` - - - -
public fun aborted(r: u64): u64
-
- - - -
-Implementation - - -
public fun aborted(r: u64): u64 { canonical(ABORTED, r) }
-
- - - -
- - - -## Function `already_exists` - - - -
public fun already_exists(r: u64): u64
-
- - - -
-Implementation - - -
public fun already_exists(r: u64): u64 { canonical(ALREADY_EXISTS, r) }
-
- - - -
- - - -## Function `resource_exhausted` - - - -
public fun resource_exhausted(r: u64): u64
-
- - - -
-Implementation - - -
public fun resource_exhausted(r: u64): u64 {  canonical(RESOURCE_EXHAUSTED, r) }
-
- - - -
- - - -## Function `internal` - - - -
public fun internal(r: u64): u64
-
- - - -
-Implementation - - -
public fun internal(r: u64): u64 {  canonical(INTERNAL, r) }
-
- - - -
- - - -## Function `not_implemented` - - - -
public fun not_implemented(r: u64): u64
-
- - - -
-Implementation - - -
public fun not_implemented(r: u64): u64 {  canonical(NOT_IMPLEMENTED, r) }
-
- - - -
- - - -## Function `unavailable` - - - -
public fun unavailable(r: u64): u64
-
- - - -
-Implementation - - -
public fun unavailable(r: u64): u64 { canonical(UNAVAILABLE, r) }
-
- - - -
- - -[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/fixed_point32.md b/external-crates/move/crates/move-stdlib/docs/fixed_point32.md index 8644f861dd01d..95abd66963732 100644 --- a/external-crates/move/crates/move-stdlib/docs/fixed_point32.md +++ b/external-crates/move/crates/move-stdlib/docs/fixed_point32.md @@ -15,12 +15,6 @@ a 32-bit fractional part. - [Function `create_from_raw_value`](#0x1_fixed_point32_create_from_raw_value) - [Function `get_raw_value`](#0x1_fixed_point32_get_raw_value) - [Function `is_zero`](#0x1_fixed_point32_is_zero) -- [Function `min`](#0x1_fixed_point32_min) -- [Function `max`](#0x1_fixed_point32_max) -- [Function `create_from_u64`](#0x1_fixed_point32_create_from_u64) -- [Function `floor`](#0x1_fixed_point32_floor) -- [Function `ceil`](#0x1_fixed_point32_ceil) -- [Function `round`](#0x1_fixed_point32_round)
@@ -53,7 +47,7 @@ decimal.
-value: u64 +value: u64
@@ -73,17 +67,17 @@ decimal. The denominator provided was zero -
const EDENOMINATOR: u64 = 65537;
+
const EDENOMINATOR: u64 = 65537;
 
-The quotient value would be too large to be held in a u64 +The quotient value would be too large to be held in a u64 -
const EDIVISION: u64 = 131074;
+
const EDIVISION: u64 = 131074;
 
@@ -93,17 +87,17 @@ The quotient value would be too large to be held in a u64 A division by zero was encountered -
const EDIVISION_BY_ZERO: u64 = 65540;
+
const EDIVISION_BY_ZERO: u64 = 65540;
 
-The multiplied value would be too large to be held in a u64 +The multiplied value would be too large to be held in a u64 -
const EMULTIPLICATION: u64 = 131075;
+
const EMULTIPLICATION: u64 = 131075;
 
@@ -113,7 +107,7 @@ The multiplied value would be too large to be held in a u64 The computed ratio when converting to a FixedPoint32 would be unrepresentable -
const ERATIO_OUT_OF_RANGE: u64 = 131077;
+
const ERATIO_OUT_OF_RANGE: u64 = 131077;
 
@@ -123,7 +117,7 @@ The computed ratio when converting to a MAX_U64: u128 = 18446744073709551615; +
const MAX_U64: u128 = 18446744073709551615;
 
@@ -137,7 +131,7 @@ fractional part of the product. This will abort if the product overflows. -
public fun multiply_u64(val: u64, multiplier: fixed_point32::FixedPoint32): u64
+
public fun multiply_u64(val: u64, multiplier: fixed_point32::FixedPoint32): u64
 
@@ -146,17 +140,17 @@ overflows. Implementation -
public fun multiply_u64(val: u64, multiplier: FixedPoint32): u64 {
+
public fun multiply_u64(val: u64, multiplier: FixedPoint32): u64 {
     // The product of two 64 bit values has 128 bits, so perform the
-    // multiplication with u128 types and keep the full 128 bit product
+    // multiplication with u128 types and keep the full 128 bit product
     // to avoid losing accuracy.
-    let unscaled_product = (val as u128) * (multiplier.value as u128);
+    let unscaled_product = val as u128 * (multiplier.value as u128);
     // The unscaled product has 32 fractional bits (from the multiplier)
     // so rescale it by shifting away the low bits.
     let product = unscaled_product >> 32;
     // Check whether the value is too large.
     assert!(product <= MAX_U64, EMULTIPLICATION);
-    (product as u64)
+    product as u64
 }
 
@@ -173,7 +167,7 @@ fractional part of the quotient. This will abort if the divisor is zero or if the quotient overflows. -
public fun divide_u64(val: u64, divisor: fixed_point32::FixedPoint32): u64
+
public fun divide_u64(val: u64, divisor: fixed_point32::FixedPoint32): u64
 
@@ -182,18 +176,18 @@ is zero or if the quotient overflows. Implementation -
public fun divide_u64(val: u64, divisor: FixedPoint32): u64 {
+
public fun divide_u64(val: u64, divisor: FixedPoint32): u64 {
     // Check for division by zero.
     assert!(divisor.value != 0, EDIVISION_BY_ZERO);
     // First convert to 128 bits and then shift left to
     // add 32 fractional zero bits to the dividend.
-    let scaled_value = (val as u128) << 32;
-    let quotient = scaled_value / (divisor.value as u128);
+    let scaled_value = val as u128 << 32;
+    let quotient = scaled_value / (divisor.value as u128);
     // Check whether the value is too large.
     assert!(quotient <= MAX_U64, EDIVISION);
     // the value may be too large, which will cause the cast to fail
-    // with an arithmetic error.
-    (quotient as u64)
+    // with an arithmetic error.
+    quotient as u64
 }
 
@@ -217,7 +211,7 @@ very small imprecision in the binary representation could change the rounding, e.g., 0.0125 will round down to 0.012 instead of up to 0.013. -
public fun create_from_rational(numerator: u64, denominator: u64): fixed_point32::FixedPoint32
+
public fun create_from_rational(numerator: u64, denominator: u64): fixed_point32::FixedPoint32
 
@@ -226,20 +220,20 @@ rounding, e.g., 0.0125 will round down to 0.012 instead of up to 0.013. Implementation -
public fun create_from_rational(numerator: u64, denominator: u64): FixedPoint32 {
+
public fun create_from_rational(numerator: u64, denominator: u64): FixedPoint32 {
     // If the denominator is zero, this will abort.
     // Scale the numerator to have 64 fractional bits and the denominator
     // to have 32 fractional bits, so that the quotient will have 32
     // fractional bits.
-    let scaled_numerator = (numerator as u128) << 64;
-    let scaled_denominator = (denominator as u128) << 32;
+    let scaled_numerator = numerator as u128 << 64;
+    let scaled_denominator = denominator as u128 << 32;
     assert!(scaled_denominator != 0, EDENOMINATOR);
     let quotient = scaled_numerator / scaled_denominator;
     assert!(quotient != 0 || numerator == 0, ERATIO_OUT_OF_RANGE);
     // Return the quotient as a fixed-point number. We first need to check whether the cast
     // can succeed.
     assert!(quotient <= MAX_U64, ERATIO_OUT_OF_RANGE);
-    FixedPoint32 { value: (quotient as u64) }
+    FixedPoint32 { value: quotient as u64 }
 }
 
@@ -254,7 +248,7 @@ rounding, e.g., 0.0125 will round down to 0.012 instead of up to 0.013. Create a fixedpoint value from a raw value. -
public fun create_from_raw_value(value: u64): fixed_point32::FixedPoint32
+
public fun create_from_raw_value(value: u64): fixed_point32::FixedPoint32
 
@@ -263,7 +257,7 @@ Create a fixedpoint value from a raw value. Implementation -
public fun create_from_raw_value(value: u64): FixedPoint32 {
+
public fun create_from_raw_value(value: u64): FixedPoint32 {
     FixedPoint32 { value }
 }
 
@@ -281,7 +275,7 @@ adding or subtracting FixedPoint32 values, can be done using the raw values directly. -
public fun get_raw_value(num: fixed_point32::FixedPoint32): u64
+
public fun get_raw_value(num: fixed_point32::FixedPoint32): u64
 
@@ -290,7 +284,7 @@ values directly. Implementation -
public fun get_raw_value(num: FixedPoint32): u64 {
+
public fun get_raw_value(num: FixedPoint32): u64 {
     num.value
 }
 
@@ -322,177 +316,6 @@ Returns true if the ratio is zero. - - - - -## Function `min` - -Returns the smaller of the two FixedPoint32 numbers. - - -
public fun min(num1: fixed_point32::FixedPoint32, num2: fixed_point32::FixedPoint32): fixed_point32::FixedPoint32
-
- - - -
-Implementation - - -
public fun min(num1: FixedPoint32, num2: FixedPoint32): FixedPoint32 {
-    if (num1.value < num2.value) {
-        num1
-    } else {
-        num2
-    }
-}
-
- - - -
- - - -## Function `max` - -Returns the larger of the two FixedPoint32 numbers. - - -
public fun max(num1: fixed_point32::FixedPoint32, num2: fixed_point32::FixedPoint32): fixed_point32::FixedPoint32
-
- - - -
-Implementation - - -
public fun max(num1: FixedPoint32, num2: FixedPoint32): FixedPoint32 {
-    if (num1.value > num2.value) {
-        num1
-    } else {
-        num2
-    }
-}
-
- - - -
- - - -## Function `create_from_u64` - -Create a fixedpoint value from a u64 value. - - -
public fun create_from_u64(val: u64): fixed_point32::FixedPoint32
-
- - - -
-Implementation - - -
public fun create_from_u64(val: u64): FixedPoint32 {
-    let value = (val as u128) << 32;
-    assert!(value <= MAX_U64, ERATIO_OUT_OF_RANGE);
-    FixedPoint32{value: (value as u64)}
-}
-
- - - -
- - - -## Function `floor` - -Returns the largest integer less than or equal to a given number. - - -
public fun floor(num: fixed_point32::FixedPoint32): u64
-
- - - -
-Implementation - - -
public fun floor(num: FixedPoint32): u64 {
-    num.value >> 32
-}
-
- - - -
- - - -## Function `ceil` - -Rounds up the given FixedPoint32 to the next largest integer. - - -
public fun ceil(num: fixed_point32::FixedPoint32): u64
-
- - - -
-Implementation - - -
public fun ceil(num: FixedPoint32): u64 {
-    let floored_num = floor(num) << 32;
-    if (num.value == floored_num) {
-        return floored_num >> 32
-    };
-    let val = ((floored_num as u128) + (1 << 32));
-    (val >> 32 as u64)
-}
-
- - - -
- - - -## Function `round` - -Returns the value of a FixedPoint32 to the nearest integer. - - -
public fun round(num: fixed_point32::FixedPoint32): u64
-
- - - -
-Implementation - - -
public fun round(num: FixedPoint32): u64 {
-    let floored_num = floor(num) << 32;
-    let boundary = floored_num + ((1 << 32) / 2);
-    if (num.value < boundary) {
-        floored_num >> 32
-    } else {
-        ceil(num)
-    }
-}
-
- - -
diff --git a/external-crates/move/crates/move-stdlib/docs/hash.md b/external-crates/move/crates/move-stdlib/docs/hash.md index c054f33cb569a..e3b110a627729 100644 --- a/external-crates/move/crates/move-stdlib/docs/hash.md +++ b/external-crates/move/crates/move-stdlib/docs/hash.md @@ -23,7 +23,7 @@ as in the Move prover's prelude. -
public fun sha2_256(data: vector<u8>): vector<u8>
+
public fun sha2_256(data: vector<u8>): vector<u8>
 
@@ -32,7 +32,7 @@ as in the Move prover's prelude. Implementation -
native public fun sha2_256(data: vector<u8>): vector<u8>;
+
native public fun sha2_256(data: vector<u8>): vector<u8>;
 
@@ -45,7 +45,7 @@ as in the Move prover's prelude. -
public fun sha3_256(data: vector<u8>): vector<u8>
+
public fun sha3_256(data: vector<u8>): vector<u8>
 
@@ -54,7 +54,7 @@ as in the Move prover's prelude. Implementation -
native public fun sha3_256(data: vector<u8>): vector<u8>;
+
native public fun sha3_256(data: vector<u8>): vector<u8>;
 
diff --git a/external-crates/move/crates/move-stdlib/docs/macros.md b/external-crates/move/crates/move-stdlib/docs/macros.md new file mode 100644 index 0000000000000..4fd3e7cd33d95 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/macros.md @@ -0,0 +1,14 @@ + + + +# Module `0x1::macros` + +This module holds shared implementation of macros used in std + + + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/option.md b/external-crates/move/crates/move-stdlib/docs/option.md index 04baf52a56f91..070a8f9672a07 100644 --- a/external-crates/move/crates/move-stdlib/docs/option.md +++ b/external-crates/move/crates/move-stdlib/docs/option.md @@ -72,7 +72,7 @@ The Option is in an inval The Option is Some while it should be None. -
const EOPTION_IS_SET: u64 = 262144;
+
const EOPTION_IS_SET: u64 = 262144;
 
@@ -83,7 +83,7 @@ The Option is in an inval The Option is None while it should be Some. -
const EOPTION_NOT_SET: u64 = 262145;
+
const EOPTION_NOT_SET: u64 = 262145;
 
@@ -155,7 +155,7 @@ Return true if t does not hold a value
public fun is_none<Element>(t: &Option<Element>): bool {
-    vector::is_empty(&t.vec)
+    t.vec.is_empty()
 }
 
@@ -180,7 +180,7 @@ Return true if t holds a value
public fun is_some<Element>(t: &Option<Element>): bool {
-    !vector::is_empty(&t.vec)
+    !t.vec.is_empty()
 }
 
@@ -206,7 +206,7 @@ Always returns false if t does not hold a value
public fun contains<Element>(t: &Option<Element>, e_ref: &Element): bool {
-    vector::contains(&t.vec, e_ref)
+    t.vec.contains(e_ref)
 }
 
@@ -232,8 +232,8 @@ Aborts if t does not hold a value
public fun borrow<Element>(t: &Option<Element>): &Element {
-    assert!(is_some(t), EOPTION_NOT_SET);
-    vector::borrow(&t.vec, 0)
+    assert!(t.is_some(), EOPTION_NOT_SET);
+    &t.vec[0]
 }
 
@@ -260,8 +260,8 @@ Return default_ref if t does not hold a value
public fun borrow_with_default<Element>(t: &Option<Element>, default_ref: &Element): &Element {
     let vec_ref = &t.vec;
-    if (vector::is_empty(vec_ref)) default_ref
-    else vector::borrow(vec_ref, 0)
+    if (vec_ref.is_empty()) default_ref
+    else &vec_ref[0]
 }
 
@@ -291,8 +291,8 @@ Return default if t does not hold a value default: Element, ): Element { let vec_ref = &t.vec; - if (vector::is_empty(vec_ref)) default - else *vector::borrow(vec_ref, 0) + if (vec_ref.is_empty()) default + else vec_ref[0] }
@@ -319,7 +319,7 @@ Aborts if t already holds a value
public fun fill<Element>(t: &mut Option<Element>, e: Element) {
     let vec_ref = &mut t.vec;
-    if (vector::is_empty(vec_ref)) vector::push_back(vec_ref, e)
+    if (vec_ref.is_empty()) vec_ref.push_back(e)
     else abort EOPTION_IS_SET
 }
 
@@ -346,8 +346,8 @@ Aborts if t does not hold a value
public fun extract<Element>(t: &mut Option<Element>): Element {
-    assert!(is_some(t), EOPTION_NOT_SET);
-    vector::pop_back(&mut t.vec)
+    assert!(t.is_some(), EOPTION_NOT_SET);
+    t.vec.pop_back()
 }
 
@@ -373,8 +373,8 @@ Aborts if t does not hold a value
public fun borrow_mut<Element>(t: &mut Option<Element>): &mut Element {
-    assert!(is_some(t), EOPTION_NOT_SET);
-    vector::borrow_mut(&mut t.vec, 0)
+    assert!(t.is_some(), EOPTION_NOT_SET);
+    &mut t.vec[0]
 }
 
@@ -400,10 +400,10 @@ Aborts if t does not hold a value
public fun swap<Element>(t: &mut Option<Element>, e: Element): Element {
-    assert!(is_some(t), EOPTION_NOT_SET);
+    assert!(t.is_some(), EOPTION_NOT_SET);
     let vec_ref = &mut t.vec;
-    let old_value = vector::pop_back(vec_ref);
-    vector::push_back(vec_ref, e);
+    let old_value = vec_ref.pop_back();
+    vec_ref.push_back(e);
     old_value
 }
 
@@ -432,9 +432,9 @@ Different from swap(), swap_or_fill() allows for t not holding a va
public fun swap_or_fill<Element>(t: &mut Option<Element>, e: Element): Option<Element> {
     let vec_ref = &mut t.vec;
-    let old_value = if (vector::is_empty(vec_ref)) none()
-        else some(vector::pop_back(vec_ref));
-    vector::push_back(vec_ref, e);
+    let old_value = if (vec_ref.is_empty()) none()
+        else some(vec_ref.pop_back());
+    vec_ref.push_back(e);
     old_value
 }
 
@@ -460,9 +460,9 @@ Destroys t. If t holds a value, return it. Returns public fun destroy_with_default<Element: drop>(t: Option<Element>, default: Element): Element { - let Option { vec } = t; - if (vector::is_empty(&vec)) default - else vector::pop_back(&mut vec) + let Option { mut vec } = t; + if (vec.is_empty()) default + else vec.pop_back() }
@@ -488,10 +488,10 @@ Aborts if t does not hold a value
public fun destroy_some<Element>(t: Option<Element>): Element {
-    assert!(is_some(&t), EOPTION_NOT_SET);
-    let Option { vec } = t;
-    let elem = vector::pop_back(&mut vec);
-    vector::destroy_empty(vec);
+    assert!(t.is_some(), EOPTION_NOT_SET);
+    let Option { mut vec } = t;
+    let elem = vec.pop_back();
+    vec.destroy_empty();
     elem
 }
 
@@ -518,9 +518,9 @@ Aborts if t holds a value
public fun destroy_none<Element>(t: Option<Element>) {
-    assert!(is_none(&t), EOPTION_IS_SET);
+    assert!(t.is_none(), EOPTION_IS_SET);
     let Option { vec } = t;
-    vector::destroy_empty(vec)
+    vec.destroy_empty()
 }
 
diff --git a/external-crates/move/crates/move-stdlib/docs/overview.md b/external-crates/move/crates/move-stdlib/docs/overview.md index e8aff3f0414fa..e3e118394a99c 100644 --- a/external-crates/move/crates/move-stdlib/docs/overview.md +++ b/external-crates/move/crates/move-stdlib/docs/overview.md @@ -12,16 +12,23 @@ This is the root document for the Move stdlib module documentation. The Move std ## Index +- [`0x1::address`](address.md#0x1_address) - [`0x1::ascii`](ascii.md#0x1_ascii) - [`0x1::bcs`](bcs.md#0x1_bcs) - [`0x1::bit_vector`](bit_vector.md#0x1_bit_vector) -- [`0x1::error`](error.md#0x1_error) +- [`0x1::debug`](debug.md#0x1_debug) - [`0x1::fixed_point32`](fixed_point32.md#0x1_fixed_point32) - [`0x1::hash`](hash.md#0x1_hash) +- [`0x1::macros`](macros.md#0x1_macros) - [`0x1::option`](option.md#0x1_option) -- [`0x1::signer`](signer.md#0x1_signer) - [`0x1::string`](string.md#0x1_string) - [`0x1::type_name`](type_name.md#0x1_type_name) +- [`0x1::u128`](u128.md#0x1_u128) +- [`0x1::u16`](u16.md#0x1_u16) +- [`0x1::u256`](u256.md#0x1_u256) +- [`0x1::u32`](u32.md#0x1_u32) +- [`0x1::u64`](u64.md#0x1_u64) +- [`0x1::u8`](u8.md#0x1_u8) - [`0x1::vector`](vector.md#0x1_vector) diff --git a/external-crates/move/crates/move-stdlib/docs/signer.md b/external-crates/move/crates/move-stdlib/docs/signer.md deleted file mode 100644 index 99b418f9e1abc..0000000000000 --- a/external-crates/move/crates/move-stdlib/docs/signer.md +++ /dev/null @@ -1,63 +0,0 @@ - - - -# Module `0x1::signer` - - - -- [Function `borrow_address`](#0x1_signer_borrow_address) -- [Function `address_of`](#0x1_signer_address_of) - - -
- - - - - -## Function `borrow_address` - - - -
public fun borrow_address(s: &signer): &address
-
- - - -
-Implementation - - -
native public fun borrow_address(s: &signer): &address;
-
- - - -
- - - -## Function `address_of` - - - -
public fun address_of(s: &signer): address
-
- - - -
-Implementation - - -
public fun address_of(s: &signer): address {
-    *borrow_address(s)
-}
-
- - - -
- - -[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/string.md b/external-crates/move/crates/move-stdlib/docs/string.md index e962b56d86758..c08d3514d8861 100644 --- a/external-crates/move/crates/move-stdlib/docs/string.md +++ b/external-crates/move/crates/move-stdlib/docs/string.md @@ -3,28 +3,35 @@ # Module `0x1::string` -The string module defines the String type which represents UTF8 encoded strings. +The string module defines the String type which represents UTF8 encoded +strings. - [Struct `String`](#0x1_string_String) - [Constants](#@Constants_0) - [Function `utf8`](#0x1_string_utf8) +- [Function `from_ascii`](#0x1_string_from_ascii) +- [Function `to_ascii`](#0x1_string_to_ascii) - [Function `try_utf8`](#0x1_string_try_utf8) -- [Function `bytes`](#0x1_string_bytes) +- [Function `as_bytes`](#0x1_string_as_bytes) +- [Function `into_bytes`](#0x1_string_into_bytes) - [Function `is_empty`](#0x1_string_is_empty) - [Function `length`](#0x1_string_length) - [Function `append`](#0x1_string_append) - [Function `append_utf8`](#0x1_string_append_utf8) - [Function `insert`](#0x1_string_insert) -- [Function `sub_string`](#0x1_string_sub_string) +- [Function `substring`](#0x1_string_substring) - [Function `index_of`](#0x1_string_index_of) - [Function `internal_check_utf8`](#0x1_string_internal_check_utf8) - [Function `internal_is_char_boundary`](#0x1_string_internal_is_char_boundary) - [Function `internal_sub_string`](#0x1_string_internal_sub_string) - [Function `internal_index_of`](#0x1_string_internal_index_of) +- [Function `bytes`](#0x1_string_bytes) +- [Function `sub_string`](#0x1_string_sub_string) -
use 0x1::option;
+
use 0x1::ascii;
+use 0x1::option;
 use 0x1::vector;
 
@@ -34,7 +41,8 @@ The string module defines the String
holds a sequence of bytes which is guaranteed to be in utf8 format. +A String holds a sequence of bytes which is guaranteed to be in utf8 +format.
struct String has copy, drop, store
@@ -48,7 +56,7 @@ A String holds a sequence
 
 
-bytes: vector<u8> +bytes: vector<u8>
@@ -63,22 +71,22 @@ A String holds a sequence ## Constants - + Index out of range. -
const EINVALID_INDEX: u64 = 2;
+
const EInvalidIndex: u64 = 2;
 
- + An invalid UTF8 encoding. -
const EINVALID_UTF8: u64 = 1;
+
const EInvalidUTF8: u64 = 1;
 
@@ -87,10 +95,63 @@ An invalid UTF8 encoding. ## Function `utf8` -Creates a new string from a sequence of bytes. Aborts if the bytes do not represent valid utf8. +Creates a new string from a sequence of bytes. Aborts if the bytes do +not represent valid utf8. + + +
public fun utf8(bytes: vector<u8>): string::String
+
+ + + +
+Implementation + + +
public fun utf8(bytes: vector<u8>): String {
+    assert!(internal_check_utf8(&bytes), EInvalidUTF8);
+    String { bytes }
+}
+
+ + + +
+ + + +## Function `from_ascii` + +Convert an ASCII string to a UTF8 string + + +
public fun from_ascii(s: ascii::String): string::String
+
+ -
public fun utf8(bytes: vector<u8>): string::String
+
+Implementation + + +
public fun from_ascii(s: ascii::String): String {
+    String { bytes: s.into_bytes() }
+}
+
+ + + +
+ + + +## Function `to_ascii` + +Convert an UTF8 string to an ASCII string. +Aborts if s is not valid ASCII + + +
public fun to_ascii(s: string::String): ascii::String
 
@@ -99,9 +160,9 @@ Creates a new string from a sequence of bytes. Aborts if the bytes do not repres Implementation -
public fun utf8(bytes: vector<u8>): String {
-    assert!(internal_check_utf8(&bytes), EINVALID_UTF8);
-    String{bytes}
+
public fun to_ascii(s: String): ascii::String {
+    let String { bytes } = s;
+    bytes.to_ascii_string()
 }
 
@@ -116,7 +177,7 @@ Creates a new string from a sequence of bytes. Aborts if the bytes do not repres Tries to create a new string from a sequence of bytes. -
public fun try_utf8(bytes: vector<u8>): option::Option<string::String>
+
public fun try_utf8(bytes: vector<u8>): option::Option<string::String>
 
@@ -125,12 +186,9 @@ Tries to create a new string from a sequence of bytes. Implementation -
public fun try_utf8(bytes: vector<u8>): Option<String> {
-    if (internal_check_utf8(&bytes)) {
-        option::some(String{bytes})
-    } else {
-        option::none()
-    }
+
public fun try_utf8(bytes: vector<u8>): Option<String> {
+    if (internal_check_utf8(&bytes)) option::some(String { bytes })
+    else option::none()
 }
 
@@ -138,14 +196,14 @@ Tries to create a new string from a sequence of bytes. - + -## Function `bytes` +## Function `as_bytes` Returns a reference to the underlying byte vector. -
public fun bytes(s: &string::String): &vector<u8>
+
public fun as_bytes(s: &string::String): &vector<u8>
 
@@ -154,13 +212,39 @@ Returns a reference to the underlying byte vector. Implementation -
public fun bytes(s: &String): &vector<u8> {
+
public fun as_bytes(s: &String): &vector<u8> {
     &s.bytes
 }
 
+ + + + +## Function `into_bytes` + +Unpack the string to get its underlying bytes. + + +
public fun into_bytes(s: string::String): vector<u8>
+
+ + + +
+Implementation + + +
public fun into_bytes(s: String): vector<u8> {
+    let String { bytes } = s;
+    bytes
+}
+
+ + +
@@ -180,7 +264,7 @@ Checks whether this string is empty.
public fun is_empty(s: &String): bool {
-    vector::is_empty(&s.bytes)
+    s.bytes.is_empty()
 }
 
@@ -195,7 +279,7 @@ Checks whether this string is empty. Returns the length of this string, in bytes. -
public fun length(s: &string::String): u64
+
public fun length(s: &string::String): u64
 
@@ -204,8 +288,8 @@ Returns the length of this string, in bytes. Implementation -
public fun length(s: &String): u64 {
-    vector::length(&s.bytes)
+
public fun length(s: &String): u64 {
+    s.bytes.length()
 }
 
@@ -230,7 +314,7 @@ Appends a string.
public fun append(s: &mut String, r: String) {
-    vector::append(&mut s.bytes, r.bytes)
+    s.bytes.append(r.bytes)
 }
 
@@ -245,7 +329,7 @@ Appends a string. Appends bytes which must be in valid utf8 format. -
public fun append_utf8(s: &mut string::String, bytes: vector<u8>)
+
public fun append_utf8(s: &mut string::String, bytes: vector<u8>)
 
@@ -254,8 +338,8 @@ Appends bytes which must be in valid utf8 format. Implementation -
public fun append_utf8(s: &mut String, bytes: vector<u8>) {
-    append(s, utf8(bytes))
+
public fun append_utf8(s: &mut String, bytes: vector<u8>) {
+    s.append(utf8(bytes))
 }
 
@@ -267,11 +351,11 @@ Appends bytes which must be in valid utf8 format. ## Function `insert` -Insert the other string at the byte index in given string. The index must be at a valid utf8 char -boundary. +Insert the other string at the byte index in given string. The index +must be at a valid utf8 char boundary. -
public fun insert(s: &mut string::String, at: u64, o: string::String)
+
public fun insert(s: &mut string::String, at: u64, o: string::String)
 
@@ -280,14 +364,17 @@ boundary. Implementation -
public fun insert(s: &mut String, at: u64, o: String) {
+
public fun insert(s: &mut String, at: u64, o: String) {
     let bytes = &s.bytes;
-    assert!(at <= vector::length(bytes) && internal_is_char_boundary(bytes, at), EINVALID_INDEX);
-    let l = length(s);
-    let front = sub_string(s, 0, at);
-    let end = sub_string(s, at, l);
-    append(&mut front, o);
-    append(&mut front, end);
+    assert!(
+        at <= bytes.length() && internal_is_char_boundary(bytes, at),
+        EInvalidIndex,
+    );
+    let l = s.length();
+    let mut front = s.substring(0, at);
+    let end = s.substring(at, l);
+    front.append(o);
+    front.append(end);
     *s = front;
 }
 
@@ -296,16 +383,17 @@ boundary. - + -## Function `sub_string` +## Function `substring` -Returns a sub-string using the given byte indices, where i is the first byte position and j is the start -of the first byte not included (or the length of the string). The indices must be at valid utf8 char boundaries, +Returns a sub-string using the given byte indices, where i is the first +byte position and j is the start of the first byte not included (or the +length of the string). The indices must be at valid utf8 char boundaries, guaranteeing that the result is valid utf8. -
public fun sub_string(s: &string::String, i: u64, j: u64): string::String
+
public fun substring(s: &string::String, i: u64, j: u64): string::String
 
@@ -314,14 +402,17 @@ guaranteeing that the result is valid utf8. Implementation -
public fun sub_string(s: &String, i: u64, j: u64): String {
+
public fun substring(s: &String, i: u64, j: u64): String {
     let bytes = &s.bytes;
-    let l = vector::length(bytes);
+    let l = bytes.length();
     assert!(
-        j <= l && i <= j && internal_is_char_boundary(bytes, i) && internal_is_char_boundary(bytes, j),
-        EINVALID_INDEX
+        j <= l &&
+        i <= j &&
+        internal_is_char_boundary(bytes, i) &&
+        internal_is_char_boundary(bytes, j),
+        EInvalidIndex,
     );
-    String{bytes: internal_sub_string(bytes, i, j)}
+    String { bytes: internal_sub_string(bytes, i, j) }
 }
 
@@ -333,10 +424,11 @@ guaranteeing that the result is valid utf8. ## Function `index_of` -Computes the index of the first occurrence of a string. Returns length(s) if no occurrence found. +Computes the index of the first occurrence of a string. Returns s.length() +if no occurrence found. -
public fun index_of(s: &string::String, r: &string::String): u64
+
public fun index_of(s: &string::String, r: &string::String): u64
 
@@ -345,7 +437,7 @@ Computes the index of the first occurrence of a string. Returns index_of(s: &String, r: &String): u64 { +
public fun index_of(s: &String, r: &String): u64 {
     internal_index_of(&s.bytes, &r.bytes)
 }
 
@@ -360,7 +452,7 @@ Computes the index of the first occurrence of a string. Returns internal_check_utf8(v: &vector<u8>): bool +
fun internal_check_utf8(v: &vector<u8>): bool
 
@@ -369,7 +461,7 @@ Computes the index of the first occurrence of a string. Returns internal_check_utf8(v: &vector<u8>): bool; +
native fun internal_check_utf8(v: &vector<u8>): bool;
 
@@ -382,7 +474,7 @@ Computes the index of the first occurrence of a string. Returns internal_is_char_boundary(v: &vector<u8>, i: u64): bool +
fun internal_is_char_boundary(v: &vector<u8>, i: u64): bool
 
@@ -391,7 +483,7 @@ Computes the index of the first occurrence of a string. Returns internal_is_char_boundary(v: &vector<u8>, i: u64): bool; +
native fun internal_is_char_boundary(v: &vector<u8>, i: u64): bool;
 
@@ -404,7 +496,7 @@ Computes the index of the first occurrence of a string. Returns internal_sub_string(v: &vector<u8>, i: u64, j: u64): vector<u8> +
fun internal_sub_string(v: &vector<u8>, i: u64, j: u64): vector<u8>
 
@@ -413,7 +505,7 @@ Computes the index of the first occurrence of a string. Returns internal_sub_string(v: &vector<u8>, i: u64, j: u64): vector<u8>; +
native fun internal_sub_string(v: &vector<u8>, i: u64, j: u64): vector<u8>;
 
@@ -426,7 +518,29 @@ Computes the index of the first occurrence of a string. Returns internal_index_of(v: &vector<u8>, r: &vector<u8>): u64 +
fun internal_index_of(v: &vector<u8>, r: &vector<u8>): u64
+
+ + + +
+Implementation + + +
native fun internal_index_of(v: &vector<u8>, r: &vector<u8>): u64;
+
+ + + +
+ + + +## Function `bytes` + + + +
public fun bytes(s: &string::String): &vector<u8>
 
@@ -435,7 +549,31 @@ Computes the index of the first occurrence of a string. Returns internal_index_of(v: &vector<u8>, r: &vector<u8>): u64; +
public fun bytes(s: &String): &vector<u8> { s.as_bytes() }
+
+ + + + + + + +## Function `sub_string` + + + +
public fun sub_string(s: &string::String, i: u64, j: u64): string::String
+
+ + + +
+Implementation + + +
public fun sub_string(s: &String, i: u64, j: u64): String {
+    s.substring(i, j)
+}
 
diff --git a/external-crates/move/crates/move-stdlib/docs/type_name.md b/external-crates/move/crates/move-stdlib/docs/type_name.md index 070e0ffd56e45..2c79606a1aefe 100644 --- a/external-crates/move/crates/move-stdlib/docs/type_name.md +++ b/external-crates/move/crates/move-stdlib/docs/type_name.md @@ -7,13 +7,18 @@ Functionality for converting Move types into values. Use with care! - [Struct `TypeName`](#0x1_type_name_TypeName) +- [Constants](#@Constants_0) - [Function `get`](#0x1_type_name_get) - [Function `get_with_original_ids`](#0x1_type_name_get_with_original_ids) +- [Function `is_primitive`](#0x1_type_name_is_primitive) - [Function `borrow_string`](#0x1_type_name_borrow_string) +- [Function `get_address`](#0x1_type_name_get_address) +- [Function `get_module`](#0x1_type_name_get_module) - [Function `into_string`](#0x1_type_name_into_string) -
use 0x1::ascii;
+
use 0x1::address;
+use 0x1::ascii;
 
@@ -40,10 +45,10 @@ Functionality for converting Move types into values. Use with care!
String representation of the type. All types are represented using their source syntax: - "u8", "u64", "u128", "bool", "address", "vector", "signer" for ground types. + "u8", "u64", "bool", "address", "vector", and so on for primitive types. Struct types are represented as fully qualified type names; e.g. 00000000000000000000000000000001::string::String or - 0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>> + 0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>> Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or 32 depending on the Move platform)
@@ -51,6 +56,91 @@ Functionality for converting Move types into values. Use with care! + + +## Constants + + + + +ASCII Character code for the c (lowercase c) symbol. + + +
const ASCII_C: u8 = 99;
+
+ + + + + +ASCII Character code for the : (colon) symbol. + + +
const ASCII_COLON: u8 = 58;
+
+ + + + + +ASCII Character code for the e (lowercase e) symbol. + + +
const ASCII_E: u8 = 101;
+
+ + + + + +ASCII Character code for the o (lowercase o) symbol. + + +
const ASCII_O: u8 = 111;
+
+ + + + + +ASCII Character code for the r (lowercase r) symbol. + + +
const ASCII_R: u8 = 114;
+
+ + + + + +ASCII Character code for the t (lowercase t) symbol. + + +
const ASCII_T: u8 = 116;
+
+ + + + + +ASCII Character code for the v (lowercase v) symbol. + + +
const ASCII_V: u8 = 118;
+
+ + + + + +The type is not from a package/module. It is a primitive type. + + +
const ENonModuleType: u64 = 0;
+
+ + + ## Function `get` @@ -102,6 +192,49 @@ later upgrade). + + + + +## Function `is_primitive` + +Returns true iff the TypeName represents a primitive type, i.e. one of +u8, u16, u32, u64, u128, u256, bool, address, vector. + + +
public fun is_primitive(self: &type_name::TypeName): bool
+
+ + + +
+Implementation + + +
public fun is_primitive(self: &TypeName): bool {
+    let bytes = self.name.as_bytes();
+    bytes == &b"bool" ||
+    bytes == &b"u8" ||
+    bytes == &b"u16" ||
+    bytes == &b"u32" ||
+    bytes == &b"u64" ||
+    bytes == &b"u128" ||
+    bytes == &b"u256" ||
+    bytes == &b"address" ||
+    (
+        bytes.length() >= 6 &&
+        bytes[0] == ASCII_V &&
+        bytes[1] == ASCII_E &&
+        bytes[2] == ASCII_C &&
+        bytes[3] == ASCII_T &&
+        bytes[4] == ASCII_O &&
+        bytes[5] == ASCII_R,
+    )
+}
+
+ + +
@@ -127,6 +260,89 @@ Get the String representation of self + + + + +## Function `get_address` + +Get Address string (Base16 encoded), first part of the TypeName. +Aborts if given a primitive type. + + +
public fun get_address(self: &type_name::TypeName): ascii::String
+
+ + + +
+Implementation + + +
public fun get_address(self: &TypeName): String {
+    assert!(!self.is_primitive(), ENonModuleType);
+
+    // Base16 (string) representation of an address has 2 symbols per byte.
+    let len = address::length() * 2;
+    let str_bytes = self.name.as_bytes();
+    let mut addr_bytes = vector[];
+    let mut i = 0;
+
+    // Read `len` bytes from the type name and push them to addr_bytes.
+    while (i < len) {
+        addr_bytes.push_back(str_bytes[i]);
+        i = i + 1;
+    };
+
+    ascii::string(addr_bytes)
+}
+
+ + + +
+ + + +## Function `get_module` + +Get name of the module. +Aborts if given a primitive type. + + +
public fun get_module(self: &type_name::TypeName): ascii::String
+
+ + + +
+Implementation + + +
public fun get_module(self: &TypeName): String {
+    assert!(!self.is_primitive(), ENonModuleType);
+
+    // Starts after address and a double colon: `<addr as HEX>::`
+    let mut i = address::length() * 2 + 2;
+    let str_bytes = self.name.as_bytes();
+    let mut module_name = vector[];
+    let colon = ASCII_COLON;
+    loop {
+        let char = &str_bytes[i];
+        if (char != &colon) {
+            module_name.push_back(*char);
+            i = i + 1;
+        } else {
+            break
+        }
+    };
+
+    ascii::string(module_name)
+}
+
+ + +
diff --git a/external-crates/move/crates/move-stdlib/docs/u128.md b/external-crates/move/crates/move-stdlib/docs/u128.md new file mode 100644 index 0000000000000..682372e184dc2 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/u128.md @@ -0,0 +1,195 @@ + + + +# Module `0x1::u128` + + + +- [Function `max`](#0x1_u128_max) +- [Function `min`](#0x1_u128_min) +- [Function `diff`](#0x1_u128_diff) +- [Function `divide_and_round_up`](#0x1_u128_divide_and_round_up) +- [Function `pow`](#0x1_u128_pow) +- [Function `sqrt`](#0x1_u128_sqrt) + + +
+ + + + + +## Function `max` + +Return the larger of x and y + + +
public fun max(x: u128, y: u128): u128
+
+ + + +
+Implementation + + +
public fun max(x: u128, y: u128): u128 {
+    std::macros::num_max!(x, y)
+}
+
+ + + +
+ + + +## Function `min` + +Return the smaller of x and y + + +
public fun min(x: u128, y: u128): u128
+
+ + + +
+Implementation + + +
public fun min(x: u128, y: u128): u128 {
+    std::macros::num_min!(x, y)
+}
+
+ + + +
+ + + +## Function `diff` + +Return the absolute value of x - y + + +
public fun diff(x: u128, y: u128): u128
+
+ + + +
+Implementation + + +
public fun diff(x: u128, y: u128): u128 {
+    std::macros::num_diff!(x, y)
+}
+
+ + + +
+ + + +## Function `divide_and_round_up` + +Calculate x / y, but round up the result. + + +
public fun divide_and_round_up(x: u128, y: u128): u128
+
+ + + +
+Implementation + + +
public fun divide_and_round_up(x: u128, y: u128): u128 {
+    std::macros::num_divide_and_round_up!(x, y)
+}
+
+ + + +
+ + + +## Function `pow` + +Return the value of a base raised to a power + + +
public fun pow(base: u128, exponent: u8): u128
+
+ + + +
+Implementation + + +
public fun pow(base: u128, exponent: u8): u128 {
+    std::macros::num_pow!(base, exponent)
+}
+
+ + + +
+ + + +## Function `sqrt` + +Get a nearest lower integer Square Root for x. Given that this +function can only operate with integers, it is impossible +to get perfect (or precise) integer square root for some numbers. + +Example: +``` +math::sqrt(9) => 3 +math::sqrt(8) => 2 // the nearest lower square root is 4; +``` + +In integer math, one of the possible ways to get results with more +precision is to use higher values or temporarily multiply the +value by some bigger number. Ideally if this is a square of 10 or 100. + +Example: +``` +math::sqrt(8) => 2; +math::sqrt(8 * 10000) => 282; +// now we can use this value as if it was 2.82; +// but to get the actual result, this value needs +// to be divided by 100 (because sqrt(10000)). + + +math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) +``` + + +
public fun sqrt(x: u128): u128
+
+ + + +
+Implementation + + +
public fun sqrt(x: u128): u128 {
+    std::macros::num_sqrt!<u128, u256>(x, 128)
+}
+
+ + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/u16.md b/external-crates/move/crates/move-stdlib/docs/u16.md new file mode 100644 index 0000000000000..08f849ea354fa --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/u16.md @@ -0,0 +1,195 @@ + + + +# Module `0x1::u16` + + + +- [Function `max`](#0x1_u16_max) +- [Function `min`](#0x1_u16_min) +- [Function `diff`](#0x1_u16_diff) +- [Function `divide_and_round_up`](#0x1_u16_divide_and_round_up) +- [Function `pow`](#0x1_u16_pow) +- [Function `sqrt`](#0x1_u16_sqrt) + + +
+ + + + + +## Function `max` + +Return the larger of x and y + + +
public fun max(x: u16, y: u16): u16
+
+ + + +
+Implementation + + +
public fun max(x: u16, y: u16): u16 {
+    std::macros::num_max!(x, y)
+}
+
+ + + +
+ + + +## Function `min` + +Return the smaller of x and y + + +
public fun min(x: u16, y: u16): u16
+
+ + + +
+Implementation + + +
public fun min(x: u16, y: u16): u16 {
+    std::macros::num_min!(x, y)
+}
+
+ + + +
+ + + +## Function `diff` + +Return the absolute value of x - y + + +
public fun diff(x: u16, y: u16): u16
+
+ + + +
+Implementation + + +
public fun diff(x: u16, y: u16): u16 {
+    std::macros::num_diff!(x, y)
+}
+
+ + + +
+ + + +## Function `divide_and_round_up` + +Calculate x / y, but round up the result. + + +
public fun divide_and_round_up(x: u16, y: u16): u16
+
+ + + +
+Implementation + + +
public fun divide_and_round_up(x: u16, y: u16): u16 {
+    std::macros::num_divide_and_round_up!(x, y)
+}
+
+ + + +
+ + + +## Function `pow` + +Return the value of a base raised to a power + + +
public fun pow(base: u16, exponent: u8): u16
+
+ + + +
+Implementation + + +
public fun pow(base: u16, exponent: u8): u16 {
+    std::macros::num_pow!(base, exponent)
+}
+
+ + + +
+ + + +## Function `sqrt` + +Get a nearest lower integer Square Root for x. Given that this +function can only operate with integers, it is impossible +to get perfect (or precise) integer square root for some numbers. + +Example: +``` +math::sqrt(9) => 3 +math::sqrt(8) => 2 // the nearest lower square root is 4; +``` + +In integer math, one of the possible ways to get results with more +precision is to use higher values or temporarily multiply the +value by some bigger number. Ideally if this is a square of 10 or 100. + +Example: +``` +math::sqrt(8) => 2; +math::sqrt(8 * 10000) => 282; +// now we can use this value as if it was 2.82; +// but to get the actual result, this value needs +// to be divided by 100 (because sqrt(10000)). + + +math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) +``` + + +
public fun sqrt(x: u16): u16
+
+ + + +
+Implementation + + +
public fun sqrt(x: u16): u16 {
+    std::macros::num_sqrt!<u16, u32>(x, 16)
+}
+
+ + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/u256.md b/external-crates/move/crates/move-stdlib/docs/u256.md new file mode 100644 index 0000000000000..84ed79a1229c6 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/u256.md @@ -0,0 +1,145 @@ + + + +# Module `0x1::u256` + + + +- [Function `max`](#0x1_u256_max) +- [Function `min`](#0x1_u256_min) +- [Function `diff`](#0x1_u256_diff) +- [Function `divide_and_round_up`](#0x1_u256_divide_and_round_up) +- [Function `pow`](#0x1_u256_pow) + + +
+ + + + + +## Function `max` + +Return the larger of x and y + + +
public fun max(x: u256, y: u256): u256
+
+ + + +
+Implementation + + +
public fun max(x: u256, y: u256): u256 {
+    std::macros::num_max!(x, y)
+}
+
+ + + +
+ + + +## Function `min` + +Return the smaller of x and y + + +
public fun min(x: u256, y: u256): u256
+
+ + + +
+Implementation + + +
public fun min(x: u256, y: u256): u256 {
+    std::macros::num_min!(x, y)
+}
+
+ + + +
+ + + +## Function `diff` + +Return the absolute value of x - y + + +
public fun diff(x: u256, y: u256): u256
+
+ + + +
+Implementation + + +
public fun diff(x: u256, y: u256): u256 {
+    std::macros::num_diff!(x, y)
+}
+
+ + + +
+ + + +## Function `divide_and_round_up` + +Calculate x / y, but round up the result. + + +
public fun divide_and_round_up(x: u256, y: u256): u256
+
+ + + +
+Implementation + + +
public fun divide_and_round_up(x: u256, y: u256): u256 {
+    std::macros::num_divide_and_round_up!(x, y)
+}
+
+ + + +
+ + + +## Function `pow` + +Return the value of a base raised to a power + + +
public fun pow(base: u256, exponent: u8): u256
+
+ + + +
+Implementation + + +
public fun pow(base: u256, exponent: u8): u256 {
+    std::macros::num_pow!(base, exponent)
+}
+
+ + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/u32.md b/external-crates/move/crates/move-stdlib/docs/u32.md new file mode 100644 index 0000000000000..084335a41875f --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/u32.md @@ -0,0 +1,195 @@ + + + +# Module `0x1::u32` + + + +- [Function `max`](#0x1_u32_max) +- [Function `min`](#0x1_u32_min) +- [Function `diff`](#0x1_u32_diff) +- [Function `divide_and_round_up`](#0x1_u32_divide_and_round_up) +- [Function `pow`](#0x1_u32_pow) +- [Function `sqrt`](#0x1_u32_sqrt) + + +
+ + + + + +## Function `max` + +Return the larger of x and y + + +
public fun max(x: u32, y: u32): u32
+
+ + + +
+Implementation + + +
public fun max(x: u32, y: u32): u32 {
+    std::macros::num_max!(x, y)
+}
+
+ + + +
+ + + +## Function `min` + +Return the smaller of x and y + + +
public fun min(x: u32, y: u32): u32
+
+ + + +
+Implementation + + +
public fun min(x: u32, y: u32): u32 {
+    std::macros::num_min!(x, y)
+}
+
+ + + +
+ + + +## Function `diff` + +Return the absolute value of x - y + + +
public fun diff(x: u32, y: u32): u32
+
+ + + +
+Implementation + + +
public fun diff(x: u32, y: u32): u32 {
+    std::macros::num_diff!(x, y)
+}
+
+ + + +
+ + + +## Function `divide_and_round_up` + +Calculate x / y, but round up the result. + + +
public fun divide_and_round_up(x: u32, y: u32): u32
+
+ + + +
+Implementation + + +
public fun divide_and_round_up(x: u32, y: u32): u32 {
+    std::macros::num_divide_and_round_up!(x, y)
+}
+
+ + + +
+ + + +## Function `pow` + +Return the value of a base raised to a power + + +
public fun pow(base: u32, exponent: u8): u32
+
+ + + +
+Implementation + + +
public fun pow(base: u32, exponent: u8): u32 {
+    std::macros::num_pow!(base, exponent)
+}
+
+ + + +
+ + + +## Function `sqrt` + +Get a nearest lower integer Square Root for x. Given that this +function can only operate with integers, it is impossible +to get perfect (or precise) integer square root for some numbers. + +Example: +``` +math::sqrt(9) => 3 +math::sqrt(8) => 2 // the nearest lower square root is 4; +``` + +In integer math, one of the possible ways to get results with more +precision is to use higher values or temporarily multiply the +value by some bigger number. Ideally if this is a square of 10 or 100. + +Example: +``` +math::sqrt(8) => 2; +math::sqrt(8 * 10000) => 282; +// now we can use this value as if it was 2.82; +// but to get the actual result, this value needs +// to be divided by 100 (because sqrt(10000)). + + +math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) +``` + + +
public fun sqrt(x: u32): u32
+
+ + + +
+Implementation + + +
public fun sqrt(x: u32): u32 {
+    std::macros::num_sqrt!<u32, u64>(x, 32)
+}
+
+ + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/u64.md b/external-crates/move/crates/move-stdlib/docs/u64.md new file mode 100644 index 0000000000000..9d27a4311f1c6 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/u64.md @@ -0,0 +1,195 @@ + + + +# Module `0x1::u64` + + + +- [Function `max`](#0x1_u64_max) +- [Function `min`](#0x1_u64_min) +- [Function `diff`](#0x1_u64_diff) +- [Function `divide_and_round_up`](#0x1_u64_divide_and_round_up) +- [Function `pow`](#0x1_u64_pow) +- [Function `sqrt`](#0x1_u64_sqrt) + + +
+ + + + + +## Function `max` + +Return the larger of x and y + + +
public fun max(x: u64, y: u64): u64
+
+ + + +
+Implementation + + +
public fun max(x: u64, y: u64): u64 {
+    std::macros::num_max!(x, y)
+}
+
+ + + +
+ + + +## Function `min` + +Return the smaller of x and y + + +
public fun min(x: u64, y: u64): u64
+
+ + + +
+Implementation + + +
public fun min(x: u64, y: u64): u64 {
+    std::macros::num_min!(x, y)
+}
+
+ + + +
+ + + +## Function `diff` + +Return the absolute value of x - y + + +
public fun diff(x: u64, y: u64): u64
+
+ + + +
+Implementation + + +
public fun diff(x: u64, y: u64): u64 {
+    std::macros::num_diff!(x, y)
+}
+
+ + + +
+ + + +## Function `divide_and_round_up` + +Calculate x / y, but round up the result. + + +
public fun divide_and_round_up(x: u64, y: u64): u64
+
+ + + +
+Implementation + + +
public fun divide_and_round_up(x: u64, y: u64): u64 {
+    std::macros::num_divide_and_round_up!(x, y)
+}
+
+ + + +
+ + + +## Function `pow` + +Return the value of a base raised to a power + + +
public fun pow(base: u64, exponent: u8): u64
+
+ + + +
+Implementation + + +
public fun pow(base: u64, exponent: u8): u64 {
+    std::macros::num_pow!(base, exponent)
+}
+
+ + + +
+ + + +## Function `sqrt` + +Get a nearest lower integer Square Root for x. Given that this +function can only operate with integers, it is impossible +to get perfect (or precise) integer square root for some numbers. + +Example: +``` +math::sqrt(9) => 3 +math::sqrt(8) => 2 // the nearest lower square root is 4; +``` + +In integer math, one of the possible ways to get results with more +precision is to use higher values or temporarily multiply the +value by some bigger number. Ideally if this is a square of 10 or 100. + +Example: +``` +math::sqrt(8) => 2; +math::sqrt(8 * 10000) => 282; +// now we can use this value as if it was 2.82; +// but to get the actual result, this value needs +// to be divided by 100 (because sqrt(10000)). + + +math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) +``` + + +
public fun sqrt(x: u64): u64
+
+ + + +
+Implementation + + +
public fun sqrt(x: u64): u64 {
+    std::macros::num_sqrt!<u64, u128>(x, 64)
+}
+
+ + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/u8.md b/external-crates/move/crates/move-stdlib/docs/u8.md new file mode 100644 index 0000000000000..0dc6d3b4fc02e --- /dev/null +++ b/external-crates/move/crates/move-stdlib/docs/u8.md @@ -0,0 +1,195 @@ + + + +# Module `0x1::u8` + + + +- [Function `max`](#0x1_u8_max) +- [Function `min`](#0x1_u8_min) +- [Function `diff`](#0x1_u8_diff) +- [Function `divide_and_round_up`](#0x1_u8_divide_and_round_up) +- [Function `pow`](#0x1_u8_pow) +- [Function `sqrt`](#0x1_u8_sqrt) + + +
+ + + + + +## Function `max` + +Return the larger of x and y + + +
public fun max(x: u8, y: u8): u8
+
+ + + +
+Implementation + + +
public fun max(x: u8, y: u8): u8 {
+    std::macros::num_max!(x, y)
+}
+
+ + + +
+ + + +## Function `min` + +Return the smaller of x and y + + +
public fun min(x: u8, y: u8): u8
+
+ + + +
+Implementation + + +
public fun min(x: u8, y: u8): u8 {
+    std::macros::num_min!(x, y)
+}
+
+ + + +
+ + + +## Function `diff` + +Return the absolute value of x - y + + +
public fun diff(x: u8, y: u8): u8
+
+ + + +
+Implementation + + +
public fun diff(x: u8, y: u8): u8 {
+    std::macros::num_diff!(x, y)
+}
+
+ + + +
+ + + +## Function `divide_and_round_up` + +Calculate x / y, but round up the result. + + +
public fun divide_and_round_up(x: u8, y: u8): u8
+
+ + + +
+Implementation + + +
public fun divide_and_round_up(x: u8, y: u8): u8 {
+    std::macros::num_divide_and_round_up!(x, y)
+}
+
+ + + +
+ + + +## Function `pow` + +Return the value of a base raised to a power + + +
public fun pow(base: u8, exponent: u8): u8
+
+ + + +
+Implementation + + +
public fun pow(base: u8, exponent: u8): u8 {
+    std::macros::num_pow!(base, exponent)
+}
+
+ + + +
+ + + +## Function `sqrt` + +Get a nearest lower integer Square Root for x. Given that this +function can only operate with integers, it is impossible +to get perfect (or precise) integer square root for some numbers. + +Example: +``` +math::sqrt(9) => 3 +math::sqrt(8) => 2 // the nearest lower square root is 4; +``` + +In integer math, one of the possible ways to get results with more +precision is to use higher values or temporarily multiply the +value by some bigger number. Ideally if this is a square of 10 or 100. + +Example: +``` +math::sqrt(8) => 2; +math::sqrt(8 * 10000) => 282; +// now we can use this value as if it was 2.82; +// but to get the actual result, this value needs +// to be divided by 100 (because sqrt(10000)). + + +math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) +``` + + +
public fun sqrt(x: u8): u8
+
+ + + +
+Implementation + + +
public fun sqrt(x: u8): u8 {
+    std::macros::num_sqrt!<u8, u16>(x, 8)
+}
+
+ + + +
+ + +[//]: # ("File containing references which can be used from documentation") diff --git a/external-crates/move/crates/move-stdlib/docs/vector.md b/external-crates/move/crates/move-stdlib/docs/vector.md index be96fad8c4044..1e13e7dc46eaf 100644 --- a/external-crates/move/crates/move-stdlib/docs/vector.md +++ b/external-crates/move/crates/move-stdlib/docs/vector.md @@ -41,7 +41,7 @@ vectors are growable. This module has many native functions. The index into the vector is out of bounds -
const EINDEX_OUT_OF_BOUNDS: u64 = 131072;
+
const EINDEX_OUT_OF_BOUNDS: u64 = 131072;
 
@@ -62,7 +62,7 @@ Create an empty vector. Implementation -
native public fun empty<Element>(): vector<Element>;
+
public native fun empty<Element>(): vector<Element>;
 
@@ -76,7 +76,7 @@ Create an empty vector. Return the length of the vector. -
public fun length<Element>(v: &vector<Element>): u64
+
public fun length<Element>(v: &vector<Element>): u64
 
@@ -85,7 +85,7 @@ Return the length of the vector. Implementation -
native public fun length<Element>(v: &vector<Element>): u64;
+
public native fun length<Element>(v: &vector<Element>): u64;
 
@@ -100,7 +100,7 @@ Acquire an immutable reference to the ith element of the vector i
is out of bounds. -
public fun borrow<Element>(v: &vector<Element>, i: u64): &Element
+
public fun borrow<Element>(v: &vector<Element>, i: u64): &Element
 
@@ -109,7 +109,7 @@ Aborts if i is out of bounds. Implementation -
native public fun borrow<Element>(v: &vector<Element>, i: u64): ∈
+
public native fun borrow<Element>(v: &vector<Element>, i: u64): ∈
 
@@ -132,7 +132,7 @@ Add element e to the end of the vector v. Implementation -
native public fun push_back<Element>(v: &mut vector<Element>, e: Element);
+
public native fun push_back<Element>(v: &mut vector<Element>, e: Element);
 
@@ -147,7 +147,7 @@ Return a mutable reference to the ith element in the vector v Aborts if i is out of bounds. -
public fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element
+
public fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element
 
@@ -156,7 +156,7 @@ Aborts if i is out of bounds. Implementation -
native public fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element;
+
public native fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element;
 
@@ -180,7 +180,7 @@ Aborts if v is empty. Implementation -
native public fun pop_back<Element>(v: &mut vector<Element>): Element;
+
public native fun pop_back<Element>(v: &mut vector<Element>): Element;
 
@@ -204,7 +204,7 @@ Aborts if v is not empty. Implementation -
native public fun destroy_empty<Element>(v: vector<Element>);
+
public native fun destroy_empty<Element>(v: vector<Element>);
 
@@ -219,7 +219,7 @@ Swaps the elements at the ith and jth indices in the v Aborts if i or j is out of bounds. -
public fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64)
+
public fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64)
 
@@ -228,7 +228,7 @@ Aborts if i or j is out of bounds. Implementation -
native public fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64);
+
public native fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64);
 
@@ -252,8 +252,8 @@ Return an vector of size one containing element e.
public fun singleton<Element>(e: Element): vector<Element> {
-    let v = empty();
-    push_back(&mut v, e);
+    let mut v = empty();
+    v.push_back(e);
     v
 }
 
@@ -279,13 +279,13 @@ Reverses the order of the elements in the vector v in place.
public fun reverse<Element>(v: &mut vector<Element>) {
-    let len = length(v);
+    let len = v.length();
     if (len == 0) return ();
 
-    let front_index = 0;
-    let back_index = len -1;
+    let mut front_index = 0;
+    let mut back_index = len - 1;
     while (front_index < back_index) {
-        swap(v, front_index, back_index);
+        v.swap(front_index, back_index);
         front_index = front_index + 1;
         back_index = back_index - 1;
     }
@@ -312,10 +312,10 @@ Pushes all of the elements of the other vector into the lhsImplementation
 
 
-
public fun append<Element>(lhs: &mut vector<Element>, other: vector<Element>) {
-    reverse(&mut other);
-    while (!is_empty(&other)) push_back(lhs, pop_back(&mut other));
-    destroy_empty(other);
+
public fun append<Element>(lhs: &mut vector<Element>, mut other: vector<Element>) {
+    other.reverse();
+    while (!other.is_empty()) lhs.push_back(other.pop_back());
+    other.destroy_empty();
 }
 
@@ -340,7 +340,7 @@ Return true if the vector v has no elements and
public fun is_empty<Element>(v: &vector<Element>): bool {
-    length(v) == 0
+    v.length() == 0
 }
 
@@ -366,10 +366,10 @@ Otherwise, returns false.
public fun contains<Element>(v: &vector<Element>, e: &Element): bool {
-    let i = 0;
-    let len = length(v);
+    let mut i = 0;
+    let len = v.length();
     while (i < len) {
-        if (borrow(v, i) == e) return true;
+        if (&v[i] == e) return true;
         i = i + 1;
     };
     false
@@ -388,7 +388,7 @@ Return (true, i) if e is in the vector v<
 Otherwise, returns (false, 0).
 
 
-
public fun index_of<Element>(v: &vector<Element>, e: &Element): (bool, u64)
+
public fun index_of<Element>(v: &vector<Element>, e: &Element): (bool, u64)
 
@@ -397,11 +397,11 @@ Otherwise, returns (false, 0). Implementation -
public fun index_of<Element>(v: &vector<Element>, e: &Element): (bool, u64) {
-    let i = 0;
-    let len = length(v);
+
public fun index_of<Element>(v: &vector<Element>, e: &Element): (bool, u64) {
+    let mut i = 0;
+    let len = v.length();
     while (i < len) {
-        if (borrow(v, i) == e) return (true, i);
+        if (&v[i] == e) return (true, i);
         i = i + 1;
     };
     (false, 0)
@@ -421,7 +421,7 @@ This is O(n) and preserves ordering of elements in the vector.
 Aborts if i is out of bounds.
 
 
-
public fun remove<Element>(v: &mut vector<Element>, i: u64): Element
+
public fun remove<Element>(v: &mut vector<Element>, i: u64): Element
 
@@ -430,14 +430,14 @@ Aborts if i is out of bounds. Implementation -
public fun remove<Element>(v: &mut vector<Element>, i: u64): Element {
-    let len = length(v);
+
public fun remove<Element>(v: &mut vector<Element>, mut i: u64): Element {
+    let mut len = v.length();
     // i out of bounds; abort
     if (i >= len) abort EINDEX_OUT_OF_BOUNDS;
 
     len = len - 1;
-    while (i < len) swap(v, i, { i = i + 1; i });
-    pop_back(v)
+    while (i < len) v.swap(i, { i = i + 1; i });
+    v.pop_back()
 }
 
@@ -451,12 +451,12 @@ Aborts if i is out of bounds. Insert e at position i in the vector v. If i is in bounds, this shifts the old v[i] and all subsequent elements to the right. -If i == length(v), this adds e to the end of the vector. +If i == v.length(), this adds e to the end of the vector. This is O(n) and preserves ordering of elements in the vector. -Aborts if i > length(v) +Aborts if i > v.length() -
public fun insert<Element>(v: &mut vector<Element>, e: Element, i: u64)
+
public fun insert<Element>(v: &mut vector<Element>, e: Element, i: u64)
 
@@ -465,14 +465,14 @@ Aborts if i > length(v)Implementation -
public fun insert<Element>(v: &mut vector<Element>, e: Element, i: u64) {
-    let len = length(v);
+
public fun insert<Element>(v: &mut vector<Element>, e: Element, mut i: u64) {
+    let len = v.length();
     // i too big abort
     if (i > len) abort EINDEX_OUT_OF_BOUNDS;
 
-    push_back(v, e);
+    v.push_back(e);
     while (i < len) {
-        swap(v, i, len);
+        v.swap(i, len);
         i = i + 1
     }
 }
@@ -491,7 +491,7 @@ This is O(1), but does not preserve ordering of elements in the vector.
 Aborts if i is out of bounds.
 
 
-
public fun swap_remove<Element>(v: &mut vector<Element>, i: u64): Element
+
public fun swap_remove<Element>(v: &mut vector<Element>, i: u64): Element
 
@@ -500,11 +500,11 @@ Aborts if i is out of bounds. Implementation -
public fun swap_remove<Element>(v: &mut vector<Element>, i: u64): Element {
-    assert!(!is_empty(v), EINDEX_OUT_OF_BOUNDS);
-    let last_idx = length(v) - 1;
-    swap(v, i, last_idx);
-    pop_back(v)
+
public fun swap_remove<Element>(v: &mut vector<Element>, i: u64): Element {
+    assert!(!v.is_empty(), EINDEX_OUT_OF_BOUNDS);
+    let last_idx = v.length() - 1;
+    v.swap(i, last_idx);
+    v.pop_back()
 }
 
diff --git a/external-crates/move/crates/move-stdlib/error_description.errmap b/external-crates/move/crates/move-stdlib/error_description.errmap deleted file mode 100644 index e278809587b0938d92310bc82416685344e3b14e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1310 zcmcJP(Qnf*5XO_S4KXn$#2ye&C*TDk?Ew(tVM5AUZ!_wWs!b>0B}tQOYbmvZ<8*_+ zo{Qs7(_ou;Ac_# z87vNV{)mu{)e=+U7A1l(P%l(d7BD59P)SS=e8;l4W(lMCzrk3^zrt9|`wi@j-sno| zdAnCdoy5nVUR$^pKN@8O zN&_^U4Z_8`b&XO`W_pf5#!@RUkXpK(6-b+pAJPXd+#Wld3}QYU@Ltf4*=HMc*_1|9 zr69ZhE$pVt?&%d}a`Y|v&PLHI2%r!vQMc1L{b_T$d30 - -# Module `0x1::compare` - -Utilities for comparing Move values based on their representation in BCS. - - -- [Constants](#@Constants_0) -- [Function `cmp_bcs_bytes`](#0x1_compare_cmp_bcs_bytes) -- [Function `cmp_u8`](#0x1_compare_cmp_u8) -- [Function `cmp_u64`](#0x1_compare_cmp_u64) - - -
- - - - - -## Constants - - - - - - -
const EQUAL: u8 = 0;
-
- - - - - - - -
const GREATER_THAN: u8 = 2;
-
- - - - - - - -
const LESS_THAN: u8 = 1;
-
- - - - - -## Function `cmp_bcs_bytes` - -compare vectors v1 and v2 using (1) vector contents from right to left and then -(2) vector length to break ties. -Returns either EQUAL (0u8), LESS_THAN (1u8), or GREATER_THAN (2u8). - -This function is designed to compare BCS (Binary Canonical Serialization)-encoded values -(i.e., vectors produced by bcs::to_bytes). A typical client will call -compare::cmp_bcs_bytes(bcs::to_bytes(&t1), bcs::to_bytes(&t2)). The comparison provides the -following guarantees w.r.t the original values t1 and t2: -- cmp_bcs_bytes(bcs(t1), bcs(t2)) == LESS_THAN iff cmp_bcs_bytes(t2, t1) == GREATER_THAN -- compare::cmp<T>(t1, t2) == EQUAL iff t1 == t2 and (similarly) -compare::cmp<T>(t1, t2) != EQUAL iff t1 != t2, where == and != denote the Move -bytecode operations for polymorphic equality. -- for all primitive types T with < and > comparison operators exposed in Move bytecode -(u8, u16, u32, u64, u128, u256), we have -compare_bcs_bytes(bcs(t1), bcs(t2)) == LESS_THAN iff t1 < t2 and (similarly) -compare_bcs_bytes(bcs(t1), bcs(t2)) == LESS_THAN iff t1 > t2. - -For all other types, the order is whatever the BCS encoding of the type and the comparison -strategy above gives you. One case where the order might be surprising is the address -type. -CoreAddresses are 16 byte hex values that BCS encodes with the identity function. The right -to left, byte-by-byte comparison means that (for example) -compare_bcs_bytes(bcs(0x01), bcs(0x10)) == LESS_THAN (as you'd expect), but -compare_bcs_bytes(bcs(0x100), bcs(0x001)) == LESS_THAN (as you probably wouldn't expect). -Keep this in mind when using this function to compare addresses. - - -
public fun cmp_bcs_bytes(v1: &vector<u8>, v2: &vector<u8>): u8
-
- - - -
-Implementation - - -
public fun cmp_bcs_bytes(v1: &vector<u8>, v2: &vector<u8>): u8 {
-    let i1 = vector::length(v1);
-    let i2 = vector::length(v2);
-    let len_cmp = cmp_u64(i1, i2);
-
-    // BCS uses little endian encoding for all integer types, so we choose to compare from left
-    // to right. Going right to left would make the behavior of compare::cmp diverge from the
-    // bytecode operators < and > on integer values (which would be confusing).
-    while (i1 > 0 && i2 > 0) {
-        i1 = i1 - 1;
-        i2 = i2 - 1;
-        let elem_cmp = cmp_u8(*vector::borrow(v1, i1), *vector::borrow(v2, i2));
-        if (elem_cmp != 0) return elem_cmp
-        // else, compare next element
-    };
-    // all compared elements equal; use length comparion to break the tie
-    len_cmp
-}
-
- - - -
- - - -## Function `cmp_u8` - -Compare two u8's - - -
fun cmp_u8(i1: u8, i2: u8): u8
-
- - - -
-Implementation - - -
fun cmp_u8(i1: u8, i2: u8): u8 {
-    if (i1 == i2) EQUAL
-    else if (i1 < i2) LESS_THAN
-    else GREATER_THAN
-}
-
- - - -
- - - -## Function `cmp_u64` - -Compare two u64's - - -
fun cmp_u64(i1: u64, i2: u64): u8
-
- - - -
-Implementation - - -
fun cmp_u64(i1: u64, i2: u64): u8 {
-    if (i1 == i2) EQUAL
-    else if (i1 < i2) LESS_THAN
-    else GREATER_THAN
-}
-
- - - -
diff --git a/external-crates/move/crates/move-stdlib/nursery/sources/compare.move b/external-crates/move/crates/move-stdlib/nursery/sources/compare.move deleted file mode 100644 index 04238e4c2afe7..0000000000000 --- a/external-crates/move/crates/move-stdlib/nursery/sources/compare.move +++ /dev/null @@ -1,70 +0,0 @@ -/// Utilities for comparing Move values based on their representation in BCS. -module std::compare { - use std::vector; - - // Move does not have signed integers, so we cannot use the usual 0, -1, 1 convention to - // represent EQUAL, LESS_THAN, and GREATER_THAN. Instead, we fun a new convention using u8 - // constants: - const EQUAL: u8 = 0; - const LESS_THAN: u8 = 1; - const GREATER_THAN: u8 = 2; - - /// compare vectors `v1` and `v2` using (1) vector contents from right to left and then - /// (2) vector length to break ties. - /// Returns either `EQUAL` (0u8), `LESS_THAN` (1u8), or `GREATER_THAN` (2u8). - /// - /// This function is designed to compare BCS (Binary Canonical Serialization)-encoded values - /// (i.e., vectors produced by `bcs::to_bytes`). A typical client will call - /// `compare::cmp_bcs_bytes(bcs::to_bytes(&t1), bcs::to_bytes(&t2))`. The comparison provides the - /// following guarantees w.r.t the original values t1 and t2: - /// - `cmp_bcs_bytes(bcs(t1), bcs(t2)) == LESS_THAN` iff `cmp_bcs_bytes(t2, t1) == GREATER_THAN` - /// - `compare::cmp(t1, t2) == EQUAL` iff `t1 == t2` and (similarly) - /// `compare::cmp(t1, t2) != EQUAL` iff `t1 != t2`, where `==` and `!=` denote the Move - /// bytecode operations for polymorphic equality. - /// - for all primitive types `T` with `<` and `>` comparison operators exposed in Move bytecode - /// (`u8`, `u16`, `u32`, `u64`, `u128`, `u256`), we have - /// `compare_bcs_bytes(bcs(t1), bcs(t2)) == LESS_THAN` iff `t1 < t2` and (similarly) - /// `compare_bcs_bytes(bcs(t1), bcs(t2)) == LESS_THAN` iff `t1 > t2`. - /// - /// For all other types, the order is whatever the BCS encoding of the type and the comparison - /// strategy above gives you. One case where the order might be surprising is the `address` - /// type. - /// CoreAddresses are 16 byte hex values that BCS encodes with the identity function. The right - /// to left, byte-by-byte comparison means that (for example) - /// `compare_bcs_bytes(bcs(0x01), bcs(0x10)) == LESS_THAN` (as you'd expect), but - /// `compare_bcs_bytes(bcs(0x100), bcs(0x001)) == LESS_THAN` (as you probably wouldn't expect). - /// Keep this in mind when using this function to compare addresses. - public fun cmp_bcs_bytes(v1: &vector, v2: &vector): u8 { - let i1 = vector::length(v1); - let i2 = vector::length(v2); - let len_cmp = cmp_u64(i1, i2); - - // BCS uses little endian encoding for all integer types, so we choose to compare from left - // to right. Going right to left would make the behavior of compare::cmp diverge from the - // bytecode operators < and > on integer values (which would be confusing). - while (i1 > 0 && i2 > 0) { - i1 = i1 - 1; - i2 = i2 - 1; - let elem_cmp = cmp_u8(*vector::borrow(v1, i1), *vector::borrow(v2, i2)); - if (elem_cmp != 0) return elem_cmp - // else, compare next element - }; - // all compared elements equal; use length comparion to break the tie - len_cmp - } - - /// Compare two `u8`'s - fun cmp_u8(i1: u8, i2: u8): u8 { - if (i1 == i2) EQUAL - else if (i1 < i2) LESS_THAN - else GREATER_THAN - } - - /// Compare two `u64`'s - fun cmp_u64(i1: u64, i2: u64): u8 { - if (i1 == i2) EQUAL - else if (i1 < i2) LESS_THAN - else GREATER_THAN - } - -} diff --git a/external-crates/move/crates/move-stdlib/nursery/sources/debug.move b/external-crates/move/crates/move-stdlib/nursery/sources/debug.move deleted file mode 100644 index d4a506d10f5dd..0000000000000 --- a/external-crates/move/crates/move-stdlib/nursery/sources/debug.move +++ /dev/null @@ -1,18 +0,0 @@ -/// Module providing debug functionality. -module std::debug { - - /// Pretty-prints any Move value. For a Move struct, includes its field names, their types and their values. - native public fun print(x: &T); - - /// Prints the calling function's stack trace. - native public fun print_stack_trace(); - - #[test_only] - use std::string; - - #[test_only] - /// Utility function for printing a sequence of UTF8 bytes as a string (e.g., `b"Hello"`). - public fun print_string(utf8_bytes: vector) { - print(&string::utf8(utf8_bytes)); - } -} diff --git a/external-crates/move/crates/move-stdlib/nursery/tests/compare_tests.move b/external-crates/move/crates/move-stdlib/nursery/tests/compare_tests.move deleted file mode 100644 index 4af198639ffd0..0000000000000 --- a/external-crates/move/crates/move-stdlib/nursery/tests/compare_tests.move +++ /dev/null @@ -1,86 +0,0 @@ -// Tests for polymorphic comparison in Move -#[test_only] -module std::compareTests { - use std::compare; - use std::bcs; - - const EQUAL: u8 = 0; - const LESS_THAN: u8 = 1; - const GREATER_THAN: u8 = 2; - - - #[test] - fun equality_of_simple_types() { - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&true), &bcs::to_bytes(&true)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u8), &bcs::to_bytes(&1u8)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u16), &bcs::to_bytes(&1u16)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u32), &bcs::to_bytes(&1u32)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1), &bcs::to_bytes(&1)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u128), &bcs::to_bytes(&1u128)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u256), &bcs::to_bytes(&1u256)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x1), &bcs::to_bytes(&@0x1)) == EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"01"), &bcs::to_bytes(&x"01")) == EQUAL, 0); - } - - #[test] - fun inequality_of_simple_types() { - // inequality of simple types - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&true), &bcs::to_bytes(&false)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u8), &bcs::to_bytes(&0u8)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u16), &bcs::to_bytes(&0u16)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u32), &bcs::to_bytes(&0u32)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1), &bcs::to_bytes(&0)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u128), &bcs::to_bytes(&0u128)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u256), &bcs::to_bytes(&0u256)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x1), &bcs::to_bytes(&@0x0)) != EQUAL, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"01"), &bcs::to_bytes(&x"00")) != EQUAL, 0); - } - - #[test] - fun less_than_with_natural_ordering() { - // less than for types with a natural ordering exposed via bytecode operations - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&false), &bcs::to_bytes(&true)) == LESS_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&0u8), &bcs::to_bytes(&1u8)) == LESS_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&0u16), &bcs::to_bytes(&1u16)) == LESS_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&0u32), &bcs::to_bytes(&1u32)) == LESS_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&0), &bcs::to_bytes(&1)) == LESS_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&0u128), &bcs::to_bytes(&1u128)) == LESS_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&0u256), &bcs::to_bytes(&1u256)) == LESS_THAN, 0); - } - - #[test] - fun less_than_without_natural_ordering() { - // less then for types without a natural ordering exposed by bytecode operations - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x0), &bcs::to_bytes(&@0x1)) == LESS_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x01), &bcs::to_bytes(&@0x10)) == LESS_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x100), &bcs::to_bytes(&@0x001)) == LESS_THAN, 0); // potentially confusing - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"00"), &bcs::to_bytes(&x"01")) == LESS_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"01"), &bcs::to_bytes(&x"10")) == LESS_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"0000"), &bcs::to_bytes(&x"01")) == LESS_THAN, 0); // - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"0100"), &bcs::to_bytes(&x"0001")) == LESS_THAN, 0); // potentially confusing - } - - #[test] - fun greater_than_with_natural_ordering() { - // greater than for types with a natural ordering exposed by bytecode operations - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&true), &bcs::to_bytes(&false)) == GREATER_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u8), &bcs::to_bytes(&0u8)) == GREATER_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u16), &bcs::to_bytes(&0u16)) == GREATER_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u32), &bcs::to_bytes(&0u32)) == GREATER_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1), &bcs::to_bytes(&0)) == GREATER_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u128), &bcs::to_bytes(&0u128)) == GREATER_THAN, 0); - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&1u256), &bcs::to_bytes(&0u256)) == GREATER_THAN, 0); - } - - #[test] - fun greater_than_without_natural_ordering() { - // greater than for types without a natural ordering exposed by by bytecode operations - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x1), &bcs::to_bytes(&@0x0)) == GREATER_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x10), &bcs::to_bytes(&@0x01)) == GREATER_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&@0x001), &bcs::to_bytes(&@0x100)) == GREATER_THAN, 0); // potentially confusing - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"01"), &bcs::to_bytes(&x"00")) == GREATER_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"10"), &bcs::to_bytes(&x"01")) == GREATER_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"01"), &bcs::to_bytes(&x"0000")) == GREATER_THAN, 0); // sensible - assert!(compare::cmp_bcs_bytes(&bcs::to_bytes(&x"0001"), &bcs::to_bytes(&x"0100")) == GREATER_THAN, 0); // potentially confusing - } -} diff --git a/external-crates/move/crates/move-stdlib/sources/address.move b/external-crates/move/crates/move-stdlib/sources/address.move new file mode 100644 index 0000000000000..ec1416b4473bf --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/address.move @@ -0,0 +1,12 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// Provides a way to get address length since it's a +/// platform-specific parameter. +module std::address { + /// Should be converted to a native function. + /// Current implementation only works for Sui. + public fun length(): u64 { + 32 + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/ascii.move b/external-crates/move/crates/move-stdlib/sources/ascii.move index 95e05588b4be4..60564b49893a1 100644 --- a/external-crates/move/crates/move-stdlib/sources/ascii.move +++ b/external-crates/move/crates/move-stdlib/sources/ascii.move @@ -1,107 +1,166 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + /// The `ASCII` module defines basic string and char newtypes in Move that verify /// that characters are valid ASCII, and that strings consist of only valid ASCII characters. module std::ascii { - use std::vector; - use std::option::{Self, Option}; + // Allows calling `.to_string()` to convert an `ascii::String` into as `string::String` + public use fun std::string::from_ascii as String.to_string; /// An invalid ASCII character was encountered when creating an ASCII string. - const EINVALID_ASCII_CHARACTER: u64 = 0x10000; - - /// The `String` struct holds a vector of bytes that all represent - /// valid ASCII characters. Note that these ASCII characters may not all - /// be printable. To determine if a `String` contains only "printable" - /// characters you should use the `all_characters_printable` predicate - /// defined in this module. - struct String has copy, drop, store { - bytes: vector, - } - - /// An ASCII character. - struct Char has copy, drop, store { - byte: u8, - } + const EInvalidASCIICharacter: u64 = 0x10000; + /// An invalid index was encountered when creating a substring. + const EInvalidIndex: u64 = 0x10001; + + /// The `String` struct holds a vector of bytes that all represent + /// valid ASCII characters. Note that these ASCII characters may not all + /// be printable. To determine if a `String` contains only "printable" + /// characters you should use the `all_characters_printable` predicate + /// defined in this module. + public struct String has copy, drop, store { + bytes: vector, + } + + /// An ASCII character. + public struct Char has copy, drop, store { + byte: u8, + } /// Convert a `byte` into a `Char` that is checked to make sure it is valid ASCII. public fun char(byte: u8): Char { - assert!(is_valid_char(byte), EINVALID_ASCII_CHARACTER); + assert!(is_valid_char(byte), EInvalidASCIICharacter); Char { byte } } /// Convert a vector of bytes `bytes` into an `String`. Aborts if /// `bytes` contains non-ASCII characters. public fun string(bytes: vector): String { - let x = try_string(bytes); - assert!( - option::is_some(&x), - EINVALID_ASCII_CHARACTER - ); - option::destroy_some(x) + let x = try_string(bytes); + assert!(x.is_some(), EInvalidASCIICharacter); + x.destroy_some() } /// Convert a vector of bytes `bytes` into an `String`. Returns /// `Some()` if the `bytes` contains all valid ASCII /// characters. Otherwise returns `None`. public fun try_string(bytes: vector): Option { - let len = vector::length(&bytes); - let i = 0; - while (i < len) { - let possible_byte = *vector::borrow(&bytes, i); - if (!is_valid_char(possible_byte)) return option::none(); - i = i + 1; - }; - option::some(String { bytes }) + let is_valid = bytes.all!(|byte| is_valid_char(*byte)); + if (is_valid) option::some(String { bytes }) + else option::none() } /// Returns `true` if all characters in `string` are printable characters /// Returns `false` otherwise. Not all `String`s are printable strings. public fun all_characters_printable(string: &String): bool { - let len = vector::length(&string.bytes); - let i = 0; - while (i < len) { - let byte = *vector::borrow(&string.bytes, i); - if (!is_printable_char(byte)) return false; - i = i + 1; - }; - true + string.bytes.all!(|byte| is_printable_char(*byte)) } + /// Push a `Char` to the end of the `string`. public fun push_char(string: &mut String, char: Char) { - vector::push_back(&mut string.bytes, char.byte); + string.bytes.push_back(char.byte); } + /// Pop a `Char` from the end of the `string`. public fun pop_char(string: &mut String): Char { - Char { byte: vector::pop_back(&mut string.bytes) } + Char { byte: string.bytes.pop_back() } } + /// Returns the length of the `string` in bytes. public fun length(string: &String): u64 { - vector::length(as_bytes(string)) + string.as_bytes().length() + } + + /// Append the `other` string to the end of `string`. + public fun append(string: &mut String, other: String) { + string.bytes.append(other.into_bytes()) + } + + /// Insert the `other` string at the `at` index of `string`. + public fun insert(s: &mut String, at: u64, o: String) { + assert!(at <= s.length(), EInvalidIndex); + o.into_bytes().destroy!(|e| s.bytes.insert(e, at)); + } + + /// Copy the slice of the `string` from `i` to `j` into a new `String`. + public fun substring(string: &String, i: u64, j: u64): String { + assert!(i <= j && j <= string.length(), EInvalidIndex); + let mut bytes = vector[]; + i.range_do!(j, |i| bytes.push_back(string.bytes[i])); + String { bytes } } /// Get the inner bytes of the `string` as a reference public fun as_bytes(string: &String): &vector { - &string.bytes + &string.bytes } /// Unpack the `string` to get its backing bytes public fun into_bytes(string: String): vector { - let String { bytes } = string; - bytes + let String { bytes } = string; + bytes } - /// Unpack the `char` into its underlying byte. + /// Unpack the `char` into its underlying bytes. public fun byte(char: Char): u8 { - let Char { byte } = char; - byte + let Char { byte } = char; + byte } - /// Returns `true` if `b` is a valid ASCII character. Returns `false` otherwise. + /// Returns `true` if `b` is a valid ASCII character. + /// Returns `false` otherwise. public fun is_valid_char(b: u8): bool { - b <= 0x7F + b <= 0x7F } - /// Returns `true` if `byte` is an printable ASCII character. Returns `false` otherwise. + /// Returns `true` if `byte` is an printable ASCII character. + /// Returns `false` otherwise. public fun is_printable_char(byte: u8): bool { - byte >= 0x20 && // Disallow metacharacters - byte <= 0x7E // Don't allow DEL metacharacter + byte >= 0x20 && // Disallow metacharacters + byte <= 0x7E // Don't allow DEL metacharacter + } + + /// Returns `true` if `string` is empty. + public fun is_empty(string: &String): bool { + string.bytes.is_empty() + } + + /// Convert a `string` to its uppercase equivalent. + public fun to_uppercase(string: &String): String { + let bytes = string.as_bytes().map_ref!(|byte| char_to_uppercase(*byte)); + String { bytes } + } + + /// Convert a `string` to its lowercase equivalent. + public fun to_lowercase(string: &String): String { + let bytes = string.as_bytes().map_ref!(|byte| char_to_lowercase(*byte)); + String { bytes } + } + + /// Computes the index of the first occurrence of the `substr` in the `string`. + /// Returns the length of the `string` if the `substr` is not found. + /// Returns 0 if the `substr` is empty. + public fun index_of(string: &String, substr: &String): u64 { + let mut i = 0; + let (n, m) = (string.length(), substr.length()); + if (n < m) return n; + while (i <= n - m) { + let mut j = 0; + while (j < m && string.bytes[i + j] == substr.bytes[j]) j = j + 1; + if (j == m) return i; + i = i + 1; + }; + n + } + + /// Convert a `char` to its lowercase equivalent. + fun char_to_uppercase(byte: u8): u8 { + if (byte >= 0x61 && byte <= 0x7A) byte - 0x20 + else byte + } + + /// Convert a `char` to its lowercase equivalent. + fun char_to_lowercase(byte: u8): u8 { + if (byte >= 0x41 && byte <= 0x5A) byte + 0x20 + else byte } } diff --git a/external-crates/move/crates/move-stdlib/sources/bcs.move b/external-crates/move/crates/move-stdlib/sources/bcs.move index edac0cff2f19e..8e07273cf1ee5 100644 --- a/external-crates/move/crates/move-stdlib/sources/bcs.move +++ b/external-crates/move/crates/move-stdlib/sources/bcs.move @@ -1,3 +1,6 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + /// Utility for converting a Move value to its binary representation in BCS (Binary Canonical /// Serialization). BCS is the binary encoding for Move resources and other non-module values /// published on-chain. See https://github.com/diem/bcs#binary-canonical-serialization-bcs for more diff --git a/external-crates/move/crates/move-stdlib/sources/bit_vector.move b/external-crates/move/crates/move-stdlib/sources/bit_vector.move index ddf3b99b3fda1..354b72c492872 100644 --- a/external-crates/move/crates/move-stdlib/sources/bit_vector.move +++ b/external-crates/move/crates/move-stdlib/sources/bit_vector.move @@ -1,17 +1,18 @@ -module std::bit_vector { - use std::vector; +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +module std::bit_vector { /// The provided index is out of bounds const EINDEX: u64 = 0x20000; /// An invalid length of bitvector was given const ELENGTH: u64 = 0x20001; - #[test_only] + #[allow(unused_const)] const WORD_SIZE: u64 = 1; /// The maximum allowed bitvector size const MAX_SIZE: u64 = 1024; - struct BitVector has copy, drop, store { + public struct BitVector has copy, drop, store { length: u64, bit_field: vector, } @@ -19,10 +20,10 @@ module std::bit_vector { public fun new(length: u64): BitVector { assert!(length > 0, ELENGTH); assert!(length < MAX_SIZE, ELENGTH); - let counter = 0; - let bit_field = vector::empty(); + let mut counter = 0; + let mut bit_field = vector::empty(); while (counter < length) { - vector::push_back(&mut bit_field, false); + bit_field.push_back(false); counter = counter + 1; }; @@ -34,15 +35,15 @@ module std::bit_vector { /// Set the bit at `bit_index` in the `bitvector` regardless of its previous state. public fun set(bitvector: &mut BitVector, bit_index: u64) { - assert!(bit_index < vector::length(&bitvector.bit_field), EINDEX); - let x = vector::borrow_mut(&mut bitvector.bit_field, bit_index); + assert!(bit_index < bitvector.bit_field.length(), EINDEX); + let x = &mut bitvector.bit_field[bit_index]; *x = true; } /// Unset the bit at `bit_index` in the `bitvector` regardless of its previous state. public fun unset(bitvector: &mut BitVector, bit_index: u64) { - assert!(bit_index < vector::length(&bitvector.bit_field), EINDEX); - let x = vector::borrow_mut(&mut bitvector.bit_field, bit_index); + assert!(bit_index < bitvector.bit_field.length(), EINDEX); + let x = &mut bitvector.bit_field[bit_index]; *x = false; } @@ -50,19 +51,19 @@ module std::bit_vector { /// bitvector's length the bitvector will be zeroed out. public fun shift_left(bitvector: &mut BitVector, amount: u64) { if (amount >= bitvector.length) { - let len = vector::length(&bitvector.bit_field); - let i = 0; + let len = bitvector.bit_field.length(); + let mut i = 0; while (i < len) { - let elem = vector::borrow_mut(&mut bitvector.bit_field, i); + let elem = &mut bitvector.bit_field[i]; *elem = false; i = i + 1; }; } else { - let i = amount; + let mut i = amount; while (i < bitvector.length) { - if (is_index_set(bitvector, i)) set(bitvector, i - amount) - else unset(bitvector, i - amount); + if (bitvector.is_index_set(i)) bitvector.set(i - amount) + else bitvector.unset(i - amount); i = i + 1; }; @@ -78,13 +79,13 @@ module std::bit_vector { /// Return the value of the bit at `bit_index` in the `bitvector`. `true` /// represents "1" and `false` represents a 0 public fun is_index_set(bitvector: &BitVector, bit_index: u64): bool { - assert!(bit_index < vector::length(&bitvector.bit_field), EINDEX); - *vector::borrow(&bitvector.bit_field, bit_index) + assert!(bit_index < bitvector.bit_field.length(), EINDEX); + bitvector.bit_field[bit_index] } /// Return the length (number of usable bits) of this bitvector public fun length(bitvector: &BitVector): u64 { - vector::length(&bitvector.bit_field) + bitvector.bit_field.length() } /// Returns the length of the longest sequence of set bits starting at (and @@ -92,11 +93,11 @@ module std::bit_vector { /// sequence, then `0` is returned. public fun longest_set_sequence_starting_at(bitvector: &BitVector, start_index: u64): u64 { assert!(start_index < bitvector.length, EINDEX); - let index = start_index; + let mut index = start_index; // Find the greatest index in the vector such that all indices less than it are set. while (index < bitvector.length) { - if (!is_index_set(bitvector, index)) break; + if (!bitvector.is_index_set(index)) break; index = index + 1; }; diff --git a/external-crates/move/crates/move-stdlib/sources/debug.move b/external-crates/move/crates/move-stdlib/sources/debug.move new file mode 100644 index 0000000000000..dc9d236a8d07d --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/debug.move @@ -0,0 +1,9 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// Module providing debug functionality. +module std::debug { + native public fun print(x: &T); + + native public fun print_stack_trace(); +} diff --git a/external-crates/move/crates/move-stdlib/sources/error.move b/external-crates/move/crates/move-stdlib/sources/error.move deleted file mode 100644 index 81958a6914eb4..0000000000000 --- a/external-crates/move/crates/move-stdlib/sources/error.move +++ /dev/null @@ -1,82 +0,0 @@ -/// This module defines a set of canonical error codes which are optional to use by applications for the -/// `abort` and `assert!` features. -/// -/// Canonical error codes use the 3 lowest bytes of the u64 abort code range (the upper 5 bytes are free for other use). -/// Of those, the highest byte represents the *error category* and the lower two bytes the *error reason*. -/// Given an error category `0x1` and a reason `0x3`, a canonical abort code looks as `0x10003`. -/// -/// A module can use a canonical code with a constant declaration of the following form: -/// -/// ``` -/// /// An invalid ASCII character was encountered when creating a string. -/// const EINVALID_CHARACTER: u64 = 0x010003; -/// ``` -/// -/// This code is both valid in the worlds with and without canonical errors. It can be used as a plain module local -/// error reason understand by the existing error map tooling, or as a canonical code. -/// -/// The actual canonical categories have been adopted from Google's canonical error codes, which in turn are derived -/// from Unix error codes [see here](https://cloud.google.com/apis/design/errors#handling_errors). Each code has an -/// associated HTTP error code which can be used in REST apis. The mapping from error code to http code is not 1:1; -/// error codes here are a bit richer than HTTP codes. -module std::error { - - /// Caller specified an invalid argument (http: 400) - const INVALID_ARGUMENT: u64 = 0x1; - - /// An input or result of a computation is out of range (http: 400) - const OUT_OF_RANGE: u64 = 0x2; - - /// The system is not in a state where the operation can be performed (http: 400) - const INVALID_STATE: u64 = 0x3; - - /// Request not authenticated due to missing, invalid, or expired auth token (http: 401) - const UNAUTHENTICATED: u64 = 0x4; - - /// client does not have sufficient permission (http: 403) - const PERMISSION_DENIED: u64 = 0x5; - - /// A specified resource is not found (http: 404) - const NOT_FOUND: u64 = 0x6; - - /// Concurrency conflict, such as read-modify-write conflict (http: 409) - const ABORTED: u64 = 0x7; - - /// The resource that a client tried to create already exists (http: 409) - const ALREADY_EXISTS: u64 = 0x8; - - /// Out of gas or other forms of quota (http: 429) - const RESOURCE_EXHAUSTED: u64 = 0x9; - - #[allow(unused_const)] - /// Request cancelled by the client (http: 499) - const CANCELLED: u64 = 0xA; - - /// Internal error (http: 500) - const INTERNAL: u64 = 0xB; - - /// Feature not implemented (http: 501) - const NOT_IMPLEMENTED: u64 = 0xC; - - /// The service is currently unavailable. Indicates that a retry could solve the issue (http: 503) - const UNAVAILABLE: u64 = 0xD; - - /// Construct a canonical error code from a category and a reason. - public fun canonical(category: u64, reason: u64): u64 { - (category << 16) + reason - } - - /// Functions to construct a canonical error code of the given category. - public fun invalid_argument(r: u64): u64 { canonical(INVALID_ARGUMENT, r) } - public fun out_of_range(r: u64): u64 { canonical(OUT_OF_RANGE, r) } - public fun invalid_state(r: u64): u64 { canonical(INVALID_STATE, r) } - public fun unauthenticated(r: u64): u64 { canonical(UNAUTHENTICATED, r) } - public fun permission_denied(r: u64): u64 { canonical(PERMISSION_DENIED, r) } - public fun not_found(r: u64): u64 { canonical(NOT_FOUND, r) } - public fun aborted(r: u64): u64 { canonical(ABORTED, r) } - public fun already_exists(r: u64): u64 { canonical(ALREADY_EXISTS, r) } - public fun resource_exhausted(r: u64): u64 { canonical(RESOURCE_EXHAUSTED, r) } - public fun internal(r: u64): u64 { canonical(INTERNAL, r) } - public fun not_implemented(r: u64): u64 { canonical(NOT_IMPLEMENTED, r) } - public fun unavailable(r: u64): u64 { canonical(UNAVAILABLE, r) } -} diff --git a/external-crates/move/crates/move-stdlib/sources/fixed_point32.move b/external-crates/move/crates/move-stdlib/sources/fixed_point32.move index 40cee62aeaefd..d25eb58ed3b1c 100644 --- a/external-crates/move/crates/move-stdlib/sources/fixed_point32.move +++ b/external-crates/move/crates/move-stdlib/sources/fixed_point32.move @@ -1,3 +1,6 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + /// Defines a fixed-point numeric type with a 32-bit integer part and /// a 32-bit fractional part. @@ -12,7 +15,7 @@ module std::fixed_point32 { /// floating-point has less than 16 decimal digits of precision, so /// be careful about using floating-point to convert these values to /// decimal. - struct FixedPoint32 has copy, drop, store { value: u64 } + public struct FixedPoint32 has copy, drop, store { value: u64 } ///> TODO: This is a basic constant and should be provided somewhere centrally in the framework. const MAX_U64: u128 = 18446744073709551615; @@ -35,13 +38,13 @@ module std::fixed_point32 { // The product of two 64 bit values has 128 bits, so perform the // multiplication with u128 types and keep the full 128 bit product // to avoid losing accuracy. - let unscaled_product = (val as u128) * (multiplier.value as u128); + let unscaled_product = val as u128 * (multiplier.value as u128); // The unscaled product has 32 fractional bits (from the multiplier) // so rescale it by shifting away the low bits. let product = unscaled_product >> 32; // Check whether the value is too large. assert!(product <= MAX_U64, EMULTIPLICATION); - (product as u64) + product as u64 } /// Divide a u64 integer by a fixed-point number, truncating any @@ -52,13 +55,13 @@ module std::fixed_point32 { assert!(divisor.value != 0, EDIVISION_BY_ZERO); // First convert to 128 bits and then shift left to // add 32 fractional zero bits to the dividend. - let scaled_value = (val as u128) << 32; + let scaled_value = val as u128 << 32; let quotient = scaled_value / (divisor.value as u128); // Check whether the value is too large. assert!(quotient <= MAX_U64, EDIVISION); // the value may be too large, which will cause the cast to fail // with an arithmetic error. - (quotient as u64) + quotient as u64 } /// Create a fixed-point value from a rational number specified by its @@ -76,15 +79,15 @@ module std::fixed_point32 { // Scale the numerator to have 64 fractional bits and the denominator // to have 32 fractional bits, so that the quotient will have 32 // fractional bits. - let scaled_numerator = (numerator as u128) << 64; - let scaled_denominator = (denominator as u128) << 32; + let scaled_numerator = numerator as u128 << 64; + let scaled_denominator = denominator as u128 << 32; assert!(scaled_denominator != 0, EDENOMINATOR); let quotient = scaled_numerator / scaled_denominator; assert!(quotient != 0 || numerator == 0, ERATIO_OUT_OF_RANGE); // Return the quotient as a fixed-point number. We first need to check whether the cast // can succeed. assert!(quotient <= MAX_U64, ERATIO_OUT_OF_RANGE); - FixedPoint32 { value: (quotient as u64) } + FixedPoint32 { value: quotient as u64 } } /// Create a fixedpoint value from a raw value. @@ -103,55 +106,4 @@ module std::fixed_point32 { public fun is_zero(num: FixedPoint32): bool { num.value == 0 } - - /// Returns the smaller of the two FixedPoint32 numbers. - public fun min(num1: FixedPoint32, num2: FixedPoint32): FixedPoint32 { - if (num1.value < num2.value) { - num1 - } else { - num2 - } - } - - /// Returns the larger of the two FixedPoint32 numbers. - public fun max(num1: FixedPoint32, num2: FixedPoint32): FixedPoint32 { - if (num1.value > num2.value) { - num1 - } else { - num2 - } - } - - /// Create a fixedpoint value from a u64 value. - public fun create_from_u64(val: u64): FixedPoint32 { - let value = (val as u128) << 32; - assert!(value <= MAX_U64, ERATIO_OUT_OF_RANGE); - FixedPoint32{value: (value as u64)} - } - - /// Returns the largest integer less than or equal to a given number. - public fun floor(num: FixedPoint32): u64 { - num.value >> 32 - } - - /// Rounds up the given FixedPoint32 to the next largest integer. - public fun ceil(num: FixedPoint32): u64 { - let floored_num = floor(num) << 32; - if (num.value == floored_num) { - return floored_num >> 32 - }; - let val = ((floored_num as u128) + (1 << 32)); - (val >> 32 as u64) - } - - /// Returns the value of a FixedPoint32 to the nearest integer. - public fun round(num: FixedPoint32): u64 { - let floored_num = floor(num) << 32; - let boundary = floored_num + ((1 << 32) / 2); - if (num.value < boundary) { - floored_num >> 32 - } else { - ceil(num) - } - } } diff --git a/external-crates/move/crates/move-stdlib/sources/hash.move b/external-crates/move/crates/move-stdlib/sources/hash.move index daadc4e815770..ed84f18a9a7fc 100644 --- a/external-crates/move/crates/move-stdlib/sources/hash.move +++ b/external-crates/move/crates/move-stdlib/sources/hash.move @@ -1,3 +1,6 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + /// Module which defines SHA hashes for byte vectors. /// /// The functions in this module are natively declared both in the Move runtime diff --git a/external-crates/move/crates/move-stdlib/sources/macros.move b/external-crates/move/crates/move-stdlib/sources/macros.move new file mode 100644 index 0000000000000..53416703f5c9c --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/macros.move @@ -0,0 +1,102 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// This module holds shared implementation of macros used in `std` +module std::macros { + public macro fun num_max($x: _, $y: _): _ { + let x = $x; + let y = $y; + if (x > y) x + else y + } + + public macro fun num_min($x: _, $y: _): _ { + let x = $x; + let y = $y; + if (x < y) x + else y + } + + public macro fun num_diff($x: _, $y: _): _ { + let x = $x; + let y = $y; + if (x > y) x - y + else y - x + } + + public macro fun num_divide_and_round_up($x: _, $y: _): _ { + let x = $x; + let y = $y; + if (x % y == 0) x / y + else x / y + 1 + } + + + public macro fun num_pow($base: _, $exponent: u8): _ { + let mut base = $base; + let mut exponent = $exponent; + let mut res = 1; + while (exponent >= 1) { + if (exponent % 2 == 0) { + base = base * base; + exponent = exponent / 2; + } else { + res = res * base; + exponent = exponent - 1; + } + }; + + res + } + + public macro fun num_sqrt<$T, $U>($x: $T, $bitsize: u8): $T { + let x = $x; + let mut bit = (1: $U) << $bitsize; + let mut res = (0: $U); + let mut x = x as $U; + + while (bit != 0) { + if (x >= res + bit) { + x = x - (res + bit); + res = (res >> 1) + bit; + } else { + res = res >> 1; + }; + bit = bit >> 2; + }; + + res as $T + } + + public macro fun range_do($start: _, $stop: _, $f: |_|) { + let mut i = $start; + let stop = $stop; + while (i < stop) { + $f(i); + i = i + 1; + } + } + + public macro fun range_do_eq($start: _, $stop: _, $f: |_|) { + let mut i = $start; + let stop = $stop; + // we check `i >= stop` inside the loop instead of `i <= stop` as `while` condition to avoid + // incrementing `i` past the MAX integer value. + // Because of this, we need to check if `i > stop` and return early--instead of letting the + // loop bound handle it, like in the `range_do` macro. + if (i > stop) return; + loop { + $f(i); + if (i >= stop) break; + i = i + 1; + } + } + + public macro fun do($stop: _, $f: |_|) { + range_do!(0, $stop, $f) + } + + public macro fun do_eq($stop: _, $f: |_|) { + range_do_eq!(0, $stop, $f) + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/option.move b/external-crates/move/crates/move-stdlib/sources/option.move index 1de18126613bc..b0f1862c91ba5 100644 --- a/external-crates/move/crates/move-stdlib/sources/option.move +++ b/external-crates/move/crates/move-stdlib/sources/option.move @@ -1,10 +1,11 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + /// This module defines the Option type and its methods to represent and handle an optional value. module std::option { - use std::vector; - /// Abstraction of a value that may or may not be present. Implemented with a vector of size /// zero or one because Move bytecode does not have ADTs. - struct Option has copy, drop, store { + public struct Option has copy, drop, store { vec: vector } @@ -27,33 +28,33 @@ module std::option { /// Return true if `t` does not hold a value public fun is_none(t: &Option): bool { - vector::is_empty(&t.vec) + t.vec.is_empty() } /// Return true if `t` holds a value public fun is_some(t: &Option): bool { - !vector::is_empty(&t.vec) + !t.vec.is_empty() } /// Return true if the value in `t` is equal to `e_ref` /// Always returns `false` if `t` does not hold a value public fun contains(t: &Option, e_ref: &Element): bool { - vector::contains(&t.vec, e_ref) + t.vec.contains(e_ref) } /// Return an immutable reference to the value inside `t` /// Aborts if `t` does not hold a value public fun borrow(t: &Option): &Element { - assert!(is_some(t), EOPTION_NOT_SET); - vector::borrow(&t.vec, 0) + assert!(t.is_some(), EOPTION_NOT_SET); + &t.vec[0] } /// Return a reference to the value inside `t` if it holds one /// Return `default_ref` if `t` does not hold a value public fun borrow_with_default(t: &Option, default_ref: &Element): &Element { let vec_ref = &t.vec; - if (vector::is_empty(vec_ref)) default_ref - else vector::borrow(vec_ref, 0) + if (vec_ref.is_empty()) default_ref + else &vec_ref[0] } /// Return the value inside `t` if it holds one @@ -63,39 +64,39 @@ module std::option { default: Element, ): Element { let vec_ref = &t.vec; - if (vector::is_empty(vec_ref)) default - else *vector::borrow(vec_ref, 0) + if (vec_ref.is_empty()) default + else vec_ref[0] } /// Convert the none option `t` to a some option by adding `e`. /// Aborts if `t` already holds a value public fun fill(t: &mut Option, e: Element) { let vec_ref = &mut t.vec; - if (vector::is_empty(vec_ref)) vector::push_back(vec_ref, e) + if (vec_ref.is_empty()) vec_ref.push_back(e) else abort EOPTION_IS_SET } /// Convert a `some` option to a `none` by removing and returning the value stored inside `t` /// Aborts if `t` does not hold a value public fun extract(t: &mut Option): Element { - assert!(is_some(t), EOPTION_NOT_SET); - vector::pop_back(&mut t.vec) + assert!(t.is_some(), EOPTION_NOT_SET); + t.vec.pop_back() } /// Return a mutable reference to the value inside `t` /// Aborts if `t` does not hold a value public fun borrow_mut(t: &mut Option): &mut Element { - assert!(is_some(t), EOPTION_NOT_SET); - vector::borrow_mut(&mut t.vec, 0) + assert!(t.is_some(), EOPTION_NOT_SET); + &mut t.vec[0] } /// Swap the old value inside `t` with `e` and return the old value /// Aborts if `t` does not hold a value public fun swap(t: &mut Option, e: Element): Element { - assert!(is_some(t), EOPTION_NOT_SET); + assert!(t.is_some(), EOPTION_NOT_SET); let vec_ref = &mut t.vec; - let old_value = vector::pop_back(vec_ref); - vector::push_back(vec_ref, e); + let old_value = vec_ref.pop_back(); + vec_ref.push_back(e); old_value } @@ -104,41 +105,136 @@ module std::option { /// Different from swap(), swap_or_fill() allows for `t` not holding a value. public fun swap_or_fill(t: &mut Option, e: Element): Option { let vec_ref = &mut t.vec; - let old_value = if (vector::is_empty(vec_ref)) none() - else some(vector::pop_back(vec_ref)); - vector::push_back(vec_ref, e); + let old_value = if (vec_ref.is_empty()) none() + else some(vec_ref.pop_back()); + vec_ref.push_back(e); old_value } /// Destroys `t.` If `t` holds a value, return it. Returns `default` otherwise public fun destroy_with_default(t: Option, default: Element): Element { - let Option { vec } = t; - if (vector::is_empty(&vec)) default - else vector::pop_back(&mut vec) + let Option { mut vec } = t; + if (vec.is_empty()) default + else vec.pop_back() } /// Unpack `t` and return its contents /// Aborts if `t` does not hold a value public fun destroy_some(t: Option): Element { - assert!(is_some(&t), EOPTION_NOT_SET); - let Option { vec } = t; - let elem = vector::pop_back(&mut vec); - vector::destroy_empty(vec); + assert!(t.is_some(), EOPTION_NOT_SET); + let Option { mut vec } = t; + let elem = vec.pop_back(); + vec.destroy_empty(); elem } /// Unpack `t` /// Aborts if `t` holds a value public fun destroy_none(t: Option) { - assert!(is_none(&t), EOPTION_IS_SET); + assert!(t.is_none(), EOPTION_IS_SET); let Option { vec } = t; - vector::destroy_empty(vec) + vec.destroy_empty() } - /// Convert `t` into a vector of length 1 if it is `Some`, /// and an empty vector otherwise public fun to_vec(t: Option): vector { let Option { vec } = t; vec } + + // === Macro Functions === + + /// Destroy `Option` and call the closure `f` on the value inside if it holds one. + public macro fun destroy<$T>($o: Option<$T>, $f: |$T|) { + let o = $o; + o.do!($f); + } + + /// Destroy `Option` and call the closure `f` on the value inside if it holds one. + public macro fun do<$T>($o: Option<$T>, $f: |$T|) { + let o = $o; + if (o.is_some()) { + $f(o.destroy_some()); + } + } + + /// Execute a closure on the value inside `t` if it holds one. + public macro fun do_ref<$T>($o: &Option<$T>, $f: |&$T|) { + let o = $o; + if (o.is_some()) { + $f(o.borrow()); + } + } + + /// Execute a closure on the mutable reference to the value inside `t` if it holds one. + public macro fun do_mut<$T>($o: &mut Option<$T>, $f: |&mut $T|) { + let o = $o; + if (o.is_some()) $f(o.borrow_mut()); + } + + /// Select the first `Some` value from the two options, or `None` if both are `None`. + /// Equivalent to Rust's `a.or(b)`. + public macro fun or<$T>($o: Option<$T>, $default: Option<$T>): Option<$T> { + let o = $o; + if (o.is_some()) o + else $default + } + + /// If the value is `Some`, call the closure `f` on it. Otherwise, return `None`. + /// Equivalent to Rust's `t.and_then(f)`. + public macro fun and<$T, $U>($o: Option<$T>, $f: |$T| -> Option<$U>): Option<$U> { + let o = $o; + if (o.is_some()) $f(o.extract()) + else none() + } + + /// If the value is `Some`, call the closure `f` on it. Otherwise, return `None`. + /// Equivalent to Rust's `t.and_then(f)`. + public macro fun and_ref<$T, $U>($o: &Option<$T>, $f: |&$T| -> Option<$U>): Option<$U> { + let o = $o; + if (o.is_some()) $f(o.borrow()) + else none() + } + + /// Map an `Option` to `Option` by applying a function to a contained value. + /// Equivalent to Rust's `t.map(f)`. + public macro fun map<$T, $U>($o: Option<$T>, $f: |$T| -> $U): Option<$U> { + let mut o = $o; + if (o.is_some()) some($f(o.extract())) + else none() + } + + /// Map an `Option` value to `Option` by applying a function to a contained value by reference. + /// Original `Option` is preserved. + /// Equivalent to Rust's `t.map(f)`. + public macro fun map_ref<$T, $U>($o: &Option<$T>, $f: |&$T| -> $U): Option<$U> { + let o = $o; + if (o.is_some()) some($f(o.borrow())) + else none() + } + + /// Return `None` if the value is `None`, otherwise return `Option` if the predicate `f` returns true. + public macro fun filter<$T: drop>($o: Option<$T>, $f: |&$T| -> bool): Option<$T> { + let o = $o; + if (o.is_some() && $f(o.borrow())) o + else none() + } + + /// Return `false` if the value is `None`, otherwise return the result of the predicate `f`. + public macro fun is_some_and<$T>($o: &Option<$T>, $f: |&$T| -> bool): bool { + let o = $o; + o.is_some() && $f(o.borrow()) + } + + /// Destroy `Option` and return the value inside if it holds one, or `default` otherwise. + /// Equivalent to Rust's `t.unwrap_or(default)`. + /// + /// Note: this function is a more efficient version of `destroy_with_default`, as it does not + /// evaluate the default value unless necessary. The `destroy_with_default` function should be + /// deprecated in favor of this function. + public macro fun destroy_or<$T>($o: Option<$T>, $default: $T): $T { + let o = $o; + if (o.is_some()) o.destroy_some() + else $default + } } diff --git a/external-crates/move/crates/move-stdlib/sources/signer.move b/external-crates/move/crates/move-stdlib/sources/signer.move deleted file mode 100644 index 55376dd3fff7e..0000000000000 --- a/external-crates/move/crates/move-stdlib/sources/signer.move +++ /dev/null @@ -1,15 +0,0 @@ -module std::signer { - // Borrows the address of the signer - // Conceptually, you can think of the `signer` as being a struct wrapper arround an - // address - // ``` - // struct signer has drop { addr: address } - // ``` - // `borrow_address` borrows this inner field - native public fun borrow_address(s: &signer): &address; - - // Copies the address of the signer - public fun address_of(s: &signer): address { - *borrow_address(s) - } -} diff --git a/external-crates/move/crates/move-stdlib/sources/string.move b/external-crates/move/crates/move-stdlib/sources/string.move index fa9f6b61b7967..0939b2cbe45f3 100644 --- a/external-crates/move/crates/move-stdlib/sources/string.move +++ b/external-crates/move/crates/move-stdlib/sources/string.move @@ -1,101 +1,137 @@ -/// The `string` module defines the `String` type which represents UTF8 encoded strings. +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// The `string` module defines the `String` type which represents UTF8 encoded +/// strings. module std::string { - use std::vector; - use std::option::{Self, Option}; + use std::ascii; /// An invalid UTF8 encoding. - const EINVALID_UTF8: u64 = 1; + const EInvalidUTF8: u64 = 1; /// Index out of range. - const EINVALID_INDEX: u64 = 2; + const EInvalidIndex: u64 = 2; - /// A `String` holds a sequence of bytes which is guaranteed to be in utf8 format. - struct String has copy, drop, store { + /// A `String` holds a sequence of bytes which is guaranteed to be in utf8 + /// format. + public struct String has copy, drop, store { bytes: vector, } - /// Creates a new string from a sequence of bytes. Aborts if the bytes do not represent valid utf8. + /// Creates a new string from a sequence of bytes. Aborts if the bytes do + /// not represent valid utf8. public fun utf8(bytes: vector): String { - assert!(internal_check_utf8(&bytes), EINVALID_UTF8); - String{bytes} + assert!(internal_check_utf8(&bytes), EInvalidUTF8); + String { bytes } + } + + /// Convert an ASCII string to a UTF8 string + public fun from_ascii(s: ascii::String): String { + String { bytes: s.into_bytes() } + } + + /// Convert an UTF8 string to an ASCII string. + /// Aborts if `s` is not valid ASCII + public fun to_ascii(s: String): ascii::String { + let String { bytes } = s; + bytes.to_ascii_string() } /// Tries to create a new string from a sequence of bytes. public fun try_utf8(bytes: vector): Option { - if (internal_check_utf8(&bytes)) { - option::some(String{bytes}) - } else { - option::none() - } + if (internal_check_utf8(&bytes)) option::some(String { bytes }) + else option::none() } /// Returns a reference to the underlying byte vector. - public fun bytes(s: &String): &vector { + public fun as_bytes(s: &String): &vector { &s.bytes } + /// Unpack the `string` to get its underlying bytes. + public fun into_bytes(s: String): vector { + let String { bytes } = s; + bytes + } + /// Checks whether this string is empty. public fun is_empty(s: &String): bool { - vector::is_empty(&s.bytes) + s.bytes.is_empty() } /// Returns the length of this string, in bytes. public fun length(s: &String): u64 { - vector::length(&s.bytes) + s.bytes.length() } /// Appends a string. public fun append(s: &mut String, r: String) { - vector::append(&mut s.bytes, r.bytes) + s.bytes.append(r.bytes) } /// Appends bytes which must be in valid utf8 format. public fun append_utf8(s: &mut String, bytes: vector) { - append(s, utf8(bytes)) + s.append(utf8(bytes)) } - /// Insert the other string at the byte index in given string. The index must be at a valid utf8 char - /// boundary. + /// Insert the other string at the byte index in given string. The index + /// must be at a valid utf8 char boundary. public fun insert(s: &mut String, at: u64, o: String) { let bytes = &s.bytes; - assert!(at <= vector::length(bytes) && internal_is_char_boundary(bytes, at), EINVALID_INDEX); - let l = length(s); - let front = sub_string(s, 0, at); - let end = sub_string(s, at, l); - append(&mut front, o); - append(&mut front, end); + assert!( + at <= bytes.length() && internal_is_char_boundary(bytes, at), + EInvalidIndex, + ); + let l = s.length(); + let mut front = s.substring(0, at); + let end = s.substring(at, l); + front.append(o); + front.append(end); *s = front; } - /// Returns a sub-string using the given byte indices, where `i` is the first byte position and `j` is the start - /// of the first byte not included (or the length of the string). The indices must be at valid utf8 char boundaries, + /// Returns a sub-string using the given byte indices, where `i` is the first + /// byte position and `j` is the start of the first byte not included (or the + /// length of the string). The indices must be at valid utf8 char boundaries, /// guaranteeing that the result is valid utf8. - public fun sub_string(s: &String, i: u64, j: u64): String { + public fun substring(s: &String, i: u64, j: u64): String { let bytes = &s.bytes; - let l = vector::length(bytes); + let l = bytes.length(); assert!( - j <= l && i <= j && internal_is_char_boundary(bytes, i) && internal_is_char_boundary(bytes, j), - EINVALID_INDEX + j <= l && + i <= j && + internal_is_char_boundary(bytes, i) && + internal_is_char_boundary(bytes, j), + EInvalidIndex, ); - String{bytes: internal_sub_string(bytes, i, j)} + String { bytes: internal_sub_string(bytes, i, j) } } - /// Computes the index of the first occurrence of a string. Returns `length(s)` if no occurrence found. + /// Computes the index of the first occurrence of a string. Returns `s.length()` + /// if no occurrence found. public fun index_of(s: &String, r: &String): u64 { internal_index_of(&s.bytes, &r.bytes) } - // Native API + native fun internal_check_utf8(v: &vector): bool; native fun internal_is_char_boundary(v: &vector, i: u64): bool; native fun internal_sub_string(v: &vector, i: u64, j: u64): vector; native fun internal_index_of(v: &vector, r: &vector): u64; - // Test only API for the native function. Don't return a value so other - // tests aren't tempted to use this function. #[test_only] - public fun internal_sub_string_for_testing(v: &vector, i: u64, j: u64) { - internal_sub_string(v, i, j); + public fun internal_sub_string_for_testing(v: &vector, i: u64, j: u64): vector { + internal_sub_string(v, i, j) + } + + // === Deprecated === + + #[deprecated(note = b"Use `std::string::as_bytes` instead.")] + public fun bytes(s: &String): &vector { s.as_bytes() } + + #[deprecated(note = b"Use `std::string::substring` instead.")] + public fun sub_string(s: &String, i: u64, j: u64): String { + s.substring(i, j) } } diff --git a/external-crates/move/crates/move-stdlib/sources/type_name.move b/external-crates/move/crates/move-stdlib/sources/type_name.move index f439a64182b01..70cc4407a8c5c 100644 --- a/external-crates/move/crates/move-stdlib/sources/type_name.move +++ b/external-crates/move/crates/move-stdlib/sources/type_name.move @@ -1,16 +1,39 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + /// Functionality for converting Move types into values. Use with care! module std::type_name { - use std::ascii::String; + use std::ascii::{Self, String}; + use std::address; + + /// ASCII Character code for the `:` (colon) symbol. + const ASCII_COLON: u8 = 58; + + /// ASCII Character code for the `v` (lowercase v) symbol. + const ASCII_V: u8 = 118; + /// ASCII Character code for the `e` (lowercase e) symbol. + const ASCII_E: u8 = 101; + /// ASCII Character code for the `c` (lowercase c) symbol. + const ASCII_C: u8 = 99; + /// ASCII Character code for the `t` (lowercase t) symbol. + const ASCII_T: u8 = 116; + /// ASCII Character code for the `o` (lowercase o) symbol. + const ASCII_O: u8 = 111; + /// ASCII Character code for the `r` (lowercase r) symbol. + const ASCII_R: u8 = 114; + + /// The type is not from a package/module. It is a primitive type. + const ENonModuleType: u64 = 0; - struct TypeName has copy, drop, store { + public struct TypeName has copy, drop, store { /// String representation of the type. All types are represented /// using their source syntax: - /// "u8", "u64", "u128", "bool", "address", "vector", "signer" for ground types. + /// "u8", "u64", "bool", "address", "vector", and so on for primitive types. /// Struct types are represented as fully qualified type names; e.g. /// `00000000000000000000000000000001::string::String` or /// `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2>` /// Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or 32 depending on the Move platform) - name: String + name: String, } /// Return a value representation of the type `T`. Package IDs @@ -26,11 +49,77 @@ module std::type_name { /// later upgrade). public native fun get_with_original_ids(): TypeName; + /// Returns true iff the TypeName represents a primitive type, i.e. one of + /// u8, u16, u32, u64, u128, u256, bool, address, vector. + public fun is_primitive(self: &TypeName): bool { + let bytes = self.name.as_bytes(); + bytes == &b"bool" || + bytes == &b"u8" || + bytes == &b"u16" || + bytes == &b"u32" || + bytes == &b"u64" || + bytes == &b"u128" || + bytes == &b"u256" || + bytes == &b"address" || + ( + bytes.length() >= 6 && + bytes[0] == ASCII_V && + bytes[1] == ASCII_E && + bytes[2] == ASCII_C && + bytes[3] == ASCII_T && + bytes[4] == ASCII_O && + bytes[5] == ASCII_R, + ) + } + /// Get the String representation of `self` public fun borrow_string(self: &TypeName): &String { &self.name } + /// Get Address string (Base16 encoded), first part of the TypeName. + /// Aborts if given a primitive type. + public fun get_address(self: &TypeName): String { + assert!(!self.is_primitive(), ENonModuleType); + + // Base16 (string) representation of an address has 2 symbols per byte. + let len = address::length() * 2; + let str_bytes = self.name.as_bytes(); + let mut addr_bytes = vector[]; + let mut i = 0; + + // Read `len` bytes from the type name and push them to addr_bytes. + while (i < len) { + addr_bytes.push_back(str_bytes[i]); + i = i + 1; + }; + + ascii::string(addr_bytes) + } + + /// Get name of the module. + /// Aborts if given a primitive type. + public fun get_module(self: &TypeName): String { + assert!(!self.is_primitive(), ENonModuleType); + + // Starts after address and a double colon: `::` + let mut i = address::length() * 2 + 2; + let str_bytes = self.name.as_bytes(); + let mut module_name = vector[]; + let colon = ASCII_COLON; + loop { + let char = &str_bytes[i]; + if (char != &colon) { + module_name.push_back(*char); + i = i + 1; + } else { + break + } + }; + + ascii::string(module_name) + } + /// Convert `self` into its inner String public fun into_string(self: TypeName): String { self.name diff --git a/external-crates/move/crates/move-stdlib/sources/u128.move b/external-crates/move/crates/move-stdlib/sources/u128.move new file mode 100644 index 0000000000000..947c330085ca1 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/u128.move @@ -0,0 +1,79 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[defines_primitive(u128)] +module std::u128 { + /// Return the larger of `x` and `y` + public fun max(x: u128, y: u128): u128 { + std::macros::num_max!(x, y) + } + + /// Return the smaller of `x` and `y` + public fun min(x: u128, y: u128): u128 { + std::macros::num_min!(x, y) + } + + /// Return the absolute value of x - y + public fun diff(x: u128, y: u128): u128 { + std::macros::num_diff!(x, y) + } + + /// Calculate x / y, but round up the result. + public fun divide_and_round_up(x: u128, y: u128): u128 { + std::macros::num_divide_and_round_up!(x, y) + } + + /// Return the value of a base raised to a power + public fun pow(base: u128, exponent: u8): u128 { + std::macros::num_pow!(base, exponent) + } + + /// Get a nearest lower integer Square Root for `x`. Given that this + /// function can only operate with integers, it is impossible + /// to get perfect (or precise) integer square root for some numbers. + /// + /// Example: + /// ``` + /// math::sqrt(9) => 3 + /// math::sqrt(8) => 2 // the nearest lower square root is 4; + /// ``` + /// + /// In integer math, one of the possible ways to get results with more + /// precision is to use higher values or temporarily multiply the + /// value by some bigger number. Ideally if this is a square of 10 or 100. + /// + /// Example: + /// ``` + /// math::sqrt(8) => 2; + /// math::sqrt(8 * 10000) => 282; + /// // now we can use this value as if it was 2.82; + /// // but to get the actual result, this value needs + /// // to be divided by 100 (because sqrt(10000)). + /// + /// + /// math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) + /// ``` + public fun sqrt(x: u128): u128 { + std::macros::num_sqrt!(x, 128) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (exclusive) + public macro fun range_do($start: u128, $stop: u128, $f: |u128|) { + std::macros::range_do!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (inclusive) + public macro fun range_do_eq($start: u128, $stop: u128, $f: |u128|) { + std::macros::range_do_eq!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (exclusive) + public macro fun do($stop: u128, $f: |u128|) { + std::macros::do!($stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (inclusive) + public macro fun do_eq($stop: u128, $f: |u128|) { + std::macros::do_eq!($stop, $f) + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/u16.move b/external-crates/move/crates/move-stdlib/sources/u16.move new file mode 100644 index 0000000000000..9d051c11721dc --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/u16.move @@ -0,0 +1,79 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[defines_primitive(u16)] +module std::u16 { + /// Return the larger of `x` and `y` + public fun max(x: u16, y: u16): u16 { + std::macros::num_max!(x, y) + } + + /// Return the smaller of `x` and `y` + public fun min(x: u16, y: u16): u16 { + std::macros::num_min!(x, y) + } + + /// Return the absolute value of x - y + public fun diff(x: u16, y: u16): u16 { + std::macros::num_diff!(x, y) + } + + /// Calculate x / y, but round up the result. + public fun divide_and_round_up(x: u16, y: u16): u16 { + std::macros::num_divide_and_round_up!(x, y) + } + + /// Return the value of a base raised to a power + public fun pow(base: u16, exponent: u8): u16 { + std::macros::num_pow!(base, exponent) + } + + /// Get a nearest lower integer Square Root for `x`. Given that this + /// function can only operate with integers, it is impossible + /// to get perfect (or precise) integer square root for some numbers. + /// + /// Example: + /// ``` + /// math::sqrt(9) => 3 + /// math::sqrt(8) => 2 // the nearest lower square root is 4; + /// ``` + /// + /// In integer math, one of the possible ways to get results with more + /// precision is to use higher values or temporarily multiply the + /// value by some bigger number. Ideally if this is a square of 10 or 100. + /// + /// Example: + /// ``` + /// math::sqrt(8) => 2; + /// math::sqrt(8 * 10000) => 282; + /// // now we can use this value as if it was 2.82; + /// // but to get the actual result, this value needs + /// // to be divided by 100 (because sqrt(10000)). + /// + /// + /// math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) + /// ``` + public fun sqrt(x: u16): u16 { + std::macros::num_sqrt!(x, 16) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (exclusive) + public macro fun range_do($start: u16, $stop: u16, $f: |u16|) { + std::macros::range_do!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (inclusive) + public macro fun range_do_eq($start: u16, $stop: u16, $f: |u16|) { + std::macros::range_do_eq!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (exclusive) + public macro fun do($stop: u16, $f: |u16|) { + std::macros::do!($stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (inclusive) + public macro fun do_eq($stop: u16, $f: |u16|) { + std::macros::do_eq!($stop, $f) + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/u256.move b/external-crates/move/crates/move-stdlib/sources/u256.move new file mode 100644 index 0000000000000..1c1846db661d7 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/u256.move @@ -0,0 +1,50 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[defines_primitive(u256)] +module std::u256 { + /// Return the larger of `x` and `y` + public fun max(x: u256, y: u256): u256 { + std::macros::num_max!(x, y) + } + + /// Return the smaller of `x` and `y` + public fun min(x: u256, y: u256): u256 { + std::macros::num_min!(x, y) + } + + /// Return the absolute value of x - y + public fun diff(x: u256, y: u256): u256 { + std::macros::num_diff!(x, y) + } + + /// Calculate x / y, but round up the result. + public fun divide_and_round_up(x: u256, y: u256): u256 { + std::macros::num_divide_and_round_up!(x, y) + } + + /// Return the value of a base raised to a power + public fun pow(base: u256, exponent: u8): u256 { + std::macros::num_pow!(base, exponent) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (exclusive) + public macro fun range_do($start: u256, $stop: u256, $f: |u256|) { + std::macros::range_do!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (inclusive) + public macro fun range_do_eq($start: u256, $stop: u256, $f: |u256|) { + std::macros::range_do_eq!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (exclusive) + public macro fun do($stop: u256, $f: |u256|) { + std::macros::do!($stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (inclusive) + public macro fun do_eq($stop: u256, $f: |u256|) { + std::macros::do_eq!($stop, $f) + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/u32.move b/external-crates/move/crates/move-stdlib/sources/u32.move new file mode 100644 index 0000000000000..8ad44d722c178 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/u32.move @@ -0,0 +1,79 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[defines_primitive(u32)] +module std::u32 { + /// Return the larger of `x` and `y` + public fun max(x: u32, y: u32): u32 { + std::macros::num_max!(x, y) + } + + /// Return the smaller of `x` and `y` + public fun min(x: u32, y: u32): u32 { + std::macros::num_min!(x, y) + } + + /// Return the absolute value of x - y + public fun diff(x: u32, y: u32): u32 { + std::macros::num_diff!(x, y) + } + + /// Calculate x / y, but round up the result. + public fun divide_and_round_up(x: u32, y: u32): u32 { + std::macros::num_divide_and_round_up!(x, y) + } + + /// Return the value of a base raised to a power + public fun pow(base: u32, exponent: u8): u32 { + std::macros::num_pow!(base, exponent) + } + + /// Get a nearest lower integer Square Root for `x`. Given that this + /// function can only operate with integers, it is impossible + /// to get perfect (or precise) integer square root for some numbers. + /// + /// Example: + /// ``` + /// math::sqrt(9) => 3 + /// math::sqrt(8) => 2 // the nearest lower square root is 4; + /// ``` + /// + /// In integer math, one of the possible ways to get results with more + /// precision is to use higher values or temporarily multiply the + /// value by some bigger number. Ideally if this is a square of 10 or 100. + /// + /// Example: + /// ``` + /// math::sqrt(8) => 2; + /// math::sqrt(8 * 10000) => 282; + /// // now we can use this value as if it was 2.82; + /// // but to get the actual result, this value needs + /// // to be divided by 100 (because sqrt(10000)). + /// + /// + /// math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) + /// ``` + public fun sqrt(x: u32): u32 { + std::macros::num_sqrt!(x, 32) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (exclusive) + public macro fun range_do($start: u32, $stop: u32, $f: |u32|) { + std::macros::range_do!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (inclusive) + public macro fun range_do_eq($start: u32, $stop: u32, $f: |u32|) { + std::macros::range_do_eq!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (exclusive) + public macro fun do($stop: u32, $f: |u32|) { + std::macros::do!($stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (inclusive) + public macro fun do_eq($stop: u32, $f: |u32|) { + std::macros::do_eq!($stop, $f) + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/u64.move b/external-crates/move/crates/move-stdlib/sources/u64.move new file mode 100644 index 0000000000000..9963dcc1b8206 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/u64.move @@ -0,0 +1,79 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[defines_primitive(u64)] +module std::u64 { + /// Return the larger of `x` and `y` + public fun max(x: u64, y: u64): u64 { + std::macros::num_max!(x, y) + } + + /// Return the smaller of `x` and `y` + public fun min(x: u64, y: u64): u64 { + std::macros::num_min!(x, y) + } + + /// Return the absolute value of x - y + public fun diff(x: u64, y: u64): u64 { + std::macros::num_diff!(x, y) + } + + /// Calculate x / y, but round up the result. + public fun divide_and_round_up(x: u64, y: u64): u64 { + std::macros::num_divide_and_round_up!(x, y) + } + + /// Return the value of a base raised to a power + public fun pow(base: u64, exponent: u8): u64 { + std::macros::num_pow!(base, exponent) + } + + /// Get a nearest lower integer Square Root for `x`. Given that this + /// function can only operate with integers, it is impossible + /// to get perfect (or precise) integer square root for some numbers. + /// + /// Example: + /// ``` + /// math::sqrt(9) => 3 + /// math::sqrt(8) => 2 // the nearest lower square root is 4; + /// ``` + /// + /// In integer math, one of the possible ways to get results with more + /// precision is to use higher values or temporarily multiply the + /// value by some bigger number. Ideally if this is a square of 10 or 100. + /// + /// Example: + /// ``` + /// math::sqrt(8) => 2; + /// math::sqrt(8 * 10000) => 282; + /// // now we can use this value as if it was 2.82; + /// // but to get the actual result, this value needs + /// // to be divided by 100 (because sqrt(10000)). + /// + /// + /// math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) + /// ``` + public fun sqrt(x: u64): u64 { + std::macros::num_sqrt!(x, 64) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (exclusive) + public macro fun range_do($start: u64, $stop: u64, $f: |u64|) { + std::macros::range_do!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (inclusive) + public macro fun range_do_eq($start: u64, $stop: u64, $f: |u64|) { + std::macros::range_do_eq!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (exclusive) + public macro fun do($stop: u64, $f: |u64|) { + std::macros::do!($stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (inclusive) + public macro fun do_eq($stop: u64, $f: |u64|) { + std::macros::do_eq!($stop, $f) + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/u8.move b/external-crates/move/crates/move-stdlib/sources/u8.move new file mode 100644 index 0000000000000..4eaca05a94345 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/sources/u8.move @@ -0,0 +1,79 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[defines_primitive(u8)] +module std::u8 { + /// Return the larger of `x` and `y` + public fun max(x: u8, y: u8): u8 { + std::macros::num_max!(x, y) + } + + /// Return the smaller of `x` and `y` + public fun min(x: u8, y: u8): u8 { + std::macros::num_min!(x, y) + } + + /// Return the absolute value of x - y + public fun diff(x: u8, y: u8): u8 { + std::macros::num_diff!(x, y) + } + + /// Calculate x / y, but round up the result. + public fun divide_and_round_up(x: u8, y: u8): u8 { + std::macros::num_divide_and_round_up!(x, y) + } + + /// Return the value of a base raised to a power + public fun pow(base: u8, exponent: u8): u8 { + std::macros::num_pow!(base, exponent) + } + + /// Get a nearest lower integer Square Root for `x`. Given that this + /// function can only operate with integers, it is impossible + /// to get perfect (or precise) integer square root for some numbers. + /// + /// Example: + /// ``` + /// math::sqrt(9) => 3 + /// math::sqrt(8) => 2 // the nearest lower square root is 4; + /// ``` + /// + /// In integer math, one of the possible ways to get results with more + /// precision is to use higher values or temporarily multiply the + /// value by some bigger number. Ideally if this is a square of 10 or 100. + /// + /// Example: + /// ``` + /// math::sqrt(8) => 2; + /// math::sqrt(8 * 10000) => 282; + /// // now we can use this value as if it was 2.82; + /// // but to get the actual result, this value needs + /// // to be divided by 100 (because sqrt(10000)). + /// + /// + /// math::sqrt(8 * 1000000) => 2828; // same as above, 2828 / 1000 (2.828) + /// ``` + public fun sqrt(x: u8): u8 { + std::macros::num_sqrt!(x, 8) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (exclusive) + public macro fun range_do($start: u8, $stop: u8, $f: |u8|) { + std::macros::range_do!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `$start` to `$stop` (inclusive) + public macro fun range_do_eq($start: u8, $stop: u8, $f: |u8|) { + std::macros::range_do_eq!($start, $stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (exclusive) + public macro fun do($stop: u8, $f: |u8|) { + std::macros::do!($stop, $f) + } + + /// Loops applying `$f` to each number from `0` to `$stop` (inclusive) + public macro fun do_eq($stop: u8, $f: |u8|) { + std::macros::do_eq!($stop, $f) + } +} diff --git a/external-crates/move/crates/move-stdlib/sources/unit_test.move b/external-crates/move/crates/move-stdlib/sources/unit_test.move index 28526857c8521..1deb6a70c0529 100644 --- a/external-crates/move/crates/move-stdlib/sources/unit_test.move +++ b/external-crates/move/crates/move-stdlib/sources/unit_test.move @@ -1,3 +1,6 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] /// Module providing testing functionality. Only included for tests. module std::unit_test { @@ -9,4 +12,23 @@ module std::unit_test { /// This will cause a linking failure if an attempt is made to publish a /// test module in a VM that isn't in unit test mode. native public fun poison(); + + public macro fun assert_eq<$T: drop>($t1: $T, $t2: $T) { + let t1 = $t1; + let t2 = $t2; + assert_ref_eq!(&t1, &t2) + } + + public macro fun assert_ref_eq<$T>($t1: &$T, $t2: &$T) { + let t1 = $t1; + let t2 = $t2; + let res = t1 == t2; + if (!res) { + std::debug::print(&b"Assertion failed:"); + std::debug::print(t1); + std::debug::print(&b"!="); + std::debug::print(t2); + assert!(false); + } + } } diff --git a/external-crates/move/crates/move-stdlib/sources/vector.move b/external-crates/move/crates/move-stdlib/sources/vector.move index 1eb179ba683c1..cd98ed0ae7955 100644 --- a/external-crates/move/crates/move-stdlib/sources/vector.move +++ b/external-crates/move/crates/move-stdlib/sources/vector.move @@ -1,88 +1,106 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[defines_primitive(vector)] /// A variable-sized container that can hold any type. Indexing is 0-based, and /// vectors are growable. This module has many native functions. module std::vector { + /// Allows calling `.to_string()` on a vector of `u8` to get a utf8 `String`. + public use fun std::string::utf8 as vector.to_string; + + /// Allows calling `.try_to_string()` on a vector of `u8` to get a utf8 `String`. + /// This will return `None` if the vector is not valid utf8. + public use fun std::string::try_utf8 as vector.try_to_string; + + /// Allows calling `.to_ascii_string()` on a vector of `u8` to get an `ascii::String`. + public use fun std::ascii::string as vector.to_ascii_string; + + /// Allows calling `.try_to_ascii_string()` on a vector of `u8` to get an + /// `ascii::String`. This will return `None` if the vector is not valid ascii. + public use fun std::ascii::try_string as vector.try_to_ascii_string; /// The index into the vector is out of bounds const EINDEX_OUT_OF_BOUNDS: u64 = 0x20000; #[bytecode_instruction] /// Create an empty vector. - native public fun empty(): vector; + public native fun empty(): vector; #[bytecode_instruction] /// Return the length of the vector. - native public fun length(v: &vector): u64; + public native fun length(v: &vector): u64; + #[syntax(index)] #[bytecode_instruction] /// Acquire an immutable reference to the `i`th element of the vector `v`. /// Aborts if `i` is out of bounds. - native public fun borrow(v: &vector, i: u64): ∈ + public native fun borrow(v: &vector, i: u64): ∈ #[bytecode_instruction] /// Add element `e` to the end of the vector `v`. - native public fun push_back(v: &mut vector, e: Element); + public native fun push_back(v: &mut vector, e: Element); + #[syntax(index)] #[bytecode_instruction] /// Return a mutable reference to the `i`th element in the vector `v`. /// Aborts if `i` is out of bounds. - native public fun borrow_mut(v: &mut vector, i: u64): &mut Element; + public native fun borrow_mut(v: &mut vector, i: u64): &mut Element; #[bytecode_instruction] /// Pop an element from the end of vector `v`. /// Aborts if `v` is empty. - native public fun pop_back(v: &mut vector): Element; + public native fun pop_back(v: &mut vector): Element; #[bytecode_instruction] /// Destroy the vector `v`. /// Aborts if `v` is not empty. - native public fun destroy_empty(v: vector); + public native fun destroy_empty(v: vector); #[bytecode_instruction] /// Swaps the elements at the `i`th and `j`th indices in the vector `v`. /// Aborts if `i` or `j` is out of bounds. - native public fun swap(v: &mut vector, i: u64, j: u64); + public native fun swap(v: &mut vector, i: u64, j: u64); /// Return an vector of size one containing element `e`. public fun singleton(e: Element): vector { - let v = empty(); - push_back(&mut v, e); + let mut v = empty(); + v.push_back(e); v } /// Reverses the order of the elements in the vector `v` in place. public fun reverse(v: &mut vector) { - let len = length(v); + let len = v.length(); if (len == 0) return (); - let front_index = 0; - let back_index = len -1; + let mut front_index = 0; + let mut back_index = len - 1; while (front_index < back_index) { - swap(v, front_index, back_index); + v.swap(front_index, back_index); front_index = front_index + 1; back_index = back_index - 1; } } /// Pushes all of the elements of the `other` vector into the `lhs` vector. - public fun append(lhs: &mut vector, other: vector) { - reverse(&mut other); - while (!is_empty(&other)) push_back(lhs, pop_back(&mut other)); - destroy_empty(other); + public fun append(lhs: &mut vector, mut other: vector) { + other.reverse(); + while (!other.is_empty()) lhs.push_back(other.pop_back()); + other.destroy_empty(); } /// Return `true` if the vector `v` has no elements and `false` otherwise. public fun is_empty(v: &vector): bool { - length(v) == 0 + v.length() == 0 } /// Return true if `e` is in the vector `v`. /// Otherwise, returns false. public fun contains(v: &vector, e: &Element): bool { - let i = 0; - let len = length(v); + let mut i = 0; + let len = v.length(); while (i < len) { - if (borrow(v, i) == e) return true; + if (&v[i] == e) return true; i = i + 1; }; false @@ -91,10 +109,10 @@ module std::vector { /// Return `(true, i)` if `e` is in the vector `v` at index `i`. /// Otherwise, returns `(false, 0)`. public fun index_of(v: &vector, e: &Element): (bool, u64) { - let i = 0; - let len = length(v); + let mut i = 0; + let len = v.length(); while (i < len) { - if (borrow(v, i) == e) return (true, i); + if (&v[i] == e) return (true, i); i = i + 1; }; (false, 0) @@ -103,29 +121,29 @@ module std::vector { /// Remove the `i`th element of the vector `v`, shifting all subsequent elements. /// This is O(n) and preserves ordering of elements in the vector. /// Aborts if `i` is out of bounds. - public fun remove(v: &mut vector, i: u64): Element { - let len = length(v); + public fun remove(v: &mut vector, mut i: u64): Element { + let mut len = v.length(); // i out of bounds; abort if (i >= len) abort EINDEX_OUT_OF_BOUNDS; len = len - 1; - while (i < len) swap(v, i, { i = i + 1; i }); - pop_back(v) + while (i < len) v.swap(i, { i = i + 1; i }); + v.pop_back() } /// Insert `e` at position `i` in the vector `v`. /// If `i` is in bounds, this shifts the old `v[i]` and all subsequent elements to the right. - /// If `i == length(v)`, this adds `e` to the end of the vector. + /// If `i == v.length()`, this adds `e` to the end of the vector. /// This is O(n) and preserves ordering of elements in the vector. - /// Aborts if `i > length(v)` - public fun insert(v: &mut vector, e: Element, i: u64) { - let len = length(v); + /// Aborts if `i > v.length()` + public fun insert(v: &mut vector, e: Element, mut i: u64) { + let len = v.length(); // i too big abort if (i > len) abort EINDEX_OUT_OF_BOUNDS; - push_back(v, e); + v.push_back(e); while (i < len) { - swap(v, i, len); + v.swap(i, len); i = i + 1 } } @@ -134,9 +152,213 @@ module std::vector { /// This is O(1), but does not preserve ordering of elements in the vector. /// Aborts if `i` is out of bounds. public fun swap_remove(v: &mut vector, i: u64): Element { - assert!(!is_empty(v), EINDEX_OUT_OF_BOUNDS); - let last_idx = length(v) - 1; - swap(v, i, last_idx); - pop_back(v) + assert!(!v.is_empty(), EINDEX_OUT_OF_BOUNDS); + let last_idx = v.length() - 1; + v.swap(i, last_idx); + v.pop_back() + } + + // === Macros === + + /// Create a vector of length `n` by calling the function `f` on each index. + public macro fun tabulate<$T>($n: u64, $f: |u64| -> $T): vector<$T> { + let mut v = vector[]; + let n = $n; + n.do!(|i| v.push_back($f(i))); + v + } + + /// Destroy the vector `v` by calling `f` on each element and then destroying the vector. + /// Does not preserve the order of elements in the vector (starts from the end of the vector). + public macro fun destroy<$T>($v: vector<$T>, $f: |$T|) { + let mut v = $v; + while (!v.is_empty()) $f(v.pop_back()); + v.destroy_empty(); + } + + /// Destroy the vector `v` by calling `f` on each element and then destroying the vector. + /// Preserves the order of elements in the vector. + public macro fun do<$T>($v: vector<$T>, $f: |$T|) { + let mut v = $v; + v.reverse(); + while (!v.is_empty()) $f(v.pop_back()); + v.destroy_empty(); + } + + /// Perform an action `f` on each element of the vector `v`. The vector is not modified. + public macro fun do_ref<$T>($v: &vector<$T>, $f: |&$T|) { + let v = $v; + v.length().do!(|i| $f(&v[i])) + } + + /// Perform an action `f` on each element of the vector `v`. + /// The function `f` takes a mutable reference to the element. + public macro fun do_mut<$T>($v: &mut vector<$T>, $f: |&mut $T|) { + let v = $v; + v.length().do!(|i| $f(&mut v[i])) + } + + /// Map the vector `v` to a new vector by applying the function `f` to each element. + /// Preserves the order of elements in the vector, first is called first. + public macro fun map<$T, $U>($v: vector<$T>, $f: |$T| -> $U): vector<$U> { + let v = $v; + let mut r = vector[]; + v.do!(|e| r.push_back($f(e))); + r + } + + /// Map the vector `v` to a new vector by applying the function `f` to each element. + /// Preserves the order of elements in the vector, first is called first. + public macro fun map_ref<$T, $U>($v: &vector<$T>, $f: |&$T| -> $U): vector<$U> { + let v = $v; + let mut r = vector[]; + v.do_ref!(|e| r.push_back($f(e))); + r + } + + /// Filter the vector `v` by applying the function `f` to each element. + /// Return a new vector containing only the elements for which `f` returns `true`. + public macro fun filter<$T: drop>($v: vector<$T>, $f: |&$T| -> bool): vector<$T> { + let v = $v; + let mut r = vector[]; + v.do!(|e| if ($f(&e)) r.push_back(e)); + r + } + + /// Split the vector `v` into two vectors by applying the function `f` to each element. + /// Return a tuple containing two vectors: the first containing the elements for which `f` returns `true`, + /// and the second containing the elements for which `f` returns `false`. + public macro fun partition<$T>($v: vector<$T>, $f: |&$T| -> bool): (vector<$T>, vector<$T>) { + let v = $v; + let mut r1 = vector[]; + let mut r2 = vector[]; + v.do!(|e| if ($f(&e)) r1.push_back(e) else r2.push_back(e)); + (r1, r2) + } + + /// Finds the index of first element in the vector `v` that satisfies the predicate `f`. + /// Returns `some(index)` if such an element is found, otherwise `none()`. + public macro fun find_index<$T>($v: vector<$T>, $f: |&$T| -> bool): Option { + let v = $v; + 'find_index: { + v.length().do!(|i| if ($f(&v[i])) return 'find_index option::some(i)); + option::none() + } + } + + /// Count how many elements in the vector `v` satisfy the predicate `f`. + public macro fun count<$T>($v: &vector<$T>, $f: |&$T| -> bool): u64 { + let v = $v; + let mut count = 0; + v.do_ref!(|e| if ($f(e)) count = count + 1); + count + } + + /// Reduce the vector `v` to a single value by applying the function `f` to each element. + /// Similar to `fold_left` in Rust and `reduce` in Python and JavaScript. + public macro fun fold<$T, $Acc>($v: vector<$T>, $init: $Acc, $f: |$Acc, $T| -> $Acc): $Acc { + let v = $v; + let mut acc = $init; + v.do!(|e| acc = $f(acc, e)); + acc + } + + /// Whether any element in the vector `v` satisfies the predicate `f`. + /// If the vector is empty, returns `false`. + public macro fun any<$T>($v: &vector<$T>, $f: |&$T| -> bool): bool { + let v = $v; + 'any: { + v.do_ref!(|e| if ($f(e)) return 'any true); + false + } + } + + /// Whether all elements in the vector `v` satisfy the predicate `f`. + /// If the vector is empty, returns `true`. + public macro fun all<$T>($v: &vector<$T>, $f: |&$T| -> bool): bool { + let v = $v; + 'all: { + v.do_ref!(|e| if (!$f(e)) return 'all false); + true + } + } + + /// Destroys two vectors `v1` and `v2` by calling `f` to each pair of elements. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_do<$T1, $T2>($v1: vector<$T1>, $v2: vector<$T2>, $f: |$T1, $T2|) { + let v1 = $v1; + let mut v2 = $v2; + v2.reverse(); + let len = v1.length(); + assert!(len == v2.length()); + v1.do!(|el1| $f(el1, v2.pop_back())); + } + + /// Destroys two vectors `v1` and `v2` by calling `f` to each pair of elements. + /// Aborts if the vectors are not of the same length. + /// Starts from the end of the vectors. + public macro fun zip_do_reverse<$T1, $T2>($v1: vector<$T1>, $v2: vector<$T2>, $f: |$T1, $T2|) { + let v1 = $v1; + let mut v2 = $v2; + let len = v1.length(); + assert!(len == v2.length()); + v1.destroy!(|el1| $f(el1, v2.pop_back())); + } + + /// Iterate through `v1` and `v2` and apply the function `f` to references of each pair of + /// elements. The vectors are not modified. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_do_ref<$T1, $T2>($v1: &vector<$T1>, $v2: &vector<$T2>, $f: |&$T1, &$T2|) { + let v1 = $v1; + let v2 = $v2; + let len = v1.length(); + assert!(len == v2.length()); + len.do!(|i| $f(&v1[i], &v2[i])); + } + + /// Iterate through `v1` and `v2` and apply the function `f` to mutable references of each pair + /// of elements. The vectors may be modified. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_do_mut<$T1, $T2>( + $v1: &mut vector<$T1>, + $v2: &mut vector<$T2>, + $f: |&mut $T1, &mut $T2|, + ) { + let v1 = $v1; + let v2 = $v2; + let len = v1.length(); + assert!(len == v2.length()); + len.do!(|i| $f(&mut v1[i], &mut v2[i])); + } + + /// Destroys two vectors `v1` and `v2` by applying the function `f` to each pair of elements. + /// The returned values are collected into a new vector. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_map<$T1, $T2, $U>( + $v1: vector<$T1>, + $v2: vector<$T2>, + $f: |$T1, $T2| -> $U, + ): vector<$U> { + let mut r = vector[]; + zip_do!($v1, $v2, |el1, el2| r.push_back($f(el1, el2))); + r + } + + /// Iterate through `v1` and `v2` and apply the function `f` to references of each pair of + /// elements. The returned values are collected into a new vector. + /// Aborts if the vectors are not of the same length. + /// The order of elements in the vectors is preserved. + public macro fun zip_map_ref<$T1, $T2, $U>( + $v1: &vector<$T1>, + $v2: &vector<$T2>, + $f: |&$T1, &$T2| -> $U, + ): vector<$U> { + let mut r = vector[]; + zip_do_ref!($v1, $v2, |el1, el2| r.push_back($f(el1, el2))); + r } } diff --git a/external-crates/move/crates/move-stdlib/src/lib.rs b/external-crates/move/crates/move-stdlib/src/lib.rs index 45c5c87b8b7d2..5d714e3d3acd1 100644 --- a/external-crates/move/crates/move-stdlib/src/lib.rs +++ b/external-crates/move/crates/move-stdlib/src/lib.rs @@ -14,9 +14,7 @@ mod tests; pub mod utils; const MODULES_DIR: &str = "sources"; -const NURSERY_DIR: &str = "nursery"; const DOCS_DIR: &str = "docs"; -const NURSERY_DOCS_DIR: &str = "nursery/docs"; const REFERENCES_TEMPLATE: &str = "doc_templates/references.md"; const OVERVIEW_TEMPLATE: &str = "doc_templates/overview.md"; @@ -45,20 +43,11 @@ pub fn move_stdlib_docs_full_path() -> String { format!("{}/{}", env!("CARGO_MANIFEST_DIR"), DOCS_DIR) } -pub fn move_nursery_docs_full_path() -> String { - format!("{}/{}", env!("CARGO_MANIFEST_DIR"), NURSERY_DOCS_DIR) -} - pub fn move_stdlib_files() -> Vec { let path = path_in_crate(MODULES_DIR); find_filenames(&[path], |p| extension_equals(p, MOVE_EXTENSION)).unwrap() } -pub fn move_nursery_files() -> Vec { - let path = path_in_crate(NURSERY_DIR); - find_filenames(&[path], |p| extension_equals(p, MOVE_EXTENSION)).unwrap() -} - pub fn move_stdlib_named_addresses() -> BTreeMap { let mapping = [("std", "0x1")]; mapping @@ -116,16 +105,3 @@ pub fn build_stdlib_doc(output_path: &str) { move_stdlib_named_addresses(), ) } - -pub fn build_nursery_doc(output_path: &str) { - build_doc( - output_path, - "", - vec![], - None, - move_nursery_files().as_slice(), - vec![move_stdlib_modules_full_path()], - false, - move_stdlib_named_addresses(), - ) -} diff --git a/external-crates/move/crates/move-stdlib/src/main.rs b/external-crates/move/crates/move-stdlib/src/main.rs index 03652b782db60..500c40977c5d5 100644 --- a/external-crates/move/crates/move-stdlib/src/main.rs +++ b/external-crates/move/crates/move-stdlib/src/main.rs @@ -12,10 +12,5 @@ fn main() { //std::fs::create_dir_all(&move_stdlib::move_stdlib_docs_full_path()).unwrap(); move_stdlib::build_stdlib_doc(&move_stdlib::move_stdlib_docs_full_path()); }); - - time_it("Generating nursery documentation", || { - std::fs::remove_dir_all(move_stdlib::move_nursery_docs_full_path()).unwrap_or(()); - move_stdlib::build_nursery_doc(&move_stdlib::move_nursery_docs_full_path()); - }); } } diff --git a/external-crates/move/crates/move-stdlib/tests/ascii_tests.move b/external-crates/move/crates/move-stdlib/tests/ascii_tests.move index c455b362b62fa..ec6d4c7fdb817 100644 --- a/external-crates/move/crates/move-stdlib/tests/ascii_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/ascii_tests.move @@ -1,120 +1,222 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::ascii_tests { use std::ascii; - use std::vector; - use std::option; #[test] fun test_ascii_chars() { - let i = 0; + let mut i = 0; let end = 128; - let vec = vector::empty(); + let mut vec = vector[]; while (i < end) { - assert!(ascii::is_valid_char(i), 0); - vector::push_back(&mut vec, i); + assert!(ascii::is_valid_char(i)); + vec.push_back(i); i = i + 1; }; - let str = ascii::string(vec); - assert!(vector::length(ascii::as_bytes(&str)) == 128, 0); - assert!(!ascii::all_characters_printable(&str), 1); - assert!(vector::length(&ascii::into_bytes(str)) == 128, 2); + let str = vec.to_ascii_string(); + assert!(str.as_bytes().length() == 128); + assert!(!str.all_characters_printable()); + assert!(str.into_bytes().length() == 128); } #[test] fun test_ascii_push_chars() { - let i = 0; + let mut i = 0; let end = 128; - let str = ascii::string(vector::empty()); + let mut str = vector[].to_ascii_string(); while (i < end) { - ascii::push_char(&mut str, ascii::char(i)); + str.push_char(ascii::char(i)); i = i + 1; }; - assert!(vector::length(ascii::as_bytes(&str)) == 128, 0); - assert!(ascii::length(&str) == 128, 0); - assert!(!ascii::all_characters_printable(&str), 1); + assert!(str.as_bytes().length() == 128); + assert!(str.length() == 128); + assert!(!str.all_characters_printable()); } #[test] fun test_ascii_push_char_pop_char() { - let i = 0; + let mut i = 0; let end = 128; - let str = ascii::string(vector::empty()); + let mut str = vector[].to_ascii_string(); while (i < end) { - ascii::push_char(&mut str, ascii::char(i)); + str.push_char(ascii::char(i)); i = i + 1; }; while (i > 0) { - let char = ascii::pop_char(&mut str); - assert!(ascii::byte(char) == i - 1, 0); + let char = str.pop_char(); + assert!(ascii::byte(char) == i - 1); i = i - 1; }; - assert!(vector::length(ascii::as_bytes(&str)) == 0, 0); - assert!(ascii::length(&str) == 0, 0); - assert!(ascii::all_characters_printable(&str), 1); + assert!(str.as_bytes().length() == 0); + assert!(str.length() == 0); + assert!(str.all_characters_printable()); } #[test] fun test_printable_chars() { - let i = 0x20; + let mut i = 0x20; let end = 0x7E; - let vec = vector::empty(); + let mut vec = vector[]; while (i <= end) { - assert!(ascii::is_printable_char(i), 0); - vector::push_back(&mut vec, i); + assert!(ascii::is_printable_char(i)); + vec.push_back(i); i = i + 1; }; - let str = ascii::string(vec); - assert!(ascii::all_characters_printable(&str), 0); + let str = vec.to_ascii_string(); + assert!(str.all_characters_printable()); } #[test] fun printable_chars_dont_allow_tab() { - let str = ascii::string(vector::singleton(0x09)); - assert!(!ascii::all_characters_printable(&str), 0); + let str = vector[0x09].to_ascii_string(); + assert!(!str.all_characters_printable()); } #[test] fun printable_chars_dont_allow_newline() { - let str = ascii::string(vector::singleton(0x0A)); - assert!(!ascii::all_characters_printable(&str), 0); + let str = vector[0x0A].to_ascii_string(); + assert!(!str.all_characters_printable()); } #[test] fun test_invalid_ascii_characters() { - let i = 128u8; + let mut i = 128u8; let end = 255u8; while (i < end) { - let try_str = ascii::try_string(vector::singleton(i)); - assert!(option::is_none(&try_str), 0); + let try_str = vector[i].try_to_ascii_string(); + assert!(try_str.is_none()); i = i + 1; }; } #[test] fun test_nonvisible_chars() { - let i = 0; + let mut i = 0; let end = 0x09; while (i < end) { - let str = ascii::string(vector::singleton(i)); - assert!(!ascii::all_characters_printable(&str), 0); + let str = vector[i].to_ascii_string(); + assert!(!str.all_characters_printable()); i = i + 1; }; - let i = 0x0B; + let mut i = 0x0B; let end = 0x0F; while (i <= end) { - let str = ascii::string(vector::singleton(i)); - assert!(!ascii::all_characters_printable(&str), 0); + let str = vector[i].to_ascii_string(); + assert!(!str.all_characters_printable()); i = i + 1; }; } + + #[test] + fun test_append() { + let mut str = b"hello".to_ascii_string(); + str.append(b" world".to_ascii_string()); + + assert!(str == b"hello world".to_ascii_string()); + } + + #[test] + fun test_to_uppercase() { + let str = b"azhello_world_!".to_ascii_string(); + assert!(str.to_uppercase() == b"AZHELLO_WORLD_!".to_ascii_string()); + } + + #[test] + fun test_to_lowercase() { + let str = b"AZHELLO_WORLD_!".to_ascii_string(); + assert!(str.to_lowercase() == b"azhello_world_!".to_ascii_string()); + } + + #[test] + fun test_substring() { + let str = b"hello world".to_ascii_string(); + assert!(str.substring(0, 5) == b"hello".to_ascii_string()); + assert!(str.substring(6, 11) == b"world".to_ascii_string()); + } + + #[test] + fun test_substring_len_one() { + let str = b"hello world".to_ascii_string(); + assert!(str.substring(0, 1) == b"h".to_ascii_string()); + assert!(str.substring(6, 7) == b"w".to_ascii_string()); + } + + #[test] + fun test_substring_len_zero() { + let str = b"hello world".to_ascii_string(); + assert!(str.substring(0, 0).is_empty()); + } + + #[test] + fun test_index_of() { + let str = b"hello world orwell".to_ascii_string(); + assert!(str.index_of(&b"hello".to_ascii_string()) == 0); + assert!(str.index_of(&b"world".to_ascii_string()) == 6); + assert!(str.index_of(&b"o".to_ascii_string()) == 4); + assert!(str.index_of(&b"z".to_ascii_string()) == str.length()); + assert!(str.index_of(&b"o ".to_ascii_string()) == 4); + assert!(str.index_of(&b"or".to_ascii_string()) == 7); + assert!(str.index_of(&b"".to_ascii_string()) == 0); + assert!(str.index_of(&b"orwell".to_ascii_string()) == 12); + assert!( + b"ororwell" + .to_ascii_string() + .index_of(&b"orwell".to_ascii_string()) == 2, + ); + } + + #[test, expected_failure(abort_code = ascii::EInvalidIndex)] + fun test_substring_i_out_of_bounds_fail() { + let str = b"hello world".to_ascii_string(); + str.substring(12, 13); + } + + #[test, expected_failure(abort_code = ascii::EInvalidIndex)] + fun test_substring_j_lt_i_fail() { + let str = b"hello world".to_ascii_string(); + str.substring(9, 8); + } + + #[test, expected_failure(abort_code = ascii::EInvalidIndex)] + fun test_substring_j_out_of_bounds_fail() { + let str = b"hello world".to_ascii_string(); + str.substring(9, 13); + } + + #[test] + fun test_insert() { + let mut str = b"hello".to_ascii_string(); + str.insert(5, b" world".to_ascii_string()); + assert!(str == b"hello world".to_ascii_string()); + + str.insert(5, b" cruel".to_ascii_string()); + assert!(str == b"hello cruel world".to_ascii_string()); + } + + #[test] + fun test_insert_empty() { + let mut str = b"hello".to_ascii_string(); + str.insert(5, b"".to_ascii_string()); + assert!(str == b"hello".to_ascii_string()); + } + + #[test, expected_failure(abort_code = ascii::EInvalidIndex)] + fun test_insert_out_of_bounds_fail() { + let mut str = b"hello".to_ascii_string(); + str.insert(6, b" world".to_ascii_string()); + } } diff --git a/external-crates/move/crates/move-stdlib/tests/bcs_tests.move b/external-crates/move/crates/move-stdlib/tests/bcs_tests.move index c6ca978b397c1..308dd99920289 100644 --- a/external-crates/move/crates/move-stdlib/tests/bcs_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/bcs_tests.move @@ -1,69 +1,74 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::bcs_tests { use std::bcs; - struct Box has copy, drop, store { x: T } - struct Box3 has copy, drop, store { x: Box> } - struct Box7 has copy, drop, store { x: Box3> } - struct Box15 has copy, drop, store { x: Box7> } - struct Box31 has copy, drop, store { x: Box15> } - struct Box63 has copy, drop, store { x: Box31> } - struct Box127 has copy, drop, store { x: Box63> } + public struct Box has copy, drop, store { x: T } + public struct Box3 has copy, drop, store { x: Box> } + public struct Box7 has copy, drop, store { x: Box3> } + public struct Box15 has copy, drop, store { x: Box7> } + public struct Box31 has copy, drop, store { x: Box15> } + public struct Box63 has copy, drop, store { x: Box31> } + public struct Box127 has copy, drop, store { x: Box63> } #[test] fun bcs_address() { - let addr = @0x1234567890abcdef1234567890abcdef89b9f9d1fadc027cf9532d6f99041522; - let expected_output = x"1234567890abcdef1234567890abcdef89b9f9d1fadc027cf9532d6f99041522"; - assert!(bcs::to_bytes(&addr) == expected_output, 0); + let addr = @0x0000000000000000000000000000000089b9f9d1fadc027cf9532d6f99041522; + let expected_output = x"0000000000000000000000000000000089b9f9d1fadc027cf9532d6f99041522"; + assert!(bcs::to_bytes(&addr) == expected_output); } #[test] fun bcs_bool() { let expected_output = x"01"; - assert!(bcs::to_bytes(&true) == expected_output, 0); + assert!(bcs::to_bytes(&true) == expected_output); } #[test] fun bcs_u8() { let expected_output = x"01"; - assert!(bcs::to_bytes(&1u8) == expected_output, 0); + assert!(bcs::to_bytes(&1u8) == expected_output); } #[test] fun bcs_u16() { let expected_output = x"0100"; - assert!(bcs::to_bytes(&1u16) == expected_output, 0); + assert!(bcs::to_bytes(&1u16) == expected_output); } #[test] fun bcs_u32() { let expected_output = x"01000000"; - assert!(bcs::to_bytes(&1u32) == expected_output, 0); + assert!(bcs::to_bytes(&1u32) == expected_output); } #[test] fun bcs_u64() { let expected_output = x"0100000000000000"; - assert!(bcs::to_bytes(&1) == expected_output, 0); + assert!(bcs::to_bytes(&1) == expected_output); } #[test] fun bcs_u128() { let expected_output = x"01000000000000000000000000000000"; - assert!(bcs::to_bytes(&1u128) == expected_output, 0); + assert!(bcs::to_bytes(&1u128) == expected_output); } #[test] fun bcs_u256() { let expected_output = x"0100000000000000000000000000000000000000000000000000000000000000"; - assert!(bcs::to_bytes(&1u256) == expected_output, 0); + assert!(bcs::to_bytes(&1u256) == expected_output); } #[test] fun bcs_vec_u8() { let v = x"0f"; let expected_output = x"010f"; - assert!(bcs::to_bytes(&v) == expected_output, 0); + assert!(bcs::to_bytes(&v) == expected_output); } fun box3(x: T): Box3 { @@ -96,7 +101,8 @@ module std::bcs_tests { } #[test] - #[expected_failure] // VM_MAX_VALUE_DEPTH_REACHED + #[expected_failure] + // failes due to VM max value depth fun encode_129() { bcs::to_bytes(&Box { x: box127(true) }); } diff --git a/external-crates/move/crates/move-stdlib/tests/bit_vector_tests.move b/external-crates/move/crates/move-stdlib/tests/bit_vector_tests.move index 2dfa2e047471a..10a35c0cfa84c 100644 --- a/external-crates/move/crates/move-stdlib/tests/bit_vector_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/bit_vector_tests.move @@ -1,18 +1,23 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::bit_vector_tests { use std::bit_vector; #[test_only] fun test_bitvector_set_unset_of_size(k: u64) { - let bitvector = bit_vector::new(k); - let index = 0; + let mut bitvector = bit_vector::new(k); + let mut index = 0; while (index < k) { - bit_vector::set(&mut bitvector, index); - assert!(bit_vector::is_index_set(&bitvector, index), 0); + bitvector.set(index); + assert!(bitvector.is_index_set(index)); index = index + 1; - let index_to_right = index; + let mut index_to_right = index; while (index_to_right < k) { - assert!(!bit_vector::is_index_set(&bitvector, index_to_right), 1); + assert!(!bitvector.is_index_set(index_to_right)); index_to_right = index_to_right + 1; }; }; @@ -20,12 +25,12 @@ module std::bit_vector_tests { index = 0; while (index < k) { - bit_vector::unset(&mut bitvector, index); - assert!(!bit_vector::is_index_set(&bitvector, index), 0); + bitvector.unset(index); + assert!(!bitvector.is_index_set(index)); index = index + 1; - let index_to_right = index; + let mut index_to_right = index; while (index_to_right < k) { - assert!(bit_vector::is_index_set(&bitvector, index_to_right), 1); + assert!(bitvector.is_index_set(index_to_right)); index_to_right = index_to_right + 1; }; }; @@ -34,22 +39,22 @@ module std::bit_vector_tests { #[test] #[expected_failure(abort_code = bit_vector::EINDEX)] fun set_bit_out_of_bounds() { - let bitvector = bit_vector::new(bit_vector::word_size()); - bit_vector::set(&mut bitvector, bit_vector::word_size()); + let mut bitvector = bit_vector::new(bit_vector::word_size()); + bitvector.set(bit_vector::word_size()); } #[test] #[expected_failure(abort_code = bit_vector::EINDEX)] fun unset_bit_out_of_bounds() { - let bitvector = bit_vector::new(bit_vector::word_size()); - bit_vector::unset(&mut bitvector, bit_vector::word_size()); + let mut bitvector = bit_vector::new(bit_vector::word_size()); + bitvector.unset(bit_vector::word_size()); } #[test] #[expected_failure(abort_code = bit_vector::EINDEX)] fun index_bit_out_of_bounds() { let bitvector = bit_vector::new(bit_vector::word_size()); - bit_vector::is_index_set(&bitvector, bit_vector::word_size()); + bitvector.is_index_set(bit_vector::word_size()); } #[test] @@ -59,71 +64,71 @@ module std::bit_vector_tests { #[test] fun test_set_bit_and_index_odd_size() { - test_bitvector_set_unset_of_size(300) + test_bitvector_set_unset_of_size(140) } #[test] fun longest_sequence_no_set_zero_index() { let bitvector = bit_vector::new(100); - assert!(bit_vector::longest_set_sequence_starting_at(&bitvector, 0) == 0, 0); + assert!(bitvector.longest_set_sequence_starting_at(0) == 0); } #[test] fun longest_sequence_one_set_zero_index() { - let bitvector = bit_vector::new(100); - bit_vector::set(&mut bitvector, 1); - assert!(bit_vector::longest_set_sequence_starting_at(&bitvector, 0) == 0, 0); + let mut bitvector = bit_vector::new(100); + bitvector.set(1); + assert!(bitvector.longest_set_sequence_starting_at(0) == 0); } #[test] fun longest_sequence_no_set_nonzero_index() { let bitvector = bit_vector::new(100); - assert!(bit_vector::longest_set_sequence_starting_at(&bitvector, 51) == 0, 0); + assert!(bitvector.longest_set_sequence_starting_at(51) == 0); } #[test] fun longest_sequence_two_set_nonzero_index() { - let bitvector = bit_vector::new(100); - bit_vector::set(&mut bitvector, 50); - bit_vector::set(&mut bitvector, 52); - assert!(bit_vector::longest_set_sequence_starting_at(&bitvector, 51) == 0, 0); + let mut bitvector = bit_vector::new(100); + bitvector.set(50); + bitvector.set(52); + assert!(bitvector.longest_set_sequence_starting_at(51) == 0); } #[test] fun longest_sequence_with_break() { - let bitvector = bit_vector::new(100); - let i = 0; + let mut bitvector = bit_vector::new(100); + let mut i = 0; while (i < 20) { - bit_vector::set(&mut bitvector, i); + bitvector.set(i); i = i + 1; }; // create a break in the run i = i + 1; while (i < 100) { - bit_vector::set(&mut bitvector, i); + bitvector.set(i); i = i + 1; }; - assert!(bit_vector::longest_set_sequence_starting_at(&bitvector, 0) == 20, 0); - assert!(bit_vector::longest_set_sequence_starting_at(&bitvector, 20) == 0, 0); - assert!(bit_vector::longest_set_sequence_starting_at(&bitvector, 21) == 100 - 21, 0); + assert!(bitvector.longest_set_sequence_starting_at(0) == 20); + assert!(bitvector.longest_set_sequence_starting_at(20) == 0); + assert!(bitvector.longest_set_sequence_starting_at(21) == 100 - 21); } #[test] fun test_shift_left() { - let bitlen = 133; - let bitvector = bit_vector::new(bitlen); + let bitlen = 97; + let mut bitvector = bit_vector::new(bitlen); - let i = 0; + let mut i = 0; while (i < bitlen) { - bit_vector::set(&mut bitvector, i); + bitvector.set(i); i = i + 1; }; i = bitlen - 1; while (i > 0) { - assert!(bit_vector::is_index_set(&bitvector, i), 0); - bit_vector::shift_left(&mut bitvector, 1); - assert!(!bit_vector::is_index_set(&bitvector, i), 1); + assert!(bitvector.is_index_set(i)); + bitvector.shift_left(1); + assert!(!bitvector.is_index_set( i)); i = i - 1; }; } @@ -132,21 +137,21 @@ module std::bit_vector_tests { fun test_shift_left_specific_amount() { let bitlen = 300; let shift_amount = 133; - let bitvector = bit_vector::new(bitlen); + let mut bitvector = bit_vector::new(bitlen); - bit_vector::set(&mut bitvector, 201); - assert!(bit_vector::is_index_set(&bitvector, 201), 0); + bitvector.set(201); + assert!(bitvector.is_index_set(201)); - bit_vector::shift_left(&mut bitvector, shift_amount); - assert!(bit_vector::is_index_set(&bitvector, 201 - shift_amount), 1); - assert!(!bit_vector::is_index_set(&bitvector, 201), 2); + bitvector.shift_left(shift_amount); + assert!(bitvector.is_index_set(201 - shift_amount)); + assert!(!bitvector.is_index_set(201)); // Make sure this shift clears all the bits - bit_vector::shift_left(&mut bitvector, bitlen - 1); + bitvector.shift_left(bitlen - 1); - let i = 0; + let mut i = 0; while (i < bitlen) { - assert!(!bit_vector::is_index_set(&bitvector, i), 3); + assert!(!bitvector.is_index_set(i)); i = i + 1; } } @@ -156,28 +161,28 @@ module std::bit_vector_tests { let bitlen = 50; let chosen_index = 24; let shift_amount = 3; - let bitvector = bit_vector::new(bitlen); + let mut bitvector = bit_vector::new(bitlen); - let i = 0; + let mut i = 0; while (i < bitlen) { - bit_vector::set(&mut bitvector, i); + bitvector.set(i); i = i + 1; }; - bit_vector::unset(&mut bitvector, chosen_index); - assert!(!bit_vector::is_index_set(&bitvector, chosen_index), 0); + bitvector.unset(chosen_index); + assert!(!bitvector.is_index_set(chosen_index)); - bit_vector::shift_left(&mut bitvector, shift_amount); + bitvector.shift_left(shift_amount); i = 0; while (i < bitlen) { // only chosen_index - shift_amount and the remaining bits should be BitVector::unset if ((i == chosen_index - shift_amount) || (i >= bitlen - shift_amount)) { - assert!(!bit_vector::is_index_set(&bitvector, i), 1); + assert!(!bitvector.is_index_set(i)); } else { - assert!(bit_vector::is_index_set(&bitvector, i), 2); + assert!(bitvector.is_index_set(i)); }; i = i + 1; } @@ -186,18 +191,18 @@ module std::bit_vector_tests { #[test] fun shift_left_at_size() { let bitlen = 133; - let bitvector = bit_vector::new(bitlen); + let mut bitvector = bit_vector::new(bitlen); - let i = 0; + let mut i = 0; while (i < bitlen) { - bit_vector::set(&mut bitvector, i); + bitvector.set(i); i = i + 1; }; - bit_vector::shift_left(&mut bitvector, bitlen - 1); + bitvector.shift_left(bitlen - 1); i = bitlen - 1; while (i > 0) { - assert!(!bit_vector::is_index_set(&bitvector, i), 1); + assert!(!bitvector.is_index_set( i)); i = i - 1; }; } @@ -205,8 +210,8 @@ module std::bit_vector_tests { #[test] fun shift_left_more_than_size() { let bitlen = 133; - let bitvector = bit_vector::new(bitlen); - bit_vector::shift_left(&mut bitvector, bitlen); + let mut bitvector = bit_vector::new(bitlen); + bitvector.shift_left(bitlen); } #[test] @@ -218,6 +223,6 @@ module std::bit_vector_tests { #[test] fun single_bit_bitvector() { let bitvector = bit_vector::new(1); - assert!(bit_vector::length(&bitvector) == 1, 0); + assert!(bitvector.length() == 1); } } diff --git a/external-crates/move/crates/move-stdlib/tests/fixedpoint32_tests.move b/external-crates/move/crates/move-stdlib/tests/fixedpoint32_tests.move index 83513dbe0cfda..4fd5f847b4ab9 100644 --- a/external-crates/move/crates/move-stdlib/tests/fixedpoint32_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/fixedpoint32_tests.move @@ -1,3 +1,8 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::fixed_point32_tests { use std::fixed_point32; @@ -28,7 +33,7 @@ module std::fixed_point32_tests { #[test] fun create_zero() { let x = fixed_point32::create_from_rational(0, 1); - assert!(fixed_point32::is_zero(x), 0); + assert!(x.is_zero()); } #[test] @@ -75,14 +80,14 @@ module std::fixed_point32_tests { fun exact_multiply() { let f = fixed_point32::create_from_rational(3, 4); // 0.75 let nine = fixed_point32::multiply_u64(12, f); // 12 * 0.75 - assert!(nine == 9, 0); + assert!(nine == 9); } #[test] fun exact_divide() { let f = fixed_point32::create_from_rational(3, 4); // 0.75 let twelve = fixed_point32::divide_u64(9, f); // 9 / 0.75 - assert!(twelve == 12, 0); + assert!(twelve == 12); } #[test] @@ -91,98 +96,19 @@ module std::fixed_point32_tests { let not_three = fixed_point32::multiply_u64(9, copy f); // 9 * 0.333... // multiply_u64 does NOT round -- it truncates -- so values that // are not perfectly representable in binary may be off by one. - assert!(not_three == 2, 0); + assert!(not_three == 2); // Try again with a fraction slightly larger than 1/3. - let f = fixed_point32::create_from_raw_value(fixed_point32::get_raw_value(f) + 1); + let f = fixed_point32::create_from_raw_value(f.get_raw_value() + 1); let three = fixed_point32::multiply_u64(9, f); - assert!(three == 3, 1); + assert!(three == 3); } #[test] fun create_from_rational_max_numerator_denominator() { // Test creating a 1.0 fraction from the maximum u64 value. let f = fixed_point32::create_from_rational(18446744073709551615, 18446744073709551615); - let one = fixed_point32::get_raw_value(f); - assert!(one == 4294967296, 0); // 0x1.00000000 - } - - #[test] - fun min_can_return_smaller_fixed_point_number() { - let one = fixed_point32::create_from_rational(1, 1); - let two = fixed_point32::create_from_rational(2, 1); - let smaller_number1 = fixed_point32::min(one, two); - let val1 = fixed_point32::get_raw_value(smaller_number1); - assert!(val1 == 4294967296, 0); // 0x1.00000000 - let smaller_number2 = fixed_point32::min(two, one); - let val2 = fixed_point32::get_raw_value(smaller_number2); - assert!(val2 == 4294967296, 0); // 0x1.00000000 - } - - #[test] - fun max_can_return_larger_fixed_point_number() { - let one = fixed_point32::create_from_rational(1, 1); - let two = fixed_point32::create_from_rational(2, 1); - let larger_number1 = fixed_point32::max(one, two); - let larger_number2 = fixed_point32::max(two, one); - let val1 = fixed_point32::get_raw_value(larger_number1); - assert!(val1 == 8589934592, 0); // 0x2.00000000 - let val2 = fixed_point32::get_raw_value(larger_number2); - assert!(val2 == 8589934592, 0); // 0x2.00000000 - } - - #[test] - fun floor_can_return_the_correct_number_zero() { - let point_five = fixed_point32::create_from_rational(1, 2); - let val = fixed_point32::floor(point_five); - assert!(val == 0, 0); - } - - #[test] - fun create_from_u64_create_correct_fixed_point_number() { - let one = fixed_point32::create_from_u64(1); - let val = fixed_point32::get_raw_value(one); - assert!(val == 4294967296, 0); - } - - #[test] - #[expected_failure(abort_code = fixed_point32::ERATIO_OUT_OF_RANGE)] - fun create_from_u64_throw_error_when_number_too_large() { - fixed_point32::create_from_u64(4294967296); // (u64 >> 32) + 1 - } - - #[test] - fun floor_can_return_the_correct_number_one() { - let three_point_five = fixed_point32::create_from_rational(7, 2); // 3.5 - let val = fixed_point32::floor(three_point_five); - assert!(val == 3, 0); - } - - #[test] - fun ceil_can_round_up_correctly() { - let point_five = fixed_point32::create_from_rational(1, 2); // 0.5 - let val = fixed_point32::ceil(point_five); - assert!(val == 1, 0); - } - - #[test] - fun ceil_will_not_change_if_number_already_integer() { - let one = fixed_point32::create_from_rational(1, 1); // 0.5 - let val = fixed_point32::ceil(one); - assert!(val == 1, 0); - } - - #[test] - fun round_can_round_up_correctly() { - let point_five = fixed_point32::create_from_rational(1, 2); // 0.5 - let val = fixed_point32::round(point_five); - assert!(val == 1, 0); - } - - #[test] - fun round_can_round_down_correctly() { - let num = fixed_point32::create_from_rational(499, 1000); // 0.499 - let val = fixed_point32::round(num); - assert!(val == 0, 0); + let one = f.get_raw_value(); + assert!(one == 4294967296); // 0x1.00000000 } } diff --git a/external-crates/move/crates/move-stdlib/tests/hash_tests.move b/external-crates/move/crates/move-stdlib/tests/hash_tests.move index 449f7b914bae7..8b309c30e1f75 100644 --- a/external-crates/move/crates/move-stdlib/tests/hash_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/hash_tests.move @@ -1,3 +1,8 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::hash_tests { use std::hash; @@ -6,13 +11,13 @@ module std::hash_tests { fun sha2_256_expected_hash() { let input = x"616263"; let expected_output = x"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"; - assert!(hash::sha2_256(input) == expected_output, 0); + assert!(hash::sha2_256(input) == expected_output); } #[test] fun sha3_256_expected_hash() { let input = x"616263"; let expected_output = x"3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532"; - assert!(hash::sha3_256(input) == expected_output, 0); + assert!(hash::sha3_256(input) == expected_output); } } diff --git a/external-crates/move/crates/move-stdlib/tests/integer_tests.move b/external-crates/move/crates/move-stdlib/tests/integer_tests.move new file mode 100644 index 0000000000000..07d940b7a86d4 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/tests/integer_tests.move @@ -0,0 +1,220 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// helpers for integer tests +#[test_only] +module std::integer_tests { + use std::unit_test::assert_eq; + + public(package) macro fun cases($max: _, $cases: vector<_>, $f: |_, _, _|) { + let mut cases = $cases; + let max_pred = $max - 1; + while (!cases.is_empty()) { + let case = cases.pop_back(); + let case_pred = case.max(1) - 1; + let case_succ = case.min(max_pred) + 1; + $f(case_pred, case, case_succ); + } + } + + public(package) macro fun test_max($max: _, $cases: vector<_>) { + let max = $max; + let cases = $cases; + assert_eq!(max.max(max), max); + cases!(max, cases, |case_pred, case, case_succ| { + assert_eq!(max.max(case), max); + assert_eq!(case.max(max), max); + assert_eq!(case.max(case), case); + assert_eq!(case_pred.max(case), case); + assert_eq!(case_succ.max(case), case_succ); + }) + } + + public(package) macro fun test_min($max: _, $cases: vector<_>) { + let max = $max; + let cases = $cases; + assert_eq!(max.min(max), max); + cases!(max, cases, |case_pred, case, case_succ| { + assert_eq!(max.min(case), case); + assert_eq!(case.min(max), case); + assert_eq!(case.min(case), case); + assert_eq!(case_pred.min(case), case_pred); + assert_eq!(case_succ.min(case), case); + }) + } + + public(package) macro fun test_diff($max: _, $cases: vector<_>) { + let max = $max; + let cases = $cases; + assert_eq!(max.diff(max), 0); + cases!(max, cases, |case_pred, case, case_succ| { + assert_eq!(max.diff(case), max - case); + assert_eq!(case.diff(max), max - case); + assert_eq!(case.diff(case), 0); + assert_eq!(case_pred.diff(case), case - case_pred); + assert_eq!(case.diff(case_pred), case - case_pred); + assert_eq!(case_succ.diff(case), case_succ - case); + assert_eq!(case.diff(case_succ), case_succ - case); + }) + } + + public(package) macro fun check_div_round($x: _, $y: _) { + let x = $x; + let y = $y; + if (y == 0) return; + assert_eq!(x.divide_and_round_up(y), (x / y) + (x % y).min(1)); + } + + public(package) macro fun test_divide_and_round_up($max: _, $cases: vector<_>) { + let max = $max; + let cases = $cases; + assert_eq!(max.divide_and_round_up(max), 1); + check_div_round!(max, max); + cases!(max, cases, |case_pred, case, case_succ| { + check_div_round!(max, case); + check_div_round!(case, max); + check_div_round!(case, case); + check_div_round!(case_pred, case); + check_div_round!(case, case_pred); + check_div_round!(case_succ, case); + check_div_round!(case, case_succ); + }) + } + + public(package) macro fun slow_pow($base: _, $exp: u8): _ { + let base = $base; + let mut exp = $exp; + let mut result = 1; + while (exp > 0) { + result = result * base; + exp = exp - 1; + }; + result + } + + public(package) macro fun test_pow<$T>($max: $T, $cases: vector<$T>) { + let max = $max; + let cases = $cases; + cases!(max, cases, |case_pred, case, case_succ| { + assert_eq!(case_pred.pow(0), 1); + assert_eq!(case_pred.pow(1), case_pred); + assert_eq!(case.pow(0), 1); + assert_eq!(case.pow(1), case); + assert_eq!(case_succ.pow(0), 1); + assert_eq!(case_succ.pow(1), case_succ); + }); + assert_eq!((0: $T).pow(2), 0); + assert_eq!((1: $T).pow(255), 1); + assert_eq!((2: $T).pow(7), slow_pow!((2: $T), 7)); + assert_eq!((3: $T).pow(5), slow_pow!((3: $T), 5)); + } + + public(package) macro fun test_sqrt<$T>( + $max: $T, + $bound_cases: vector<$T>, + $reflexive_cases: vector<$T>, + ) { + let max = $max; + let cases = $bound_cases; + // logical bounds cases + let max_sqrt = max.sqrt(); + cases!(max, cases, |case_pred, case, case_succ| { + let sqrt_pred = case_pred.sqrt(); + assert!(sqrt_pred * sqrt_pred <= case_pred); + let sqrt = case.sqrt(); + assert!(sqrt * sqrt <= case); + let sqrt_succ = case_succ.sqrt(); + assert!(sqrt_succ * sqrt_succ <= case_succ); + + if (sqrt_pred >= max_sqrt) return; + assert!((sqrt_pred + 1) * (sqrt_pred + 1) > case_pred); + + if (sqrt >= max_sqrt) return; + assert!((sqrt + 1) * (sqrt + 1) > case); + + if (sqrt_succ >= max_sqrt) return; + assert!((sqrt_succ + 1) * (sqrt_succ + 1) > case_succ); + }); + + // simple reflexive cases + let cases: vector<$T> = $reflexive_cases; + cases!(max, cases, |case_pred, case, case_succ| { + assert_eq!((case_pred * case_pred).sqrt(), case_pred); + assert_eq!((case * case).sqrt(), case); + assert_eq!((case_succ * case_succ).sqrt(), case_succ); + }); + + // test that the square of a non perfect square is the most recent square root perfect + // square, rounding down + let mut cases: vector<$T> = vector[2, 3, 4, 5, 6]; + while (!cases.is_empty()) { + let case = cases.pop_back(); + let prev = case - 1; + let square = case * case; + let prev_suare = prev * prev; + let mut i = prev_suare; + while (i < square) { + assert_eq!(i.sqrt(), prev); + i = i + 1; + } + } + } + + public(package) macro fun sum_range<$T>($n: $T): $T { + let n = $n; + (n * (n + 1)) / 2 + } + + public(package) macro fun test_dos_case<$T>($case: $T) { + let case = $case; + let mut sum: $T = 0; + case.do!(|i| sum = sum + i); + assert_eq!(sum, sum_range!(case - 1)); + + sum = 0; + case.do_eq!(|i| sum = sum + i); + assert_eq!(sum, sum_range!(case)); + + let half = case / 2; + + sum = 0; + half.range_do!(case, |i| sum = sum + i); + assert_eq!(sum, sum_range!(case - 1) - sum_range!(half - 1)); + + sum = 0; + half.range_do_eq!(case, |i| sum = sum + i); + assert_eq!(sum, sum_range!(case) - sum_range!(half - 1)); + } + + public(package) macro fun test_dos<$T>($max: $T, $cases: vector<$T>) { + let max = $max; + let cases = $cases; + // test bounds/invalid ranges + (0: $T).do!(|_| assert!(false)); + cases!(max, cases, |case_pred, case, case_succ| { + if (case == 0) return; + case.range_do!(0, |_| assert!(false)); + case.range_do_eq!(0, |_| assert!(false)); + + if (case == max) return; + case.range_do!(case_pred, |_| assert!(false)); + case_succ.range_do!(case, |_| assert!(false)); + case.range_do_eq!(case_pred, |_| assert!(false)); + case_succ.range_do_eq!(case, |_| assert!(false)); + }); + + // test upper bound being max + let max_pred = max - 1; + max_pred.range_do_eq!(max, |_| ()); + + // test iteration numbers + let cases: vector<$T> = vector[3, 5, 8, 11, 14]; + cases!(max, cases, |case_pred, case, case_succ| { + test_dos_case!(case_pred); + test_dos_case!(case); + test_dos_case!(case_succ); + }); + } + + +} diff --git a/external-crates/move/crates/move-stdlib/tests/move_unit_test.rs b/external-crates/move/crates/move-stdlib/tests/move_unit_test.rs deleted file mode 100644 index 538b08c3e8718..0000000000000 --- a/external-crates/move/crates/move-stdlib/tests/move_unit_test.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// SPDX-License-Identifier: Apache-2.0 - -use move_cli::base::test::{run_move_unit_tests, UnitTestResult}; -use move_core_types::account_address::AccountAddress; -use move_stdlib::path_in_crate; -use move_stdlib_natives::{all_natives, nursery_natives, GasParameters, NurseryGasParameters}; -use move_unit_test::UnitTestingConfig; -use tempfile::tempdir; - -fn run_tests_for_pkg(path_to_pkg: impl Into, include_nursery_natives: bool) { - let pkg_path = path_in_crate(path_to_pkg); - - let mut natives = all_natives( - AccountAddress::from_hex_literal("0x1").unwrap(), - GasParameters::zeros(), - ); - if include_nursery_natives { - natives.extend(nursery_natives( - /* silent */ false, - AccountAddress::from_hex_literal("0x1").unwrap(), - NurseryGasParameters::zeros(), - )) - } - - let result = run_move_unit_tests( - &pkg_path, - move_package::BuildConfig { - test_mode: true, - install_dir: Some(tempdir().unwrap().path().to_path_buf()), - ..Default::default() - }, - UnitTestingConfig::default_with_bound(Some(1_000_000_000)), - natives, - None, - /* compute_coverage */ false, - &mut std::io::stdout(), - ) - .unwrap(); - if result.0 != UnitTestResult::Success { - panic!("aborting because of Move unit test failures"); - } -} - -#[test] -fn move_unit_tests() { - run_tests_for_pkg(".", false); - run_tests_for_pkg("nursery", true); -} diff --git a/external-crates/move/crates/move-stdlib/tests/move_verification_test.rs b/external-crates/move/crates/move-stdlib/tests/move_verification_test.rs deleted file mode 100644 index 2a5dbffb18fa8..0000000000000 --- a/external-crates/move/crates/move-stdlib/tests/move_verification_test.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// SPDX-License-Identifier: Apache-2.0 - -// TODO: split this into individual tests once the package system supports this. - -#[test] -fn prove() { - // TODO re-enable when the prover works again - // use move_cli::base::prove::ProverTest; - // ProverTest::create(".").run(); - // ProverTest::create("nursery").run() -} diff --git a/external-crates/move/crates/move-stdlib/tests/option_tests.move b/external-crates/move/crates/move-stdlib/tests/option_tests.move index 950a940dc4207..a8cb8875d5495 100644 --- a/external-crates/move/crates/move-stdlib/tests/option_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/option_tests.move @@ -1,20 +1,22 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::option_tests { - use std::option; - use std::vector; - #[test] fun option_none_is_none() { let none = option::none(); - assert!(option::is_none(&none), 0); - assert!(!option::is_some(&none), 1); + assert!(none.is_none()); + assert!(!none.is_some()); } #[test] fun option_some_is_some() { let some = option::some(5); - assert!(!option::is_none(&some), 0); - assert!(option::is_some(&some), 1); + assert!(!some.is_none()); + assert!(some.is_some()); } #[test] @@ -22,149 +24,197 @@ module std::option_tests { let none = option::none(); let some = option::some(5); let some_other = option::some(6); - assert!(option::contains(&some, &5), 0); - assert!(option::contains(&some_other, &6), 1); - assert!(!option::contains(&none, &5), 2); - assert!(!option::contains(&some_other, &5), 3); + assert!(some.contains(&5)); + assert!(some_other.contains(&6)); + assert!(!none.contains(&5)); + assert!(!some_other.contains(&5)); } #[test] fun option_borrow_some() { let some = option::some(5); let some_other = option::some(6); - assert!(*option::borrow(&some) == 5, 3); - assert!(*option::borrow(&some_other) == 6, 4); + assert!(*some.borrow() == 5); + assert!(*some_other.borrow() == 6); } #[test] #[expected_failure(abort_code = option::EOPTION_NOT_SET)] fun option_borrow_none() { - option::borrow(&option::none()); + option::none().borrow(); } #[test] fun borrow_mut_some() { - let some = option::some(1); - let ref = option::borrow_mut(&mut some); + let mut some = option::some(1); + let ref = some.borrow_mut(); *ref = 10; - assert!(*option::borrow(&some) == 10, 0); + assert!(*some.borrow() == 10); } #[test] #[expected_failure(abort_code = option::EOPTION_NOT_SET)] fun borrow_mut_none() { - option::borrow_mut(&mut option::none()); + option::none().borrow_mut(); } #[test] fun borrow_with_default() { let none = option::none(); let some = option::some(5); - assert!(*option::borrow_with_default(&some, &7) == 5, 0); - assert!(*option::borrow_with_default(&none, &7) == 7, 1); + assert!(*some.borrow_with_default(&7) == 5); + assert!(*none.borrow_with_default(&7) == 7); } #[test] fun get_with_default() { let none = option::none(); let some = option::some(5); - assert!(option::get_with_default(&some, 7) == 5, 0); - assert!(option::get_with_default(&none, 7) == 7, 1); + assert!(option::get_with_default(&some, 7) == 5); + assert!(option::get_with_default(&none, 7) == 7); } #[test] fun extract_some() { - let opt = option::some(1); - assert!(option::extract(&mut opt) == 1, 0); - assert!(option::is_none(&opt), 1); + let mut opt = option::some(1); + assert!(opt.extract() == 1); + assert!(opt.is_none()); } #[test] #[expected_failure(abort_code = option::EOPTION_NOT_SET)] fun extract_none() { - option::extract(&mut option::none()); + option::none().extract(); } #[test] fun swap_some() { - let some = option::some(5); - assert!(option::swap(&mut some, 1) == 5, 0); - assert!(*option::borrow(&some) == 1, 1); + let mut some = option::some(5); + assert!(some.swap(1) == 5); + assert!(*some.borrow() == 1); } #[test] fun swap_or_fill_some() { - let some = option::some(5); - assert!(option::swap_or_fill(&mut some, 1) == option::some(5), 0); - assert!(*option::borrow(&some) == 1, 1); + let mut some = option::some(5); + assert!(some.swap_or_fill(1) == option::some(5)); + assert!(*some.borrow() == 1); } #[test] fun swap_or_fill_none() { - let none = option::none(); - assert!(option::swap_or_fill(&mut none, 1) == option::none(), 0); - assert!(*option::borrow(&none) == 1, 1); + let mut none = option::none(); + assert!(none.swap_or_fill(1) == option::none()); + assert!(*none.borrow() == 1); } #[test] #[expected_failure(abort_code = option::EOPTION_NOT_SET)] fun swap_none() { - option::swap(&mut option::none(), 1); + option::none().swap(1); } #[test] fun fill_none() { - let none = option::none(); - option::fill(&mut none, 3); - assert!(option::is_some(&none), 0); - assert!(*option::borrow(&none) == 3, 1); + let mut none = option::none(); + none.fill(3); + assert!(none.is_some()); + assert!(*none.borrow() == 3); } #[test] #[expected_failure(abort_code = option::EOPTION_IS_SET)] fun fill_some() { - option::fill(&mut option::some(3), 0); + option::some(3).fill(0); } #[test] fun destroy_with_default() { - assert!(option::destroy_with_default(option::none(), 4) == 4, 0); - assert!(option::destroy_with_default(option::some(4), 5) == 4, 1); + assert!(option::none().destroy_with_default(4) == 4); + assert!(option::some(4).destroy_with_default(5) == 4); } #[test] fun destroy_some() { - assert!(option::destroy_some(option::some(4)) == 4, 0); + assert!(option::some(4).destroy_some() == 4); } #[test] #[expected_failure(abort_code = option::EOPTION_NOT_SET)] fun destroy_some_none() { - option::destroy_some(option::none()); + option::none().destroy_some(); } #[test] fun destroy_none() { - option::destroy_none(option::none()); + option::none().destroy_none(); } #[test] #[expected_failure(abort_code = option::EOPTION_IS_SET)] fun destroy_none_some() { - option::destroy_none(option::some(0)); + option::some(0).destroy_none(); } #[test] fun into_vec_some() { - let v = option::to_vec(option::some(0)); - assert!(vector::length(&v) == 1, 0); - let x = vector::pop_back(&mut v); - assert!(x == 0, 1); + let mut v = option::some(0).to_vec(); + assert!(v.length() == 1); + let x = v.pop_back(); + assert!(x == 0); } #[test] fun into_vec_none() { - let v: vector = option::to_vec(option::none()); - assert!(vector::is_empty(&v), 0); + let v: vector = option::none().to_vec(); + assert!(v.is_empty()); + } + + // === Macros === + + #[test] + fun do_destroy() { + let mut counter = 0; + option::some(5).destroy!(|x| counter = x); + option::some(10).do!(|x| counter = counter + x); + + assert!(counter == 15); + } + + #[test] + fun do_ref_mut() { + let mut counter = 0; + let mut opt = option::some(5); + opt.do_mut!(|x| *x = 100); + opt.do_ref!(|x| counter = *x); + + assert!(counter == 100); + } + + #[test] + fun map_map_ref() { + assert!(option::some(5).map!(|x| vector[x]) == option::some(vector[5])); + assert!(option::some(5).map_ref!(|x| vector[*x]) == option::some(vector[5])); + assert!(option::none().map!(|x| vector[x]) == option::none()); + assert!(option::none().map_ref!(|x| vector[*x]) == option::none()); + } + + #[test] + fun filter() { + assert!(option::some(5).filter!(|x| *x == 5) == option::some(5)); + assert!(option::some(5).filter!(|x| *x == 6) == option::none()); + } + + #[test] + fun is_some_and() { + assert!(option::some(5).is_some_and!(|x| *x == 5)); + assert!(!option::some(5).is_some_and!(|x| *x == 6)); + assert!(!option::none().is_some_and!(|x| *x == 5)); + } + + #[test] + fun destroy_or() { + assert!(option::none().destroy_or!(10) == 10); + assert!(option::some(5).destroy_or!(10) == 5); } } diff --git a/external-crates/move/crates/move-stdlib/tests/string_tests.move b/external-crates/move/crates/move-stdlib/tests/string_tests.move index e7810a3422262..bf99e678860d0 100644 --- a/external-crates/move/crates/move-stdlib/tests/string_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/string_tests.move @@ -1,3 +1,8 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::string_tests { use std::string; @@ -5,74 +10,79 @@ module std::string_tests { #[test] fun test_valid_utf8() { let sparkle_heart = vector[240, 159, 146, 150]; - let s = string::utf8(sparkle_heart); - assert!(string::length(&s) == 4, 22); + let s = sparkle_heart.to_string(); + assert!(s.length() == 4); } #[test] - #[expected_failure(abort_code = string::EINVALID_UTF8)] + #[expected_failure(abort_code = string::EInvalidUTF8)] fun test_invalid_utf8() { let no_sparkle_heart = vector[0, 159, 146, 150]; - let s = string::utf8(no_sparkle_heart); - assert!(string::length(&s) == 1, 22); + let s = no_sparkle_heart.to_string(); + assert!(s.length() == 1); } #[test] - fun test_sub_string() { - let s = string::utf8(b"abcd"); - let sub = string::sub_string(&s, 2, 4); - assert!(sub == string::utf8(b"cd"), 22) + fun test_substring() { + let s = b"abcd".to_string(); + let sub = s.substring(2, 4); + assert!(sub == b"cd".to_string()) } #[test] - #[expected_failure(abort_code = string::EINVALID_INDEX)] - fun test_sub_string_invalid_boundary() { + #[expected_failure(abort_code = string::EInvalidIndex)] + fun test_substring_invalid_boundary() { let sparkle_heart = vector[240, 159, 146, 150]; - let s = string::utf8(sparkle_heart); - let _sub = string::sub_string(&s, 1, 4); + let s = sparkle_heart.to_string(); + let _sub = s.substring(1, 4); } #[test] - #[expected_failure(abort_code = string::EINVALID_INDEX)] - fun test_sub_string_invalid_index() { - let s = string::utf8(b"abcd"); - let _sub = string::sub_string(&s, 4, 5); + #[expected_failure(abort_code = string::EInvalidIndex)] + fun test_substring_invalid_index() { + let s = b"abcd".to_string(); + let _sub = s.substring(4, 5); } #[test] - fun test_sub_string_empty() { - let s = string::utf8(b"abcd"); - let sub = string::sub_string(&s, 4, 4); - assert!(string::is_empty(&sub), 22) + fun test_substring_empty() { + let s = b"abcd".to_string(); + let sub = s.substring(4, 4); + assert!(sub.is_empty()) } #[test] fun test_index_of() { - let s = string::utf8(b"abcd"); - let r = string::utf8(b"bc"); - let p = string::index_of(&s, &r); - assert!(p == 1, 22) + let s = b"abcd".to_string(); + let r = b"bc".to_string(); + let p = s.index_of(&r); + assert!(p == 1) } #[test] fun test_index_of_fail() { - let s = string::utf8(b"abcd"); - let r = string::utf8(b"bce"); - let p = string::index_of(&s, &r); - assert!(p == 4, 22) + let s = b"abcd".to_string(); + let r = b"bce".to_string(); + let p = s.index_of(&r); + assert!(p == 4) } #[test] fun test_append() { - let s = string::utf8(b"abcd"); - string::append(&mut s, string::utf8(b"ef")); - assert!(s == string::utf8(b"abcdef"), 22) + let mut s = b"abcd".to_string(); + s.append(b"ef".to_string()); + assert!(s == b"abcdef".to_string()) } #[test] fun test_insert() { - let s = string::utf8(b"abcd"); - string::insert(&mut s, 1, string::utf8(b"xy")); - assert!(s == string::utf8(b"axybcd"), 22) + let mut s = b"abcd".to_string(); + s.insert(1, b"xy".to_string()); + assert!(s == b"axybcd".to_string()) + } + + #[test] + fun test_into_bytes() { + assert!(b"abcd" == b"abcd".to_string().into_bytes()) } } diff --git a/external-crates/move/crates/move-stdlib/tests/type_name_tests.move b/external-crates/move/crates/move-stdlib/tests/type_name_tests.move index 48c1ba2edc1a5..256c31c901fa8 100644 --- a/external-crates/move/crates/move-stdlib/tests/type_name_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/type_name_tests.move @@ -1,47 +1,104 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + // note: intentionally using 0xa here to test non-0x1 module addresses module 0xA::type_name_tests { #[test_only] - use std::type_name::{get, into_string}; + use std::type_name::{get, into_string, is_primitive, get_address, get_module}; #[test_only] use std::ascii::string; - struct TestStruct {} + public struct TestStruct {} - struct TestGenerics { } + public struct TestGenerics { } - struct TestMultiGenerics { } + public struct TestMultiGenerics { } #[test] - fun test_ground_types() { - assert!(into_string(get()) == string(b"u8"), 0); - assert!(into_string(get()) == string(b"u64"), 0); - assert!(into_string(get()) == string(b"u128"), 0); - assert!(into_string(get
()) == string(b"address"), 0); - assert!(into_string(get()) == string(b"signer"), 0); - assert!(into_string(get>()) == string(b"vector"), 0) + fun test_primitive_types() { + assert!(into_string(get()) == string(b"u8")); + assert!(into_string(get()) == string(b"u16")); + assert!(into_string(get()) == string(b"u32")); + assert!(into_string(get()) == string(b"u64")); + assert!(into_string(get()) == string(b"u128")); + assert!(into_string(get()) == string(b"u256")); + assert!(into_string(get
()) == string(b"address")); + assert!(into_string(get>()) == string(b"vector")); + assert!(into_string(get>>()) == string(b"vector>")); + assert!(into_string(get>>()) == string(b"vector>")); } - // Note: these tests assume a 16 byte address length, and will fail on platforms where addresses are 20 or 32 bytes + #[test] + fun test_is_primitive() { + assert!(is_primitive(&get())); + assert!(is_primitive(&get())); + assert!(is_primitive(&get())); + assert!(is_primitive(&get())); + assert!(is_primitive(&get())); + assert!(is_primitive(&get())); + assert!(is_primitive(&get
())); + assert!(is_primitive(&get>())); + assert!(is_primitive(&get>>())); + assert!(is_primitive(&get>>())); + } + + // Note: these tests assume a 32 byte address length #[test] fun test_structs() { - assert!(into_string(get()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestStruct"), 0); - assert!(into_string(get()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::ascii::String"), 0); - assert!(into_string(get>()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::option::Option"), 0); - assert!(into_string(get()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::string::String"), 0); + assert!(into_string(get()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestStruct")); + assert!(into_string(get()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::ascii::String")); + assert!(into_string(get>()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::option::Option")); + assert!(into_string(get()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::string::String")); } - // Note: these tests assume a 16 byte address length, and will fail on platforms where addresses are 20 or 32 bytes + // Note: these tests assume a 32 byte address length #[test] fun test_generics() { - assert!(into_string(get>()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics<0000000000000000000000000000000000000000000000000000000000000001::string::String>"), 0); - assert!(into_string(get>>()) == string(b"vector<000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics>"), 0); - assert!(into_string(get>>()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::option::Option<000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics>"), 0); + assert!(into_string(get>()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics<0000000000000000000000000000000000000000000000000000000000000001::string::String>")); + assert!(into_string(get>>()) == string(b"vector<000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics>")); + assert!(into_string(get>>()) == string(b"0000000000000000000000000000000000000000000000000000000000000001::option::Option<000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics>")); } - // Note: these tests assume a 16 byte address length, and will fail on platforms where addresses are 20 or 32 bytes + // Note: these tests assume a 32 byte address length #[test] fun test_multi_generics() { - assert!(into_string(get>()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestMultiGenerics"), 0); - assert!(into_string(get, TestGenerics>>()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestMultiGenerics,000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics>"), 0); + assert!(into_string(get>()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestMultiGenerics")); + assert!(into_string(get, TestGenerics>>()) == string(b"000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestMultiGenerics,000000000000000000000000000000000000000000000000000000000000000a::type_name_tests::TestGenerics>")); + } + + #[test] + fun test_get_address() { + assert!(get_address(&get()) == string(b"0000000000000000000000000000000000000000000000000000000000000001")); + assert!(get_address(&get()) == string(b"000000000000000000000000000000000000000000000000000000000000000a")); + assert!(get_address(&get>()) == string(b"000000000000000000000000000000000000000000000000000000000000000a")); + } + + #[test] + fun test_get_module() { + assert!(get_module(&get()) == string(b"ascii")); + assert!(get_module(&get()) == string(b"type_name_tests")); + assert!(get_module(&get>()) == string(b"type_name_tests")); + } + + #[test, expected_failure(abort_code = std::type_name::ENonModuleType)] + fun test_get_address_aborts_with_primitive() { + get_address(&get()); + } + + #[test, expected_failure(abort_code = std::type_name::ENonModuleType)] + fun test_get_module_aborts_with_primitive() { + get_module(&get()); + } + + #[test, expected_failure(abort_code = std::type_name::ENonModuleType)] + fun test_get_address_aborts_with_primitive_generic() { + get_address(&get>()); + } + + #[test, expected_failure(abort_code = std::type_name::ENonModuleType)] + fun test_get_module_aborts_with_primitive_generic() { + get_module(&get>>()); } } diff --git a/external-crates/move/crates/move-stdlib/tests/u128_tests.move b/external-crates/move/crates/move-stdlib/tests/u128_tests.move new file mode 100644 index 0000000000000..315190be0589b --- /dev/null +++ b/external-crates/move/crates/move-stdlib/tests/u128_tests.move @@ -0,0 +1,78 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module std::u128_tests { + use std::integer_tests; + use std::unit_test::assert_eq; + + const BIT_SIZE: u8 = 128; + const MAX: u128 = 0xFFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF; + const MAX_PRED: u128 = MAX - 1; + + const CASES: vector = vector[ + 0, + 1, + 10, + 11, + 100, + 111, + 1 << (BIT_SIZE / 2 - 1), + (1 << (BIT_SIZE / 2 - 1)) + 1, + 1 << (BIT_SIZE - 1), + (1 << (BIT_SIZE - 1)) + 1, + MAX / 2, + (MAX / 2) + 1, + MAX_PRED, + MAX, + ]; + + #[test] + fun test_max() { + integer_tests::test_max!(MAX, CASES); + } + + #[test] + fun test_min() { + integer_tests::test_min!(MAX, CASES); + } + + #[test] + fun test_diff() { + integer_tests::test_diff!(MAX, CASES); + } + + #[test] + fun test_divide_and_round_up() { + integer_tests::test_divide_and_round_up!(MAX, CASES); + } + + #[test, expected_failure(arithmetic_error, location = std::u8)] + fun test_divide_and_round_up_error() { + 1u8.divide_and_round_up(0); + } + + #[test] + fun test_pow() { + integer_tests::test_pow!(MAX, CASES); + assert_eq!(2u128.pow(12), integer_tests::slow_pow!(2u128, 12)); + assert_eq!(3u128.pow(27), integer_tests::slow_pow!(3u128, 27)); + } + + #[test, expected_failure(arithmetic_error, location = std::u16)] + fun test_pow_overflow() { + 255u16.pow(255); + } + + #[test] + fun test_sqrt() { + let reflexive_cases = + vector[0, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59]; + integer_tests::test_sqrt!(MAX, CASES, reflexive_cases) + } + + #[test] + fun test_dos() { + integer_tests::test_dos!(MAX, CASES); + } +} diff --git a/external-crates/move/crates/move-stdlib/tests/u16_tests.move b/external-crates/move/crates/move-stdlib/tests/u16_tests.move new file mode 100644 index 0000000000000..f872acf70f988 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/tests/u16_tests.move @@ -0,0 +1,78 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module std::u16_tests { + use std::integer_tests; + use std::unit_test::assert_eq; + + const BIT_SIZE: u8 = 16; + const MAX: u16 = 0xFFFF; + const MAX_PRED: u16 = MAX - 1; + + const CASES: vector = vector[ + 0, + 1, + 10, + 11, + 100, + 111, + 1 << (BIT_SIZE / 2 - 1), + (1 << (BIT_SIZE / 2 - 1)) + 1, + 1 << (BIT_SIZE - 1), + (1 << (BIT_SIZE - 1)) + 1, + MAX / 2, + (MAX / 2) + 1, + MAX_PRED, + MAX, + ]; + + #[test] + fun test_max() { + integer_tests::test_max!(MAX, CASES); + } + + #[test] + fun test_min() { + integer_tests::test_min!(MAX, CASES); + } + + #[test] + fun test_diff() { + integer_tests::test_diff!(MAX, CASES); + } + + #[test] + fun test_divide_and_round_up() { + integer_tests::test_divide_and_round_up!(MAX, CASES); + } + + #[test, expected_failure(arithmetic_error, location = std::u8)] + fun test_divide_and_round_up_error() { + 1u8.divide_and_round_up(0); + } + + #[test] + fun test_pow() { + integer_tests::test_pow!(MAX, CASES); + assert_eq!(2u16.pow(12), integer_tests::slow_pow!(2u16, 12)); + assert_eq!(3u16.pow(10), integer_tests::slow_pow!(3u16, 10)); + } + + #[test, expected_failure(arithmetic_error, location = std::u16)] + fun test_pow_overflow() { + 255u16.pow(255); + } + + #[test] + fun test_sqrt() { + let reflexive_cases = + vector[0, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59]; + integer_tests::test_sqrt!(MAX, CASES, reflexive_cases) + } + + #[test] + fun test_dos() { + integer_tests::test_dos!(MAX, CASES); + } +} diff --git a/external-crates/move/crates/move-stdlib/tests/u256_tests.move b/external-crates/move/crates/move-stdlib/tests/u256_tests.move new file mode 100644 index 0000000000000..eff171bf43fa0 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/tests/u256_tests.move @@ -0,0 +1,72 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module std::u256_tests { + use std::integer_tests; + use std::unit_test::assert_eq; + + const BIT_SIZE: u8 = 255; + const MAX: u256 = + 0xFFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF; + const MAX_PRED: u256 = MAX - 1; + + const CASES: vector = vector[ + 0, + 1, + 10, + 11, + 100, + 111, + 1 << (BIT_SIZE / 2), + (1 << (BIT_SIZE / 2)) + 1, + 1 << BIT_SIZE, + (1 << BIT_SIZE) + 1, + MAX / 2, + (MAX / 2) + 1, + MAX_PRED, + MAX, + ]; + + #[test] + fun test_max() { + integer_tests::test_max!(MAX, CASES); + } + + #[test] + fun test_min() { + integer_tests::test_min!(MAX, CASES); + } + + #[test] + fun test_diff() { + integer_tests::test_diff!(MAX, CASES); + } + + #[test] + fun test_divide_and_round_up() { + integer_tests::test_divide_and_round_up!(MAX, CASES); + } + + #[test, expected_failure(arithmetic_error, location = std::u8)] + fun test_divide_and_round_up_error() { + 1u8.divide_and_round_up(0); + } + + #[test] + fun test_pow() { + integer_tests::test_pow!(MAX, CASES); + assert_eq!(2u256.pow(12), integer_tests::slow_pow!(2u256, 12)); + assert_eq!(3u256.pow(27), integer_tests::slow_pow!(3u256, 27)); + } + + #[test, expected_failure(arithmetic_error, location = std::u256)] + fun test_pow_overflow() { + 255u256.pow(255); + } + + #[test] + fun test_dos() { + integer_tests::test_dos!(MAX, CASES); + } +} diff --git a/external-crates/move/crates/move-stdlib/tests/u32_tests.move b/external-crates/move/crates/move-stdlib/tests/u32_tests.move new file mode 100644 index 0000000000000..c2890c1d5cff9 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/tests/u32_tests.move @@ -0,0 +1,78 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module std::u32_tests { + use std::integer_tests; + use std::unit_test::assert_eq; + + const BIT_SIZE: u8 = 32; + const MAX: u32 = 0xFFFF_FFFF; + const MAX_PRED: u32 = MAX - 1; + + const CASES: vector = vector[ + 0, + 1, + 10, + 11, + 100, + 111, + 1 << (BIT_SIZE / 2 - 1), + (1 << (BIT_SIZE / 2 - 1)) + 1, + 1 << (BIT_SIZE - 1), + (1 << (BIT_SIZE - 1)) + 1, + MAX / 2, + (MAX / 2) + 1, + MAX_PRED, + MAX, + ]; + + #[test] + fun test_max() { + integer_tests::test_max!(MAX, CASES); + } + + #[test] + fun test_min() { + integer_tests::test_min!(MAX, CASES); + } + + #[test] + fun test_diff() { + integer_tests::test_diff!(MAX, CASES); + } + + #[test] + fun test_divide_and_round_up() { + integer_tests::test_divide_and_round_up!(MAX, CASES); + } + + #[test, expected_failure(arithmetic_error, location = std::u8)] + fun test_divide_and_round_up_error() { + 1u8.divide_and_round_up(0); + } + + #[test] + fun test_pow() { + integer_tests::test_pow!(MAX, CASES); + assert_eq!(2u32.pow(12), integer_tests::slow_pow!(2u32, 12)); + assert_eq!(3u32.pow(20), integer_tests::slow_pow!(3u32, 20)); + } + + #[test, expected_failure(arithmetic_error, location = std::u32)] + fun test_pow_overflow() { + 255u32.pow(255); + } + + #[test] + fun test_sqrt() { + let reflexive_cases = + vector[0, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59]; + integer_tests::test_sqrt!(MAX, CASES, reflexive_cases) + } + + #[test] + fun test_dos() { + integer_tests::test_dos!(MAX, CASES); + } +} diff --git a/external-crates/move/crates/move-stdlib/tests/u64_tests.move b/external-crates/move/crates/move-stdlib/tests/u64_tests.move new file mode 100644 index 0000000000000..aee0790856f0f --- /dev/null +++ b/external-crates/move/crates/move-stdlib/tests/u64_tests.move @@ -0,0 +1,79 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module std::u64_tests { + use std::integer_tests; + use std::unit_test::assert_eq; + + const BIT_SIZE: u8 = 64; + const MAX: u64 = 0xFFFF_FFFF_FFFF_FFFF; + const MAX_PRED: u64 = MAX - 1; + + const CASES: vector = vector[ + 0, + 1, + 10, + 11, + 100, + 111, + 1 << (BIT_SIZE / 2 - 1), + (1 << (BIT_SIZE / 2 - 1)) + 1, + 1 << (BIT_SIZE - 1), + (1 << (BIT_SIZE - 1)) + 1, + MAX / 2, + (MAX / 2) + 1, + MAX_PRED, + MAX, + ]; + + #[test] + fun test_max() { + integer_tests::test_max!(MAX, CASES); + } + + #[test] + fun test_min() { + integer_tests::test_min!(MAX, CASES); + } + + #[test] + fun test_diff() { + integer_tests::test_diff!(MAX, CASES); + } + + #[test] + fun test_divide_and_round_up() { + integer_tests::test_divide_and_round_up!(MAX, CASES); + } + + #[test, expected_failure(arithmetic_error, location = std::u8)] + fun test_divide_and_round_up_error() { + 1u8.divide_and_round_up(0); + } + + #[test] + fun test_pow() { + integer_tests::test_pow!(MAX, CASES); + assert_eq!(2u64.pow(12), integer_tests::slow_pow!(2u64, 12)); + assert_eq!(3u64.pow(27), integer_tests::slow_pow!(3u64, 27)); + } + + #[test, expected_failure(arithmetic_error, location = std::u64)] + fun test_pow_overflow() { + 255u64.pow(255); + } + + #[test] + fun test_sqrt() { + let reflexive_cases = + vector[0, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59]; + integer_tests::test_sqrt!(MAX, CASES, reflexive_cases) + } + + #[test] + fun test_dos() { + integer_tests::test_dos!(MAX, CASES); + } + +} diff --git a/external-crates/move/crates/move-stdlib/tests/u8_tests.move b/external-crates/move/crates/move-stdlib/tests/u8_tests.move new file mode 100644 index 0000000000000..7aa1d6f263a00 --- /dev/null +++ b/external-crates/move/crates/move-stdlib/tests/u8_tests.move @@ -0,0 +1,77 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#[test_only] +module std::u8_tests { + use std::integer_tests; + use std::unit_test::assert_eq; + + const BIT_SIZE: u8 = 8; + const MAX: u8 = 0xFF; + const MAX_PRED: u8 = MAX - 1; + + const CASES: vector = vector[ + 0, + 1, + 10, + 11, + 100, + 111, + 1 << (BIT_SIZE / 2 - 1), + (1 << (BIT_SIZE / 2 - 1)) + 1, + 1 << (BIT_SIZE - 1), + (1 << (BIT_SIZE - 1)) + 1, + MAX / 2, + (MAX / 2) + 1, + MAX_PRED, + MAX, + ]; + + #[test] + fun test_max() { + integer_tests::test_max!(MAX, CASES); + } + + #[test] + fun test_min() { + integer_tests::test_min!(MAX, CASES); + } + + #[test] + fun test_diff() { + integer_tests::test_diff!(MAX, CASES); + } + + #[test] + fun test_divide_and_round_up() { + integer_tests::test_divide_and_round_up!(MAX, CASES); + } + + #[test, expected_failure(arithmetic_error, location = std::u8)] + fun test_divide_and_round_up_error() { + 1u8.divide_and_round_up(0); + } + + #[test] + fun test_pow() { + integer_tests::test_pow!(MAX, CASES); + } + + #[test, expected_failure(arithmetic_error, location = std::u8)] + fun test_pow_overflow() { + 255u8.pow(255); + } + + #[test] + fun test_sqrt() { + integer_tests::test_sqrt!(MAX, CASES, vector[0, 2, 5, 8, 11, 14]); + } + + #[test] + fun test_dos() { + let mut sum = 0u16; + 255u8.do_eq!(|i| sum = sum + (i as u16)); + assert_eq!(sum, 32640); + integer_tests::test_dos!(MAX, CASES); + } +} diff --git a/external-crates/move/crates/move-stdlib/tests/vector_tests.move b/external-crates/move/crates/move-stdlib/tests/vector_tests.move index 5480f6b685d96..2bb76d6310017 100644 --- a/external-crates/move/crates/move-stdlib/tests/vector_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/vector_tests.move @@ -1,90 +1,93 @@ +// Copyright (c) The Diem Core Contributors +// Copyright (c) The Move Contributors +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + #[test_only] module std::vector_tests { - use std::vector as V; - - struct R has store { } - struct Droppable has drop {} - struct NotDroppable {} + public struct R has store { } + public struct Droppable has drop {} + public struct NotDroppable {} #[test] fun test_singleton_contains() { - assert!(*V::borrow(&V::singleton(0), 0) == 0, 0); - assert!(*V::borrow(&V::singleton(true), 0) == true, 0); - assert!(*V::borrow(&V::singleton(@0x1), 0) == @0x1, 0); + assert!(vector[0][0] == 0); + assert!(vector[true][0] == true); + assert!(vector[@0x1][0] == @0x1); } #[test] fun test_singleton_len() { - assert!(V::length(&V::singleton(0)) == 1, 0); - assert!(V::length(&V::singleton(true)) == 1, 0); - assert!(V::length(&V::singleton(@0x1)) == 1, 0); + assert!(&vector[0].length() == 1); + assert!(&vector[true].length() == 1); + assert!(&vector[@0x1].length() == 1); } #[test] fun test_empty_is_empty() { - assert!(V::is_empty(&V::empty()), 0); + assert!(vector[].is_empty()); } #[test] fun append_empties_is_empty() { - let v1 = V::empty(); - let v2 = V::empty(); - V::append(&mut v1, v2); - assert!(V::is_empty(&v1), 0); + let mut v1 = vector[]; + let v2 = vector[]; + v1.append(v2); + assert!(v1.is_empty()); } #[test] fun append_respects_order_empty_lhs() { - let v1 = V::empty(); - let v2 = V::empty(); - V::push_back(&mut v2, 0); - V::push_back(&mut v2, 1); - V::push_back(&mut v2, 2); - V::push_back(&mut v2, 3); - V::append(&mut v1, v2); - assert!(!V::is_empty(&v1), 0); - assert!(V::length(&v1) == 4, 1); - assert!(*V::borrow(&v1, 0) == 0, 2); - assert!(*V::borrow(&v1, 1) == 1, 3); - assert!(*V::borrow(&v1, 2) == 2, 4); - assert!(*V::borrow(&v1, 3) == 3, 5); + let mut v1 = vector[]; + let mut v2 = vector[]; + v2.push_back(0); + v2.push_back(1); + v2.push_back(2); + v2.push_back(3); + v1.append(v2); + assert!(!v1.is_empty()); + assert!(v1.length() == 4); + assert!(v1[0] == 0); + assert!(v1[1] == 1); + assert!(v1[2] == 2); + assert!(v1[3] == 3); } #[test] fun append_respects_order_empty_rhs() { - let v1 = V::empty(); - let v2 = V::empty(); - V::push_back(&mut v1, 0); - V::push_back(&mut v1, 1); - V::push_back(&mut v1, 2); - V::push_back(&mut v1, 3); - V::append(&mut v1, v2); - assert!(!V::is_empty(&v1), 0); - assert!(V::length(&v1) == 4, 1); - assert!(*V::borrow(&v1, 0) == 0, 2); - assert!(*V::borrow(&v1, 1) == 1, 3); - assert!(*V::borrow(&v1, 2) == 2, 4); - assert!(*V::borrow(&v1, 3) == 3, 5); + let mut v1 = vector[]; + let v2 = vector[]; + v1.push_back(0); + v1.push_back(1); + v1.push_back(2); + v1.push_back(3); + v1.append(v2); + assert!(!v1.is_empty()); + assert!(v1.length() == 4); + assert!(v1[0] == 0); + assert!(v1[1] == 1); + assert!(v1[2] == 2); + assert!(v1[3] == 3); } #[test] fun append_respects_order_nonempty_rhs_lhs() { - let v1 = V::empty(); - let v2 = V::empty(); - V::push_back(&mut v1, 0); - V::push_back(&mut v1, 1); - V::push_back(&mut v1, 2); - V::push_back(&mut v1, 3); - V::push_back(&mut v2, 4); - V::push_back(&mut v2, 5); - V::push_back(&mut v2, 6); - V::push_back(&mut v2, 7); - V::append(&mut v1, v2); - assert!(!V::is_empty(&v1), 0); - assert!(V::length(&v1) == 8, 1); - let i = 0; + let mut v1 = vector[]; + let mut v2 = vector[]; + v1.push_back(0); + v1.push_back(1); + v1.push_back(2); + v1.push_back(3); + v2.push_back(4); + v2.push_back(5); + v2.push_back(6); + v2.push_back(7); + v1.append(v2); + assert!(!v1.is_empty()); + assert!(v1.length() == 8); + let mut i = 0; while (i < 8) { - assert!(*V::borrow(&v1, i) == i, i); + assert!(v1[i] == i, i); i = i + 1; } } @@ -92,395 +95,397 @@ module std::vector_tests { #[test] #[expected_failure(vector_error, minor_status = 1, location = Self)] fun borrow_out_of_range() { - let v = V::empty(); - V::push_back(&mut v, 7); - V::borrow(&v, 1); + let mut v = vector[]; + v.push_back(7); + &v[1]; } #[test] fun vector_contains() { - let vec = V::empty(); - assert!(!V::contains(&vec, &0), 1); + let mut vec = vector[]; + assert!(!vec.contains(&0)); - V::push_back(&mut vec, 0); - assert!(V::contains(&vec, &0), 2); - assert!(!V::contains(&vec, &1), 3); + vec.push_back(0); + assert!(vec.contains(&0)); + assert!(!vec.contains(&1)); - V::push_back(&mut vec, 1); - assert!(V::contains(&vec, &0), 4); - assert!(V::contains(&vec, &1), 5); - assert!(!V::contains(&vec, &2), 6); + vec.push_back(1); + assert!(vec.contains(&0)); + assert!(vec.contains(&1)); + assert!(!vec.contains(&2)); - V::push_back(&mut vec, 2); - assert!(V::contains(&vec, &0), 7); - assert!(V::contains(&vec, &1), 8); - assert!(V::contains(&vec, &2), 9); - assert!(!V::contains(&vec, &3), 10); + vec.push_back(2); + assert!(vec.contains(&0)); + assert!(vec.contains(&1)); + assert!(vec.contains(&2)); + assert!(!vec.contains(&3)); } #[test] fun destroy_empty() { - V::destroy_empty(V::empty()); - V::destroy_empty(V::empty()); + vector[].destroy_empty(); + vector[].destroy_empty(); + vector::empty().destroy_empty(); + vector::empty().destroy_empty(); } #[test] fun destroy_empty_with_pops() { - let v = V::empty(); - V::push_back(&mut v, 42); - V::pop_back(&mut v); - V::destroy_empty(v); + let mut v = vector[]; + v.push_back(42); + v.pop_back(); + v.destroy_empty(); } #[test] #[expected_failure(vector_error, minor_status = 3, location = Self)] fun destroy_non_empty() { - let v = V::empty(); - V::push_back(&mut v, 42); - V::destroy_empty(v); + let mut v = vector[]; + v.push_back(42); + v.destroy_empty(); } #[test] fun get_set_work() { - let vec = V::empty(); - V::push_back(&mut vec, 0); - V::push_back(&mut vec, 1); - assert!(*V::borrow(&vec, 1) == 1, 0); - assert!(*V::borrow(&vec, 0) == 0, 1); + let mut vec = vector[]; + vec.push_back(0); + vec.push_back(1); + assert!(vec[1] == 1); + assert!(vec[0] == 0); - *V::borrow_mut(&mut vec, 0) = 17; - assert!(*V::borrow(&vec, 1) == 1, 0); - assert!(*V::borrow(&vec, 0) == 17, 0); + *&mut vec[0] = 17; + assert!(vec[1] == 1); + assert!(vec[0] == 17); } #[test] #[expected_failure(vector_error, minor_status = 2, location = Self)] fun pop_out_of_range() { - let v = V::empty(); - V::pop_back(&mut v); + let mut v = vector[]; + v.pop_back(); } #[test] fun swap_different_indices() { - let vec = V::empty(); - V::push_back(&mut vec, 0); - V::push_back(&mut vec, 1); - V::push_back(&mut vec, 2); - V::push_back(&mut vec, 3); - V::swap(&mut vec, 0, 3); - V::swap(&mut vec, 1, 2); - assert!(*V::borrow(&vec, 0) == 3, 0); - assert!(*V::borrow(&vec, 1) == 2, 0); - assert!(*V::borrow(&vec, 2) == 1, 0); - assert!(*V::borrow(&vec, 3) == 0, 0); + let mut vec = vector[]; + vec.push_back(0); + vec.push_back(1); + vec.push_back(2); + vec.push_back(3); + vec.swap(0, 3); + vec.swap(1, 2); + assert!(vec[0] == 3); + assert!(vec[1] == 2); + assert!(vec[2] == 1); + assert!(vec[3] == 0); } #[test] fun swap_same_index() { - let vec = V::empty(); - V::push_back(&mut vec, 0); - V::push_back(&mut vec, 1); - V::push_back(&mut vec, 2); - V::push_back(&mut vec, 3); - V::swap(&mut vec, 1, 1); - assert!(*V::borrow(&vec, 0) == 0, 0); - assert!(*V::borrow(&vec, 1) == 1, 0); - assert!(*V::borrow(&vec, 2) == 2, 0); - assert!(*V::borrow(&vec, 3) == 3, 0); + let mut vec = vector[]; + vec.push_back(0); + vec.push_back(1); + vec.push_back(2); + vec.push_back(3); + vec.swap(1, 1); + assert!(vec[0] == 0); + assert!(vec[1] == 1); + assert!(vec[2] == 2); + assert!(vec[3] == 3); } #[test] fun remove_singleton_vector() { - let v = V::empty(); - V::push_back(&mut v, 0); - assert!(V::remove(&mut v, 0) == 0, 0); - assert!(V::length(&v) == 0, 0); + let mut v = vector[]; + v.push_back(0); + assert!(v.remove(0) == 0); + assert!(v.length() == 0); } #[test] fun remove_nonsingleton_vector() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::push_back(&mut v, 1); - V::push_back(&mut v, 2); - V::push_back(&mut v, 3); + let mut v = vector[]; + v.push_back(0); + v.push_back(1); + v.push_back(2); + v.push_back(3); - assert!(V::remove(&mut v, 1) == 1, 0); - assert!(V::length(&v) == 3, 0); - assert!(*V::borrow(&v, 0) == 0, 0); - assert!(*V::borrow(&v, 1) == 2, 0); - assert!(*V::borrow(&v, 2) == 3, 0); + assert!(v.remove(1) == 1); + assert!(v.length() == 3); + assert!(v[0] == 0); + assert!(v[1] == 2); + assert!(v[2] == 3); } #[test] fun remove_nonsingleton_vector_last_elem() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::push_back(&mut v, 1); - V::push_back(&mut v, 2); - V::push_back(&mut v, 3); + let mut v = vector[]; + v.push_back(0); + v.push_back(1); + v.push_back(2); + v.push_back(3); - assert!(V::remove(&mut v, 3) == 3, 0); - assert!(V::length(&v) == 3, 0); - assert!(*V::borrow(&v, 0) == 0, 0); - assert!(*V::borrow(&v, 1) == 1, 0); - assert!(*V::borrow(&v, 2) == 2, 0); + assert!(v.remove(3) == 3); + assert!(v.length() == 3); + assert!(v[0] == 0); + assert!(v[1] == 1); + assert!(v[2] == 2); } #[test] - #[expected_failure(abort_code = V::EINDEX_OUT_OF_BOUNDS)] + #[expected_failure(abort_code = vector::EINDEX_OUT_OF_BOUNDS)] fun remove_empty_vector() { - let v = V::empty(); - V::remove(&mut v, 0); + let mut v = vector[]; + v.remove(0); } #[test] - #[expected_failure(abort_code = V::EINDEX_OUT_OF_BOUNDS)] + #[expected_failure(abort_code = vector::EINDEX_OUT_OF_BOUNDS)] fun remove_out_of_bound_index() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::remove(&mut v, 1); + let mut v = vector[]; + v.push_back(0); + v.remove(1); } #[test] fun reverse_vector_empty() { - let v = V::empty(); - let is_empty = V::is_empty(&v); - V::reverse(&mut v); - assert!(is_empty == V::is_empty(&v), 0); + let mut v = vector[]; + let is_empty = v.is_empty(); + v.reverse(); + assert!(is_empty == v.is_empty()); } #[test] fun reverse_singleton_vector() { - let v = V::empty(); - V::push_back(&mut v, 0); - assert!(*V::borrow(&v, 0) == 0, 1); - V::reverse(&mut v); - assert!(*V::borrow(&v, 0) == 0, 2); + let mut v = vector[]; + v.push_back(0); + assert!(v[0] == 0); + v.reverse(); + assert!(v[0] == 0); } #[test] fun reverse_vector_nonempty_even_length() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::push_back(&mut v, 1); - V::push_back(&mut v, 2); - V::push_back(&mut v, 3); + let mut v = vector[]; + v.push_back(0); + v.push_back(1); + v.push_back(2); + v.push_back(3); - assert!(*V::borrow(&v, 0) == 0, 1); - assert!(*V::borrow(&v, 1) == 1, 2); - assert!(*V::borrow(&v, 2) == 2, 3); - assert!(*V::borrow(&v, 3) == 3, 4); + assert!(v[0] == 0); + assert!(v[1] == 1); + assert!(v[2] == 2); + assert!(v[3] == 3); - V::reverse(&mut v); + v.reverse(); - assert!(*V::borrow(&v, 3) == 0, 5); - assert!(*V::borrow(&v, 2) == 1, 6); - assert!(*V::borrow(&v, 1) == 2, 7); - assert!(*V::borrow(&v, 0) == 3, 8); + assert!(v[3] == 0); + assert!(v[2] == 1); + assert!(v[1] == 2); + assert!(v[0] == 3); } #[test] fun reverse_vector_nonempty_odd_length_non_singleton() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::push_back(&mut v, 1); - V::push_back(&mut v, 2); + let mut v = vector[]; + v.push_back(0); + v.push_back(1); + v.push_back(2); - assert!(*V::borrow(&v, 0) == 0, 1); - assert!(*V::borrow(&v, 1) == 1, 2); - assert!(*V::borrow(&v, 2) == 2, 3); + assert!(v[0] == 0); + assert!(v[1] == 1); + assert!(v[2] == 2); - V::reverse(&mut v); + v.reverse(); - assert!(*V::borrow(&v, 2) == 0, 4); - assert!(*V::borrow(&v, 1) == 1, 5); - assert!(*V::borrow(&v, 0) == 2, 6); + assert!(v[2] == 0); + assert!(v[1] == 1); + assert!(v[0] == 2); } #[test] #[expected_failure(vector_error, minor_status = 1, location = Self)] fun swap_empty() { - let v = V::empty(); - V::swap(&mut v, 0, 0); + let mut v = vector[]; + v.swap(0, 0); } #[test] #[expected_failure(vector_error, minor_status = 1, location = Self)] fun swap_out_of_range() { - let v = V::empty(); + let mut v = vector[]; - V::push_back(&mut v, 0); - V::push_back(&mut v, 1); - V::push_back(&mut v, 2); - V::push_back(&mut v, 3); + v.push_back(0); + v.push_back(1); + v.push_back(2); + v.push_back(3); - V::swap(&mut v, 1, 10); + v.swap(1, 10); } #[test] - #[expected_failure(abort_code = V::EINDEX_OUT_OF_BOUNDS)] + #[expected_failure(abort_code = std::vector::EINDEX_OUT_OF_BOUNDS)] fun swap_remove_empty() { - let v = V::empty(); - V::swap_remove(&mut v, 0); + let mut v = vector[]; + v.swap_remove(0); } #[test] fun swap_remove_singleton() { - let v = V::empty(); - V::push_back(&mut v, 0); - assert!(V::swap_remove(&mut v, 0) == 0, 0); - assert!(V::is_empty(&v), 1); + let mut v = vector[]; + v.push_back(0); + assert!(v.swap_remove(0) == 0); + assert!(v.is_empty()); } #[test] fun swap_remove_inside_vector() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::push_back(&mut v, 1); - V::push_back(&mut v, 2); - V::push_back(&mut v, 3); + let mut v = vector[]; + v.push_back(0); + v.push_back(1); + v.push_back(2); + v.push_back(3); - assert!(*V::borrow(&v, 0) == 0, 1); - assert!(*V::borrow(&v, 1) == 1, 2); - assert!(*V::borrow(&v, 2) == 2, 3); - assert!(*V::borrow(&v, 3) == 3, 4); + assert!(v[0] == 0); + assert!(v[1] == 1); + assert!(v[2] == 2); + assert!(v[3] == 3); - assert!(V::swap_remove(&mut v, 1) == 1, 5); - assert!(V::length(&v) == 3, 6); + assert!(v.swap_remove(1) == 1); + assert!(v.length() == 3); - assert!(*V::borrow(&v, 0) == 0, 7); - assert!(*V::borrow(&v, 1) == 3, 8); - assert!(*V::borrow(&v, 2) == 2, 9); + assert!(v[0] == 0); + assert!(v[1] == 3); + assert!(v[2] == 2); } #[test] fun swap_remove_end_of_vector() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::push_back(&mut v, 1); - V::push_back(&mut v, 2); - V::push_back(&mut v, 3); + let mut v = vector[]; + v.push_back(0); + v.push_back(1); + v.push_back(2); + v.push_back(3); - assert!(*V::borrow(&v, 0) == 0, 1); - assert!(*V::borrow(&v, 1) == 1, 2); - assert!(*V::borrow(&v, 2) == 2, 3); - assert!(*V::borrow(&v, 3) == 3, 4); + assert!(v[0] == 0); + assert!(v[1] == 1); + assert!(v[2] == 2); + assert!(v[3] == 3); - assert!(V::swap_remove(&mut v, 3) == 3, 5); - assert!(V::length(&v) == 3, 6); + assert!(v.swap_remove(3) == 3); + assert!(v.length() == 3); - assert!(*V::borrow(&v, 0) == 0, 7); - assert!(*V::borrow(&v, 1) == 1, 8); - assert!(*V::borrow(&v, 2) == 2, 9); + assert!(v[0] == 0); + assert!(v[1] == 1); + assert!(v[2] == 2); } #[test] #[expected_failure(vector_error, minor_status = 1, location = std::vector)] fun swap_remove_out_of_range() { - let v = V::empty(); - V::push_back(&mut v, 0); - V::swap_remove(&mut v, 1); + let mut v = vector[]; + v.push_back(0); + v.swap_remove(1); } #[test] fun push_back_and_borrow() { - let v = V::empty(); - V::push_back(&mut v, 7); - assert!(!V::is_empty(&v), 0); - assert!(V::length(&v) == 1, 1); - assert!(*V::borrow(&v, 0) == 7, 2); + let mut v = vector[]; + v.push_back(7); + assert!(!v.is_empty()); + assert!(v.length() == 1); + assert!(v[0] == 7); - V::push_back(&mut v, 8); - assert!(V::length(&v) == 2, 3); - assert!(*V::borrow(&v, 0) == 7, 4); - assert!(*V::borrow(&v, 1) == 8, 5); + v.push_back(8); + assert!(v.length() == 2); + assert!(v[0] == 7); + assert!(v[1] == 8); } #[test] fun index_of_empty_not_has() { - let v = V::empty(); - let (has, index) = V::index_of(&v, &true); - assert!(!has, 0); - assert!(index == 0, 1); + let v = vector[]; + let (has, index) = v.index_of(&true); + assert!(!has); + assert!(index == 0); } #[test] fun index_of_nonempty_not_has() { - let v = V::empty(); - V::push_back(&mut v, false); - let (has, index) = V::index_of(&v, &true); - assert!(!has, 0); - assert!(index == 0, 1); + let mut v = vector[]; + v.push_back(false); + let (has, index) = v.index_of(&true); + assert!(!has); + assert!(index == 0); } #[test] fun index_of_nonempty_has() { - let v = V::empty(); - V::push_back(&mut v, false); - V::push_back(&mut v, true); - let (has, index) = V::index_of(&v, &true); - assert!(has, 0); - assert!(index == 1, 1); + let mut v = vector[]; + v.push_back(false); + v.push_back(true); + let (has, index) = v.index_of(&true); + assert!(has); + assert!(index == 1); } // index_of will return the index first occurence that is equal #[test] fun index_of_nonempty_has_multiple_occurences() { - let v = V::empty(); - V::push_back(&mut v, false); - V::push_back(&mut v, true); - V::push_back(&mut v, true); - let (has, index) = V::index_of(&v, &true); - assert!(has, 0); - assert!(index == 1, 1); + let mut v = vector[]; + v.push_back(false); + v.push_back(true); + v.push_back(true); + let (has, index) = v.index_of(&true); + assert!(has); + assert!(index == 1); } #[test] fun length() { - let empty = V::empty(); - assert!(V::length(&empty) == 0, 0); - let i = 0; + let mut empty = vector[]; + assert!(empty.length() == 0); + let mut i = 0; let max_len = 42; while (i < max_len) { - V::push_back(&mut empty, i); - assert!(V::length(&empty) == i + 1, i); + empty.push_back(i); + assert!(empty.length() == i + 1, i); i = i + 1; } } #[test] fun pop_push_back() { - let v = V::empty(); - let i = 0; + let mut v = vector[]; + let mut i = 0; let max_len = 42; while (i < max_len) { - V::push_back(&mut v, i); + v.push_back(i); i = i + 1; }; while (i > 0) { - assert!(V::pop_back(&mut v) == i - 1, i); + assert!(v.pop_back() == i - 1, i); i = i - 1; }; } #[test_only] - fun test_natives_with_type(x1: T, x2: T): (T, T) { - let v = V::empty(); - assert!(V::length(&v) == 0, 0); - V::push_back(&mut v, x1); - assert!(V::length(&v) == 1, 1); - V::push_back(&mut v, x2); - assert!(V::length(&v) == 2, 2); - V::swap(&mut v, 0, 1); - x1 = V::pop_back(&mut v); - assert!(V::length(&v) == 1, 3); - x2 = V::pop_back(&mut v); - assert!(V::length(&v) == 0, 4); - V::destroy_empty(v); + fun test_natives_with_type(mut x1: T, mut x2: T): (T, T) { + let mut v = vector[]; + assert!(v.length() == 0); + v.push_back(x1); + assert!(v.length() == 1); + v.push_back(x2); + assert!(v.length() == 2); + v.swap(0, 1); + x1 = v.pop_back(); + assert!(v.length() == 1); + x2 = v.pop_back(); + assert!(v.length() == 0); + v.destroy_empty(); (x1, x2) } @@ -495,7 +500,7 @@ module std::vector_tests { test_natives_with_type(true, false); test_natives_with_type
(@0x1, @0x2); - test_natives_with_type>(V::empty(), V::empty()); + test_natives_with_type>(vector[], vector[]); test_natives_with_type(Droppable{}, Droppable{}); (NotDroppable {}, NotDroppable {}) = test_natives_with_type( @@ -506,64 +511,279 @@ module std::vector_tests { #[test] fun test_insert() { - let v = vector[7]; - V::insert(&mut v, 6, 0); - assert!(v == vector[6, 7], 0); + let mut v = vector[7]; + v.insert(6, 0); + assert!(v == vector[6, 7]); - let v = vector[7, 9]; - V::insert(&mut v, 8, 1); - assert!(v == vector[7, 8, 9], 0); + let mut v = vector[7, 9]; + v.insert(8, 1); + assert!(v == vector[7, 8, 9]); - let v = vector[6, 7]; - V::insert(&mut v, 5, 0); - assert!(v == vector[5, 6, 7], 0); + let mut v = vector[6, 7]; + v.insert(5, 0); + assert!(v == vector[5, 6, 7]); - let v = vector[5, 6, 8]; - V::insert(&mut v, 7, 2); - assert!(v == vector[5, 6, 7, 8], 0); + let mut v = vector[5, 6, 8]; + v.insert(7, 2); + assert!(v == vector[5, 6, 7, 8]); } #[test] fun insert_at_end() { - let v = vector[]; - V::insert(&mut v, 6, 0); - assert!(v == vector[6], 0); + let mut v = vector[]; + v.insert(6, 0); + assert!(v == vector[6]); - V::insert(&mut v, 7, 1); - assert!(v == vector[6, 7], 0); + v.insert(7, 1); + assert!(v == vector[6, 7]); } #[test] - #[expected_failure(abort_code = V::EINDEX_OUT_OF_BOUNDS)] + #[expected_failure(abort_code = std::vector::EINDEX_OUT_OF_BOUNDS)] fun insert_out_of_range() { - let v = vector[7]; - V::insert(&mut v, 6, 2); + let mut v = vector[7]; + v.insert(6, 2); } #[test] fun size_limit_ok() { - let v = V::empty(); - let i = 0; - // Limit is currently 1024 * 1024 - let max_len = 1024 * 1024; + let mut v = vector[]; + let mut i = 0; + // Limit is currently 1024 * 54 + let max_len = 1024 * 53; while (i < max_len) { - V::push_back(&mut v, i); + v.push_back(i); i = i + 1; }; } #[test] - #[expected_failure(vector_error, minor_status = 4, location = Self)] + #[expected_failure(out_of_gas, location = Self)] fun size_limit_fail() { - let v = V::empty(); - let i = 0; - // Limit is currently 1024 * 1024 - let max_len = 1024 * 1024 + 1; + let mut v = vector[]; + let mut i = 0; + // Choose value beyond limit + let max_len = 1024 * 1024; while (i < max_len) { - V::push_back(&mut v, i); + v.push_back(i); i = i + 1; }; } + + #[test] + fun test_string_aliases() { + assert!(b"hello_world".to_string().length() == 11); + assert!(b"hello_world".try_to_string().is_some()); + + assert!(b"hello_world".to_ascii_string().length() == 11); + assert!(b"hello_world".try_to_ascii_string().is_some()); + } + + // === Macros === + + #[test] + fun test_destroy_macro() { + vector[].destroy!(|_| assert!(false)); // very funky + + let mut acc = 0; + vector[10, 20, 30, 40].destroy!(|e| acc = acc + e); + assert!(acc == 100); + } + + #[test] + fun test_count_macro() { + assert!(vector[].count!(|e| *e == 2) == 0); + assert!(vector[0, 1, 2, 3].count!(|e| *e == 2) == 1); + assert!(vector[0, 1, 2, 3].count!(|e| *e % 2 == 0) == vector[0, 2].length()); + } + + #[test] + fun test_tabulate_macro() { + let v = vector::tabulate!(10, |i| i); + assert!(v == vector[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); + + let v = vector::tabulate!(5, |i| 10 - i); + assert!(v == vector[10, 9, 8, 7, 6]); + + let v = vector::tabulate!(0, |i| i); + assert!(v == vector[]); + } + + #[test] + fun test_do_macro() { + vector[].do!(|_| assert!(false)); // should never run + vector[].do_ref!(|_| assert!(false)); + vector[].do_mut!(|_| assert!(false)); + + let mut acc = 0; + vector[10, 20, 30, 40].do!(|e| acc = acc + e); + assert!(acc == 100); + + let vec = vector[10, 20]; + vec.do!(|e| acc = acc + e); + assert!(vector[10, 20] == vec); + + let mut acc = 0; + vector[10, 20, 30, 40].do_ref!(|e| acc = acc + *e); + assert!(acc == 100); + + let mut vec = vector[10, 20, 30, 40]; + vec.do_mut!(|e| *e = *e + 1); + assert!(vec == vector[11, 21, 31, 41]); + } + + #[test] + fun test_map_macro() { + let e = vector[]; + assert!(e.map!(|e| e + 1) == vector[]); + + let r = vector[0, 1, 2, 3]; + assert!(r.map!(|e| e + 1) == vector[1, 2, 3, 4]); + + let r = vector[0, 1, 2, 3]; + assert!(r.map_ref!(|e| *e * 2) == vector[0, 2, 4, 6]); + } + + #[test] + fun filter_macro() { + let e = vector[]; + assert!(e.filter!(|e| *e % 2 == 0) == vector[]); + + let r = vector[0, 1, 2, 3]; + assert!(r.filter!(|e| *e % 2 == 0) == vector[0, 2]); + } + + #[test] + fun partition_macro() { + let e = vector[]; + let (even, odd) = e.partition!(|e| (*e % 2) == 0); + assert!(even == vector[]); + assert!(odd == vector[]); + + let r = vector[0, 1, 2, 3]; + let (even, odd) = r.partition!(|e| (*e % 2) == 0); + assert!(even == vector[0, 2]); + assert!(odd == vector[1, 3]); + } + + #[test] + fun find_index_macro() { + let e = vector[]; + assert!(e.find_index!(|e| *e == 0).is_none()); + assert!(e.find_index!(|_| true).is_none()); + + let r = vector[0, 10, 100, 1_000]; + assert!(r.find_index!(|e| *e == 100).destroy_some() == 2); + assert!(r.find_index!(|e| *e == 10_000).is_none()); + } + + #[test] + fun fold_macro() { + let e = vector[]; + assert!(e.fold!(0, |acc, e| acc + e) == 0); + + let r = vector[0, 1, 2, 3]; + assert!(r.fold!(10, |acc, e| acc + e) == 16); + } + + #[test] + fun any_all_macro() { + assert!(vector[].any!(|e| *e == 2) == false); + assert!(vector[].all!(|e| *e == 2) == true); + assert!(vector[0, 1, 2, 3].any!(|e| *e == 2)); + assert!(!vector[0, 1, 2, 3].any!(|e| *e == 4)); + assert!(vector[0, 1, 2, 3].all!(|e| *e < 4)); + assert!(!vector[0, 1, 2, 3].all!(|e| *e < 3)); + } + + #[test, expected_failure] + fun zip_do_macro_fail() { + let v1 = vector[1u64]; + let v2 = vector[4u64, 5]; + let mut res = vector[]; + v1.zip_do!(v2, |a, b| res.push_back(a + b)); + } + + #[test] + fun zip_do_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + let mut res = vector[]; + v1.zip_do!(v2, |a, b| res.push_back(a + b)); + assert!(res == vector[5, 7, 9]); + } + + #[test, expected_failure] + fun zip_do_reverse_macro_fail() { + let v1 = vector[1u64]; + let v2 = vector[4u64, 5]; + let mut res = vector[]; + v2.zip_do_reverse!(v1, |a, b| res.push_back(a + b)); + } + + #[test] + fun zip_do_reverse_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + let mut res = vector[]; + v2.zip_do_reverse!(v1, |a, b| res.push_back(a + b)); + assert!(res == vector[9, 7, 5]); + } + + #[test, expected_failure] + fun zip_do_ref_macro_fail() { + let v1 = vector[1u64]; + let v2 = vector[4u64, 5]; + let mut res = vector[]; + v2.zip_do_ref!(&v1, |a, b| res.push_back(*a + *b)); + } + + #[test] + fun zip_do_ref_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + let mut res = vector[]; + v1.zip_do_ref!(&v2, |a, b| res.push_back(*a + *b)); + assert!(res == vector[5, 7, 9]); + } + + #[test, expected_failure] + fun zip_do_mut_macro_fail() { + let mut v1 = vector[1u64]; + let mut v2 = vector[4u64, 5]; + v1.zip_do_mut!(&mut v2, |a, b| { + let c = *a; + *a = *b; + *b = c; + }); + } + + #[test] + fun zip_do_mut_macro() { + let mut v1 = vector[1u64, 2, 3]; + let mut v2 = vector[4u64, 5, 6]; + v1.zip_do_mut!(&mut v2, |a, b| { + let c = *a; + *a = *b; + *b = c; + }); + assert!(v1 == vector[4, 5, 6]); + assert!(v2 == vector[1, 2, 3]); + } + + #[test] + fun zip_map_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + assert!(v1.zip_map!(v2, |a, b| a + b) == vector[5, 7, 9]); + } + + #[test] + fun zip_map_ref_macro() { + let v1 = vector[1u64, 2, 3]; + let v2 = vector[4u64, 5, 6]; + assert!(v2.zip_map_ref!(&v1, |a, b| *a + *b) == vector[5, 7, 9]); + } } diff --git a/external-crates/move/crates/move-transactional-test-runner/src/vm_test_harness.rs b/external-crates/move/crates/move-transactional-test-runner/src/vm_test_harness.rs index 9ae5ca713a235..bfa9734d737e8 100644 --- a/external-crates/move/crates/move-transactional-test-runner/src/vm_test_harness.rs +++ b/external-crates/move/crates/move-transactional-test-runner/src/vm_test_harness.rs @@ -274,6 +274,7 @@ impl SimpleVMTestAdapter { STD_ADDR, // TODO: come up with a suitable gas schedule move_stdlib_natives::GasParameters::zeros(), + /* silent */ false, ), vm_config, ) diff --git a/external-crates/move/crates/move-unit-test/src/test_runner.rs b/external-crates/move/crates/move-unit-test/src/test_runner.rs index 186d45575fa12..9cc5b87c9ca0f 100644 --- a/external-crates/move/crates/move-unit-test/src/test_runner.rs +++ b/external-crates/move/crates/move-unit-test/src/test_runner.rs @@ -126,6 +126,7 @@ impl TestRunner { move_stdlib_natives::all_natives( AccountAddress::from_hex_literal("0x1").unwrap(), move_stdlib_natives::GasParameters::zeros(), + /* silent */ false, ) }); Ok(Self { diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/address_args.move b/external-crates/move/crates/move-unit-test/tests/test_sources/address_args.move index 4faabd02d0ba4..bb56acb2f988e 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/address_args.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/address_args.move @@ -1,5 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { const ErrorCode: u64 = 100; #[test(a = @0x42)] @@ -19,4 +18,3 @@ module M { assert!(a == @0x43, 100); } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/arithmetic_errors.move b/external-crates/move/crates/move-unit-test/tests/test_sources/arithmetic_errors.move index 74185c75d5e20..d4a9cb199d735 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/arithmetic_errors.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/arithmetic_errors.move @@ -1,5 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { #[test] #[expected_failure] fun u64_sub_underflow() { @@ -24,4 +23,3 @@ module M { 4294967296 * 4294967296; } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/construct_data.move b/external-crates/move/crates/move-unit-test/tests/test_sources/construct_data.move index 7a6da03ba315f..8876a204089e9 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/construct_data.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/construct_data.move @@ -1,7 +1,6 @@ -address 0x1 { -module B { +module 0x1::B { #[test_only] - struct TestingStruct has drop { x: u64 } + public struct TestingStruct has drop { x: u64 } #[test_only] public fun construct_with_number(x: u64): TestingStruct { @@ -14,7 +13,7 @@ module B { } } -module M { +module 0x1::M { #[test_only] use 0x1::B; @@ -30,4 +29,3 @@ module M { assert!(B::get_struct_x_field(&s) != 0, 0); } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.exp b/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.exp index d2d0ae63e60c7..6e7e37be0ed86 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.exp +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.exp @@ -8,16 +8,16 @@ Failures in 0x1::B: ┌── failing_test ────── │ error[E11001]: test failure -│ ┌─ cross_module_aborts.move:5:9 +│ ┌─ cross_module_aborts.move:4:9 │ │ -│ 4 │ public fun this_aborts() { +│ 3 │ public fun this_aborts() { │ │ ----------- In this function in 0x1::M -│ 5 │ abort 0 +│ 4 │ abort 0 │ │ ^^^^^^^ Test was not expected to error, but it aborted with code 0 originating in the module 0x1::M rooted here │ │ │ stack trace -│ B::failing_test(tests/test_sources/cross_module_aborts.move:19) +│ B::failing_test(tests/test_sources/cross_module_aborts.move:18) │ └────────────────── diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.move b/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.move index 519690185ebb0..2ab099fc48c06 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/cross_module_aborts.move @@ -1,5 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { #[test_only] public fun this_aborts() { abort 0 @@ -9,7 +8,7 @@ module M { fun dummy_test() { } } -module B { +module 0x1::B { #[test_only] use 0x1::M; @@ -19,4 +18,3 @@ module B { M::this_aborts() } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/do_nothing.move b/external-crates/move/crates/move-unit-test/tests/test_sources/do_nothing.move index 8aa9bb708bd51..15fe4a72923ed 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/do_nothing.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/do_nothing.move @@ -1,6 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { #[test] fun do_nothing() {} } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/expected_abort_no_abort.move b/external-crates/move/crates/move-unit-test/tests/test_sources/expected_abort_no_abort.move index e7c022e8366b3..fc94d10c56240 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/expected_abort_no_abort.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/expected_abort_no_abort.move @@ -1,9 +1,7 @@ -address 0x1 { -module M { +module 0x1::M { #[test, expected_failure] fun fail() { } #[test, expected_failure(abort_code=0, location=0x1::M)] fun fail_with_code() { } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.exp b/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.exp index ad65b7f3924c6..e62e47b3f0368 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.exp +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.exp @@ -9,11 +9,11 @@ Failures in 0x1::A: ┌── native_abort_good_wrong_code ────── │ error[E11001]: test failure -│ ┌─ native_abort.move:12:9 +│ ┌─ native_abort.move:11:9 │ │ -│ 11 │ fun native_abort_good_wrong_code() { +│ 10 │ fun native_abort_good_wrong_code() { │ │ ---------------------------- In this function in 0x1::A -│ 12 │ vector::borrow(&vector::empty(), 1); +│ 11 │ vector::borrow(&vector::empty(), 1); │ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Test did not error as expected. Expected test to give a vector operation error with sub-status 0 originating in the module 0x1::A but instead it gave a vector operation error with sub-status 1 originating in the module 0x1::A rooted here │ │ @@ -22,11 +22,11 @@ Failures in 0x1::A: ┌── native_abort_unexpected_abort ────── │ error[E11001]: test failure -│ ┌─ native_abort.move:6:9 +│ ┌─ native_abort.move:5:9 │ │ -│ 5 │ fun native_abort_unexpected_abort() { +│ 4 │ fun native_abort_unexpected_abort() { │ │ ----------------------------- In this function in 0x1::A -│ 6 │ vector::borrow(&vector::empty(), 1); +│ 5 │ vector::borrow(&vector::empty(), 1); │ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Test was not expected to error, but it gave a vector operation error with sub-status 1 originating in the module 0x1::A rooted here │ │ diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.move b/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.move index ca5ec24c188de..53203d68f1a84 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/native_abort.move @@ -1,5 +1,4 @@ module 0x1::A { - use std::vector; #[test] fun native_abort_unexpected_abort() { diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/non_exsistent_native.move b/external-crates/move/crates/move-unit-test/tests/test_sources/non_exsistent_native.move index 2dd99823a43b4..b623fa3170c51 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/non_exsistent_native.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/non_exsistent_native.move @@ -1,5 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { native fun foo(); #[test] @@ -7,4 +6,3 @@ module M { foo() } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/proposal_test.move b/external-crates/move/crates/move-unit-test/tests/test_sources/proposal_test.move index 4c5b0c42c7444..40d74305afa16 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/proposal_test.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/proposal_test.move @@ -1,13 +1,12 @@ // This is a test based on the example in the unit testing proposal -address 0x1 { -module TestonlyModule { +module 0x1::TestonlyModule { #[test_only] public fun aborts() { abort 42 } } -module Module { +module 0x1::Module { fun a(a: u64): bool { a == 10 } @@ -26,7 +25,7 @@ module Module { // A test only struct. This will only be included in test mode. #[test_only, allow(unused_field)] - struct C has drop, key, store { x: T } + public struct C has drop, key, store { x: T } #[test] // test entry point. fun tests_a() { // an actual test that will be run @@ -47,4 +46,3 @@ module Module { TestonlyModule::aborts() } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.exp b/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.exp index 08c535f42f67e..b4f7f0f84b3f6 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.exp +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.exp @@ -17,11 +17,11 @@ Failures in 0x1::M: ┌── single_signer_fail ────── │ error[E11001]: test failure -│ ┌─ signer_args.move:9:9 +│ ┌─ signer_args.move:8:9 │ │ -│ 8 │ fun single_signer_fail(_a: signer) { +│ 7 │ fun single_signer_fail(_a: signer) { │ │ ------------------ In this function in 0x1::M -│ 9 │ abort 0 +│ 8 │ abort 0 │ │ ^^^^^^^ Test was not expected to error, but it aborted with code 0 originating in the module 0x1::M rooted here │ │ diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.move b/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.move index 7b8edcb5dd3e0..9da46ca0a99e5 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/signer_args.move @@ -1,5 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { #[test(_a=@0x1)] fun single_signer_pass(_a: signer) { } @@ -20,13 +19,8 @@ module M { abort 0 } - #[test_only] - use std::signer; - #[test(a=@0x1, b=@0x2)] fun test_correct_signer_arg_addrs(a: signer, b: signer) { - assert!(signer::address_of(&a) == @0x1, 0); - assert!(signer::address_of(&b) == @0x2, 1); + assert!(a != b) } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.exp b/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.exp index 9fe952826d7eb..05c32d5cdd88e 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.exp +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.exp @@ -11,9 +11,9 @@ Failures in 0x1::M: ┌── no_timeout_fail ────── │ error[E11001]: test failure -│ ┌─ timeout.move:18:29 +│ ┌─ timeout.move:17:29 │ │ -│ 18 │ fun no_timeout_fail() { abort 0 } +│ 17 │ fun no_timeout_fail() { abort 0 } │ │ --------------- ^^^^^^^ Test was not expected to error, but it aborted with code 0 originating in the module 0x1::M rooted here │ │ │ │ │ In this function in 0x1::M diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.move b/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.move index 1c045830269af..b772e68a35d88 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/timeout.move @@ -1,5 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { #[test] fun timeout_fail() { while (true) {} @@ -19,10 +18,9 @@ module M { #[test] fun no_timeout_while_loop() { - let i = 0; + let mut i = 0; while (i < 10) { i = i + 1; }; } } -} diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.exp b/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.exp index ea763695bbc0e..7aeae31d736f8 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.exp +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.exp @@ -12,11 +12,11 @@ Failures in 0x1::M: ┌── unexpected_abort ────── │ error[E11001]: test failure -│ ┌─ unexpected_abort.move:5:9 +│ ┌─ unexpected_abort.move:4:9 │ │ -│ 4 │ public fun unexpected_abort() { +│ 3 │ public fun unexpected_abort() { │ │ ---------------- In this function in 0x1::M -│ 5 │ abort 0 +│ 4 │ abort 0 │ │ ^^^^^^^ Test was not expected to error, but it aborted with code 0 originating in the module 0x1::M rooted here │ │ @@ -25,45 +25,45 @@ Failures in 0x1::M: ┌── unexpected_abort_in_native_function ────── │ error[E11001]: test failure -│ ┌─ string.move:92:16 -│ │ -│ 92 │ native fun internal_sub_string(v: &vector, i: u64, j: u64): vector; -│ │ ^^^^^^^^^^^^^^^^^^^ -│ │ │ -│ │ Test was not expected to error, but it aborted with code 1 originating in the module std::string rooted here -│ │ In this function in std::string +│ ┌─ string.move:120:16 +│ │ +│ 120 │ native fun internal_sub_string(v: &vector, i: u64, j: u64): vector; +│ │ ^^^^^^^^^^^^^^^^^^^ +│ │ │ +│ │ Test was not expected to error, but it aborted with code 1 originating in the module std::string rooted here +│ │ In this function in std::string │ │ │ stack trace -│ M::abort_in_native(tests/test_sources/unexpected_abort.move:43) -│ M::unexpected_abort_in_native_function(tests/test_sources/unexpected_abort.move:39) +│ M::abort_in_native(tests/test_sources/unexpected_abort.move:42) +│ M::unexpected_abort_in_native_function(tests/test_sources/unexpected_abort.move:38) │ └────────────────── ┌── unexpected_abort_in_other_function ────── │ error[E11001]: test failure -│ ┌─ unexpected_abort.move:28:9 +│ ┌─ unexpected_abort.move:27:9 │ │ -│ 27 │ fun abort_in_other_function() { +│ 26 │ fun abort_in_other_function() { │ │ ----------------------- In this function in 0x1::M -│ 28 │ abort 1 +│ 27 │ abort 1 │ │ ^^^^^^^ Test was not expected to error, but it aborted with code 1 originating in the module 0x1::M rooted here │ │ │ stack trace -│ M::unexpected_abort_in_other_function(tests/test_sources/unexpected_abort.move:33) +│ M::unexpected_abort_in_other_function(tests/test_sources/unexpected_abort.move:32) │ └────────────────── ┌── wrong_abort_code ────── │ error[E11001]: test failure -│ ┌─ unexpected_abort.move:11:9 +│ ┌─ unexpected_abort.move:10:9 │ │ -│ 10 │ public fun wrong_abort_code() { +│ 9 │ public fun wrong_abort_code() { │ │ ---------------- In this function in 0x1::M -│ 11 │ abort 0 +│ 10 │ abort 0 │ │ ^^^^^^^ Test did not error as expected. Expected test to abort with code 1 originating in the module 0x1::M but instead it aborted with code 0 originating in the module 0x1::M rooted here │ │ diff --git a/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.move b/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.move index 2eaa062d07abc..1b81628abfd15 100644 --- a/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.move +++ b/external-crates/move/crates/move-unit-test/tests/test_sources/unexpected_abort.move @@ -1,5 +1,4 @@ -address 0x1 { -module M { +module 0x1::M { #[test] public fun unexpected_abort() { abort 0 @@ -43,4 +42,3 @@ module M { std::string::internal_sub_string_for_testing(&vector[0], 1, 0); } } -} diff --git a/external-crates/move/crates/move-vm-integration-tests/Cargo.toml b/external-crates/move/crates/move-vm-integration-tests/Cargo.toml index 0df741d16e3dc..370d32a3e43e0 100644 --- a/external-crates/move/crates/move-vm-integration-tests/Cargo.toml +++ b/external-crates/move/crates/move-vm-integration-tests/Cargo.toml @@ -18,7 +18,7 @@ tempfile.workspace = true memory-stats = "1.0.0" move-core-types.workspace = true -move-binary-format.workspace = true +move-binary-format = { workspace = true, features = ["fuzzing"] } move-bytecode-verifier.workspace = true move-compiler.workspace = true move-vm-config.workspace = true diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/binary_format_version.rs b/external-crates/move/crates/move-vm-integration-tests/src/tests/binary_format_version.rs index 11490fe82b292..7a39280c5997e 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/binary_format_version.rs +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/binary_format_version.rs @@ -23,6 +23,7 @@ fn test_publish_module_with_custom_max_binary_format_version() { let vm = MoveVM::new(move_stdlib_natives::all_natives( AccountAddress::from_hex_literal("0x1").unwrap(), move_stdlib_natives::GasParameters::zeros(), + /* silent debug */ true, )) .unwrap(); let mut sess = vm.new_session(&storage); @@ -55,6 +56,7 @@ fn test_publish_module_with_custom_max_binary_format_version() { move_stdlib_natives::all_natives( AccountAddress::from_hex_literal("0x1").unwrap(), move_stdlib_natives::GasParameters::zeros(), + /* silent debug */ true, ), vm_config, ) diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/depth_tests_modules.move b/external-crates/move/crates/move-vm-integration-tests/src/tests/depth_tests_modules.move index 22f0c4c9fc5b3..639d337290280 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/depth_tests_modules.move +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/depth_tests_modules.move @@ -1,61 +1,60 @@ -address 0x2 { -module A { - struct S has copy, drop { +module 0x2::A { + public struct S has copy, drop { f1: 0x2::B::S, f2: 0x2::C::S, } - struct Box has copy, drop, store { x: T } - struct Box3 has copy, drop, store { x: Box> } - struct Box7 has copy, drop, store { x: Box3> } - struct Box15 has copy, drop, store { x: Box7> } - struct Box31 has copy, drop, store { x: Box15> } - struct Box63 has copy, drop, store { x: Box31> } - struct Box127 has copy, drop, store { x: Box63> } + public struct Box has copy, drop, store { x: T } + public struct Box3 has copy, drop, store { x: Box> } + public struct Box7 has copy, drop, store { x: Box3> } + public struct Box15 has copy, drop, store { x: Box7> } + public struct Box31 has copy, drop, store { x: Box15> } + public struct Box63 has copy, drop, store { x: Box31> } + public struct Box127 has copy, drop, store { x: Box63> } } -module B { - struct S has copy, drop { +module 0x2::B { + public struct S has copy, drop { f1: u64, f2: u128, } } -module C { - struct S has copy, drop { +module 0x2::C { + public struct S has copy, drop { f1: address, f2: bool, } } -module D { - struct S has copy, drop { +module 0x2::D { + public struct S has copy, drop { f1: 0x2::B::S, } } -module E { - struct S has copy, drop { +module 0x2::E { + public struct S has copy, drop { f1: 0x2::F::S, f2: u64, } } -module F { - struct S has copy, drop { +module 0x2::F { + public struct S has copy, drop { f1: T, f2: u64, } } -module G { - struct S has copy, drop { +module 0x2::G { + public struct S has copy, drop { f1: 0x2::H::S, f2: u64, } } -module H { - struct S has copy, drop { +module 0x2::H { + public struct S has copy, drop { f1: 0x2::F::S, f2: 0x2::E::S, f3: 0x2::E::S<0x2::F::S>, @@ -65,8 +64,8 @@ module H { } } -module I { - struct S { +module 0x2::I { + public struct S { f1: F, f2: E, f3: E>, @@ -77,37 +76,36 @@ module I { f8: u64, } - struct E { + public struct E { f1: F, f2: u64, } - struct F { + public struct F { f1: T, f2: u64, } - struct H { + public struct H { f1: T, f2: u64, } - struct G { + public struct G { f: H, } - struct L { + public struct L { g1: G, g2: H, } - struct LL { + public struct LL { g1: G, g2: H, } - struct N { + public struct N { f: u64 } } -} diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/function_arg_tests.rs b/external-crates/move/crates/move-vm-integration-tests/src/tests/function_arg_tests.rs index 1f11fa7376aef..1953109d2c136 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/function_arg_tests.rs +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/function_arg_tests.rs @@ -39,8 +39,8 @@ fn run( let code = format!( r#" module 0x{}::M {{ - struct Foo has copy, drop {{ x: u64 }} - struct Bar has copy, drop {{ x: T }} + public struct Foo has copy, drop {{ x: u64 }} + public struct Bar has copy, drop {{ x: T }} fun foo<{}>({}) {{ }} }} diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/loader_tests_modules.move b/external-crates/move/crates/move-vm-integration-tests/src/tests/loader_tests_modules.move index dcdc5a4764034..74d980a6c0e28 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/loader_tests_modules.move +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/loader_tests_modules.move @@ -1,173 +1,171 @@ -address 0x2 { - module A { - struct S has copy, drop { - f1: 0x2::B::S, - f2: 0x2::C::S, - } +module 0x2::A { + public struct S has copy, drop { + f1: 0x2::B::S, + f2: 0x2::C::S, + } - public fun new(f1: 0x2::B::S, f2: 0x2::C::S): S { - Self::S { f1, f2 } - } + public fun new(f1: 0x2::B::S, f2: 0x2::C::S): S { + Self::S { f1, f2 } + } - public fun destroy(v: S): (0x2::B::S, 0x2::C::S) { - let S { f1: v1, f2: v2 } = v; - (v1, v2) - } + public fun destroy(v: S): (0x2::B::S, 0x2::C::S) { + let S { f1: v1, f2: v2 } = v; + (v1, v2) + } - public fun entry_a() { - let i = 0; - while (i < 10) { - let b = 0x2::B::new(20, 100); - let c = 0x2::C::new(@0x42, true); - let another_b = 0x2::B::b_and_c(&b, c); - let (_, _) = 0x2::B::destroy(another_b); - let another_c = 0x2::C::new(@0x42, false); - 0x2::C::destroy(another_c); - i = i + 1; - } + public fun entry_a() { + let mut i = 0; + while (i < 10) { + let b = 0x2::B::new(20, 100); + let c = 0x2::C::new(@0x42, true); + let another_b = 0x2::B::b_and_c(&b, c); + let (_, _) = 0x2::B::destroy(another_b); + let another_c = 0x2::C::new(@0x42, false); + 0x2::C::destroy(another_c); + i = i + 1; } + } - public fun get_field_1(s: &S): 0x2::B::S { - *&s.f1 - } + public fun get_field_1(s: &S): 0x2::B::S { + *&s.f1 } +} - module B { - struct S has copy, drop { - f1: u64, - f2: u128, - } +module 0x2::B { + public struct S has copy, drop { + f1: u64, + f2: u128, + } - public fun new(v1: u64, v2: u128): S { S { f1: v1, f2: v2 } } + public fun new(v1: u64, v2: u128): S { S { f1: v1, f2: v2 } } - public fun destroy(v: S): (u64, u128) { - let S { f1: val1, f2: val2 } = v; - (val1, val2) - } + public fun destroy(v: S): (u64, u128) { + let S { f1: val1, f2: val2 } = v; + (val1, val2) + } - public fun b_and_c(b: &S, c: 0x2::C::S): S { - let _ = 0x2::C::destroy(c); - let another_b = S { - f1: 0, - f2: b.f2, - }; - another_b - } + public fun b_and_c(b: &S, c: 0x2::C::S): S { + let _ = 0x2::C::destroy(c); + let another_b = S { + f1: 0, + f2: b.f2, + }; + another_b } +} - module C { - struct S has copy, drop { - f1: address, - f2: bool, - } +module 0x2::C { + public struct S has copy, drop { + f1: address, + f2: bool, + } - public fun new(v1: address, v2: bool): S { - Self::S { - f1: v1, - f2: v2, - } + public fun new(v1: address, v2: bool): S { + Self::S { + f1: v1, + f2: v2, } + } - public fun destroy(v: S): address { - let S { f1: v1, f2: _ } = v; - v1 - } + public fun destroy(v: S): address { + let S { f1: v1, f2: _ } = v; + v1 + } - public fun just_c() { - let i = 0; - while (i < 10) { - let c = new(@0x0, false); - let S { f1: _, f2: _ } = c; - i = i + 1; - } + public fun just_c() { + let mut i = 0; + while (i < 10) { + let c = new(@0x0, false); + let S { f1: _, f2: _ } = c; + i = i + 1; } } +} - module D { - struct S has copy, drop { - f1: 0x2::B::S, - } +module 0x2::D { + public struct S has copy, drop { + f1: 0x2::B::S, + } - public fun new(): 0x2::D::S { - Self::S { - f1: 0x2::B::new(20, 100), - } + public fun new(): 0x2::D::S { + Self::S { + f1: 0x2::B::new(20, 100), } + } - public fun entry_d() { - let i = 0; - while (i < 10) { - let b = 0x2::B::new(20, 100); - let c = 0x2::C::new(@0x45, false); - let another_b = 0x2::B::b_and_c(&b, c); - let (_, _) = 0x2::B::destroy(another_b); - let another_c = 0x2::C::new(@0x46, true); - 0x2::C::destroy(another_c); - i = i + 1; - } + public fun entry_d() { + let mut i = 0; + while (i < 10) { + let b = 0x2::B::new(20, 100); + let c = 0x2::C::new(@0x45, false); + let another_b = 0x2::B::b_and_c(&b, c); + let (_, _) = 0x2::B::destroy(another_b); + let another_c = 0x2::C::new(@0x46, true); + 0x2::C::destroy(another_c); + i = i + 1; } } +} - module E { - struct S { - f1: u64, - } +module 0x2::E { + public struct S { + f1: u64, + } - public fun new(): 0x2::E::S { Self::S { f1: 20 } } - - public fun entry_e() { - let i = 0; - while (i < 10) { - let b = 0x2::B::new(20, 100); - let c = 0x2::C::new(@0x100, false); - let another_b = 0x2::B::b_and_c(&b, c); - let (_, _) = 0x2::B::destroy(another_b); - let another_c = 0x2::C::new(@0x101, true); - 0x2::C::destroy(another_c); - i = i + 1; - }; - } + public fun new(): 0x2::E::S { Self::S { f1: 20 } } + + public fun entry_e() { + let mut i = 0; + while (i < 10) { + let b = 0x2::B::new(20, 100); + let c = 0x2::C::new(@0x100, false); + let another_b = 0x2::B::b_and_c(&b, c); + let (_, _) = 0x2::B::destroy(another_b); + let another_c = 0x2::C::new(@0x101, true); + 0x2::C::destroy(another_c); + i = i + 1; + }; } +} - module F { - struct S { - f1: u64, - } +module 0x2::F { + public struct S { + f1: u64, + } - public fun new(): 0x2::F::S { Self::S { f1: 20 } } + public fun new(): 0x2::F::S { Self::S { f1: 20 } } - public fun entry_f() { - 0x2::A::entry_a(); - } + public fun entry_f() { + 0x2::A::entry_a(); } +} - module G { - struct S has copy, drop { - f1: u64, - f2: u128, - f3: u16, - f4: u32, - f5: u256 - } +module 0x2::G { + public struct S has copy, drop { + f1: u64, + f2: u128, + f3: u16, + f4: u32, + f5: u256 + } - public fun new(v1: u64, v2: u128, v3: u16, v4: u32, v5: u256): S { S { f1: v1, f2: v2, f3: v3, f4: v4, f5: v5 } } + public fun new(v1: u64, v2: u128, v3: u16, v4: u32, v5: u256): S { S { f1: v1, f2: v2, f3: v3, f4: v4, f5: v5 } } - public fun destroy(v: S): (u64, u128, u16, u32, u256) { - let S { f1: val1, f2: val2, f3: val3, f4: val4, f5: val5 } = v; - (val1, val2, val3, val4, val5) - } + public fun destroy(v: S): (u64, u128, u16, u32, u256) { + let S { f1: val1, f2: val2, f3: val3, f4: val4, f5: val5 } = v; + (val1, val2, val3, val4, val5) + } - public fun b_and_c(b: &S, c: 0x2::C::S): S { - let _ = 0x2::C::destroy(c); - let another_b = S { - f1: 0, - f2: b.f2, - f3: b.f3 + (b.f2 as u16), - f4: (b.f1 as u32), - f5: b.f5 - }; - another_b - } + public fun b_and_c(b: &S, c: 0x2::C::S): S { + let _ = 0x2::C::destroy(c); + let another_b = S { + f1: 0, + f2: b.f2, + f3: b.f3 + (b.f2 as u16), + f4: (b.f1 as u32), + f5: b.f5 + }; + another_b } } diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/nested_loop_tests.rs b/external-crates/move/crates/move-vm-integration-tests/src/tests/nested_loop_tests.rs index 633f0d4f15db6..05b5110ad5bad 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/nested_loop_tests.rs +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/nested_loop_tests.rs @@ -17,9 +17,9 @@ fn test_publish_module_with_nested_loops() { let code = r#" module {{ADDR}}::M { fun foo() { - let i = 0; + let mut i = 0; while (i < 10) { - let j = 0; + let mut j = 0; while (j < 10) { j = j + 1; }; @@ -42,6 +42,7 @@ fn test_publish_module_with_nested_loops() { move_stdlib_natives::all_natives( AccountAddress::from_hex_literal("0x1").unwrap(), move_stdlib_natives::GasParameters::zeros(), + /* silent debug */ true, ), VMConfig { verifier: VerifierConfig { @@ -65,6 +66,7 @@ fn test_publish_module_with_nested_loops() { move_stdlib_natives::all_natives( AccountAddress::from_hex_literal("0x1").unwrap(), move_stdlib_natives::GasParameters::zeros(), + /* silent debug */ true, ), VMConfig { verifier: VerifierConfig { diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_b_v1.move b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_b_v1.move index 2adcb5bdb6a41..bf93efa2b63d3 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_b_v1.move +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_b_v1.move @@ -1,6 +1,6 @@ /// Dependencies: [C v0+] module 0x2::b { - struct S { x: u64 } + public struct S { x: u64 } public fun b(): u64 { 0x2::c::c() * 0x2::c::d() diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v0.move b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v0.move index f099f126c4b47..6efe3748c3795 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v0.move +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v0.move @@ -1,6 +1,6 @@ /// Dependencies: [] module 0x2::c { - struct S { x: u64 } + public struct S { x: u64 } public fun c(): u64 { 42 diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v1.move b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v1.move index fecfe86940a76..b36c4e9549b78 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v1.move +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v1.move @@ -1,7 +1,7 @@ /// Dependencies: [] module 0x2::c { - struct S { x: u64 } - struct R { x: u64, y: u64 } + public struct S { x: u64 } + public struct R { x: u64, y: u64 } public fun c(): u64 { 43 diff --git a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v2.move b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v2.move index 2660fbbe6346e..ba0318bef1cfe 100644 --- a/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v2.move +++ b/external-crates/move/crates/move-vm-integration-tests/src/tests/relinking_tests_c_v2.move @@ -1,8 +1,8 @@ /// Dependencies: [] module 0x2::c { - struct S { x: u64 } - struct R { x: u64, y: u64 } - struct Q { x: u64, y: u64, z: u64 } + public struct S { x: u64 } + public struct R { x: u64, y: u64 } + public struct Q { x: u64, y: u64, z: u64 } public fun c(): u64 { 45 diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.exp index 6cd67db3f6472..c23aa2b760be4 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.exp @@ -1 +1,5 @@ processed 1 task + +task 0, lines 1-8: +//# run --signers 0x1 +return values: { 0000000000000000000000000000000000000000000000000000000000000001 } diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.mvir b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.mvir index 3bc4def5fbcc9..d50e8c3015153 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.mvir +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/builtins/get_txn_sender.mvir @@ -1,14 +1,8 @@ //# run --signers 0x1 module 0x42.m { -import 0x1.signer; -entry foo(account: signer) { - let sender: address; - let addr: address; +entry foo(account: signer): signer { label b0: - sender = signer.address_of(&account); - addr = 0x1; - assert(copy(sender) == copy(addr), 42); - return; + return move(account); } } diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp index 7dc107f50aff1..f2d3d9e9a0fdc 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.exp @@ -5,8 +5,8 @@ task 0, line 2: return values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] task 1, line 4: -//# run std::signer::borrow_address --args @3735928559 -return values: 00000000000000000000000000000000000000000000000000000000deadbeef +//# run std::vector::borrow --type-args u64 --args vector[42] 0 +return values: 42 task 2, line 6: //# run std::type_name::get --type-args vector diff --git a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.move b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.move index 11de68abe0ba4..d471f44d41748 100644 --- a/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.move +++ b/external-crates/move/crates/move-vm-transactional-tests/tests/entry_points/call_native.move @@ -1,6 +1,6 @@ //# run std::bcs::to_bytes --type-args u256 --args 0u256 -//# run std::signer::borrow_address --args @3735928559 +//# run std::vector::borrow --type-args u64 --args vector[42] 0 //# run std::type_name::get --type-args vector diff --git a/external-crates/move/crates/test-generation/src/lib.rs b/external-crates/move/crates/test-generation/src/lib.rs index 0a7ee75176b71..4a4ce8449659a 100644 --- a/external-crates/move/crates/test-generation/src/lib.rs +++ b/external-crates/move/crates/test-generation/src/lib.rs @@ -135,6 +135,7 @@ fn execute_function_in_module( let vm = MoveVM::new(move_stdlib_natives::all_natives( AccountAddress::from_hex_literal("0x1").unwrap(), move_stdlib_natives::GasParameters::zeros(), + /* silent debug */ true, )) .unwrap(); diff --git a/sui-execution/latest/sui-adapter/src/execution_engine.rs b/sui-execution/latest/sui-adapter/src/execution_engine.rs index 60035e6806f60..306e2a9d25126 100644 --- a/sui-execution/latest/sui-adapter/src/execution_engine.rs +++ b/sui-execution/latest/sui-adapter/src/execution_engine.rs @@ -917,7 +917,7 @@ mod checked { if protocol_config.fresh_vm_on_framework_upgrade() { let new_vm = new_move_vm( - all_natives(/* silent */ true), + all_natives(/* silent */ true, protocol_config), protocol_config, /* enable_profiler */ None, ) diff --git a/sui-execution/latest/sui-move-natives/src/lib.rs b/sui-execution/latest/sui-move-natives/src/lib.rs index c129bf4e26539..36fb6865d69eb 100644 --- a/sui-execution/latest/sui-move-natives/src/lib.rs +++ b/sui-execution/latest/sui-move-natives/src/lib.rs @@ -51,7 +51,7 @@ use move_core_types::{ runtime_value as R, vm_status::StatusCode, }; -use move_stdlib_natives::{GasParameters, NurseryGasParameters}; +use move_stdlib_natives::{self as MSN, GasParameters}; use move_vm_runtime::native_functions::{NativeContext, NativeFunction, NativeFunctionTable}; use move_vm_types::{ loaded_data::runtime_types::Type, @@ -640,7 +640,111 @@ impl NativesCostTable { } } -pub fn all_natives(silent: bool) -> NativeFunctionTable { +pub fn make_stdlib_gas_params_for_protocol_config( + protocol_config: &ProtocolConfig, +) -> GasParameters { + macro_rules! get_gas_cost_or_default { + ($name: ident) => {{ + debug_assert!( + protocol_config.version.as_u64() < 53 || protocol_config.$name().is_some() + ); + protocol_config.$name().map(Into::into).unwrap_or(0.into()) + }}; + } + GasParameters::new( + MSN::bcs::GasParameters { + to_bytes: MSN::bcs::ToBytesGasParameters { + per_byte_serialized: get_gas_cost_or_default!( + bcs_per_byte_serialized_cost_as_option + ), + legacy_min_output_size: get_gas_cost_or_default!( + bcs_legacy_min_output_size_cost_as_option + ), + failure: get_gas_cost_or_default!(bcs_failure_cost_as_option), + }, + }, + MSN::debug::GasParameters { + print: MSN::debug::PrintGasParameters { + base_cost: get_gas_cost_or_default!(debug_print_base_cost_as_option), + }, + print_stack_trace: MSN::debug::PrintStackTraceGasParameters { + base_cost: get_gas_cost_or_default!(debug_print_stack_trace_base_cost_as_option), + }, + }, + MSN::hash::GasParameters { + sha2_256: MSN::hash::Sha2_256GasParameters { + base: get_gas_cost_or_default!(hash_sha2_256_base_cost_as_option), + per_byte: get_gas_cost_or_default!(hash_sha2_256_per_byte_cost_as_option), + legacy_min_input_len: get_gas_cost_or_default!( + hash_sha2_256_legacy_min_input_len_cost_as_option + ), + }, + sha3_256: MSN::hash::Sha3_256GasParameters { + base: get_gas_cost_or_default!(hash_sha3_256_base_cost_as_option), + per_byte: get_gas_cost_or_default!(hash_sha3_256_per_byte_cost_as_option), + legacy_min_input_len: get_gas_cost_or_default!( + hash_sha3_256_legacy_min_input_len_cost_as_option + ), + }, + }, + MSN::string::GasParameters { + check_utf8: MSN::string::CheckUtf8GasParameters { + base: get_gas_cost_or_default!(string_check_utf8_base_cost_as_option), + per_byte: get_gas_cost_or_default!(string_check_utf8_per_byte_cost_as_option), + }, + is_char_boundary: MSN::string::IsCharBoundaryGasParameters { + base: get_gas_cost_or_default!(string_is_char_boundary_base_cost_as_option), + }, + sub_string: MSN::string::SubStringGasParameters { + base: get_gas_cost_or_default!(string_sub_string_base_cost_as_option), + per_byte: get_gas_cost_or_default!(string_sub_string_per_byte_cost_as_option), + }, + index_of: MSN::string::IndexOfGasParameters { + base: get_gas_cost_or_default!(string_index_of_base_cost_as_option), + per_byte_pattern: get_gas_cost_or_default!( + string_index_of_per_byte_pattern_cost_as_option + ), + per_byte_searched: get_gas_cost_or_default!( + string_index_of_per_byte_searched_cost_as_option + ), + }, + }, + MSN::type_name::GasParameters { + get: MSN::type_name::GetGasParameters { + base: get_gas_cost_or_default!(type_name_get_base_cost_as_option), + per_byte: get_gas_cost_or_default!(type_name_get_per_byte_cost_as_option), + }, + }, + MSN::vector::GasParameters { + empty: MSN::vector::EmptyGasParameters { + base: get_gas_cost_or_default!(vector_empty_base_cost_as_option), + }, + length: MSN::vector::LengthGasParameters { + base: get_gas_cost_or_default!(vector_length_base_cost_as_option), + }, + push_back: MSN::vector::PushBackGasParameters { + base: get_gas_cost_or_default!(vector_push_back_base_cost_as_option), + legacy_per_abstract_memory_unit: get_gas_cost_or_default!( + vector_push_back_legacy_per_abstract_memory_unit_cost_as_option + ), + }, + borrow: MSN::vector::BorrowGasParameters { + base: get_gas_cost_or_default!(vector_borrow_base_cost_as_option), + }, + pop_back: MSN::vector::PopBackGasParameters { + base: get_gas_cost_or_default!(vector_pop_back_base_cost_as_option), + }, + destroy_empty: MSN::vector::DestroyEmptyGasParameters { + base: get_gas_cost_or_default!(vector_destroy_empty_base_cost_as_option), + }, + swap: MSN::vector::SwapGasParameters { + base: get_gas_cost_or_default!(vector_swap_base_cost_as_option), + }, + }, + ) +} + +pub fn all_natives(silent: bool, protocol_config: &ProtocolConfig) -> NativeFunctionTable { let sui_framework_natives: &[(&str, &str, NativeFunction)] = &[ ("address", "from_bytes", make_native!(address::from_bytes)), ("address", "to_u256", make_native!(address::to_u256)), @@ -966,14 +1070,8 @@ pub fn all_natives(silent: bool) -> NativeFunctionTable { .chain(sui_framework_natives_iter) .chain(move_stdlib_natives::all_natives( MOVE_STDLIB_ADDRESS, - // TODO: tune gas params - GasParameters::zeros(), - )) - .chain(move_stdlib_natives::nursery_natives( + make_stdlib_gas_params_for_protocol_config(protocol_config), silent, - MOVE_STDLIB_ADDRESS, - // TODO: tune gas params - NurseryGasParameters::zeros(), )) .collect() } diff --git a/sui-execution/src/latest.rs b/sui-execution/src/latest.rs index a9f165624b928..4fb142dda49b9 100644 --- a/sui-execution/src/latest.rs +++ b/sui-execution/src/latest.rs @@ -50,7 +50,7 @@ impl Executor { enable_profiler: Option, ) -> Result { Ok(Executor(Arc::new(new_move_vm( - all_natives(silent), + all_natives(silent, protocol_config), protocol_config, enable_profiler, )?))) From 8dba8d3518693ff76d1b42cae946218e1df5c0b7 Mon Sep 17 00:00:00 2001 From: Todd Nowacki Date: Mon, 29 Jul 2024 12:25:46 -0700 Subject: [PATCH 160/163] Cherry pick #18842 (#18845) ## Description - Cherry pick #18842 - Source only change, does not affect devnet/testnet or any other build ## Test plan - CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .../sui-framework/packages/move-stdlib/sources/vector.move | 2 +- .../packages/move-stdlib/tests/vector_tests.move | 5 +++++ .../move/crates/move-analyzer/tests/dot_completion.exp | 2 +- external-crates/move/crates/move-stdlib/sources/vector.move | 2 +- .../move/crates/move-stdlib/tests/vector_tests.move | 5 +++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/sui-framework/packages/move-stdlib/sources/vector.move b/crates/sui-framework/packages/move-stdlib/sources/vector.move index cd98ed0ae7955..55c1abac34b74 100644 --- a/crates/sui-framework/packages/move-stdlib/sources/vector.move +++ b/crates/sui-framework/packages/move-stdlib/sources/vector.move @@ -238,7 +238,7 @@ module std::vector { /// Finds the index of first element in the vector `v` that satisfies the predicate `f`. /// Returns `some(index)` if such an element is found, otherwise `none()`. - public macro fun find_index<$T>($v: vector<$T>, $f: |&$T| -> bool): Option { + public macro fun find_index<$T>($v: &vector<$T>, $f: |&$T| -> bool): Option { let v = $v; 'find_index: { v.length().do!(|i| if ($f(&v[i])) return 'find_index option::some(i)); diff --git a/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move b/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move index 2bb76d6310017..3aac6ef5b4e5f 100644 --- a/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move +++ b/crates/sui-framework/packages/move-stdlib/tests/vector_tests.move @@ -677,6 +677,11 @@ module std::vector_tests { let r = vector[0, 10, 100, 1_000]; assert!(r.find_index!(|e| *e == 100).destroy_some() == 2); assert!(r.find_index!(|e| *e == 10_000).is_none()); + + let v = vector[Droppable{}, Droppable{}]; + let idx = v.find_index!(|e| e == Droppable{}); + assert!(idx.destroy_some() == 0); + assert!(&v[idx.destroy_some()] == Droppable{}); } #[test] diff --git a/external-crates/move/crates/move-analyzer/tests/dot_completion.exp b/external-crates/move/crates/move-analyzer/tests/dot_completion.exp index ad426b6f92568..547bc99ee900a 100644 --- a/external-crates/move/crates/move-analyzer/tests/dot_completion.exp +++ b/external-crates/move/crates/move-analyzer/tests/dot_completion.exp @@ -107,7 +107,7 @@ Method 'filter!()' Method 'find_index!()' INSERT TEXT: 'find_index!(|${1}| ${2})' TARGET : '(std::vector::find_index)' - TYPE : 'fun <$T>(vector<$T>, |&$T| -> bool): Option' + TYPE : 'fun <$T>(&vector<$T>, |&$T| -> bool): Option' Method 'fold!()' INSERT TEXT: 'fold!(${1:init}, |${2}, ${3}| ${4})' TARGET : '(std::vector::fold)' diff --git a/external-crates/move/crates/move-stdlib/sources/vector.move b/external-crates/move/crates/move-stdlib/sources/vector.move index cd98ed0ae7955..55c1abac34b74 100644 --- a/external-crates/move/crates/move-stdlib/sources/vector.move +++ b/external-crates/move/crates/move-stdlib/sources/vector.move @@ -238,7 +238,7 @@ module std::vector { /// Finds the index of first element in the vector `v` that satisfies the predicate `f`. /// Returns `some(index)` if such an element is found, otherwise `none()`. - public macro fun find_index<$T>($v: vector<$T>, $f: |&$T| -> bool): Option { + public macro fun find_index<$T>($v: &vector<$T>, $f: |&$T| -> bool): Option { let v = $v; 'find_index: { v.length().do!(|i| if ($f(&v[i])) return 'find_index option::some(i)); diff --git a/external-crates/move/crates/move-stdlib/tests/vector_tests.move b/external-crates/move/crates/move-stdlib/tests/vector_tests.move index 2bb76d6310017..3aac6ef5b4e5f 100644 --- a/external-crates/move/crates/move-stdlib/tests/vector_tests.move +++ b/external-crates/move/crates/move-stdlib/tests/vector_tests.move @@ -677,6 +677,11 @@ module std::vector_tests { let r = vector[0, 10, 100, 1_000]; assert!(r.find_index!(|e| *e == 100).destroy_some() == 2); assert!(r.find_index!(|e| *e == 10_000).is_none()); + + let v = vector[Droppable{}, Droppable{}]; + let idx = v.find_index!(|e| e == Droppable{}); + assert!(idx.destroy_some() == 0); + assert!(&v[idx.destroy_some()] == Droppable{}); } #[test] From a4185da5659d8d299d34e1bb2515ff1f7e32a20a Mon Sep 17 00:00:00 2001 From: Eugene Boguslavsky Date: Mon, 29 Jul 2024 19:42:56 +0000 Subject: [PATCH 161/163] Sui v1.30.1 version bump --- Cargo.lock | 112 +++++++++++++------------- Cargo.toml | 2 +- crates/sui-open-rpc/spec/openrpc.json | 2 +- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d2e77e5b25e9..3fccfeaa82348 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1824,7 +1824,7 @@ checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" [[package]] name = "bin-version" -version = "1.30.0" +version = "1.30.1" dependencies = [ "const-str", "git-version", @@ -12075,7 +12075,7 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "sui" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anemo", "anyhow", @@ -12146,7 +12146,7 @@ dependencies = [ "sui-package-management", "sui-protocol-config", "sui-replay", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-simulator", "sui-source-validation", "sui-swarm", @@ -12290,7 +12290,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "arrow", @@ -12344,7 +12344,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer-derive" -version = "1.30.0" +version = "1.30.1" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", @@ -12353,7 +12353,7 @@ dependencies = [ [[package]] name = "sui-archival" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "byteorder", @@ -12461,7 +12461,7 @@ dependencies = [ "sui-macros", "sui-network", "sui-protocol-config", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-simulator", "sui-storage", "sui-surfer", @@ -12479,7 +12479,7 @@ dependencies = [ [[package]] name = "sui-bridge" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "arc-swap", @@ -12514,7 +12514,7 @@ dependencies = [ "sui-json-rpc-api", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-test-transaction-builder", "sui-types", "tap", @@ -12530,7 +12530,7 @@ dependencies = [ [[package]] name = "sui-bridge-cli" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "clap", @@ -12547,7 +12547,7 @@ dependencies = [ "sui-config", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-types", "telemetry-subscribers", "tokio", @@ -12576,7 +12576,7 @@ dependencies = [ "sui-config", "sui-data-ingestion-core", "sui-json-rpc-types", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-test-transaction-builder", "sui-types", "tap", @@ -12588,7 +12588,7 @@ dependencies = [ [[package]] name = "sui-cluster-test" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-trait", @@ -12612,7 +12612,7 @@ dependencies = [ "sui-json", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-swarm", "sui-swarm-config", "sui-test-transaction-builder", @@ -12788,7 +12788,7 @@ dependencies = [ [[package]] name = "sui-data-ingestion" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-trait", @@ -12850,7 +12850,7 @@ dependencies = [ [[package]] name = "sui-e2e-tests" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "assert_cmd", @@ -12894,7 +12894,7 @@ dependencies = [ "sui-node", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-simulator", "sui-storage", "sui-swarm", @@ -12967,7 +12967,7 @@ dependencies = [ [[package]] name = "sui-faucet" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-recursion", @@ -12987,7 +12987,7 @@ dependencies = [ "sui-config", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-types", "tap", "telemetry-subscribers", @@ -13025,7 +13025,7 @@ dependencies = [ [[package]] name = "sui-framework-snapshot" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "bcs", @@ -13087,7 +13087,7 @@ dependencies = [ [[package]] name = "sui-graphql-config" -version = "1.30.0" +version = "1.30.1" dependencies = [ "quote 1.0.35", "syn 1.0.107", @@ -13164,7 +13164,7 @@ dependencies = [ "sui-package-resolver", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-swarm-config", "sui-test-transaction-builder", "sui-types", @@ -13204,7 +13204,7 @@ dependencies = [ [[package]] name = "sui-indexer" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-trait", @@ -13247,7 +13247,7 @@ dependencies = [ "sui-package-resolver", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-test-transaction-builder", "sui-transaction-builder", "sui-types", @@ -13380,7 +13380,7 @@ dependencies = [ "sui-open-rpc", "sui-open-rpc-macros", "sui-protocol-config", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-simulator", "sui-swarm-config", "sui-test-transaction-builder", @@ -13441,7 +13441,7 @@ dependencies = [ [[package]] name = "sui-light-client" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-trait", @@ -13458,7 +13458,7 @@ dependencies = [ "sui-json-rpc-types", "sui-package-resolver", "sui-rest-api", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-types", "tokio", ] @@ -13475,7 +13475,7 @@ dependencies = [ [[package]] name = "sui-metric-checker" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "backoff", @@ -13496,7 +13496,7 @@ dependencies = [ [[package]] name = "sui-move" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "assert_cmd", @@ -13538,7 +13538,7 @@ dependencies = [ [[package]] name = "sui-move-build" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "datatest-stable", @@ -13562,7 +13562,7 @@ dependencies = [ [[package]] name = "sui-move-lsp" -version = "1.30.0" +version = "1.30.1" dependencies = [ "bin-version", "clap", @@ -13692,7 +13692,7 @@ dependencies = [ [[package]] name = "sui-node" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anemo", "anemo-tower", @@ -13743,7 +13743,7 @@ dependencies = [ [[package]] name = "sui-open-rpc" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "bcs", @@ -13779,7 +13779,7 @@ dependencies = [ [[package]] name = "sui-oracle" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "bcs", @@ -13799,7 +13799,7 @@ dependencies = [ "sui-json-rpc-types", "sui-keys", "sui-move-build", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-types", "tap", "telemetry-subscribers", @@ -13809,14 +13809,14 @@ dependencies = [ [[package]] name = "sui-package-management" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "move-core-types", "move-package", "move-symbol-pool", "sui-json-rpc-types", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-types", "tracing", ] @@ -13958,7 +13958,7 @@ dependencies = [ "sui-json-rpc-api", "sui-json-rpc-types", "sui-protocol-config", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-storage", "sui-transaction-checks", "sui-types", @@ -14002,7 +14002,7 @@ dependencies = [ [[package]] name = "sui-rosetta" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-trait", @@ -14030,7 +14030,7 @@ dependencies = [ "sui-keys", "sui-move-build", "sui-node", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-swarm-config", "sui-types", "telemetry-subscribers", @@ -14044,7 +14044,7 @@ dependencies = [ [[package]] name = "sui-rpc-loadgen" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-trait", @@ -14062,7 +14062,7 @@ dependencies = [ "sui-json-rpc", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-types", "telemetry-subscribers", "test-cluster", @@ -14093,7 +14093,7 @@ dependencies = [ [[package]] name = "sui-sdk" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-recursion", @@ -14129,7 +14129,7 @@ dependencies = [ [[package]] name = "sui-security-watchdog" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "arrow-array", @@ -14176,7 +14176,7 @@ dependencies = [ [[package]] name = "sui-single-node-benchmark" -version = "1.30.0" +version = "1.30.1" dependencies = [ "async-trait", "bcs", @@ -14238,7 +14238,7 @@ dependencies = [ [[package]] name = "sui-source-validation" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "colored", @@ -14255,7 +14255,7 @@ dependencies = [ "rand 0.8.5", "sui-json-rpc-types", "sui-move-build", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-test-transaction-builder", "sui-types", "tar", @@ -14291,7 +14291,7 @@ dependencies = [ "sui-json-rpc-types", "sui-move", "sui-move-build", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-source-validation", "telemetry-subscribers", "tempfile", @@ -14363,7 +14363,7 @@ dependencies = [ [[package]] name = "sui-surfer" -version = "1.30.0" +version = "1.30.1" dependencies = [ "async-trait", "bcs", @@ -14461,13 +14461,13 @@ dependencies = [ "shared-crypto", "sui-genesis-builder", "sui-move-build", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-types", ] [[package]] name = "sui-test-validator" -version = "1.30.0" +version = "1.30.1" [[package]] name = "sui-tls" @@ -14492,7 +14492,7 @@ dependencies = [ [[package]] name = "sui-tool" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anemo", "anemo-cli", @@ -14528,7 +14528,7 @@ dependencies = [ "sui-network", "sui-protocol-config", "sui-replay", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-snapshot", "sui-storage", "sui-types", @@ -14782,7 +14782,7 @@ dependencies = [ [[package]] name = "suins-indexer" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "async-trait", @@ -15140,7 +15140,7 @@ dependencies = [ "sui-macros", "sui-node", "sui-protocol-config", - "sui-sdk 1.30.0", + "sui-sdk 1.30.1", "sui-simulator", "sui-swarm", "sui-swarm-config", @@ -16904,7 +16904,7 @@ dependencies = [ [[package]] name = "x" -version = "1.30.0" +version = "1.30.1" dependencies = [ "anyhow", "camino", diff --git a/Cargo.toml b/Cargo.toml index eae984ca47082..0f26cbc43a967 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -198,7 +198,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.30.0" +version = "1.30.1" [profile.release] # debug = 1 means line charts only, which is minimum needed for good stack traces diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index 2935b547a40cd..6a558b1f5e13c 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.30.0" + "version": "1.30.1" }, "methods": [ { From 20a447119d3eb7afe853a5c61301036b54a871de Mon Sep 17 00:00:00 2001 From: NB Date: Mon, 12 Aug 2024 13:23:47 +0200 Subject: [PATCH 162/163] fix --- Cargo.lock | 862 +----------------- Cargo.toml | 48 +- binary-build-list.json | 1 - crates/sui-cluster-test/Cargo.toml | 1 + crates/sui-cluster-test/src/cluster.rs | 33 + .../sui-config/src/object_storage_config.rs | 66 +- crates/sui-data-ingestion-core/src/util.rs | 12 +- crates/sui-graphql-rpc/Cargo.toml | 10 +- .../sui-graphql-rpc/src/test_infra/cluster.rs | 33 + crates/sui-metric-checker/src/query.rs | 4 +- crates/sui/Cargo.toml | 11 +- 11 files changed, 167 insertions(+), 914 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6d01d2a3dc4e..0ea4e18f5bccc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -769,12 +769,6 @@ dependencies = [ "regex-syntax 0.8.4", ] -[[package]] -name = "ascii_utils" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" - [[package]] name = "asn1-rs" version = "0.5.1" @@ -834,7 +828,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" dependencies = [ - "brotli 3.3.4", + "brotli", "flate2", "futures-core", "memchr", @@ -855,105 +849,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-graphql" -version = "6.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298a5d587d6e6fdb271bf56af2dc325a80eb291fd0fc979146584b9a05494a8c" -dependencies = [ - "async-graphql-derive", - "async-graphql-parser", - "async-graphql-value", - "async-stream", - "async-trait", - "base64 0.13.1", - "bytes", - "chrono", - "fast_chemail", - "fnv", - "futures-channel", - "futures-timer", - "futures-util", - "handlebars", - "http 0.2.9", - "indexmap 2.2.6", - "lru 0.7.8", - "mime", - "multer", - "num-traits", - "once_cell", - "opentelemetry 0.21.0", - "pin-project-lite", - "regex", - "serde", - "serde_json", - "serde_urlencoded", - "static_assertions", - "tempfile", - "thiserror", - "tracing", - "tracing-futures", -] - -[[package]] -name = "async-graphql-axum" -version = "6.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a1c20a2059bffbc95130715b23435a05168c518fba9709c81fa2a38eed990c" -dependencies = [ - "async-graphql", - "async-trait", - "axum", - "bytes", - "futures-util", - "serde_json", - "tokio", - "tokio-stream", - "tokio-util 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tower-service", -] - -[[package]] -name = "async-graphql-derive" -version = "6.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f329c7eb9b646a72f70c9c4b516c70867d356ec46cb00dcac8ad343fd006b0" -dependencies = [ - "Inflector", - "async-graphql-parser", - "darling 0.20.10", - "proc-macro-crate", - "proc-macro2 1.0.78", - "quote 1.0.35", - "strum 0.25.0", - "syn 2.0.48", - "thiserror", -] - -[[package]] -name = "async-graphql-parser" -version = "6.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6139181845757fd6a73fbb8839f3d036d7150b798db0e9bb3c6e83cdd65bd53b" -dependencies = [ - "async-graphql-value", - "pest", - "serde", - "serde_json", -] - -[[package]] -name = "async-graphql-value" -version = "6.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "323a5143f5bdd2030f45e3f2e0c821c9b1d36e79cf382129c64299c50a7f3750" -dependencies = [ - "bytes", - "indexmap 2.2.6", - "serde", - "serde_json", -] - [[package]] name = "async-lock" version = "2.6.0" @@ -2127,18 +2022,7 @@ checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", - "brotli-decompressor 2.3.2", -] - -[[package]] -name = "brotli" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor 4.0.1", + "brotli-decompressor", ] [[package]] @@ -2151,16 +2035,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "brotli-decompressor" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bs58" version = "0.4.0" @@ -4045,23 +3919,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "enum-as-inner" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" -dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 2.0.48", -] - [[package]] name = "enum-compat-util" version = "0.1.0" dependencies = [ - "serde_yaml 0.8.26", + "serde_yaml", ] [[package]] @@ -4475,15 +4337,6 @@ dependencies = [ "rand 0.7.3", ] -[[package]] -name = "fast_chemail" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495a39d30d624c2caabe6312bfead73e7717692b44e0b32df168c275a2e8e9e4" -dependencies = [ - "ascii_utils", -] - [[package]] name = "fastcrypto" version = "0.1.8" @@ -4977,29 +4830,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "gcp-bigquery-client" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7fe3895eb99784b8ad2776688b41e068e918d18ebb736dafb1a321bce46c749" -dependencies = [ - "async-stream", - "async-trait", - "dyn-clone", - "hyper 0.14.26", - "hyper-rustls 0.25.0", - "log", - "reqwest 0.12.4", - "serde", - "serde_json", - "thiserror", - "time", - "tokio", - "tokio-stream", - "url", - "yup-oauth2", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -5280,20 +5110,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "handlebars" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" -dependencies = [ - "log", - "pest", - "pest_derive", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -5617,23 +5433,6 @@ dependencies = [ "webpki-roots 0.23.1", ] -[[package]] -name = "hyper-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c78f9338483cb7e630c8474b07268983c6bd5acee012e4211f9f7bb21b070" -dependencies = [ - "futures-util", - "http 0.2.9", - "hyper 0.14.26", - "log", - "rustls 0.22.4", - "rustls-native-certs 0.7.1", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.25.0", -] - [[package]] name = "hyper-rustls" version = "0.26.0" @@ -6539,15 +6338,6 @@ dependencies = [ "serde", ] -[[package]] -name = "lru" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" -dependencies = [ - "hashbrown 0.12.3", -] - [[package]] name = "lru" version = "0.10.0" @@ -6601,15 +6391,6 @@ dependencies = [ "libc", ] -[[package]] -name = "lz4_flex" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" -dependencies = [ - "twox-hash", -] - [[package]] name = "mach2" version = "0.4.1" @@ -6625,12 +6406,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -[[package]] -name = "markdown-gen" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8034621d7f1258317ca1dfb9205e3925d27ee4aa2a46620a09c567daf0310562" - [[package]] name = "match_opt" version = "0.1.2" @@ -7055,7 +6830,7 @@ dependencies = [ "move-vm-runtime", "move-vm-test-utils", "move-vm-types", - "serde_yaml 0.8.26", + "serde_yaml", "tempfile", "toml_edit 0.14.4", "walkdir", @@ -7192,23 +6967,6 @@ dependencies = [ "serde", ] -[[package]] -name = "move-ir-compiler" -version = "0.1.0" -dependencies = [ - "anyhow", - "bcs", - "clap", - "move-abstract-interpreter", - "move-binary-format", - "move-bytecode-source-map", - "move-bytecode-verifier", - "move-command-line-common", - "move-core-types", - "move-ir-to-bytecode", - "serde_json", -] - [[package]] name = "move-ir-to-bytecode" version = "0.1.0" @@ -7295,7 +7053,7 @@ dependencies = [ "petgraph 0.5.1", "regex", "serde", - "serde_yaml 0.8.26", + "serde_yaml", "sha2 0.9.9", "tempfile", "toml 0.5.11", @@ -7438,36 +7196,6 @@ dependencies = [ "serde", ] -[[package]] -name = "move-transactional-test-runner" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "clap", - "move-binary-format", - "move-bytecode-source-map", - "move-cli", - "move-command-line-common", - "move-compiler", - "move-core-types", - "move-disassembler", - "move-ir-compiler", - "move-ir-types", - "move-stdlib", - "move-stdlib-natives", - "move-symbol-pool", - "move-vm-config", - "move-vm-runtime", - "move-vm-test-utils", - "move-vm-types", - "once_cell", - "rayon", - "regex", - "tempfile", - "tokio", -] - [[package]] name = "move-unit-test" version = "0.1.0" @@ -7655,24 +7383,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "multer" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http 0.2.9", - "httparse", - "log", - "memchr", - "mime", - "spin 0.9.8", - "version_check", -] - [[package]] name = "multiaddr" version = "0.17.0" @@ -7986,7 +7696,7 @@ dependencies = [ "rand 0.8.5", "reqwest 0.12.4", "serde-reflection", - "serde_yaml 0.8.26", + "serde_yaml", "sui-keys", "sui-protocol-config", "sui-types", @@ -8626,15 +8336,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - [[package]] name = "number_prefix" version = "0.4.0" @@ -8671,7 +8372,6 @@ dependencies = [ "rand 0.8.5", "reqwest 0.12.4", "ring 0.17.8", - "rustls-pemfile 2.1.2", "serde", "serde_json", "snafu", @@ -8788,22 +8488,6 @@ dependencies = [ "opentelemetry_sdk", ] -[[package]] -name = "opentelemetry" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" -dependencies = [ - "futures-core", - "futures-sink", - "indexmap 2.2.6", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror", - "urlencoding", -] - [[package]] name = "opentelemetry-otlp" version = "0.13.0" @@ -8841,7 +8525,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" dependencies = [ - "opentelemetry 0.20.0", + "opentelemetry", ] [[package]] @@ -8873,7 +8557,7 @@ dependencies = [ "futures-util", "once_cell", "opentelemetry_api", - "ordered-float 3.9.1", + "ordered-float", "percent-encoding", "rand 0.8.5", "regex", @@ -8889,15 +8573,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "ordered-float" -version = "2.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" -dependencies = [ - "num-traits", -] - [[package]] name = "ordered-float" version = "3.9.1" @@ -9102,39 +8777,6 @@ dependencies = [ "windows-targets 0.48.0", ] -[[package]] -name = "parquet" -version = "52.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e977b9066b4d3b03555c22bdc442f3fadebd96a39111249113087d0edb2691cd" -dependencies = [ - "ahash 0.8.11", - "arrow-array", - "arrow-buffer", - "arrow-cast", - "arrow-data", - "arrow-ipc", - "arrow-schema", - "arrow-select", - "base64 0.22.1", - "brotli 6.0.0", - "bytes", - "chrono", - "flate2", - "half 2.4.1", - "hashbrown 0.14.5", - "lz4_flex", - "num", - "num-bigint 0.4.4", - "paste", - "seq-macro", - "snap", - "thrift", - "twox-hash", - "zstd 0.13.2", - "zstd-sys", -] - [[package]] name = "passkey-authenticator" version = "0.2.0" @@ -9795,20 +9437,6 @@ dependencies = [ "protobuf", ] -[[package]] -name = "prometheus-http-query" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0de773a6ba25c9164ed9d86d653a92fac759a6f0e683fd141d56bb96e80fd8b" -dependencies = [ - "enum-as-inner", - "mime", - "reqwest 0.11.20", - "serde", - "time", - "url", -] - [[package]] name = "prometheus-parse" version = "0.2.3" @@ -10405,7 +10033,6 @@ dependencies = [ "http 0.2.9", "http-body 0.4.5", "hyper 0.14.26", - "hyper-rustls 0.24.0", "ipnet", "js-sys", "log", @@ -10413,19 +10040,15 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.12", - "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls 0.24.0", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.2", "winreg 0.50.0", ] @@ -11261,12 +10884,6 @@ dependencies = [ "untrusted 0.7.1", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "sec1" version = "0.3.0" @@ -11386,12 +11003,6 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" -[[package]] -name = "seq-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" - [[package]] name = "serde" version = "1.0.202" @@ -11594,19 +11205,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap 2.2.6", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "serdect" version = "0.2.0" @@ -11617,31 +11215,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serial_test" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" -dependencies = [ - "dashmap", - "futures", - "lazy_static", - "log", - "parking_lot 0.12.1", - "serial_test_derive", -] - -[[package]] -name = "serial_test_derive" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" -dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 2.0.48", -] - [[package]] name = "sha-1" version = "0.9.8" @@ -12279,18 +11852,16 @@ dependencies = [ "rustyline-derive", "serde", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "shared-crypto", "shell-words", "shlex", "signature 1.6.4", "sui-bridge", - "sui-cluster-test", "sui-config", "sui-execution", "sui-faucet", "sui-genesis-builder", - "sui-graphql-rpc", "sui-indexer", "sui-json", "sui-json-rpc-types", @@ -12353,14 +11924,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "sui-adapter-transactional-tests" -version = "0.1.0" -dependencies = [ - "datatest-stable", - "sui-transactional-test-runner", -] - [[package]] name = "sui-adapter-v0" version = "0.1.0" @@ -12443,69 +12006,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "sui-analytics-indexer" -version = "1.30.1" -dependencies = [ - "anyhow", - "arrow", - "arrow-array", - "async-trait", - "axum", - "bcs", - "byteorder", - "bytes", - "chrono", - "clap", - "csv", - "eyre", - "fastcrypto", - "gcp-bigquery-client", - "move-binary-format", - "move-bytecode-utils", - "move-core-types", - "mysten-metrics", - "num_enum 0.6.1", - "object_store", - "parquet", - "prometheus", - "rocksdb", - "serde", - "serde_json", - "simulacrum", - "snowflake-api", - "strum 0.24.1", - "strum_macros 0.24.3", - "sui-analytics-indexer-derive", - "sui-config", - "sui-data-ingestion-core", - "sui-indexer", - "sui-json-rpc-types", - "sui-package-resolver", - "sui-rest-api", - "sui-storage", - "sui-types", - "tap", - "telemetry-subscribers", - "tempfile", - "thiserror", - "tokio", - "tokio-stream", - "tracing", - "typed-store", - "typed-store-derive", - "url", -] - -[[package]] -name = "sui-analytics-indexer-derive" -version = "1.30.1" -dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 1.0.107", -] - [[package]] name = "sui-archival" version = "1.30.1" @@ -12726,7 +12226,7 @@ dependencies = [ "mysten-metrics", "prometheus", "serde", - "serde_yaml 0.8.26", + "serde_yaml", "sui-bridge", "sui-config", "sui-data-ingestion-core", @@ -12741,45 +12241,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "sui-cluster-test" -version = "1.30.1" -dependencies = [ - "anyhow", - "async-trait", - "clap", - "derivative", - "diesel", - "fastcrypto", - "futures", - "jsonrpsee", - "move-core-types", - "prometheus", - "regex", - "reqwest 0.12.4", - "serde_json", - "shared-crypto", - "sui-config", - "sui-core", - "sui-faucet", - "sui-graphql-rpc", - "sui-indexer", - "sui-json", - "sui-json-rpc-types", - "sui-keys", - "sui-sdk 1.30.1", - "sui-swarm", - "sui-swarm-config", - "sui-test-transaction-builder", - "sui-types", - "telemetry-subscribers", - "tempfile", - "test-cluster", - "tokio", - "tracing", - "uuid 1.2.2", -] - [[package]] name = "sui-config" version = "0.0.0" @@ -12801,7 +12262,7 @@ dependencies = [ "reqwest 0.12.4", "serde", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "sui-keys", "sui-protocol-config", "sui-types", @@ -12881,7 +12342,7 @@ dependencies = [ "serde-reflection", "serde_json", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "shared-crypto", "signature 1.6.4", "static_assertions", @@ -12963,7 +12424,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "sui-archival", "sui-data-ingestion-core", "sui-storage", @@ -13070,7 +12531,7 @@ dependencies = [ name = "sui-enum-compat-util" version = "0.1.0" dependencies = [ - "serde_yaml 0.8.26", + "serde_yaml", ] [[package]] @@ -13228,7 +12689,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "shared-crypto", "sui-config", "sui-execution", @@ -13241,123 +12702,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "sui-graphql-config" -version = "1.30.1" -dependencies = [ - "quote 1.0.35", - "syn 1.0.107", -] - -[[package]] -name = "sui-graphql-e2e-tests" -version = "0.1.0" -dependencies = [ - "datatest-stable", - "msim", - "sui-graphql-rpc", - "sui-transactional-test-runner", - "tokio", -] - -[[package]] -name = "sui-graphql-rpc" -version = "2024.7.0" -dependencies = [ - "anyhow", - "async-graphql", - "async-graphql-axum", - "async-graphql-value", - "async-trait", - "axum", - "bcs", - "bin-version", - "chrono", - "clap", - "const-str", - "diesel", - "downcast", - "either", - "expect-test", - "fastcrypto", - "fastcrypto-zkp", - "futures", - "hex", - "http 0.2.9", - "hyper 0.14.26", - "im", - "insta", - "itertools 0.10.5", - "lru 0.10.0", - "markdown-gen", - "move-binary-format", - "move-bytecode-utils", - "move-core-types", - "move-disassembler", - "move-ir-types", - "mysten-metrics", - "mysten-network", - "once_cell", - "prometheus", - "rand 0.8.5", - "regex", - "reqwest 0.12.4", - "serde", - "serde_json", - "serde_with 3.8.1", - "serde_yaml 0.8.26", - "serial_test", - "shared-crypto", - "similar", - "simulacrum", - "sui-framework", - "sui-graphql-config", - "sui-graphql-rpc-client", - "sui-graphql-rpc-headers", - "sui-indexer", - "sui-json-rpc", - "sui-json-rpc-types", - "sui-package-resolver", - "sui-protocol-config", - "sui-rest-api", - "sui-sdk 1.30.1", - "sui-swarm-config", - "sui-test-transaction-builder", - "sui-types", - "tap", - "telemetry-subscribers", - "tempfile", - "test-cluster", - "thiserror", - "tokio", - "tokio-util 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.7.4", - "tower", - "tower-http", - "tracing", - "uuid 1.2.2", -] - -[[package]] -name = "sui-graphql-rpc-client" -version = "0.1.0" -dependencies = [ - "async-graphql", - "axum", - "hyper 0.14.26", - "reqwest 0.12.4", - "serde_json", - "sui-graphql-rpc-headers", - "thiserror", -] - -[[package]] -name = "sui-graphql-rpc-headers" -version = "0.1.0" -dependencies = [ - "axum", -] - [[package]] name = "sui-indexer" version = "1.30.1" @@ -13610,7 +12954,7 @@ dependencies = [ "move-core-types", "serde", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "sui-config", "sui-json", "sui-json-rpc-types", @@ -13631,27 +12975,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "sui-metric-checker" -version = "1.30.1" -dependencies = [ - "anyhow", - "backoff", - "base64 0.21.2", - "chrono", - "clap", - "humantime", - "once_cell", - "prometheus-http-query", - "reqwest 0.12.4", - "serde", - "serde_yaml 0.9.34+deprecated", - "strum_macros 0.24.3", - "telemetry-subscribers", - "tokio", - "tracing", -] - [[package]] name = "sui-move" version = "1.30.1" @@ -13679,7 +13002,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "sui-core", "sui-macros", "sui-move-build", @@ -14069,7 +13392,7 @@ dependencies = [ "serde", "serde_json", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "snap", "sui-tls", "sui-types", @@ -14104,7 +13427,7 @@ dependencies = [ "serde", "serde_json", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "shared-crypto", "shellexpand", "similar", @@ -14149,7 +13472,7 @@ dependencies = [ "serde", "serde_json", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "sui-protocol-config", "sui-sdk 0.0.0", "sui-types", @@ -14516,7 +13839,7 @@ dependencies = [ "typed-store", "typed-store-derive", "url", - "zstd 0.12.3+zstd.1.5.2", + "zstd", ] [[package]] @@ -14587,7 +13910,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "shared-crypto", "sui-config", "sui-execution", @@ -14727,55 +14050,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "sui-transactional-test-runner" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "bcs", - "bimap", - "clap", - "criterion", - "eyre", - "fastcrypto", - "futures", - "move-binary-format", - "move-bytecode-utils", - "move-command-line-common", - "move-compiler", - "move-core-types", - "move-stdlib", - "move-symbol-pool", - "move-transactional-test-runner", - "move-vm-runtime", - "msim", - "once_cell", - "rand 0.8.5", - "regex", - "rocksdb", - "serde_json", - "simulacrum", - "sui-config", - "sui-core", - "sui-framework", - "sui-framework-snapshot", - "sui-graphql-rpc", - "sui-json-rpc", - "sui-json-rpc-api", - "sui-json-rpc-types", - "sui-protocol-config", - "sui-rest-api", - "sui-storage", - "sui-swarm-config", - "sui-types", - "telemetry-subscribers", - "tempfile", - "tokio", - "typed-store", - "typed-store-derive", -] - [[package]] name = "sui-types" version = "0.1.0" @@ -14838,7 +14112,7 @@ dependencies = [ "serde-name", "serde_json", "serde_with 3.8.1", - "serde_yaml 0.8.26", + "serde_yaml", "shared-crypto", "signature 1.6.4", "static_assertions", @@ -14887,14 +14161,6 @@ dependencies = [ "sui-types", ] -[[package]] -name = "sui-verifier-transactional-tests" -version = "0.1.0" -dependencies = [ - "datatest-stable", - "sui-transactional-test-runner", -] - [[package]] name = "sui-verifier-v0" version = "0.1.0" @@ -14961,7 +14227,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "sui-data-ingestion-core", "sui-json-rpc", "sui-storage", @@ -14996,7 +14262,7 @@ dependencies = [ "semver 1.0.16", "serde", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "sha2 0.10.6", "spinners", "strum 0.24.1", @@ -15206,7 +14472,7 @@ dependencies = [ "crossterm 0.25.0", "futures", "once_cell", - "opentelemetry 0.20.0", + "opentelemetry", "opentelemetry-otlp", "opentelemetry-proto", "opentelemetry_api", @@ -15409,17 +14675,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "thrift" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e54bc85fc7faa8bc175c4bab5b92ba8d9a3ce893d0e9f42cc455c8ab16a9e09" -dependencies = [ - "byteorder", - "integer-encoding", - "ordered-float 2.10.1", -] - [[package]] name = "time" version = "0.3.31" @@ -15428,8 +14683,6 @@ checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", - "libc", - "num_threads", "powerfmt", "serde", "time-core", @@ -16001,8 +15254,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "futures", - "futures-task", "pin-project", "tracing", ] @@ -16025,7 +15276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" dependencies = [ "once_cell", - "opentelemetry 0.20.0", + "opentelemetry", "opentelemetry_sdk", "smallvec", "tracing", @@ -16360,12 +15611,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "unsigned-varint" version = "0.7.1" @@ -16718,12 +15963,6 @@ dependencies = [ "rustls-webpki 0.100.3", ] -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - [[package]] name = "webpki-roots" version = "0.26.3" @@ -17155,33 +16394,6 @@ dependencies = [ "time", ] -[[package]] -name = "yup-oauth2" -version = "8.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b61da40aeb0907a65f7fb5c1de83c5a224d6a9ebb83bf918588a2bb744d636b8" -dependencies = [ - "anyhow", - "async-trait", - "base64 0.21.2", - "futures", - "http 0.2.9", - "hyper 0.14.26", - "hyper-rustls 0.24.0", - "itertools 0.12.0", - "log", - "percent-encoding", - "rustls 0.22.4", - "rustls-pemfile 1.0.2", - "seahash", - "serde", - "serde_json", - "time", - "tokio", - "tower-service", - "url", -] - [[package]] name = "zerocopy" version = "0.7.35" @@ -17229,16 +16441,7 @@ version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ - "zstd-safe 6.0.5+zstd.1.5.4", -] - -[[package]] -name = "zstd" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" -dependencies = [ - "zstd-safe 7.2.1", + "zstd-safe", ] [[package]] @@ -17251,15 +16454,6 @@ dependencies = [ "zstd-sys", ] -[[package]] -name = "zstd-safe" -version = "7.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" -dependencies = [ - "zstd-sys", -] - [[package]] name = "zstd-sys" version = "2.0.12+zstd.1.5.6" diff --git a/Cargo.toml b/Cargo.toml index 694f60f670cab..0e1a8a1fa8e1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,9 +83,9 @@ members = [ "crates/shared-crypto", "crates/simulacrum", "crates/sui", - "crates/sui-adapter-transactional-tests", - "crates/sui-analytics-indexer", - "crates/sui-analytics-indexer-derive", + # "crates/sui-adapter-transactional-tests", + # "crates/sui-analytics-indexer", + # "crates/sui-analytics-indexer-derive", "crates/sui-archival", "crates/sui-authority-aggregation", "crates/sui-aws-orchestrator", @@ -93,7 +93,7 @@ members = [ "crates/sui-bridge", "crates/sui-bridge-cli", "crates/sui-bridge-indexer", - "crates/sui-cluster-test", + # "crates/sui-cluster-test", "crates/sui-config", "crates/sui-core", "crates/sui-cost", @@ -106,11 +106,11 @@ members = [ "crates/sui-framework-snapshot", "crates/sui-framework-tests", "crates/sui-genesis-builder", - "crates/sui-graphql-config", - "crates/sui-graphql-e2e-tests", - "crates/sui-graphql-rpc", - "crates/sui-graphql-rpc-client", - "crates/sui-graphql-rpc-headers", + # "crates/sui-graphql-config", + # "crates/sui-graphql-e2e-tests", + # "crates/sui-graphql-rpc", + # "crates/sui-graphql-rpc-client", + # "crates/sui-graphql-rpc-headers", "crates/sui-indexer", "crates/sui-json", "crates/sui-json-rpc", @@ -120,7 +120,7 @@ members = [ "crates/sui-keys", "crates/sui-light-client", "crates/sui-macros", - "crates/sui-metric-checker", + # "crates/sui-metric-checker", "crates/sui-move", "crates/sui-move-build", "crates/sui-move-lsp", @@ -157,10 +157,10 @@ members = [ "crates/sui-tool", "crates/sui-transaction-builder", "crates/sui-transaction-checks", - "crates/sui-transactional-test-runner", + # "crates/sui-transactional-test-runner", "crates/sui-types", "crates/sui-upgrade-compatibility-transactional-tests", - "crates/sui-verifier-transactional-tests", + # "crates/sui-verifier-transactional-tests", "crates/suins-indexer", "crates/suiop-cli", "crates/telemetry-subscribers", @@ -388,7 +388,7 @@ ntest = "0.9.0" num-bigint = "0.4.4" num_cpus = "1.15.0" num_enum = "0.6.1" -object_store = { version = "0.10", features = ["aws", "gcp", "azure", "http"] } +object_store = { version = "0.10", features = ["aws", "azure", "http"] } once_cell = "1.18.0" ouroboros = "0.17" parking_lot = "0.12.1" @@ -604,14 +604,14 @@ prometheus-closure-metric = { path = "crates/prometheus-closure-metric" } shared-crypto = { path = "crates/shared-crypto" } simulacrum = { path = "crates/simulacrum" } sui = { path = "crates/sui" } -sui-adapter-transactional-tests = { path = "crates/sui-adapter-transactional-tests" } -sui-analytics-indexer = { path = "crates/sui-analytics-indexer" } -sui-analytics-indexer-derive = { path = "crates/sui-analytics-indexer-derive" } +# sui-adapter-transactional-tests = { path = "crates/sui-adapter-transactional-tests" } +# sui-analytics-indexer = { path = "crates/sui-analytics-indexer" } +# sui-analytics-indexer-derive = { path = "crates/sui-analytics-indexer-derive" } sui-archival = { path = "crates/sui-archival" } sui-authority-aggregation = { path = "crates/sui-authority-aggregation" } sui-benchmark = { path = "crates/sui-benchmark" } sui-bridge = { path = "crates/sui-bridge" } -sui-cluster-test = { path = "crates/sui-cluster-test" } +# sui-cluster-test = { path = "crates/sui-cluster-test" } sui-config = { path = "crates/sui-config" } sui-core = { path = "crates/sui-core" } sui-cost = { path = "crates/sui-cost" } @@ -623,10 +623,10 @@ sui-faucet = { path = "crates/sui-faucet" } sui-framework = { path = "crates/sui-framework" } sui-framework-snapshot = { path = "crates/sui-framework-snapshot" } sui-framework-tests = { path = "crates/sui-framework-tests" } -sui-graphql-config = { path = "crates/sui-graphql-config" } -sui-graphql-rpc = { path = "crates/sui-graphql-rpc" } -sui-graphql-rpc-client = { path = "crates/sui-graphql-rpc-client" } -sui-graphql-rpc-headers = { path = "crates/sui-graphql-rpc-headers" } +# sui-graphql-config = { path = "crates/sui-graphql-config" } +# sui-graphql-rpc = { path = "crates/sui-graphql-rpc" } +# sui-graphql-rpc-client = { path = "crates/sui-graphql-rpc-client" } +# sui-graphql-rpc-headers = { path = "crates/sui-graphql-rpc-headers" } sui-genesis-builder = { path = "crates/sui-genesis-builder" } sui-indexer = { path = "crates/sui-indexer" } sui-json = { path = "crates/sui-json" } @@ -635,7 +635,7 @@ sui-json-rpc-api = { path = "crates/sui-json-rpc-api" } sui-json-rpc-types = { path = "crates/sui-json-rpc-types" } sui-keys = { path = "crates/sui-keys" } sui-macros = { path = "crates/sui-macros" } -sui-metric-checker = { path = "crates/sui-metric-checker" } +# sui-metric-checker = { path = "crates/sui-metric-checker" } sui-move = { path = "crates/sui-move" } sui-move-build = { path = "crates/sui-move-build" } sui-move-lsp = { path = "crates/sui-move-lsp" } @@ -669,10 +669,10 @@ sui-rest-api = { path = "crates/sui-rest-api" } sui-tool = { path = "crates/sui-tool" } sui-transaction-builder = { path = "crates/sui-transaction-builder" } sui-transaction-checks = { path = "crates/sui-transaction-checks" } -sui-transactional-test-runner = { path = "crates/sui-transactional-test-runner" } +# sui-transactional-test-runner = { path = "crates/sui-transactional-test-runner" } sui-types = { path = "crates/sui-types" } sui-upgrade-compatibility-transactional-tests = { path = "crates/sui-upgrade-compatibility-transactional-tests" } -sui-verifier-transactional-tests = { path = "crates/sui-verifier-transactional-tests" } +# sui-verifier-transactional-tests = { path = "crates/sui-verifier-transactional-tests" } telemetry-subscribers = { path = "crates/telemetry-subscribers" } test-cluster = { path = "crates/test-cluster" } transaction-fuzzer = { path = "crates/transaction-fuzzer" } diff --git a/binary-build-list.json b/binary-build-list.json index 4855c1b2a220b..344be336436a8 100644 --- a/binary-build-list.json +++ b/binary-build-list.json @@ -7,7 +7,6 @@ "sui-data-ingestion", "sui-bridge", "sui-bridge-cli", - "sui-graphql-rpc", "sui-test-validator", "move-analyzer" ], diff --git a/crates/sui-cluster-test/Cargo.toml b/crates/sui-cluster-test/Cargo.toml index a6477761d408b..9186b9ea56db2 100644 --- a/crates/sui-cluster-test/Cargo.toml +++ b/crates/sui-cluster-test/Cargo.toml @@ -7,6 +7,7 @@ publish = false edition = "2021" [dependencies] +odin = { workspace = true, version = "0.1.0" } futures.workspace = true serde_json.workspace = true tempfile.workspace = true diff --git a/crates/sui-cluster-test/src/cluster.rs b/crates/sui-cluster-test/src/cluster.rs index 80cfa27153024..244d288063141 100644 --- a/crates/sui-cluster-test/src/cluster.rs +++ b/crates/sui-cluster-test/src/cluster.rs @@ -3,8 +3,10 @@ use super::config::{ClusterTestOpt, Env}; use async_trait::async_trait; +use odin::{ConnectOptions, Odin}; use std::net::SocketAddr; use std::path::Path; +use std::sync::Arc; use sui_config::Config; use sui_config::{PersistedConfig, SUI_KEYSTORE_FILENAME, SUI_NETWORK_CONFIG}; use sui_graphql_rpc::config::ConnectionConfig; @@ -20,6 +22,7 @@ use sui_types::base_types::SuiAddress; use sui_types::crypto::KeypairTraits; use sui_types::crypto::SuiKeyPair; use sui_types::crypto::{get_key_pair, AccountKeyPair}; +use sui_types::nats_queue::nats_queue; use tempfile::tempdir; use test_cluster::{TestCluster, TestClusterBuilder}; use tracing::info; @@ -226,14 +229,43 @@ impl Cluster for LocalNewCluster { if let (Some(pg_address), Some(indexer_address)) = (options.pg_address.clone(), indexer_address) { + let odin = Odin::connect( + Some(vec![ + "nats://localhost:4228".to_string(), + "nats://localhost:4229".to_string(), + ]), + Some(ConnectOptions::with_user_and_password( + "alexandria".to_string(), + "alexandria".to_string(), + )), + ) + .await; + let odin_connection: Arc = Arc::new(odin); + let queue_sender = nats_queue(odin_connection.clone()); + // Start in writer mode start_test_indexer::( Some(pg_address.clone()), fullnode_url.clone(), ReaderWriterConfig::writer_mode(None), data_ingestion_path.clone(), + queue_sender, + ) + .await; + + let odin = Odin::connect( + Some(vec![ + "nats://localhost:4228".to_string(), + "nats://localhost:4229".to_string(), + ]), + Some(ConnectOptions::with_user_and_password( + "alexandria".to_string(), + "alexandria".to_string(), + )), ) .await; + let odin_connection: Arc = Arc::new(odin); + let queue_sender = nats_queue(odin_connection.clone()); // Start in reader mode start_test_indexer::( @@ -241,6 +273,7 @@ impl Cluster for LocalNewCluster { fullnode_url.clone(), ReaderWriterConfig::reader_mode(indexer_address.to_string()), data_ingestion_path, + queue_sender, ) .await; } diff --git a/crates/sui-config/src/object_storage_config.rs b/crates/sui-config/src/object_storage_config.rs index 7bdf75defe4e3..3ded9ffbc2e3f 100644 --- a/crates/sui-config/src/object_storage_config.rs +++ b/crates/sui-config/src/object_storage_config.rs @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -use anyhow::{anyhow, Context, Result}; +use anyhow::{anyhow, bail, Context, Result}; use clap::*; use object_store::aws::AmazonS3Builder; @@ -168,37 +168,37 @@ impl ObjectStoreConfig { self.object_store_connection_limit, ))) } - fn new_gcs(&self) -> Result, anyhow::Error> { - use object_store::gcp::GoogleCloudStorageBuilder; - use object_store::limit::LimitStore; - - info!(bucket=?self.bucket, object_store_type="GCS", "Object Store"); - - let mut builder = GoogleCloudStorageBuilder::new(); - - if let Some(bucket) = &self.bucket { - builder = builder.with_bucket_name(bucket); - } - if let Some(account) = &self.google_service_account { - builder = builder.with_service_account_path(account); - } - if let Some(google_project_id) = &self.google_project_id { - let x_project_header = HeaderName::from_static("x-goog-user-project"); - let iam_req_header = HeaderName::from_static("userproject"); - - let mut headers = HeaderMap::new(); - headers.insert(x_project_header, HeaderValue::from_str(google_project_id)?); - headers.insert(iam_req_header, HeaderValue::from_str(google_project_id)?); - - builder = - builder.with_client_options(ClientOptions::new().with_default_headers(headers)); - } - - Ok(Arc::new(LimitStore::new( - builder.build().context("Invalid gcs config")?, - self.object_store_connection_limit, - ))) - } + // fn new_gcs(&self) -> Result, anyhow::Error> { + // use object_store::gcp::GoogleCloudStorageBuilder; + // use object_store::limit::LimitStore; + + // info!(bucket=?self.bucket, object_store_type="GCS", "Object Store"); + + // let mut builder = GoogleCloudStorageBuilder::new(); + + // if let Some(bucket) = &self.bucket { + // builder = builder.with_bucket_name(bucket); + // } + // if let Some(account) = &self.google_service_account { + // builder = builder.with_service_account_path(account); + // } + // if let Some(google_project_id) = &self.google_project_id { + // let x_project_header = HeaderName::from_static("x-goog-user-project"); + // let iam_req_header = HeaderName::from_static("userproject"); + + // let mut headers = HeaderMap::new(); + // headers.insert(x_project_header, HeaderValue::from_str(google_project_id)?); + // headers.insert(iam_req_header, HeaderValue::from_str(google_project_id)?); + + // builder = + // builder.with_client_options(ClientOptions::new().with_default_headers(headers)); + // } + + // Ok(Arc::new(LimitStore::new( + // builder.build().context("Invalid gcs config")?, + // self.object_store_connection_limit, + // ))) + // } fn new_azure(&self) -> Result, anyhow::Error> { use object_store::azure::MicrosoftAzureBuilder; use object_store::limit::LimitStore; @@ -227,7 +227,7 @@ impl ObjectStoreConfig { match &self.object_store { Some(ObjectStoreType::File) => self.new_local_fs(), Some(ObjectStoreType::S3) => self.new_s3(), - Some(ObjectStoreType::GCS) => self.new_gcs(), + Some(ObjectStoreType::GCS) => bail!("not implemented"), Some(ObjectStoreType::Azure) => self.new_azure(), _ => Err(anyhow!("At least one storage backend should be provided")), } diff --git a/crates/sui-data-ingestion-core/src/util.rs b/crates/sui-data-ingestion-core/src/util.rs index 0ff279fe6c867..57dd3838369af 100644 --- a/crates/sui-data-ingestion-core/src/util.rs +++ b/crates/sui-data-ingestion-core/src/util.rs @@ -3,7 +3,7 @@ use anyhow::Result; use object_store::aws::AmazonS3ConfigKey; -use object_store::gcp::GoogleConfigKey; +// use object_store::gcp::GoogleConfigKey; use object_store::{ClientOptions, ObjectStore, RetryConfig}; use std::str::FromStr; use std::time::Duration; @@ -29,16 +29,6 @@ pub fn create_remote_store_client( .with_retry(retry_config) .build()?; Ok(Box::new(http_store)) - } else if Url::parse(&url)?.scheme() == "gs" { - let url = Url::parse(&url)?; - let mut builder = object_store::gcp::GoogleCloudStorageBuilder::new() - .with_url(url.as_str()) - .with_retry(retry_config) - .with_client_options(client_options); - for (key, value) in remote_store_options { - builder = builder.with_config(GoogleConfigKey::from_str(&key)?, value); - } - Ok(Box::new(builder.build()?)) } else { let url = Url::parse(&url)?; let mut builder = object_store::aws::AmazonS3Builder::new() diff --git a/crates/sui-graphql-rpc/Cargo.toml b/crates/sui-graphql-rpc/Cargo.toml index aa58529dab532..54dfb33052d1b 100644 --- a/crates/sui-graphql-rpc/Cargo.toml +++ b/crates/sui-graphql-rpc/Cargo.toml @@ -8,8 +8,14 @@ edition = "2021" [dependencies] +odin = { workspace = true, version = "0.1.0" } anyhow.workspace = true -async-graphql = {workspace = true, features = ["dataloader", "apollo_tracing", "tracing", "opentelemetry"] } +async-graphql = { workspace = true, features = [ + "dataloader", + "apollo_tracing", + "tracing", + "opentelemetry", +] } async-graphql-axum.workspace = true async-graphql-value.workspace = true async-trait.workspace = true @@ -71,7 +77,7 @@ sui-graphql-rpc-client.workspace = true # TODO: put these behind feature flag to prevent leakage # Used for dummy data bcs.workspace = true -simulacrum.workspace = true # todo: cleanup test only deps +simulacrum.workspace = true # todo: cleanup test only deps sui-json-rpc.workspace = true sui-json-rpc-types.workspace = true sui-indexer = { workspace = true, default-features = true } diff --git a/crates/sui-graphql-rpc/src/test_infra/cluster.rs b/crates/sui-graphql-rpc/src/test_infra/cluster.rs index 4036e3d2985c2..a17bcbdc83996 100644 --- a/crates/sui-graphql-rpc/src/test_infra/cluster.rs +++ b/crates/sui-graphql-rpc/src/test_infra/cluster.rs @@ -6,6 +6,8 @@ use crate::config::ServerConfig; use crate::config::ServiceConfig; use crate::config::Version; use crate::server::graphiql_server::start_graphiql_server; +use odin::ConnectOptions; +use odin::Odin; use std::net::SocketAddr; use std::path::PathBuf; use std::sync::Arc; @@ -20,6 +22,7 @@ use sui_indexer::test_utils::start_test_indexer; use sui_indexer::test_utils::start_test_indexer_impl; use sui_indexer::test_utils::ReaderWriterConfig; use sui_swarm_config::genesis_config::{AccountConfig, DEFAULT_GAS_AMOUNT}; +use sui_types::nats_queue::nats_queue; use sui_types::storage::RestStateReader; use test_cluster::TestCluster; use test_cluster::TestClusterBuilder; @@ -67,12 +70,27 @@ pub async fn start_cluster( start_validator_with_fullnode(internal_data_source_rpc_port, data_ingestion_path.clone()) .await; + let odin = Odin::connect( + Some(vec![ + "nats://localhost:4228".to_string(), + "nats://localhost:4229".to_string(), + ]), + Some(ConnectOptions::with_user_and_password( + "alexandria".to_string(), + "alexandria".to_string(), + )), + ) + .await; + let odin_connection: Arc = Arc::new(odin); + let queue_sender = nats_queue(odin_connection.clone()); + // Starts indexer let (pg_store, pg_handle) = start_test_indexer( Some(db_url), val_fn.rpc_url().to_string(), ReaderWriterConfig::writer_mode(None), data_ingestion_path, + queue_sender, ) .await; @@ -127,6 +145,20 @@ pub async fn serve_executor( .await; }); + let odin = Odin::connect( + Some(vec![ + "nats://localhost:4228".to_string(), + "nats://localhost:4229".to_string(), + ]), + Some(ConnectOptions::with_user_and_password( + "alexandria".to_string(), + "alexandria".to_string(), + )), + ) + .await; + let odin_connection: Arc = Arc::new(odin); + let queue_sender = nats_queue(odin_connection.clone()); + let (pg_store, pg_handle) = start_test_indexer_impl( Some(db_url), format!("http://{}", executor_server_url), @@ -134,6 +166,7 @@ pub async fn serve_executor( Some(graphql_connection_config.db_name()), Some(data_ingestion_path), cancellation_token.clone(), + queue_sender, ) .await; diff --git a/crates/sui-metric-checker/src/query.rs b/crates/sui-metric-checker/src/query.rs index f07972002ce69..f4c16b75b0e18 100644 --- a/crates/sui-metric-checker/src/query.rs +++ b/crates/sui-metric-checker/src/query.rs @@ -16,7 +16,7 @@ pub async fn instant_query( let response = client .query(query) .header( - AUTHORIZATION, + AUTHORIZATION.as_str(), HeaderValue::from_str(&format!( "Basic {}", general_purpose::STANDARD.encode(auth_header) @@ -55,7 +55,7 @@ pub async fn range_query( let response = client .query_range(query, start, end, step) .header( - AUTHORIZATION, + AUTHORIZATION.as_str(), HeaderValue::from_str(&format!( "Basic {}", general_purpose::STANDARD.encode(auth_header) diff --git a/crates/sui/Cargo.toml b/crates/sui/Cargo.toml index 9c06cb2893505..0c2872feefab4 100644 --- a/crates/sui/Cargo.toml +++ b/crates/sui/Cargo.toml @@ -50,11 +50,11 @@ url.workspace = true sui-config.workspace = true sui-bridge.workspace = true -sui-cluster-test.workspace = true +# sui-cluster-test.workspace = true sui-execution = { path = "../../sui-execution" } sui-faucet.workspace = true sui-swarm-config.workspace = true -sui-graphql-rpc = {workspace = true, optional = true} +# sui-graphql-rpc = { workspace = true, optional = true } sui-indexer = { workspace = true, optional = true } sui-genesis-builder.workspace = true sui-types.workspace = true @@ -127,8 +127,5 @@ name = "ptb_files_tests" harness = false [features] -gas-profiler = [ - "sui-types/gas-profiler", - "sui-execution/gas-profiler", -] -indexer = ["dep:sui-indexer", "dep:sui-graphql-rpc"] +gas-profiler = ["sui-types/gas-profiler", "sui-execution/gas-profiler"] +# indexer = ["dep:sui-indexer", "dep:sui-graphql-rpc"] From 500cd81c33a823df7ddc76bfe5fab13515755b69 Mon Sep 17 00:00:00 2001 From: NB Date: Mon, 12 Aug 2024 14:57:09 +0200 Subject: [PATCH 163/163] maybe this will help with speed --- .cargo/config | 5 ++++- Cargo.toml | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.cargo/config b/.cargo/config index 77ddee744f4d2..004789605a37f 100644 --- a/.cargo/config +++ b/.cargo/config @@ -44,4 +44,7 @@ mysql-clippy = [ rustflags = ["-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes"] [net] -git-fetch-with-cli = true \ No newline at end of file +git-fetch-with-cli = true + +[target.x86_64-unknown-linux-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=lld", "-C", "target-cpu=native"] \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 0e1a8a1fa8e1a..9d6d4fb066496 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -209,6 +209,11 @@ split-debuginfo = 'packed' strip = 'debuginfo' # Exit process with SIGABRT when any thread panics panic = 'abort' +# custom +opt-level = 3 +lto = true +incremental = false +codegen-units = 1 # Same as release, but build binary with debug symbols (binary size will be ~ 1GB). [profile.release-dbgsym] @@ -216,6 +221,7 @@ inherits = "release" split-debuginfo = 'off' strip = 'none' + # Inherits from the release profile above. [profile.bench] # For convenience.