hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.43k stars 757 forks source link

Don't persist BFT proposed blocks, only committed ones #7204

Closed matthew1001 closed 3 weeks ago

matthew1001 commented 3 weeks ago

PR description

This PR changes BFT block proposal validation to not persist the changes as a result of the proposed block. When a QBFT commit message or Ethereum NewBlock message is processed the changes will still be persisted at that point.

Prior to this PR I could only get a few 1000 transactions through a 4-validator QBFT chain before I hit Invalid block error. With this fix in place I can run any number of high TPS tests against a 4-validator chain and have yet to see an Invalid block error.

Fixed Issue(s)

Fixes https://github.com/hyperledger/besu/issues/6680

(It might fix this issue, or there could still be something to resolve regarding the RocksDB busy error. I suspect this PR will improve the above issue at the very least, but suggest closing it with this PR and re-opening if it still occurs after this has merged)