1.Background
PBSS and PebbleDB was supported since v1.3.1-beta and promoted it since v1.3.5 on BSC. Since then, lots of nodes have been upgraded to PBSS + PebbleDB mode, so far everything is good.
As we have announced before, we will mainly support PBSS + PebbleDB mode, the support for Hash or LevelDB will be limited after the end of Mar 2024.
1.1.About PBSS
PBSS stands for Path-Based-Storage-Scheme, which was already enabled since BSC v1.3.1-beta. It is used to optimize the MPT trie tree access, to improve its efficiency and also brings the inline state prune. There is a brief introduction on v1.3.1-beta release page
1.2.About PebbleDB
Currently, BSC uses LevelDB as its default underlying database, but the project is no longer maintained, there are many opens issues and the latest commit is more than 1 years ago. So BSC would switch to PebbleDB in long term, same as what Go-Ethereum has done.
2.FAQs
Q1: Will BSC Stop Supporting Hash&LevelDB?
Yes
BSC uses PBSS&PebbleDB as the default and primary mode now, we will mainly put our limited resource on supporting PBSS + PebbleDB.
And the support for the Hash&LevelDB mode will be discontinued after September 30, 2024. Consequently, the functionality may become unavailable or cease to function properly at any time following this date.
Q2: How To Check Node’s Running Mode?
The running mode will be printed into the bsc.log on node startup. For Path&PebbleDB, here is the logs:
cat <logdir>/bsc.log |grep -E "scheme|backing database"
t=2024-08-01T01:03:29+0000 lvl=info msg="Use CLI state scheme" CLI=path
t=2024-08-01T01:03:29+0000 lvl=info msg="Using pebble as the backing database"
t=2024-08-01T01:03:29+0000 lvl=info msg="State scheme set by user" scheme=path
t=2024-08-01T01:03:29+0000 lvl=info msg="Allocated memory caches" state_scheme=path trie_clean_cache="6.78 GiB" trie_dirty_cache="256.00 MiB" snapshot_cache="3.52 GiB"
Q3: How To Try PBSS & PebbleDB?
For binary, you can try the latest stable release for PBSS + PebbleDB mode. As it is already the default mode, you don’t need extra configuration to use PBSS + PebbleDB.
To catch to the latest block:
- Option-1: Sync from genesis, it will be PBSS + PebbleDB by default. But it is not recommended for BSC mainnet, as it could take several months to get your node synced.
- Option-2: Sync based on snapshot: we have updated the snapshot of PBSS + PebbleDB on bsc-snapshots. Just download it and sync based on it, then your node will be PBSS + PebbleDB mode.
Q4: Can BSC Support Archive Node After PBSS?
PBSS does not support archive mode, for Archive node, you may need to run BSC-Erigon.
3.Conclusion
If you have any other questions, you may simply reply this page or fire an issue on bsc repo.