Skip to content
Snippets Groups Projects
Commit 2325de55 authored by Alexandru Gheorghe's avatar Alexandru Gheorghe Committed by github-actions[bot]
Browse files

approval-voting: Fix sending of assignments after restart (#6973)

There is a problem on restart where nodes will not trigger their needed
assignment if they were offline while the time of the assignment passed.

That happens because after restart we will hit this condition
https://github.com/paritytech/polkadot-sdk/blob/4e805ca0

/polkadot/node/core/approval-voting/src/lib.rs#L2495
and considered will be `tick_now` which is already higher than the tick
of our assignment.

The fix is to schedule a wakeup for untriggered assignments at restart
and let the logic of processing an wakeup decide if it needs to trigger
the assignment or not.

One thing that we need to be careful here is to make sure we don't
schedule the wake up immediately after restart because, the node would
still be behind with all the assignments that should have received and
might make it wrongfully decide it needs to trigger its assignment, so I
added a `RESTART_WAKEUP_DELAY: Tick = 12` which should be more than
enough for the node to catch up.

---------

Signed-off-by: default avatarAlexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: default avatarordian <write@reusable.software>
Co-authored-by: default avatarAndrei Eres <eresav@me.com>
(cherry picked from commit d38bb953)
parent 2b34f2dd
No related merge requests found
Pipeline #511638 waiting for manual action with stages
in 11 minutes and 40 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment