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

Removing mdbx.dat without removing static files leads to error on ExecutionStage #13136

Closed
1 task done
joshieDo opened this issue Dec 4, 2024 · 0 comments · Fixed by #13157
Closed
1 task done

Removing mdbx.dat without removing static files leads to error on ExecutionStage #13136

joshieDo opened this issue Dec 4, 2024 · 0 comments · Fixed by #13157
Assignees
Labels
A-db Related to the database C-bug An unexpected or incorrect behavior D-good-first-issue Nice and easy! A great choice to get started

Comments

@joshieDo
Copy link
Collaborator

joshieDo commented Dec 4, 2024

Describe the bug

Some users when attempting to keep certain datadir configurations will only delete mdbx files. Since the genesis check is only checking the static files, we never re-write the genesis related data to mdbx. This leads eventually to an error on ExecutionStage and unwind.

2024-12-04T17:08:23.491354Z  INFO Executing stage pipeline_stages=4/12 stage=Execution checkpoint=0 target=100000
2024-12-04T17:08:23.853051Z ERROR Stage encountered an execution error: EVM reported invalid transaction (0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060): transaction validation error: lack of funds (0) for max fee (1050000000000031337) stage=Execution bad_block=46147
2024-12-04T17:08:23.853429Z  INFO Unwinding{stage=Finish}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853447Z  INFO Unwinding{stage=IndexAccountHistory}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853451Z  INFO Unwinding{stage=IndexStorageHistory}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853455Z  INFO Unwinding{stage=TransactionLookup}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853459Z  INFO Unwinding{stage=MerkleExecute}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853462Z  INFO Unwinding{stage=StorageHashing}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853466Z  INFO Unwinding{stage=AccountHashing}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853577Z  INFO Unwinding{stage=MerkleUnwind}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853582Z  INFO Unwinding{stage=Execution}: Starting unwind from=0 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853587Z  INFO Unwinding{stage=SenderRecovery}: Starting unwind from=100000 to=0 bad_block=Some(46147)
2024-12-04T17:08:23.853649Z ERROR backfill sync failed err=database integrity error occurred: block meta not found for block #0
2024-12-04T17:08:23.853932Z ERROR Fatal error in consensus engine
2024-12-04T17:08:23.854080Z ERROR shutting down due to error
Error: Fatal error in consensus engine

We probably just want to modify this check and error out if there's not even a stage checkpoint on db, with a message hinting at this problem.

match factory.block_hash(0) {
Ok(None) | Err(ProviderError::MissingStaticFileBlock(StaticFileSegment::Headers, 0)) => {}

Steps to reproduce

  1. Sync to 100k
  2. Turn off node
  3. Remove datadir/db/mdbx.*
  4. Restart node
  5. ???
  6. failure

Node logs


Platform(s)

Linux (x86)

What version/commit are you on?

What database version are you on?

Which chain / network are you on?

What type of node are you running?

Archive (default)

What prune config do you use, if any?

No response

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@joshieDo joshieDo added A-db Related to the database C-bug An unexpected or incorrect behavior labels Dec 4, 2024
@joshieDo joshieDo assigned joshieDo and unassigned joshieDo Dec 4, 2024
@joshieDo joshieDo added the D-good-first-issue Nice and easy! A great choice to get started label Dec 4, 2024
@joshieDo joshieDo self-assigned this Dec 5, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database C-bug An unexpected or incorrect behavior D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant