From 82c9fe98a48f929c6d057b03c1519d69c4088d27 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 13 Dec 2024 11:36:11 +1000 Subject: [PATCH 1/2] Rename type for clarity --- crates/sp-domains-fraud-proof/src/fraud_proof.rs | 2 +- crates/sp-domains-fraud-proof/src/storage_proof.rs | 4 ++-- crates/sp-domains-fraud-proof/src/verification.rs | 6 +++--- domains/client/domain-operator/src/fraud_proof.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/sp-domains-fraud-proof/src/fraud_proof.rs b/crates/sp-domains-fraud-proof/src/fraud_proof.rs index 757e4d5dc5..157b4c3280 100644 --- a/crates/sp-domains-fraud-proof/src/fraud_proof.rs +++ b/crates/sp-domains-fraud-proof/src/fraud_proof.rs @@ -495,7 +495,7 @@ pub struct InvalidExtrinsicsRootProof { pub valid_bundle_digests: Vec, /// The storage proof used during verification - pub invalid_extrinsics_data_proof: InvalidExtrinsicsDataProof, + pub invalid_inherent_extrinsic_proof: InvalidInherentExtrinsicProof, /// Optional sudo extrinsic call storage proof pub domain_sudo_call_proof: DomainSudoCallStorageProof, diff --git a/crates/sp-domains-fraud-proof/src/storage_proof.rs b/crates/sp-domains-fraud-proof/src/storage_proof.rs index a3ccefe6c3..182ebeb46c 100644 --- a/crates/sp-domains-fraud-proof/src/storage_proof.rs +++ b/crates/sp-domains-fraud-proof/src/storage_proof.rs @@ -414,7 +414,7 @@ impl MaybeDomainRuntimeUpgradedProof { } #[derive(Clone, Debug, Decode, Encode, Eq, PartialEq, TypeInfo)] -pub struct InvalidExtrinsicsDataProof { +pub struct InvalidInherentExtrinsicProof { /// Block randomness storage proof pub block_randomness_proof: BlockRandomnessProof, @@ -434,7 +434,7 @@ pub struct InvalidExtrinsicsDataProof { pub domain_chain_allowlist_proof: DomainChainsAllowlistUpdateStorageProof, } -impl InvalidExtrinsicsDataProof { +impl InvalidInherentExtrinsicProof { #[cfg(feature = "std")] #[allow(clippy::let_and_return)] pub fn generate< diff --git a/crates/sp-domains-fraud-proof/src/verification.rs b/crates/sp-domains-fraud-proof/src/verification.rs index bf149d2b43..939918f5de 100644 --- a/crates/sp-domains-fraud-proof/src/verification.rs +++ b/crates/sp-domains-fraud-proof/src/verification.rs @@ -65,12 +65,12 @@ where { let InvalidExtrinsicsRootProof { valid_bundle_digests, - invalid_extrinsics_data_proof, + invalid_inherent_extrinsic_proof, domain_sudo_call_proof, } = fraud_proof; - let mut domain_inherent_extrinsic_data = - invalid_extrinsics_data_proof.verify::(domain_id, runtime_id, &state_root)?; + let mut domain_inherent_extrinsic_data = invalid_inherent_extrinsic_proof + .verify::(domain_id, runtime_id, &state_root)?; let domain_sudo_call = >::verify::( domain_sudo_call_proof.clone(), diff --git a/domains/client/domain-operator/src/fraud_proof.rs b/domains/client/domain-operator/src/fraud_proof.rs index b20b4578ac..ed0a0834a2 100644 --- a/domains/client/domain-operator/src/fraud_proof.rs +++ b/domains/client/domain-operator/src/fraud_proof.rs @@ -382,7 +382,7 @@ where let maybe_runtime_id = self.is_domain_runtime_updraded_at(domain_id, consensus_block_hash)?; - let invalid_extrinsics_data_proof = InvalidExtrinsicsDataProof::generate( + let invalid_inherent_extrinsic_proof = InvalidInherentExtrinsicProof::generate( &self.storage_key_provider, self.consensus_client.as_ref(), domain_id, @@ -404,7 +404,7 @@ where maybe_domain_runtime_code_proof, proof: FraudProofVariant::InvalidExtrinsicsRoot(InvalidExtrinsicsRootProof { valid_bundle_digests, - invalid_extrinsics_data_proof, + invalid_inherent_extrinsic_proof, domain_sudo_call_proof, }), }; From f91b832148f9562fe9db6b459cd404a57b1c471d Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 13 Dec 2024 11:51:47 +1000 Subject: [PATCH 2/2] Fix typos --- crates/sp-domains-fraud-proof/src/storage_proof.rs | 2 +- crates/sp-domains-fraud-proof/src/verification.rs | 2 +- domains/client/domain-operator/src/fraud_proof.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/sp-domains-fraud-proof/src/storage_proof.rs b/crates/sp-domains-fraud-proof/src/storage_proof.rs index 182ebeb46c..e0c15e3db7 100644 --- a/crates/sp-domains-fraud-proof/src/storage_proof.rs +++ b/crates/sp-domains-fraud-proof/src/storage_proof.rs @@ -45,7 +45,7 @@ pub enum VerificationError { RuntimeRegistryStorageProof(StorageProofVerificationError), DynamicCostOfStorageStorageProof(StorageProofVerificationError), DigestStorageProof(StorageProofVerificationError), - BlockFessStorageProof(StorageProofVerificationError), + BlockFeesStorageProof(StorageProofVerificationError), TransfersStorageProof(StorageProofVerificationError), ExtrinsicStorageProof(StorageProofVerificationError), DomainSudoCallStorageProof(StorageProofVerificationError), diff --git a/crates/sp-domains-fraud-proof/src/verification.rs b/crates/sp-domains-fraud-proof/src/verification.rs index 939918f5de..af8715cadb 100644 --- a/crates/sp-domains-fraud-proof/src/verification.rs +++ b/crates/sp-domains-fraud-proof/src/verification.rs @@ -381,7 +381,7 @@ where ) .map_err(|err| { VerificationError::StorageProof( - storage_proof::VerificationError::BlockFessStorageProof(err), + storage_proof::VerificationError::BlockFeesStorageProof(err), ) })?; diff --git a/domains/client/domain-operator/src/fraud_proof.rs b/domains/client/domain-operator/src/fraud_proof.rs index ed0a0834a2..7236273d35 100644 --- a/domains/client/domain-operator/src/fraud_proof.rs +++ b/domains/client/domain-operator/src/fraud_proof.rs @@ -380,7 +380,7 @@ where self.maybe_generate_domain_runtime_code_proof_for_receipt(domain_id, local_receipt)?; let maybe_runtime_id = - self.is_domain_runtime_updraded_at(domain_id, consensus_block_hash)?; + self.is_domain_runtime_upgraded_at(domain_id, consensus_block_hash)?; let invalid_inherent_extrinsic_proof = InvalidInherentExtrinsicProof::generate( &self.storage_key_provider, @@ -412,7 +412,7 @@ where Ok(invalid_domain_extrinsics_root_proof) } - pub fn is_domain_runtime_updraded_at( + pub fn is_domain_runtime_upgraded_at( &self, domain_id: DomainId, at: CBlock::Hash,