diff --git a/chain/chain/src/chain.rs b/chain/chain/src/chain.rs index b1a3a772b6c..c8a5154e783 100644 --- a/chain/chain/src/chain.rs +++ b/chain/chain/src/chain.rs @@ -4483,9 +4483,16 @@ impl Chain { ) -> HashMap> { let mut result = HashMap::new(); for receipt in receipts { - let shard_id = shard_layout.account_id_to_shard_id(receipt.receiver_id()); - let entry = result.entry(shard_id).or_insert_with(Vec::new); - entry.push(receipt) + if receipt.send_to_all_shards() { + for shard_id in shard_layout.shard_ids() { + let entry = result.entry(shard_id).or_insert_with(Vec::new); + entry.push(receipt.clone()); + } + } else { + let shard_id = shard_layout.account_id_to_shard_id(receipt.receiver_id()); + let entry = result.entry(shard_id).or_insert_with(Vec::new); + entry.push(receipt); + } } result } @@ -4506,13 +4513,22 @@ impl Chain { } let mut cache = HashMap::new(); for receipt in receipts { - let &mut shard_id = cache - .entry(receipt.receiver_id()) - .or_insert_with(|| shard_layout.account_id_to_shard_id(receipt.receiver_id())); - // This unwrap should be safe as we pre-populated the map with all - // valid shard ids. - let shard_index = shard_layout.get_shard_index(shard_id).unwrap(); - result_map.get_mut(&shard_index).unwrap().1.push(receipt); + if receipt.send_to_all_shards() { + for shard_id in shard_layout.shard_ids() { + // This unwrap should be safe as we pre-populated the map with all + // valid shard ids. + let shard_index = shard_layout.get_shard_index(shard_id).unwrap(); + result_map.get_mut(&shard_index).unwrap().1.push(receipt); + } + } else { + let &mut shard_id = cache + .entry(receipt.receiver_id()) + .or_insert_with(|| shard_layout.account_id_to_shard_id(receipt.receiver_id())); + // This unwrap should be safe as we pre-populated the map with all + // valid shard ids. + let shard_index = shard_layout.get_shard_index(shard_id).unwrap(); + result_map.get_mut(&shard_index).unwrap().1.push(receipt); + } } let mut result_vec = vec![]; diff --git a/chain/chain/src/runtime/tests.rs b/chain/chain/src/runtime/tests.rs index 5b18d8b47e3..5f12da5f171 100644 --- a/chain/chain/src/runtime/tests.rs +++ b/chain/chain/src/runtime/tests.rs @@ -375,8 +375,14 @@ impl TestEnv { let shard_layout = self.epoch_manager.get_shard_layout_from_prev_block(&new_hash).unwrap(); let mut new_receipts = HashMap::<_, Vec>::new(); for receipt in all_receipts { - let shard_id = shard_layout.account_id_to_shard_id(receipt.receiver_id()); - new_receipts.entry(shard_id).or_default().push(receipt); + if receipt.send_to_all_shards() { + for shard_id in shard_layout.shard_ids() { + new_receipts.entry(shard_id).or_default().push(receipt.clone()); + } + } else { + let shard_id = shard_layout.account_id_to_shard_id(receipt.receiver_id()); + new_receipts.entry(shard_id).or_default().push(receipt); + } } self.last_receipts = new_receipts; self.last_proposals = all_proposals; diff --git a/chain/chain/src/store/mod.rs b/chain/chain/src/store/mod.rs index b170aaa6ccf..e85c3d06fd4 100644 --- a/chain/chain/src/store/mod.rs +++ b/chain/chain/src/store/mod.rs @@ -382,9 +382,10 @@ pub fn filter_incoming_receipts_for_shard( let mut filtered_receipts = vec![]; let ReceiptProof(receipts, shard_proof) = receipt_proof.clone(); for receipt in receipts { - let receiver_shard_id = - target_shard_layout.account_id_to_shard_id(receipt.receiver_id()); - if receiver_shard_id == target_shard_id { + if receipt.send_to_all_shards() + || target_shard_layout.account_id_to_shard_id(receipt.receiver_id()) + == target_shard_id + { tracing::trace!(target: "chain", receipt_id=?receipt.receipt_id(), "including receipt"); filtered_receipts.push(receipt); } else { diff --git a/chain/chain/src/test_utils.rs b/chain/chain/src/test_utils.rs index cb2fb9daf4c..1088637deca 100644 --- a/chain/chain/src/test_utils.rs +++ b/chain/chain/src/test_utils.rs @@ -297,7 +297,8 @@ mod test { let shard_receipts: Vec = receipts .iter() .filter(|&receipt| { - shard_layout.account_id_to_shard_id(receipt.receiver_id()) == shard_id + receipt.send_to_all_shards() + || shard_layout.account_id_to_shard_id(receipt.receiver_id()) == shard_id }) .cloned() .collect(); diff --git a/core/primitives/src/action/mod.rs b/core/primitives/src/action/mod.rs index 7c3a0ddef90..b9b00275950 100644 --- a/core/primitives/src/action/mod.rs +++ b/core/primitives/src/action/mod.rs @@ -12,8 +12,9 @@ use near_schema_checker_lib::ProtocolSchema; use serde_with::base64::Base64; use serde_with::serde_as; use std::fmt; +use std::sync::Arc; -fn base64(s: &[u8]) -> String { +pub fn base64(s: &[u8]) -> String { use base64::Engine; base64::engine::general_purpose::STANDARD.encode(s) } @@ -146,7 +147,7 @@ pub enum GlobalContractDeployMode { pub struct DeployGlobalContractAction { /// WebAssembly binary #[serde_as(as = "Base64")] - pub code: Vec, + pub code: Arc<[u8]>, pub deploy_mode: GlobalContractDeployMode, } @@ -166,6 +167,7 @@ impl fmt::Debug for DeployGlobalContractAction { BorshDeserialize, serde::Serialize, serde::Deserialize, + Hash, PartialEq, Eq, Clone, diff --git a/core/primitives/src/receipt.rs b/core/primitives/src/receipt.rs index e2ab0ab92b7..b4d9e825906 100644 --- a/core/primitives/src/receipt.rs +++ b/core/primitives/src/receipt.rs @@ -1,3 +1,4 @@ +use crate::action::{base64, GlobalContractIdentifier}; use crate::hash::CryptoHash; use crate::serialize::dec_format; use crate::transaction::{Action, TransferAction}; @@ -15,6 +16,7 @@ use std::collections::{BTreeMap, HashMap}; use std::fmt; use std::io::{self, Read}; use std::io::{Error, ErrorKind}; +use std::sync::Arc; /// The outgoing (egress) data which will be transformed /// to a `DataReceipt` to be sent to a `receipt.receiver` @@ -246,10 +248,10 @@ impl<'a> StateStoredReceipt<'a> { impl BorshSerialize for Receipt { fn serialize(&self, writer: &mut W) -> io::Result<()> { match self { - Receipt::V0(receipt) => receipt.serialize(writer), + Receipt::V0(receipt) => BorshSerialize::serialize(&receipt, writer), Receipt::V1(receipt) => { BorshSerialize::serialize(&1_u8, writer)?; - receipt.serialize(writer) + BorshSerialize::serialize(&receipt, writer) } } } @@ -485,6 +487,10 @@ impl Receipt { *self.receipt_id() } + pub fn send_to_all_shards(&self) -> bool { + matches!(self.receipt(), ReceiptEnum::GlobalContractDistribution(..)) + } + /// Generates a receipt with a transfer from system for a given balance without a receipt_id. /// This should be used for token refunds instead of gas refunds. It inherits priority from the parent receipt. /// It doesn't refund the allowance of the access key. For gas refunds use `new_gas_refund`. @@ -571,6 +577,19 @@ impl Receipt { }), } } + + pub fn new_global_contract_distribution( + predecessor_id: AccountId, + code: Arc<[u8]>, + id: GlobalContractIdentifier, + ) -> Self { + Self::V0(ReceiptV0 { + predecessor_id, + receiver_id: "system".parse().unwrap(), + receipt_id: CryptoHash::default(), + receipt: ReceiptEnum::GlobalContractDistribution(GlobalContractData { code, id }), + }) + } } /// Receipt could be either ActionReceipt or DataReceipt @@ -590,6 +609,7 @@ pub enum ReceiptEnum { Data(DataReceipt), PromiseYield(ActionReceipt), PromiseResume(DataReceipt), + GlobalContractDistribution(GlobalContractData), } /// ActionReceipt is derived from an Action from `Transaction or from Receipt` @@ -670,6 +690,33 @@ impl fmt::Debug for ReceivedData { } } +#[serde_as] +#[derive( + BorshSerialize, + BorshDeserialize, + Hash, + PartialEq, + Eq, + Clone, + serde::Deserialize, + serde::Serialize, + ProtocolSchema, +)] +pub struct GlobalContractData { + #[serde_as(as = "Base64")] + pub code: Arc<[u8]>, + pub id: GlobalContractIdentifier, +} + +impl fmt::Debug for GlobalContractData { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("GlobalContractData") + .field("code", &format_args!("{}", base64(&self.code))) + .field("id", &self.id) + .finish() + } +} + /// Stores indices for a persistent queue for delayed receipts that didn't fit into a block. #[derive(Default, BorshSerialize, BorshDeserialize, Clone, PartialEq, Debug, ProtocolSchema)] pub struct DelayedReceiptIndices { diff --git a/core/primitives/src/views.rs b/core/primitives/src/views.rs index 05a68f772d5..681df9c7e77 100644 --- a/core/primitives/src/views.rs +++ b/core/primitives/src/views.rs @@ -18,7 +18,9 @@ use crate::errors::TxExecutionError; use crate::hash::{hash, CryptoHash}; use crate::merkle::{combine_hash, MerklePath}; use crate::network::PeerId; -use crate::receipt::{ActionReceipt, DataReceipt, DataReceiver, Receipt, ReceiptEnum, ReceiptV1}; +use crate::receipt::{ + ActionReceipt, DataReceipt, DataReceiver, GlobalContractData, Receipt, ReceiptEnum, ReceiptV1, +}; use crate::serialize::dec_format; use crate::sharding::shard_chunk_header_inner::ShardChunkHeaderInnerV4; use crate::sharding::{ @@ -1285,13 +1287,13 @@ impl TryFrom for Action { } ActionView::DeployGlobalContract { code } => { Action::DeployGlobalContract(DeployGlobalContractAction { - code, + code: code.into(), deploy_mode: GlobalContractDeployMode::CodeHash, }) } ActionView::DeployGlobalContractByAccountId { code } => { Action::DeployGlobalContract(DeployGlobalContractAction { - code, + code: code.into(), deploy_mode: GlobalContractDeployMode::AccountId, }) } @@ -1962,6 +1964,9 @@ pub enum ReceiptEnumView { #[serde(default = "default_is_promise")] is_promise_resume: bool, }, + GlobalContractDistribution { + data: GlobalContractData, + }, } // Default value used when deserializing ReceiptEnumViews which are missing either the @@ -2011,6 +2016,9 @@ impl From for ReceiptView { is_promise_resume, } } + ReceiptEnum::GlobalContractDistribution(data) => { + ReceiptEnumView::GlobalContractDistribution { data } + } }, priority, } @@ -2068,6 +2076,9 @@ impl TryFrom for Receipt { ReceiptEnum::Data(data_receipt) } } + ReceiptEnumView::GlobalContractDistribution { data } => { + ReceiptEnum::GlobalContractDistribution(data) + } }, priority: receipt_view.priority, })) diff --git a/core/store/src/genesis/state_applier.rs b/core/store/src/genesis/state_applier.rs index 4f0475b8e24..5ac5e259852 100644 --- a/core/store/src/genesis/state_applier.rs +++ b/core/store/src/genesis/state_applier.rs @@ -314,7 +314,9 @@ impl GenesisStateApplier { set_promise_yield_receipt(state_update, &receipt); }); } - ReceiptEnum::Data(_) | ReceiptEnum::PromiseResume(_) => { + ReceiptEnum::GlobalContractDistribution(_) + | ReceiptEnum::Data(_) + | ReceiptEnum::PromiseResume(_) => { panic!("Expected action receipt") } } diff --git a/runtime/runtime/src/actions.rs b/runtime/runtime/src/actions.rs index c21cad8ab16..afafb77d877 100644 --- a/runtime/runtime/src/actions.rs +++ b/runtime/runtime/src/actions.rs @@ -9,11 +9,14 @@ use near_crypto::PublicKey; use near_parameters::{AccountCreationConfig, ActionCosts, RuntimeConfig, RuntimeFeesConfig}; use near_primitives::account::{AccessKey, AccessKeyPermission, Account}; use near_primitives::action::delegate::{DelegateAction, SignedDelegateAction}; -use near_primitives::action::{DeployGlobalContractAction, UseGlobalContractAction}; +use near_primitives::action::{ + DeployGlobalContractAction, GlobalContractDeployMode, GlobalContractIdentifier, + UseGlobalContractAction, +}; use near_primitives::checked_feature; use near_primitives::config::ViewConfig; use near_primitives::errors::{ActionError, ActionErrorKind, InvalidAccessKeyError, RuntimeError}; -use near_primitives::hash::CryptoHash; +use near_primitives::hash::{hash, CryptoHash}; use near_primitives::receipt::{ ActionReceipt, DataReceipt, Receipt, ReceiptEnum, ReceiptPriority, ReceiptV0, }; @@ -655,13 +658,26 @@ pub(crate) fn action_deploy_contract( } pub(crate) fn action_deploy_global_contract( - _account_id: &AccountId, - _deploy_contract: &DeployGlobalContractAction, - _result: &mut ActionResult, -) -> Result<(), StorageError> { + account_id: &AccountId, + deploy_contract: &DeployGlobalContractAction, + result: &mut ActionResult, +) { let _span = tracing::debug_span!(target: "runtime", "action_deploy_global_contract").entered(); - // TODO(#12715): implement global contract distribution - Ok(()) + + let id = match deploy_contract.deploy_mode { + GlobalContractDeployMode::CodeHash => { + GlobalContractIdentifier::CodeHash(hash(&deploy_contract.code)) + } + GlobalContractDeployMode::AccountId => { + GlobalContractIdentifier::AccountId(account_id.clone()) + } + }; + + result.new_receipts.push(Receipt::new_global_contract_distribution( + account_id.clone(), + deploy_contract.code.clone(), + id, + )); } pub(crate) fn action_use_global_contract( @@ -920,7 +936,9 @@ fn receipt_required_gas(apply_state: &ApplyState, receipt: &Receipt) -> Result 0, + ReceiptEnum::GlobalContractDistribution(_) + | ReceiptEnum::Data(_) + | ReceiptEnum::PromiseResume(_) => 0, }) } diff --git a/runtime/runtime/src/balance_checker.rs b/runtime/runtime/src/balance_checker.rs index aeec8117a1a..56d9b939ebd 100644 --- a/runtime/runtime/src/balance_checker.rs +++ b/runtime/runtime/src/balance_checker.rs @@ -65,7 +65,9 @@ fn receipt_cost( } total_cost } - ReceiptEnum::Data(_) | ReceiptEnum::PromiseResume(_) => 0, + ReceiptEnum::GlobalContractDistribution(_) + | ReceiptEnum::Data(_) + | ReceiptEnum::PromiseResume(_) => 0, }) } @@ -258,6 +260,7 @@ fn potential_postponed_receipt_ids( account_id.clone(), data_receipt.data_id, ))), + ReceiptEnum::GlobalContractDistribution(_) => None, } }) .collect::, StorageError>>() diff --git a/runtime/runtime/src/congestion_control.rs b/runtime/runtime/src/congestion_control.rs index fa15c92513f..f486e35503b 100644 --- a/runtime/runtime/src/congestion_control.rs +++ b/runtime/runtime/src/congestion_control.rs @@ -691,6 +691,7 @@ pub(crate) fn compute_receipt_congestion_gas( // of it without expensive state lookups. Ok(0) } + ReceiptEnum::GlobalContractDistribution(_) => Ok(0), } } diff --git a/runtime/runtime/src/lib.rs b/runtime/runtime/src/lib.rs index debb8bc8e29..b9a7592e6f1 100644 --- a/runtime/runtime/src/lib.rs +++ b/runtime/runtime/src/lib.rs @@ -20,6 +20,7 @@ pub use near_crypto; use near_parameters::{ActionCosts, RuntimeConfig}; pub use near_primitives; use near_primitives::account::Account; +use near_primitives::action::GlobalContractIdentifier; use near_primitives::bandwidth_scheduler::{BandwidthRequests, BlockBandwidthRequests}; use near_primitives::checked_feature; use near_primitives::congestion_info::{BlockCongestionInfo, CongestionInfo}; @@ -42,7 +43,7 @@ use near_primitives::transaction::{ Action, ExecutionMetadata, ExecutionOutcome, ExecutionOutcomeWithId, ExecutionStatus, LogEntry, SignedTransaction, TransferAction, }; -use near_primitives::trie_key::TrieKey; +use near_primitives::trie_key::{GlobalContractCodeIdentifier, TrieKey}; use near_primitives::types::{ validator_stake::ValidatorStake, AccountId, Balance, BlockHeight, Compute, EpochHeight, EpochId, EpochInfoProvider, Gas, RawStateChangesWithTrieKey, ShardId, StateChangeCause, @@ -485,7 +486,7 @@ impl Runtime { )?; } Action::DeployGlobalContract(deploy_global_contract) => { - action_deploy_global_contract(account_id, deploy_global_contract, &mut result)?; + action_deploy_global_contract(account_id, deploy_global_contract, &mut result); } Action::UseGlobalContract(use_global_contract) => { let account = account.as_mut().expect(EXPECT_ACCOUNT_EXISTS); @@ -960,6 +961,37 @@ impl Runtime { }) } + fn apply_global_contract_distribution_receipt( + &self, + receipt: &Receipt, + state_update: &mut TrieUpdate, + ) { + let _span = tracing::debug_span!( + target: "runtime", + "apply_global_contract_distribution_receipt", + ) + .entered(); + + let ReceiptEnum::GlobalContractDistribution(global_contract_data) = receipt.receipt() + else { + unreachable!("given receipt should be an global contract distribution receipt") + }; + + let trie_key = TrieKey::GlobalContractCode { + identifier: match &global_contract_data.id { + GlobalContractIdentifier::CodeHash(hash) => { + GlobalContractCodeIdentifier::CodeHash(*hash) + } + GlobalContractIdentifier::AccountId(account_id) => { + GlobalContractCodeIdentifier::AccountId(account_id.clone()) + } + }, + }; + state_update.set(trie_key, global_contract_data.code.to_vec()); + state_update + .commit(StateChangeCause::ReceiptProcessing { receipt_hash: receipt.get_hash() }); + } + fn generate_refund_receipts( &self, current_gas_price: Balance, @@ -1232,6 +1264,10 @@ impl Runtime { return Ok(None); } } + ReceiptEnum::GlobalContractDistribution(_) => { + self.apply_global_contract_distribution_receipt(receipt, state_update); + return Ok(None); + } }; // We didn't trigger execution, so we need to commit the state. state_update @@ -2754,6 +2790,7 @@ fn schedule_contract_preparation<'b, R: MaybeRefReceipt>( }; return handle_receipt(mgr, state_update, receiver, account_id, &yr); } + ReceiptEnum::GlobalContractDistribution(_) => false, } } handle_receipt(pipeline_manager, state_update, &receiver, account_id, peek) diff --git a/runtime/runtime/src/pipelining.rs b/runtime/runtime/src/pipelining.rs index 0f2cb2d5f73..8f8f3199ed4 100644 --- a/runtime/runtime/src/pipelining.rs +++ b/runtime/runtime/src/pipelining.rs @@ -120,7 +120,9 @@ impl ReceiptPreparationPipeline { } let actions = match receipt.receipt() { ReceiptEnum::Action(a) | ReceiptEnum::PromiseYield(a) => &a.actions, - ReceiptEnum::Data(_) | ReceiptEnum::PromiseResume(_) => return false, + ReceiptEnum::GlobalContractDistribution(_) + | ReceiptEnum::Data(_) + | ReceiptEnum::PromiseResume(_) => return false, }; let mut any_function_calls = false; for (action_index, action) in actions.iter().enumerate() { @@ -219,7 +221,9 @@ impl ReceiptPreparationPipeline { .actions .get(action_index) .expect("indexing receipt actions by an action_index failed!"), - ReceiptEnum::Data(_) | ReceiptEnum::PromiseResume(_) => { + ReceiptEnum::GlobalContractDistribution(_) + | ReceiptEnum::Data(_) + | ReceiptEnum::PromiseResume(_) => { panic!("attempting to get_contract with a non-action receipt!?") } }; diff --git a/runtime/runtime/src/prefetch.rs b/runtime/runtime/src/prefetch.rs index a4164ba0856..9a4e3eec0f3 100644 --- a/runtime/runtime/src/prefetch.rs +++ b/runtime/runtime/src/prefetch.rs @@ -97,7 +97,9 @@ impl TriePrefetcher { ReceiptEnum::Action(action_receipt) | ReceiptEnum::PromiseYield(action_receipt) => { action_receipt } - ReceiptEnum::Data(_) | ReceiptEnum::PromiseResume(_) => { + ReceiptEnum::GlobalContractDistribution(_) + | ReceiptEnum::Data(_) + | ReceiptEnum::PromiseResume(_) => { continue; } }; diff --git a/runtime/runtime/src/verifier.rs b/runtime/runtime/src/verifier.rs index 1e19ff54985..e8a2bc8a7df 100644 --- a/runtime/runtime/src/verifier.rs +++ b/runtime/runtime/src/verifier.rs @@ -321,6 +321,7 @@ pub(crate) fn validate_receipt( ReceiptEnum::Data(data_receipt) | ReceiptEnum::PromiseResume(data_receipt) => { validate_data_receipt(limit_config, data_receipt) } + ReceiptEnum::GlobalContractDistribution(_) => Ok(()), // Distribution receipt can't be issued without a valid contract } } diff --git a/tools/mirror/src/chain_tracker.rs b/tools/mirror/src/chain_tracker.rs index fd46214506c..da756b33ac0 100644 --- a/tools/mirror/src/chain_tracker.rs +++ b/tools/mirror/src/chain_tracker.rs @@ -823,7 +823,7 @@ impl TxTracker { } } } - ReceiptEnumView::Data { .. } => {} + ReceiptEnumView::Data { .. } | ReceiptEnumView::GlobalContractDistribution { .. } => {} }; Ok(()) } diff --git a/tools/protocol-schema-check/res/protocol_schema.toml b/tools/protocol-schema-check/res/protocol_schema.toml index 542d3e3f126..c01b93be816 100644 --- a/tools/protocol-schema-check/res/protocol_schema.toml +++ b/tools/protocol-schema-check/res/protocol_schema.toml @@ -4,11 +4,11 @@ Account = 4069344376 AccountV1 = 3570440720 AccountV2 = 1741861562 AccountVersion = 3672019478 -Action = 3388998117 +Action = 708080604 ActionCosts = 3115555891 ActionError = 4217425219 ActionErrorKind = 1632922469 -ActionReceipt = 4271134158 +ActionReceipt = 882261823 ActionsValidationError = 1053886215 AddKeyAction = 356099649 AdvertisedPeerDistance = 1372421497 @@ -54,8 +54,8 @@ BlockV4 = 619721361 BlockWithChangesInfo = 887507517 BufferedReceiptIndices = 2030010377 CachedParts = 1180507252 -Challenge = 2176225041 -ChallengeBody = 1451448871 +Challenge = 237064378 +ChallengeBody = 86451633 ChunkContractAccesses = 266426785 ChunkContractAccessesInner = 2811580521 ChunkContractAccessesV1 = 3680796018 @@ -69,10 +69,10 @@ ChunkExtraV1 = 774877102 ChunkHash = 1471814478 ChunkHashHeight = 825215623 ChunkProductionKey = 2508733236 -ChunkProofs = 4167933191 -ChunkState = 4255527225 +ChunkProofs = 1746991624 +ChunkState = 152409845 ChunkStateTransition = 307448170 -ChunkStateWitness = 3044594480 +ChunkStateWitness = 3926833312 ChunkStateWitnessAck = 177881908 ChunkStats = 4176245277 CodeBytes = 2940589161 @@ -96,11 +96,11 @@ CurrentEpochValidatorInfo = 434177728 DataReceipt = 2506806701 DataReceiver = 1715762664 DelayedReceiptIndices = 1315689119 -DelegateAction = 1159009392 +DelegateAction = 2886759687 DeleteAccountAction = 3244670577 DeleteKeyAction = 1374597333 DeployContractAction = 2972267833 -DeployGlobalContractAction = 2078234364 +DeployGlobalContractAction = 2796563162 Direction = 1296680832 DistanceVector = 181987261 ED25519PublicKey = 213018126 @@ -146,6 +146,7 @@ FunctionCallAction = 2405840012 FunctionCallError = 3652274053 FunctionCallPermission = 1517509673 GlobalContractCodeIdentifier = 3486582651 +GlobalContractData = 1198449900 GlobalContractDeployMode = 1256912586 GlobalContractIdentifier = 31664100 Handshake = 115352275 @@ -161,24 +162,24 @@ LatestKnown = 2945167085 LatestWitnessesInfo = 2488443612 LinkAllowance = 1652755161 MainTransitionKey = 3721480128 -MaybeEncodedShardChunk = 2483515710 +MaybeEncodedShardChunk = 2673577900 MerklePathItem = 2615629611 MessageDiscriminant = 3240833245 MethodResolveError = 1206790835 MissingTrieValueContext = 2666011379 NextEpochValidatorInfo = 3660299258 -NonDelegateAction = 2970737551 +NonDelegateAction = 3326479987 OptimisticBlock = 1384126355 OptimisticBlockInner = 1534008891 ParentSplitParameters = 2945469052 PartialEdgeInfo = 1350359189 -PartialEncodedChunk = 2321210648 +PartialEncodedChunk = 3268260542 PartialEncodedChunkForwardMsg = 68012243 PartialEncodedChunkPart = 194051090 PartialEncodedChunkRequestMsg = 1470767646 -PartialEncodedChunkResponseMsg = 2470689017 -PartialEncodedChunkV1 = 4160916755 -PartialEncodedChunkV2 = 2900885561 +PartialEncodedChunkResponseMsg = 1933691847 +PartialEncodedChunkV1 = 2841697594 +PartialEncodedChunkV2 = 2431363427 PartialEncodedContractDeploys = 3216562245 PartialEncodedContractDeploysInner = 2549441552 PartialEncodedContractDeploysPart = 1672852427 @@ -190,7 +191,7 @@ PeerChainInfoV2 = 1260985250 PeerId = 2447445523 PeerIdOrHash = 4080492546 PeerInfo = 3831734408 -PeerMessage = 3330288512 +PeerMessage = 1659223948 Ping = 2783493472 Pong = 3159638327 PrepareError = 4009037507 @@ -204,29 +205,29 @@ RawStateChangesWithTrieKey = 4065520827 RawTrieNode = 4239211001 RawTrieNodeWithSize = 1474149765 ReasonForBan = 792112981 -Receipt = 1699385171 -ReceiptEnum = 2951652014 +Receipt = 1735297979 +ReceiptEnum = 475038911 ReceiptGroup = 2105921101 ReceiptGroupV0 = 2900361850 ReceiptGroupsQueueData = 289073248 ReceiptGroupsQueueDataV0 = 3449687695 ReceiptList = 3805749482 -ReceiptOrStateStoredReceipt = 2995655728 -ReceiptProof = 414952087 -ReceiptProofResponse = 1563585870 -ReceiptV0 = 3701801574 -ReceiptV1 = 2838991728 +ReceiptOrStateStoredReceipt = 1483705262 +ReceiptProof = 2761240549 +ReceiptProofResponse = 2904508690 +ReceiptV0 = 1954157170 +ReceiptV1 = 2982607639 ReceiptValidationError = 551721215 ReceivedData = 3601438283 RootProof = 3135729669 -RoutedMessage = 3890844808 -RoutedMessageBody = 4077508749 +RoutedMessage = 552691319 +RoutedMessageBody = 2711205418 RoutingTableUpdate = 2987752645 Secp256K1PublicKey = 4117078281 Secp256K1Signature = 3687154735 SerdeAccount = 399208377 ServerError = 2338793369 -ShardChunk = 2682019119 +ShardChunk = 1084327441 ShardChunkHeader = 2471921769 ShardChunkHeaderInner = 4085026561 ShardChunkHeaderInnerV1 = 1271245459 @@ -236,22 +237,22 @@ ShardChunkHeaderInnerV4 = 3066669719 ShardChunkHeaderV1 = 47891389 ShardChunkHeaderV2 = 226996174 ShardChunkHeaderV3 = 3315420662 -ShardChunkV1 = 1882971601 -ShardChunkV2 = 736427760 +ShardChunkV1 = 706095291 +ShardChunkV2 = 1024062162 ShardLayout = 1639977238 ShardLayoutV0 = 3139625127 ShardLayoutV1 = 2054829142 ShardLayoutV2 = 997571636 ShardProof = 1787648268 -ShardStateSyncResponse = 998212107 -ShardStateSyncResponseHeaderV1 = 116351680 -ShardStateSyncResponseHeaderV2 = 3773572367 -ShardStateSyncResponseV1 = 2266739500 -ShardStateSyncResponseV2 = 2597002549 -ShardStateSyncResponseV3 = 3607001423 +ShardStateSyncResponse = 3928780361 +ShardStateSyncResponseHeaderV1 = 97293996 +ShardStateSyncResponseHeaderV2 = 3887815851 +ShardStateSyncResponseV1 = 2020887407 +ShardStateSyncResponseV2 = 3212237445 +ShardStateSyncResponseV3 = 2667043360 ShardUId = 2410086023 Signature = 3997391707 -SignedDelegateAction = 590117931 +SignedDelegateAction = 1393048951 SignedTransaction = 3898692301 SlashState = 3264273950 SlashedValidator = 2601657743 @@ -261,14 +262,14 @@ StateChangeCause = 3890585134 StateHeaderKey = 1666317019 StatePartKey = 1083277414 StatePartRequest = 1911936050 -StateResponseInfo = 1422704909 -StateResponseInfoV1 = 2569959725 -StateResponseInfoV2 = 3097863223 +StateResponseInfo = 2813661149 +StateResponseInfoV1 = 3998913982 +StateResponseInfoV2 = 2508449732 StateRootNode = 1865105129 -StateStoredReceipt = 1314929805 +StateStoredReceipt = 3913153550 StateStoredReceiptMetadata = 2895538362 -StateStoredReceiptV0 = 2639551962 -StateStoredReceiptV1 = 3829861961 +StateStoredReceiptV0 = 1643088085 +StateStoredReceiptV1 = 2649493432 StateSyncDumpProgress = 2225888613 StorageError = 2572184728 StoredChunkStateTransitionData = 102691676 @@ -276,9 +277,9 @@ StoredChunkStateTransitionDataV1 = 3220541377 String = 2587724713 SyncSnapshotHosts = 1436852332 Tip = 305642482 -TransactionReceipt = 1139314092 -TransactionV0 = 2318136898 -TransactionV1 = 2359321608 +TransactionReceipt = 1340277275 +TransactionV0 = 3214747878 +TransactionV1 = 1783470324 TransferAction = 1078380396 TrieChanges = 2613580820 TrieKey = 544589632 diff --git a/tools/state-viewer/src/contract_accounts.rs b/tools/state-viewer/src/contract_accounts.rs index d47e25a7156..00fc4886be8 100644 --- a/tools/state-viewer/src/contract_accounts.rs +++ b/tools/state-viewer/src/contract_accounts.rs @@ -368,6 +368,7 @@ fn try_find_actions_spawned_by_receipt( .get_or_insert_with(Default::default) .insert(ActionType::DataReceipt); } + ReceiptEnum::GlobalContractDistribution(_) => {} } } }