Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug that caused some nodes to vote on even superblocks and other nodes to vote on odd superblocks during rollbacks #2302

Open
tmpolaczyk opened this issue Nov 11, 2022 · 1 comment
Labels
bug 🐜 Something isn't working

Comments

@tmpolaczyk
Copy link
Contributor

During the recent rollbacks that prompted the release of version 1.5.4, we noticed that some nodes were trying to count votes for superblocks with an odd index, while other nodes were trying to count votes for superblocks with an even index. This shouldn't be possible with the current protocol, because if there is no superblock consensus for superblock N, the next votes will be for superblock N+2.

In PR #2295 I introduced a workaround that works by checking that the superblock index has the expected parity when counting the votes. While this fix may be good enough because in the worst case nodes will only stay forked for one superepoch, we should try to find the root cause of the issue.

I believe this is related to the synchronization code, which in theory already checks for this case as seen by all the % 2 present in this function:

fn split_blocks_batch_at_target<T, F>(

But it was impossible for me to reproduce the bug in a local testnet, so not sure what is the actual cause.

@guidiaz guidiaz added the bug 🐜 Something isn't working label Nov 14, 2022
@tmpolaczyk
Copy link
Contributor Author

I was able to accidentally reproduce this issue when running a testnet with only one node. Ocasionally when starting the node, I would see the error log from PR #2295. So this makes me think that the issue can be triggered by a lack of new blocks, maybe because then the node goes to synced state without going through the synchronization process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐜 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants