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

Process Withdrawals #1300

Closed
Tracked by #1295
gakonst opened this issue Feb 12, 2023 · 0 comments · Fixed by #1322
Closed
Tracked by #1295

Process Withdrawals #1300

gakonst opened this issue Feb 12, 2023 · 0 comments · Fixed by #1322
Assignees
Labels
A-execution Related to the Execution and EVM C-enhancement New feature or request

Comments

@gakonst
Copy link
Member

gakonst commented Feb 12, 2023

Describe the feature request

Post-Shanghai, withdrawals are being enabled. This has the following implications:

  1. Types: Headers + Bodies now have a Withdrawals field, populated by the CL's Engine API calls (tracked in Engine API Changes for Shanghai #1297)
  2. Execution: For every block, go over the withdrawals array and increase the balance of each account by the withdrawal amount

What needs to change:

  1. Add withdrawals_root: Option<H256> to Header and other Header-like types
  2. Add withdrawals: Vec<Withdrawal> (definition) to Block and other Block-like types
  3. During header verification in Beacon Consensus, if we're in Shanghai, the withdrawals_root MUST be Some, and if we're not in Shanghai it MUST be None
  4. After execution for a block, it should go over the array of withdrawals and directly update the balances of the accounts corresponding to each withdrawal. This means that withdrawal balances are applied at the END of the block after all txs for that block have been executed. Ref

Additional context

Geth's changes: ethereum/go-ethereum@2a2b041#diff-89272f61e115723833d498a0acbe59fa2286e3dc7276a676a7f7816f21e248b7

@gakonst gakonst added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Feb 12, 2023
@gakonst gakonst changed the title Shanghai: Process Withdrawals Process Withdrawals Feb 12, 2023
@rkrasiuk rkrasiuk self-assigned this Feb 13, 2023
@onbjerg onbjerg added A-execution Related to the Execution and EVM and removed S-needs-triage This issue needs to be labelled labels Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM C-enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants