From ec4a70ac72317505b2d7f421c262d68e4d20bdac Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 15 Sep 2025 16:10:09 +0200 Subject: [PATCH 1/2] refactor: use parent block for state provider in payload builder --- crates/node/src/builder.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/node/src/builder.rs b/crates/node/src/builder.rs index 112e8c3..2c8abaf 100644 --- a/crates/node/src/builder.rs +++ b/crates/node/src/builder.rs @@ -40,8 +40,15 @@ where .validate() .map_err(|e| PayloadBuilderError::Internal(RethError::Other(Box::new(e))))?; - // Get the latest state provider - let state_provider = self.client.latest().map_err(PayloadBuilderError::other)?; + // Get the state provider for the parent header + tracing::info!( + "Creating state provider using parent hash: {}", + attributes.parent_hash + ); + let state_provider = self + .client + .state_by_block_hash(attributes.parent_hash) + .map_err(PayloadBuilderError::other)?; // Create a database from the state provider let db = StateProviderDatabase::new(&state_provider); From ca0b032b736603cad7b8edb605be147946c2a3ec Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 17 Sep 2025 12:43:51 +0200 Subject: [PATCH 2/2] chore: rm unnecessary info log --- crates/node/src/builder.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/crates/node/src/builder.rs b/crates/node/src/builder.rs index 2c8abaf..bc40efd 100644 --- a/crates/node/src/builder.rs +++ b/crates/node/src/builder.rs @@ -40,11 +40,6 @@ where .validate() .map_err(|e| PayloadBuilderError::Internal(RethError::Other(Box::new(e))))?; - // Get the state provider for the parent header - tracing::info!( - "Creating state provider using parent hash: {}", - attributes.parent_hash - ); let state_provider = self .client .state_by_block_hash(attributes.parent_hash)