MVP improvements to enable us to verify canary nodes.
What this PR does:
Upgrades project to java 21 and gradle 8
Adds bonsaitreeverifier binary to bela/bin/ distro alongside bela binary (so it can be run via CLI)
Code by code hash support (falls back to code by account hash)
Better surfacing of errors upon traversal completion
Display duration at end of traversal (about 8 hours for mainnet)
Future Improvements
What this PR does not do (but I'd like to do in future PRs):
Does not fix compatibility with recent versions of besu (I've been using ./gradlew installDist -PbesuVersion=23.7.2 to build and reverting the database metadata file)
Does not improve traversal performance
Does not fix issues running Bonsai Tree Verifier via the lanterna UI
Does not enable read only mode for verifier
probably shouldn't run the verifier on a node whose trie is concurrently changing
maybe could explore taking a rocksdb snapshot first
cd $HOME
git clone https://github.com/Consensys/bela
cd bela
git pull
git checkout verifier-improvements
./gradlew installDist -PbesuVersion=23.7.2
sudo /opt/besu/current/bin/besu --data-path=/data/besu storage revert-metadata v2-to-v1
sudo service besu stop
nohup sudo env USER_HOME=$HOME bash -c '{ time $USER_HOME/bela/build/install/bela/bin/bonsaitreeverifier /data/besu > /data/bela.log 2>&1; }' &
Example of unsuccessful run:
We are verifying : /tmp/besu
ޏ₍ ὸ.ό₎ރ
🤞🤞🤞🤞🤞🤞🤞
Starting from root 0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544
Working with root 0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544
missing account trie node for hash 0xd1aca5cee11650c81f5fafb518f320105c4e7ad931a3e46b7ee73b05476bd3d3 and location 0x03020808
missing account trie node for hash 0xf33ad4d20fc5fae3dcc1a19afc5a510ebc10a37c7c3e0d89bddef33bd698f454 and location 0x0d0f0903
missing account trie node for hash 0x84269463e5e9ecf08491d8745b98cec308498076c2cacbbe1c6e7adbe5d00438 and location 0x0f0f0e
Found 3 errors (see above)
Could not verify root 0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544 with 3462 nodes
AAAAAAAAAA!!!!!!!
Duration: 0 hours, 0 minutes, 1 seconds
Example of successful run:
We are verifying : /tmp/besu
ޏ₍ ὸ.ό₎ރ
🤞🤞🤞🤞🤞🤞🤞
Starting from root 0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544
Working with root 0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544
ޏ₍ ὸ.ό₎ރ World state was verified... ޏ₍ ὸ.ό₎ރ
Verified root 0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544 with 3463 nodes
AAAAAAAAAA!!!!!!!
Duration: 0 hours, 0 minutes, 2 seconds
MVP improvements to enable us to verify canary nodes.
What this PR does:
bonsaitreeverifier
binary tobela/bin/
distro alongsidebela
binary (so it can be run via CLI)Future Improvements
What this PR does not do (but I'd like to do in future PRs):
./gradlew installDist -PbesuVersion=23.7.2
to build and reverting the database metadata file)Running this code a canary:
See https://github.com/Consensys/protocol-misc/issues/972#issuecomment-2325590845
Example of unsuccessful run:
Example of successful run: