-
Notifications
You must be signed in to change notification settings - Fork 865
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
Add optional list of withdrawals to block body #4944
Conversation
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
84a97b4
to
664d929
Compare
Signed-off-by: Jason Frame <jason.frame@consensys.net>
+ ", ommers=" | ||
+ ommers | ||
+ ", withdrawals=" | ||
+ withdrawals |
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.
Will this just return ", withdrawals=Optional.empty" ?
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.
Yeah that's what it will return
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.
LGTM
IMO overloading the BlockBody constructor would have been a better choice rather than changing all of the usages of blockbody to take an optional list... |
@garyschulte what's your thinking around this? |
Withdrawals are an Ethereum mainnet only consideration. Also now we have a bunch of Optional.empty() params everywhere, whereas an overloaded constructor could just do that in one place. NBD, it just struck me as odd to require an optional parameter |
You have a good point about this being mainnet specific and this forces everyone to consider whether to use withdrawals. And it would make tests cleaner. The production code though would need to determine what constructor to call so the main code may necessarily not be any cleaner. Will have a quick go-see what the code would be like using an overloaded constructor approach. |
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame jason.frame@consensys.net
PR description
Add optional list of withdrawals to block body. Also update the equals, hashcode methods. This does not wire withdrawals into the block body it's just to reduce the noise as many uses especially tests will use Optional.empty for withdrawals. Changes to wire in the list of withdrawals will be done in a subsequent PR.
Fixed Issue(s)
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog