Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename fraud proof type for clarity #3313

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/sp-domains-fraud-proof/src/fraud_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pub struct InvalidExtrinsicsRootProof {
pub valid_bundle_digests: Vec<ValidBundleDigest>,

/// 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,
Expand Down
6 changes: 3 additions & 3 deletions crates/sp-domains-fraud-proof/src/storage_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub enum VerificationError {
RuntimeRegistryStorageProof(StorageProofVerificationError),
DynamicCostOfStorageStorageProof(StorageProofVerificationError),
DigestStorageProof(StorageProofVerificationError),
BlockFessStorageProof(StorageProofVerificationError),
BlockFeesStorageProof(StorageProofVerificationError),
TransfersStorageProof(StorageProofVerificationError),
ExtrinsicStorageProof(StorageProofVerificationError),
DomainSudoCallStorageProof(StorageProofVerificationError),
Expand Down Expand Up @@ -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,

Expand All @@ -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<
Expand Down
8 changes: 4 additions & 4 deletions crates/sp-domains-fraud-proof/src/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<CBlock, SKP>(domain_id, runtime_id, &state_root)?;
let mut domain_inherent_extrinsic_data = invalid_inherent_extrinsic_proof
.verify::<CBlock, SKP>(domain_id, runtime_id, &state_root)?;

let domain_sudo_call = <DomainSudoCallStorageProof as BasicStorageProof<CBlock>>::verify::<SKP>(
domain_sudo_call_proof.clone(),
Expand Down Expand Up @@ -381,7 +381,7 @@ where
)
.map_err(|err| {
VerificationError::StorageProof(
storage_proof::VerificationError::BlockFessStorageProof(err),
storage_proof::VerificationError::BlockFeesStorageProof(err),
)
})?;

Expand Down
8 changes: 4 additions & 4 deletions domains/client/domain-operator/src/fraud_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ 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_extrinsics_data_proof = InvalidExtrinsicsDataProof::generate(
let invalid_inherent_extrinsic_proof = InvalidInherentExtrinsicProof::generate(
&self.storage_key_provider,
self.consensus_client.as_ref(),
domain_id,
Expand All @@ -404,15 +404,15 @@ 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,
}),
};

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,
Expand Down
Loading