-
Notifications
You must be signed in to change notification settings - Fork 839
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
Ensure empty withdrawal lists are set in BFT blocks when the protocol spec is shanghai or higher #6765
Conversation
… schedule is shanghai or higher Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
b8df9c8
to
91c7f37
Compare
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
final Block block = blockCreator.createBlock(headerTimeStampSeconds).getBlock(); | ||
|
||
// Determine if we're at a protocol spec that requires withdrawals (even if empty) to be present | ||
ProtocolSpec protocolSpec = |
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.
This is duplicated several times. It feels like we can do this in BftBlockCreator by overriding createBlock, checking the withdrawal validator, and switching on that. If the sequence number is truly needed then making a new createBlock method with both args. May need to also do it for PkuQbftBlockCreator since there is no shared parent classes.
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.
Good thought. I've done some refactoring as BftBlockCreator
already has access to the parent header required to get the next block number. So it was a little easier than I thought. Now QbftRound
and IbftRound
can just continue to call createBlock(...)
as they did before, and BftBlockCreator.createBlock(...)
can decide which type of block to actually create. There's a little repetition in PkiQbftBlockCreator
like you say, but it's definitely tidier now.
036b7e2
to
41bf3e0
Compare
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
41bf3e0
to
082ba98
Compare
Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
… spec is shanghai or higher (hyperledger#6765) * Ensure empty withdrawal lists are set in BFT blocks when the protocol schedule is shanghai or higher Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Unit tests missing mock Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Unit tests missing mock Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Refactor and reduce code duplication Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> --------- Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io> Signed-off-by: amsmota <antonio.mota@citi.com>
… spec is shanghai or higher (hyperledger#6765) * Ensure empty withdrawal lists are set in BFT blocks when the protocol schedule is shanghai or higher Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Unit tests missing mock Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Unit tests missing mock Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Refactor and reduce code duplication Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> --------- Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io> Signed-off-by: amsmota <antonio.mota@citi.com>
hello, |
+following |
… spec is shanghai or higher (hyperledger#6765) * Ensure empty withdrawal lists are set in BFT blocks when the protocol schedule is shanghai or higher Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Unit tests missing mock Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Unit tests missing mock Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Refactor and reduce code duplication Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> --------- Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
PR description
If the protocol spec is as
shanghai
or higher, a valid (if empty) withdrawals list must be present in the blocks proposed.Fixed Issue(s)
Fixes #6760