we need to use 1/3 if the block time because each validator will re-execute all extrinsics

Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
Uncle Stinky 2026-08-31 15:03:33 +03:00
parent 85f1dc9646
commit bfcd7af559
Signed by: st1nky
GPG Key ID: 016064BD97603B40
4 changed files with 12 additions and 12 deletions

View File

@ -8,7 +8,7 @@ impl ArgumentsFactory<(), AccountId> for BenchmarkTreasuryHelper {
fn create_asset_kind(_seed: u32) -> () {
()
}
fn create_beneficiary(mut seed: [u8; 32]) -> AccountId {
fn create_beneficiary(seed: [u8; 32]) -> AccountId {
AccountId::from_entropy(&mut seed.as_slice()).unwrap()
}
}

View File

@ -39,10 +39,10 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(30);
/// be used by `Operational` extrinsics.
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(60);
/// We allow for 6 seconds of compute with a 12 seconds average block time.
/// We allow for 4 seconds of compute with a 12 seconds average block time.
/// The storage proof size is not limited so far.
pub const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(6), u64::MAX);
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(4), u64::MAX);
const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());
@ -173,7 +173,7 @@ macro_rules! prod_or_fast {
}
};
($prod:expr, $test:expr, $env:expr) => {
if cfg!(feature == "fast-runtime") {
if cfg!(feature = "fast-runtime") {
core::option_env!($env)
.map(|s| s.parse().ok())
.flatten()

View File

@ -15,13 +15,13 @@ mod test_weights {
let w = super::BlockExecutionWeight::get();
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_PER_TIME_PER_MICROS,
"Weight should be at least 100 µs."
w.ref_time() >= 5u64 * constants::WEIGHT_PER_TIME_PER_MICROS,
"Weight should be at least 5 µs."
);
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
w.ref_time() <= 12u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 12 ms."
);
}
}

View File

@ -16,13 +16,13 @@ mod test_weights {
let w = super::ExtrinsicBaseWeight::get();
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 10 µs."
w.ref_time() >= 70u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 70 µs."
);
assert!(
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 1 ms."
w.ref_time() <= 120u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 120 ms."
);
}
}