Consensys / bela

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

Parallel BonsaiTraversal - 12x improvement #62

Closed siladu closed 2 weeks ago

siladu commented 2 weeks ago

BonsaiTreeVerifier tree traversal is read-only, so it lends itself well to a naive parallel implementation using parallelStream for the child nodes.

12x improvment on holesky (with both besu and teku services stopped)

simon.dudley@dev-elc-bu-tk-holesky-simon-parallel-bvt:~/bela$ tail -f /data/bela.log

World state was successfully verified...
Verified root 0x520e9d1657af66a141329a593dca05cddb747edf47774c3cebe2868ccbde356c with 214630272 nodes

Duration: 0 hours, 13 minutes, 48 seconds (259016 nodes per second)

Previously holesky took nearly 3 hours...

simon.dudley@dev-elc-bu-tk-holesky-simon-parallel-bvt-ctrl:~/bela$ tail -f /data/bela.log

World state was successfully verified...
Verified root 0xf11bc6746bcb30553a7fd2d2cfd9d3ee3277c0845e5832e7d00018e5fb6bf18c with 214633626 nodes
AAAAAAAAAA!!!!!!!
Duration: 2 hours, 52 minutes, 27 seconds

Mainnet has ~10x more nodes than holesky so expect mainnet to take ~2.5 hours

e.g. mainnet has 2104544043 nodes 2104544043 / 259016 nodes per second / 3600 = 2.23 hours

siladu commented 2 weeks ago

Mainnet verified in < 2 hours!

World state was successfully verified...
Verified root 0xfd0ea9a51f78aec2e95dbac25b0002c21bffd434cc7026ff9412e3f6c89d4fec with 2120917973 nodes

Duration: 1 hours, 56 minutes, 9 seconds (304329 nodes per second)