From ac510412908ed0621f61e15c3d699b313df7fda0 Mon Sep 17 00:00:00 2001 From: Eitan Seri- Levi Date: Tue, 10 Feb 2026 12:26:03 -0800 Subject: [PATCH] Fix state root --- beacon_node/beacon_chain/src/block_production/gloas.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/beacon_node/beacon_chain/src/block_production/gloas.rs b/beacon_node/beacon_chain/src/block_production/gloas.rs index a28a3c5693..fedcdda671 100644 --- a/beacon_node/beacon_chain/src/block_production/gloas.rs +++ b/beacon_node/beacon_chain/src/block_production/gloas.rs @@ -156,7 +156,6 @@ impl BeaconChain { .clone() .produce_execution_payload_bid( state, - state_root_opt, produce_at_slot, BID_VALUE_SELF_BUILD, BUILDER_INDEX_SELF_BUILD, @@ -612,7 +611,7 @@ impl BeaconChain { // TODO(gloas) introduce `ProposerPreferences` so we can build out trustless // bid building. Right now this only works for local building. /// Produce an `ExecutionPayloadBid` for some `slot` upon the given `state`. - /// This function assumes we've already done the state advance. + /// This function assumes we've already advanced `state`. /// /// Returns the signed bid, the state, and optionally the payload data needed to construct /// the `ExecutionPayloadEnvelope` after the beacon block is created. @@ -623,8 +622,7 @@ impl BeaconChain { #[instrument(level = "debug", skip_all)] pub async fn produce_execution_payload_bid( self: Arc, - state: BeaconState, - state_root_opt: Option, + mut state: BeaconState, produce_at_slot: Slot, bid_value: u64, builder_index: BuilderIndex, @@ -712,7 +710,6 @@ impl BeaconChain { } }; - let state_root = state_root_opt.ok_or_else(|| BlockProductionError::MissingStateRoot)?; // TODO(gloas) this is just a dummy error variant for now let execution_payload_gloas = execution_payload @@ -720,6 +717,8 @@ impl BeaconChain { .map_err(|_| BlockProductionError::GloasNotImplemented)? .to_owned(); + let state_root = state.update_tree_hash_cache()?; + // TODO(gloas) since we are defaulting to local building, execution payment is 0 // execution payment should only be set to > 0 for trusted building. let bid = ExecutionPayloadBid:: {