Consensys / bela

Besu Lanterna tool, visualize, interrogate and manage besu storage db offline
Apache License 2.0
2 stars 1 forks source link

Bonsai Tree Verifier improvements #58

Closed siladu closed 3 weeks ago

siladu commented 3 weeks ago

MVP improvements to enable us to verify canary nodes.

What this PR does:

Future Improvements

What this PR does not do (but I'd like to do in future PRs):


Running this code a canary:

See https://github.com/Consensys/protocol-misc/issues/972#issuecomment-2325590845

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
garyschulte commented 3 weeks ago

🚢 !