Skip to content

Solved Add db reset for Ephemery network on restart #8180 #8618

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ojuschugh1
Copy link

@ojuschugh1 ojuschugh1 commented May 9, 2025

PR description

Fixed Issue(s)

Solved issue -: #8180

Created a unit test case to check it is working properly or not as well-:

Try -: gradlew.bat :besu:test --tests "org.hyperledger.besu.util.EphemeryDatabaseResetTest"

or

./gradlew :besu:test --tests 'org.hyperledger.besu.util.EphemeryDatabaseResetTest'

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

@ojuschugh1
Copy link
Author

ojuschugh1 commented May 9, 2025

Tagging @macfarla for the review. Thanks!

@macfarla
Copy link
Contributor

here's what I did to test this

gco main
gw installDist

// use --genesis file to start with existing ephemery genesis even though it's out of date
besu --genesis-file=./config/src/main/resources/ephemery.json

# Configuration:                                                                                   #
# Network: Custom genesis file                                                                     #
# /Users/sallymacfarlane/workspace/b2/./config/src/main/resources/ephemery.json                     #
# Network Id: 39438135                                                                             #
...

// verify that it doesn't auto-update when using main branch
besu --network=ephemery

2025-05-19 13:44:30.406+10:00 | main | ERROR | Besu | Failed to start Besu: Supplied genesis block does not match chain data stored in /Users/sallymacfarlane/workspace/b2/build/install/besu.
Please specify a different data directory with --data-path, specify the original genesis file with --genesis-file or supply a testnet/mainnet option with --network.
Supplied genesis block does not match chain data stored in /Users/sallymacfarlane/workspace/b2/build/install/besu.
Please specify a different data directory with --data-path, specify the original genesis file with --genesis-file or supply a testnet/mainnet option with --network.

// switch to this pr
gh pr checkout 8618
gw installDist
besu --network=ephemery
...

# Configuration:                                                                                   #
# Network: Ephemery                                                                                #
# Network Id: 39438146

It feels a bit weird to have your database silently nuked. Even though it is by definition ephemeral.

At very least a log message that indicates your db is starting again from scratch would be nice.

Is this how other clients (geth, nethermind etc) deal with the ephemery network? Would be nice to be consistent

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.

2 participants