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

Implement beacon chain push withdrawals (EIP-4895) #4731

Merged
merged 289 commits into from
Jan 11, 2023

Conversation

rubo
Copy link
Contributor

@rubo rubo commented Oct 7, 2022

Closes #4580

Changes:

These changes are preliminary for prototyping purposes and are subject to change.

  • The new Withdrawal class has been added to the Block
  • The RLP serializer has been extended to handle withdrawals according to the spec
  • BlockProcessor has been modified to process withdrawals if any

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Further comments


foreach (var withdrawal in block.Withdrawals)
{
if (_logger.IsTrace) _logger.Trace($" {(BigInteger)withdrawal.Amount / (BigInteger)Unit.Ether:N3}{Unit.EthSymbol} to account {withdrawal.Recipient}");
Copy link
Contributor

Choose a reason for hiding this comment

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

what about traces around withdrawals?

Copy link
Contributor

@MarekM25 MarekM25 left a comment

Choose a reason for hiding this comment

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

Could you reach out Mikhail Kalinin and Alex Stokes about withdrawalRoot validation?

It should be added to BlockValidator for sure (even now), but the question is how we should validate them when we're receiving newPayload from CL client.

@rubo rubo force-pushed the feature/shanghai-eip-4895-withdrawals branch from 8d3db64 to 6d83a24 Compare October 13, 2022 20:36
@rubo rubo force-pushed the feature/shanghai-eip-4895-withdrawals branch from 2539d2f to 9e6ee93 Compare October 26, 2022 22:25
Copy link
Contributor

@smartprogrammer93 smartprogrammer93 left a comment

Choose a reason for hiding this comment

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

LGTM

@rubo rubo force-pushed the feature/shanghai-eip-4895-withdrawals branch from d506374 to 7e804d8 Compare January 4, 2023 20:41
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

Main issues:

  • Incomplete validation of index and amount could lead to consensus issue on our side
  • I don't like how engine versioning is being handled. IMO we should model it as it is in the spec with either composition or inheritance + generics for messages. This would help us have better separation between protocol versions similar to what we have for eth protocol in networking. Would make code changes tracked easier. Would make code more resemble the spec. We could potentially use similar strategy on tests. More details with example in NewPayloadHandler.cs comment.

@rubo rubo force-pushed the feature/shanghai-eip-4895-withdrawals branch from b4bcf93 to 8e7be8d Compare January 6, 2023 21:16
@rubo rubo force-pushed the feature/shanghai-eip-4895-withdrawals branch from dcb5a6a to a25e999 Compare January 6, 2023 22:01
@rubo rubo marked this pull request as draft January 9, 2023 13:30
@MarekM25 MarekM25 marked this pull request as ready for review January 10, 2023 14:52
@MarekM25 MarekM25 merged commit 193c1c3 into master Jan 11, 2023
@MarekM25 MarekM25 deleted the feature/shanghai-eip-4895-withdrawals branch January 11, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement EIP-4895: Beacon chain push withdrawals as operations
5 participants