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

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.55%. Comparing base (ba5ee9a) to head (45a8bc2).
⚠️ Report is 51 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #9736      +/-   ##
============================================
+ Coverage     52.52%   52.55%   +0.02%     
============================================
  Files           848      848              
  Lines         60222    60194      -28     
  Branches       4430     4430              
============================================
  Hits          31632    31632              
+ Misses        28531    28503      -28     
  Partials         59       59              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec-gloas Issues targeting the Glamsterdam spec version

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants