fix: wait for the Leios voting committee epoch - #3650
Merged
Conversation
The Leios voting committee is drawn from a stake distribution snapshot that stays empty until epoch 3 on a freshly started cluster instance. Until then every pool answers each EB announcement with `NotOnCommittee`, so no EB can be voted on or certified. `test_eb_logs` searched for votes and certificates from the moment it started, which on a fresh instance was always before epoch 3, so the vote and certificate messages could never show up. Wait for the epoch in which the committee becomes active, and schedule the test at the end of the testrun so the wait is normally a no-op. Add `test_no_voting_before_committee_epoch`, scheduled near the start of the testrun, to check the other side of the same behavior: no vote and no certificate is reported before epoch 3, while the pools do report that they are not on the committee. The searched log window must not cross an epoch boundary, otherwise a vote from epoch 3 could land in it, so `wait_for_epoch_interval` positions the search early enough in an epoch for the whole window to fit into it. The epoch and the position in it are read from a single tip before that wait, so the test skips right away instead of burning a whole epoch when no epoch before the voting one has room left. The epoch is read again after the wait and after the search, as only the second read tells which epoch the search ran in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Leios voting committee is drawn from a stake distribution snapshot that stays empty until epoch 3 on a freshly started cluster instance. Until then every pool answers each EB announcement with
NotOnCommittee, so no EB can be voted on or certified.test_eb_logssearched for votes and certificates from the moment it started, which on a fresh instance was always before epoch 3, so the vote and certificate messages could never show up. Wait for the epoch in which the committee becomes active, and schedule the test at the end of the testrun so the wait is normally a no-op.Add
test_no_voting_before_committee_epoch, scheduled near the start of the testrun, to check the other side of the same behavior: no vote and no certificate is reported before epoch 3, while the pools do report that they are not on the committee. The searched log window must not cross an epoch boundary, otherwise a vote from epoch 3 could land in it, sowait_for_epoch_intervalpositions the search early enough in an epoch for the whole window to fit into it. The epoch and the position in it are read from a single tip before that wait, so the test skips right away instead of burning a whole epoch when no epoch before the voting one has room left. The epoch is read again after the wait and after the search, as only the second read tells which epoch the search ran in.