besu
besu copied to clipboard
Solved Add db reset for Ephemery network on restart #8180
PR description
Fixed Issue(s)
Solved issue -: https://github.com/hyperledger/besu/issues/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?
- [X] Checked out our contribution guidelines?
- [ ] Considered documentation and added the
doc-change-requiredlabel 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:
- [X] spotless:
./gradlew spotlessApply - [X] unit tests:
./gradlew build - [X] acceptance tests:
./gradlew acceptanceTest - [X] integration tests:
./gradlew integrationTest - [X] reference tests:
./gradlew ethereum:referenceTests:referenceTests
Tagging @macfarla for the review. Thanks!
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
This pr is stale because it has been open for 30 days with no activity.
@ojuschugh1 I added some comments and questions above, please take a look
This pr is stale because it has been open for 30 days with no activity.
This pr was closed because it has been inactive for 14 days since being marked as stale.