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

Use leveldb2 database by default for new databases #3895

Merged
merged 4 commits into from
Apr 22, 2021

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Apr 21, 2021

PR Description

Switch default format for new databases to leveldb2. Does not affect existing databases which will continue to use RocksDB.

Also fixed deprecation warnings in ForkChoiceStrategyTest because I thought it was doing something specific and started there before investigating further - turns out it just needed the updates to InMemoryStorageSystemBuilder.

Fixed Issue(s)

fixes #3881

Documentation

  • I thought about documentation and added the documentation label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@ajsutton ajsutton added the doc-change-required Indicates an issue or PR that requires doc to be updated label Apr 21, 2021
@ajsutton
Copy link
Contributor Author

ajsutton commented Apr 21, 2021

Documentation wise on this one it may be useful to have some docs a) clarifying that existing databases are unaffected and continue to be supported, and b) explaining how to delete the db and resync if people do want to switch to leveldb now.

Better migration tools will be provided in future releases but for nodes using "prune" mode, the migration is quick and simple:

  1. Download the latest finalized state curl -o state.ssz -H 'Accept: application/octet-stream' http://other-node:5051/eth/v1/debug/beacon/states/finalized
  2. Stop teku
  3. Delete the beacon directory under your data-path. Make sure not to delete the validator directory if one is present which contains your slashing protection data
  4. Start teku with the --initial-state state.ssz option to start from the finalized state you just downloaded. A new leveldb database will be created and teku will start from that recent state and should be back in sync and validating within a couple of minutes.

Nodes running in "archive" mode will have to resync from genesis to convert at this stage. The migration tools we'll add in future releases will make it possibly to convert the database over without having to resync.

Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ajsutton ajsutton merged commit e97a667 into Consensys:master Apr 22, 2021
@ajsutton ajsutton deleted the enable-leveldb branch April 22, 2021 00:40
@bgravenorst bgravenorst removed the doc-change-required Indicates an issue or PR that requires doc to be updated label Mar 4, 2022
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.

make leveldb 2 the default new database format
3 participants