Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
52ad11f
feature in good shape, most tests pass, except those that rely in moc…
kianenigma Sep 23, 2025
2608c36
new combinator logic, all tests pass
kianenigma Sep 23, 2025
88cb160
fix benchmarks too
kianenigma Oct 1, 2025
fac1956
move to poll, rename all weights
kianenigma Oct 1, 2025
65a2964
cleanup mock signed stuff
kianenigma Oct 1, 2025
1e4bfc2
staking uses poll now as well
kianenigma Oct 1, 2025
624e627
tidy up
kianenigma Oct 3, 2025
f74d49f
fix ahm tests and merge master
kianenigma Oct 3, 2025
c05bf0d
solid round of self-review
kianenigma Oct 3, 2025
9bcba02
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
kianenigma Oct 3, 2025
10afe31
remove some todos
kianenigma Oct 3, 2025
0c4289d
fmt
kianenigma Oct 3, 2025
5b712bb
fix build
kianenigma Oct 3, 2025
7bda95e
add unit test
kianenigma Oct 6, 2025
fe82b86
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
kianenigma Oct 6, 2025
e6d025a
add more tests, ready for benchmarks
kianenigma Oct 8, 2025
1b65e05
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
kianenigma Oct 8, 2025
cdba719
docs and add weight test
kianenigma Oct 8, 2025
62a0050
Apply suggestion from @kianenigma
kianenigma Oct 8, 2025
172ef4a
add more tests
kianenigma Oct 8, 2025
7837c72
Update from github-actions[bot] running command 'bench --pallet palle…
github-actions[bot] Oct 8, 2025
c90b1cd
Merge branch 'kiz-epmb-poll' of github.com:paritytech/polkadot-sdk in…
kianenigma Oct 8, 2025
493a46e
integrate new westend weights
kianenigma Oct 8, 2025
aa517d8
add comment
kianenigma Oct 8, 2025
c816fae
fresh tests
kianenigma Oct 9, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ impl multi_block::Config for Runtime {
// Revert back to signed phase if nothing is submitted and queued, so we prolong the election.
type AreWeDone = multi_block::RevertToSignedIfNotQueuedOf<Self>;
type OnRoundRotation = multi_block::CleanRound<Self>;
type Signed = MultiBlockElectionSigned;
type WeightInfo = multi_block::weights::westend::MultiBlockWeightInfo<Self>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ mod benchmarks {
use super::*;

#[benchmark(pov_mode = Measured)]
fn on_initialize_nothing() -> Result<(), BenchmarkError> {
fn per_block_nothing() -> Result<(), BenchmarkError> {
assert_eq!(CurrentPhase::<T>::get(), Phase::Off);

#[block]
{
Pallet::<T>::roll_next(true, false);
Pallet::<T>::roll_next(false);
}

assert_eq!(CurrentPhase::<T>::get(), Phase::Off);
Ok(())
}

#[benchmark(pov_mode = Measured)]
fn on_initialize_into_snapshot_msp() -> Result<(), BenchmarkError> {
fn per_block_snapshot_msp() -> Result<(), BenchmarkError> {
assert!(T::Pages::get() >= 2, "this benchmark only works in a runtime with 2 pages or more, set at least `type Pages = 2` for benchmark run");

#[cfg(test)]
Expand All @@ -59,7 +59,7 @@ mod benchmarks {

#[block]
{
Pallet::<T>::roll_next(true, false);
Pallet::<T>::roll_next(false);
}

// we have collected the target snapshot only
Expand All @@ -76,7 +76,7 @@ mod benchmarks {
}

#[benchmark(pov_mode = Measured)]
fn on_initialize_into_snapshot_rest() -> Result<(), BenchmarkError> {
fn per_block_snapshot_rest() -> Result<(), BenchmarkError> {
assert!(T::Pages::get() >= 2, "this benchmark only works in a runtime with 2 pages or more, set at least `type Pages = 2` for benchmark run");

#[cfg(test)]
Expand All @@ -99,7 +99,7 @@ mod benchmarks {
// take one more snapshot page.
#[block]
{
Pallet::<T>::roll_next(true, false);
Pallet::<T>::roll_next(false);
}

// we have now collected the first page of voters.
Expand All @@ -115,29 +115,7 @@ mod benchmarks {
}

#[benchmark(pov_mode = Measured)]
fn on_initialize_into_signed() -> Result<(), BenchmarkError> {
#[cfg(test)]
crate::mock::ElectionStart::set(sp_runtime::traits::Bounded::max_value());
crate::Pallet::<T>::start().unwrap();

Pallet::<T>::roll_until_before_matches(|| {
matches!(CurrentPhase::<T>::get(), Phase::Signed(_))
});

assert_eq!(CurrentPhase::<T>::get(), Phase::Snapshot(0));

#[block]
{
Pallet::<T>::roll_next(true, false);
}

assert!(CurrentPhase::<T>::get().is_signed());

Ok(())
}

#[benchmark(pov_mode = Measured)]
fn on_initialize_into_signed_validation() -> Result<(), BenchmarkError> {
fn per_block_start_signed_validation() -> Result<(), BenchmarkError> {
#[cfg(test)]
crate::mock::ElectionStart::set(sp_runtime::traits::Bounded::max_value());
crate::Pallet::<T>::start().unwrap();
Expand All @@ -150,29 +128,11 @@ mod benchmarks {

#[block]
{
Pallet::<T>::roll_next(true, false);
Pallet::<T>::roll_next(false);
}

Ok(())
}

#[benchmark(pov_mode = Measured)]
fn on_initialize_into_unsigned() -> Result<(), BenchmarkError> {
#[cfg(test)]
crate::mock::ElectionStart::set(sp_runtime::traits::Bounded::max_value());
crate::Pallet::<T>::start().unwrap();

Pallet::<T>::roll_until_before_matches(|| {
matches!(CurrentPhase::<T>::get(), Phase::Unsigned(_))
});
assert!(matches!(CurrentPhase::<T>::get(), Phase::SignedValidation(_)));

#[block]
{
Pallet::<T>::roll_next(true, false);
}
assert!(CurrentPhase::<T>::get().is_signed_validation());

assert!(matches!(CurrentPhase::<T>::get(), Phase::Unsigned(_)));
Ok(())
}

Expand Down
Loading
Loading