Skip to content

fix: use parent state with payload for block production and block reward - #9736

Draft
twoeths wants to merge 5 commits into
unstablefrom
te/produce_block_apply_parent_payload
Draft

fix: use parent state with payload for block production and block reward#9736
twoeths wants to merge 5 commits into
unstablefrom
te/produce_block_apply_parent_payload

Conversation

@twoeths

@twoeths twoeths commented Jul 31, 2026

Copy link
Copy Markdown
Member

Motivation

when reviewing #9731 I found 2 places we missed using parent state with payload applied:

  • in block production, when produceCommonBlocBody(), this is mainly to query attestations and get correct reward. We also need it to get correct voluntary exits
  • in block reward

in block production, we have different places to call withParentPayloadApplied(), it's best to prepare this state once and pass to downstream apis

Description

  • enhance BlockAttributes to include parentState, parentStateWithPayload and parentExecutionRequests
    • parentState is mostly used to compute block state's root
    • parentStateWithPayload is just the same to parentState if pre-gloas or building on EMPTY
    • parentExecutionRequests is included so that we don't have to get it twice (it could be fetched from db)
  • prepare parentState, parentStateWithPayload and parentExecutionRequests for produceBlockV4() and pass to downstream apis
  • we don't have to filter voluntary exits again since we already used parentStateWithPayload for produceCommonBlockBody()
  • fix block reward api by applying parent payload requests

AI Assistance Disclosure

  • created with the help of Claude

Base automatically changed from nflaig/fix-attestation-payload-availability to unstable August 3, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants