Skip to content
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

Merged
merged 5 commits into from
Jan 17, 2023

Conversation

jframe
Copy link
Contributor

@jframe jframe commented Jan 17, 2023

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

  • I thought about documentation and added the doc-change-required label to this PR if
    updates are required.

Changelog

Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
@jframe jframe force-pushed the withdrawals_add_to_block branch from 84a97b4 to 664d929 Compare January 17, 2023 00:49
Signed-off-by: Jason Frame <jason.frame@consensys.net>
+ ", ommers="
+ ommers
+ ", withdrawals="
+ withdrawals
Copy link
Contributor

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" ?

Copy link
Contributor Author

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

Copy link
Contributor

@pinges pinges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jframe jframe enabled auto-merge (squash) January 17, 2023 04:06
@jframe jframe merged commit 009508d into hyperledger:main Jan 17, 2023
@jframe jframe deleted the withdrawals_add_to_block branch January 17, 2023 05:52
@garyschulte
Copy link
Contributor

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...

@siladu
Copy link
Contributor

siladu commented Jan 18, 2023

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?
I think a benefit of doing it this way is you're potentially avoiding subtle bugs by surfacing missing wiring in the compiler.

@garyschulte
Copy link
Contributor

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?
I think a benefit of doing it this way is you're potentially avoiding subtle bugs by surfacing missing wiring in the compiler.

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

@jframe
Copy link
Contributor Author

jframe commented Jan 18, 2023

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?
I think a benefit of doing it this way is you're potentially avoiding subtle bugs by surfacing missing wiring in the compiler.

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.

@jframe jframe added the TeamGroot GH issues worked on by Groot Team label Jan 18, 2023
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
Signed-off-by: Jason Frame <jason.frame@consensys.net>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TeamGroot GH issues worked on by Groot Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants