-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev/test option for short BFT block periods #7588
Dev/test option for short BFT block periods #7588
Conversation
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BlockTimer.java
Outdated
Show resolved
Hide resolved
@@ -45,7 +45,12 @@ public RoundTimer( | |||
this.queue = queue; | |||
this.bftExecutors = bftExecutors; | |||
this.currentTimerTask = Optional.empty(); | |||
this.baseExpiryMillis = baseExpirySeconds * 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the baseExpiryMillis type was changed to a duration, then we could handle both milliseconds and seconds without any special logic
...g/hyperledger/besu/ethereum/mainnet/headervalidationrules/TimestampMoreRecentThanParent.java
Outdated
Show resolved
Hide resolved
Thanks for the comments @jframe, agree with you on all counts. I'll update the PR shortly |
…ption Signed-off-by: Matthew Whitehead <[email protected]>
I've done some refactoring to the PR as follows:
|
Thanks for the comments @jframe See the latest commit & comment which hopefully resolves your comments |
Signed-off-by: Matthew Whitehead <[email protected]>
* Dev mode for short BFT block periods Signed-off-by: Matthew Whitehead <[email protected]> * Refactoring Signed-off-by: Matthew Whitehead <[email protected]> * Fix comment Signed-off-by: Matthew Whitehead <[email protected]> * Refactor to make BFT block milliseconds an experimental QBFT config option Signed-off-by: Matthew Whitehead <[email protected]> * Update Json BFT config options Signed-off-by: Matthew Whitehead <[email protected]> --------- Signed-off-by: Matthew Whitehead <[email protected]> Signed-off-by: Wolmin <[email protected]>
PR description
This is a test-only option to mine BFT blocks more quickly than once a second.
It is not designed to be used in production and I've added warnings to the logs when it is set.
The reason for adding it is for Web3 frameworks wanting to run tests against a Besu node, possibly as part of a CI/CD pipeline, where lots of transactions & receipts need round-tripping during the test. 1 second block periods mean a test could take a very long time to complete.
I've tested it down to
50ms
blocks and a single node is stable enough to mine transactions into blocks at that speed. I've also tested it in conjunction with draft PR #6965 withemptyblockperiodseconds
set to 10s (so while the test isn't driving TXN traffic Besu isn't spinning creating huge numbers of empty blocks) and the two work fine together - see the following logs with300ms
blocks: