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(consensus): fix amnesia recovery boot run #4768

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

bingyanglin
Copy link
Contributor

@bingyanglin bingyanglin commented Jan 14, 2025

Description of change

(Source)
Currently if someone recovers their node within epoch R with a snapshot that's from epoch < R-1 , consensus will not start in amnesia recovery mode in epoch R as the boot counter will have already been incremented as node is trying to catch up from earlier epochs. This is problematic as it defies the whole point of the automatic amnesia recovery.

Instead on this PR we track consensus participation activity from earlier epochs/run and only then we increment the boot counter. Otherwise we keep the boot counter to 0 so we effectively enforce amnesia recovery until we get to an epoch where the node is able to participate. In this case participate means "able to have performed at least one commit".

Links to any relevant issues

fixes #4676

Type of change

  • Bug fix

How the change has been tested

Ran the local network with RUST_LOG=info cargo run --release --bin iota start --force-regenesis --with-faucet

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
apps-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:13pm
apps-ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:13pm
rebased-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:13pm
wallet-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:13pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-protocol node Issues related to the Core Node team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Consensus] fix amnesia recovery boot run (#19774) · MystenLabs/sui@b78eb10
5 participants