Skip to content

Commit 1e6f134

Browse files
authored
static-types: MaxVoters should match VoterSnapshotPerBlock (#1220)
MaxVoters = VoterSnapshotPerBlock = MaxElectingVoters::get().div_ceil(Pages::get()) = 704 for Polkadot This limits how many voters can be included per page of the solution, not the total snapshot. The miner was incorrectly setting VoterSnapshotPerBlock * Pages ending up overestimating the max numbersof voters per page. No actual damage in practice but let's make it proper.
1 parent ef48ee0 commit 1e6f134

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/static_types/multi_block.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub mod node {
2626
VoterIndex = u16,
2727
TargetIndex = u16,
2828
Accuracy = Percent,
29-
MaxVoters = ConstU32::<22500>
29+
MaxVoters = ConstU32::<704> // same default as Polkadot
3030
>(16)
3131
);
3232

@@ -61,7 +61,7 @@ pub mod polkadot {
6161
VoterIndex = u32,
6262
TargetIndex = u16,
6363
Accuracy = PerU16,
64-
MaxVoters = ConstU32::<22500>
64+
MaxVoters = ConstU32::<704> // should match VoterSnapshotPerBlock
6565
>(16)
6666
);
6767

@@ -96,7 +96,7 @@ pub mod kusama {
9696
VoterIndex = u32,
9797
TargetIndex = u16,
9898
Accuracy = PerU16,
99-
MaxVoters = ConstU32::<12500>
99+
MaxVoters = ConstU32::<782> // should match VoterSnapshotPerBlock
100100
>(24)
101101
);
102102

@@ -131,7 +131,7 @@ pub mod westend {
131131
VoterIndex = u32,
132132
TargetIndex = u16,
133133
Accuracy = PerU16,
134-
MaxVoters = ConstU32::<22500>
134+
MaxVoters = ConstU32::<703> // should match VoterSnapshotPerBlock
135135
>(16)
136136
);
137137

@@ -167,7 +167,7 @@ pub mod staking_async {
167167
VoterIndex = u32,
168168
TargetIndex = u16,
169169
Accuracy = PerU16,
170-
MaxVoters = ConstU32::<22500>
170+
MaxVoters = ConstU32::<704> // same default as Polkadot
171171
>(16)
172172
);
173173

0 commit comments

Comments
 (0)