Skip to content

Conversation

@Cherrypick14
Copy link

Fixes #33000

This PR migrates the node database in p2p/enode from LevelDB to Pebble, aligning it with the rest of the geth codebase which has already transitioned to Pebble.

Changes

  • Switched from leveldb.DB to the ethdb.KeyValueStore interface.
  • Updated database initialization to use memorydb.New() and pebble.New().
  • Fixed iterator usage in QuerySeeds() - can't use Seek() with the ethdb interface, so now we create iterators with the start position.
  • Cleaned up some error handling.

Testing

  • TestDBSeedQuery - Random seed querying works correctly.
  • TestDBPersistency - Database persistence across restarts.
  • TestDBExpiration - Node expiration logic.
  • All other enode package tests.

@Cherrypick14 Cherrypick14 force-pushed the migrate-nodedb-to-pebble branch from a0c7e5e to 163782f Compare November 16, 2025 20:13
@rjl493456442
Copy link
Member

I don't think it's required at this point.

Leveldb for peernode works very well, we should keep using it until leveldb is totally deprecated from our dependency.

@Cherrypick14
Copy link
Author

Hi @rjl493456442 thanks for the updates. I initially wanted to ask why you guys are migrating from leveldb to pebble and it seems you have clarified this.

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.

Migrating nodes db from leveldb to pebble

2 participants