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

EIP-4895: Beacon chain push withdrawals as operations #2559

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

anvacaru
Copy link
Contributor

@anvacaru anvacaru commented Aug 6, 2024

Implementing withdrawal operations as specified in EIP-4895.

  • adding a new <withdrawals> cell map subconfiguration to the <network> that is used to keep track of withdrawals.
    Similar to how <messages> is implemented, <withdrawals> has two additional Lists:
    • <withdrawalsPending> to keep track of the withdrawals that need to be applied.
    • <withdrawalsOrder> to preserve the order of the withdrawals during the check rules after the execution has finished.
  • adding new EthereumCommands productions:
    • load "withdraw" that handles the rlp decoding of the withdrawals array. For each item, the following two productions will be applied:
    • mkWD - that creates a new <withdrawal> cell map item.
    • loadWithdraw - that initialises the newly created <withdrawal> with values that are provided from the rlp payload.
    • newWithdrawalID - function that is used to generate a new index**.
  • updating .k specs

** newWithdrawalID shouldn't be necesary, as according to the specs:

Withdrawals provide key information from the consensus layer:
1. a monotonically increasing index, starting from 0, as a uint64 value that increments by 1 per withdrawal to uniquely identify each withdrawal
4. a nonzero amount of ether given in Gwei (1e9 wei) as a uint64 value.

So the provided withdrawal index should be enough to keep track of the withdrawals.
However, the conformance tests have multiple withdrawals with the 0 index and 0 amount (example).

@anvacaru anvacaru self-assigned this Aug 6, 2024
@anvacaru anvacaru marked this pull request as ready for review August 6, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants