Skip to content

Commit

Permalink
Whitelist 'intrablock_entropy' (paritytech#14489)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored Jul 2, 2023
1 parent 9e8b2f6 commit a93858a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frame/benchmarking/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,11 @@ macro_rules! impl_benchmark {
$crate::well_known_keys::EXTRINSIC_INDEX.into()
);
whitelist.push(extrinsic_index);
// Whitelist the `:intrablock_entropy`.
let intrablock_entropy = $crate::TrackedStorageKey::new(
$crate::well_known_keys::INTRABLOCK_ENTROPY.into()
);
whitelist.push(intrablock_entropy);

$crate::benchmarking::set_whitelist(whitelist.clone());

Expand Down
6 changes: 6 additions & 0 deletions frame/support/procedural/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,12 @@ pub fn benchmarks(
#krate::well_known_keys::EXTRINSIC_INDEX.into()
);
whitelist.push(extrinsic_index);
// Whitelist the `:intrablock_entropy`.
let intrablock_entropy = #krate::TrackedStorageKey::new(
#krate::well_known_keys::INTRABLOCK_ENTROPY.into()
);
whitelist.push(intrablock_entropy);

#krate::benchmarking::set_whitelist(whitelist.clone());
let mut results: #krate::Vec<#krate::BenchmarkResult> = #krate::Vec::new();

Expand Down
2 changes: 2 additions & 0 deletions primitives/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ pub mod well_known_keys {
pub const EXTRINSIC_INDEX: &[u8] = b":extrinsic_index";

/// Current intra-block entropy (a universally unique `[u8; 32]` value) is stored here.
///
/// Encodes to `0x3a696e747261626c6f636b5f656e74726f7079`.
pub const INTRABLOCK_ENTROPY: &[u8] = b":intrablock_entropy";

/// Prefix of child storage keys.
Expand Down

0 comments on commit a93858a

Please sign in to comment.