Add validator set rotation test for the node side (#532)

* add node side unit test

* complete rotation test for all networks

* set up the fast-epoch docker file

* fix pr comments
This commit is contained in:
akildemir
2024-02-24 22:51:06 +03:00
committed by GitHub
parent 019b42c0e0
commit 627e7e6210
11 changed files with 305 additions and 12 deletions

View File

@@ -124,6 +124,8 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
]
fast-epoch = []
runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",

View File

@@ -313,8 +313,14 @@ pub type MaxAuthorities = ConstU32<{ validator_sets::primitives::MAX_KEY_SHARES_
pub type ReportLongevity = <Runtime as pallet_babe::Config>::EpochDuration;
impl babe::Config for Runtime {
#[cfg(feature = "fast-epoch")]
#[allow(clippy::identity_op)]
type EpochDuration = ConstU64<{ 1 * DAYS }>;
type EpochDuration = ConstU64<{ DAYS / (24 * 60 * 2) }>; // 30 seconds
#[cfg(not(feature = "fast-epoch"))]
#[allow(clippy::identity_op)]
type EpochDuration = ConstU64<{ DAYS }>;
type ExpectedBlockTime = ConstU64<{ TARGET_BLOCK_TIME * 1000 }>;
type EpochChangeTrigger = babe::ExternalTrigger;
type DisabledValidators = ValidatorSets;