Skip to content

Commit

Permalink
Record a storage proof for each runtime upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Dec 23, 2024
1 parent a6e5b8b commit 1be717e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions crates/pallet-domains/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,7 @@ mod pallet {
let consensus_transaction_byte_fee =
sp_domains::DOMAIN_STORAGE_FEE_MULTIPLIER * transaction_byte_fee;

// Record a storage proof for each domain with a successful bundle
for domain_id in SuccessfulBundles::<T>::iter_keys() {
let domain_chain_allowlist =
T::DomainAllowlistUpdates::domain_allowlist_updates(domain_id)
Expand All @@ -1954,6 +1955,33 @@ mod pallet {
invalid_inherent_extrinsic_data,
);
}

// Record a storage proof for each domain with a runtime upgrade
for runtime_id in DomainRuntimeUpgrades::<T>::get().iter() {
let domain_id = Self::domain_id(*runtime_id)
.expect("Runtime object must be present since domain is insantiated; qed");

if BlockInvalidInherentExtrinsicData::<T>::contains_key(domain_id) {
// Skip domains that already have a record due to a successful bundle
continue;
}

let domain_chain_allowlist =
T::DomainAllowlistUpdates::domain_allowlist_updates(domain_id)
.unwrap_or_default();

let invalid_inherent_extrinsic_data = InvalidInherentExtrinsicData {
extrinsics_shuffling_seed,
timestamp,
consensus_transaction_byte_fee,
domain_chain_allowlist,
};

BlockInvalidInherentExtrinsicData::<T>::insert(
domain_id,
invalid_inherent_extrinsic_data,
);
}
}

let _ = LastEpochStakingDistribution::<T>::clear(u32::MAX, None);
Expand Down

0 comments on commit 1be717e

Please sign in to comment.