mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 12:31:03 +00:00
[Staking] Adds a round check at signed solution submission (#2690)
This PR adds a round check to the `Call::submit` extrinsic to make sure that the solution submission has been prepared for the current election round and avoid penalties for delayed submissions. Related to https://github.com/paritytech-secops/srlabs_findings/issues/329 --------- Co-authored-by: command-bot <>
This commit is contained in:
@@ -112,6 +112,15 @@ pub fn roll_to_with_ocw(n: BlockNumber) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn roll_to_round(n: u32) {
|
||||
assert!(MultiPhase::round() <= n);
|
||||
|
||||
while MultiPhase::round() != n {
|
||||
roll_to_signed();
|
||||
assert_ok!(MultiPhase::elect());
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TrimHelpers {
|
||||
pub voters: Vec<VoterOf<Runtime>>,
|
||||
pub assignments: Vec<IndexAssignmentOf<Runtime>>,
|
||||
|
||||
Reference in New Issue
Block a user