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

Bugfix/autorepair fix invalid best state calculation #5617

Merged
merged 5 commits into from
Apr 28, 2023

Conversation

MarekM25
Copy link
Contributor

Changes

Possible fix of Invalid Best State Calculation observed on syncing some archive nodes. This is automatic repair after the issue happened. Normally, a restart of the node will fix the issue. The root cause: once we have an invalid block during the sync, we
changed best blocks: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Blockchain/BlockTree.cs#L1111
but we can have more blocks that have been already suggested and because of that Invalid Best State Calculation is broken: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Synchronization/ParallelSync/MultiSyncModeSelector.cs#L674

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

I haven't done testing yet, which is why it is still a draft. It takes a lot of time to sync archive nodes, I will start with this fix and will work on tests in the meantime. For now, I want to check if the fix is working

@MarekM25 MarekM25 marked this pull request as draft April 25, 2023 09:54
retake snapshot

add warning

fix tests
@MarekM25 MarekM25 force-pushed the bugfix/autorepair_fix_invalid_state branch from 15e7bb2 to d3c28fd Compare April 25, 2023 10:26
@MarekM25 MarekM25 marked this pull request as ready for review April 28, 2023 08:08
@MarekM25 MarekM25 merged commit 794dafa into master Apr 28, 2023
@MarekM25 MarekM25 deleted the bugfix/autorepair_fix_invalid_state branch April 28, 2023 08:09
kamilchodola pushed a commit that referenced this pull request May 2, 2023
* InvalidBestState fix?

retake snapshot

add warning

fix tests

* add test

* fix test

* one more test for autorepair

* fix whitespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants