From 26293318d63727403979059c81d4daa74acbea01 Mon Sep 17 00:00:00 2001 From: Prithvish Baidya Date: Thu, 11 Sep 2025 21:06:41 +0530 Subject: [PATCH 1/2] Add Flashblocks support to RpcWithBlock in executor (#43) - Introduced a new extension trait `FlashblocksSupport` for `RpcWithBlock` to automatically select the appropriate block tag based on the chain ID. - Updated the `EoaExecutorWorker` to utilize the new `with_flashblocks_support` method when fetching the transaction count, enhancing compatibility with specific chains. These changes improve the flexibility and functionality of the RPC provider in handling flashblocks support. --- executors/src/eoa/worker/confirm.rs | 22 +++++++++++++--------- executors/src/lib.rs | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/executors/src/eoa/worker/confirm.rs b/executors/src/eoa/worker/confirm.rs index 2fc0b11..6e10e46 100644 --- a/executors/src/eoa/worker/confirm.rs +++ b/executors/src/eoa/worker/confirm.rs @@ -2,15 +2,18 @@ use alloy::{primitives::B256, providers::Provider}; use engine_core::{chain::Chain, error::AlloyRpcErrorToEngineError}; use serde::{Deserialize, Serialize}; -use crate::eoa::{ - EoaExecutorStore, - store::{ - CleanupReport, ConfirmedTransaction, ReplacedTransaction, SubmittedTransactionDehydrated, - TransactionStoreError, - }, - worker::{ - EoaExecutorWorker, - error::{EoaExecutorWorkerError, should_update_balance_threshold}, +use crate::{ + FlashblocksSupport, + eoa::{ + EoaExecutorStore, + store::{ + CleanupReport, ConfirmedTransaction, ReplacedTransaction, SubmittedTransactionDehydrated, + TransactionStoreError, + }, + worker::{ + EoaExecutorWorker, + error::{EoaExecutorWorkerError, should_update_balance_threshold}, + }, }, }; @@ -34,6 +37,7 @@ impl EoaExecutorWorker { .chain .provider() .get_transaction_count(self.eoa) + .with_flashblocks_support(self.chain.chain_id()) .await .map_err(|e| { let engine_error = e.to_engine_error(&self.chain); diff --git a/executors/src/lib.rs b/executors/src/lib.rs index 26a133a..7a01247 100644 --- a/executors/src/lib.rs +++ b/executors/src/lib.rs @@ -4,3 +4,24 @@ pub mod external_bundler; pub mod metrics; pub mod transaction_registry; pub mod webhook; + +use alloy::rpc::json_rpc::{RpcSend, RpcRecv}; + +/// Extension trait for RpcWithBlock to automatically select block tag based on flashblocks support +pub trait FlashblocksSupport { + fn with_flashblocks_support(self, chain_id: u64) -> Self; +} + +impl FlashblocksSupport for alloy::providers::RpcWithBlock +where + Params: RpcSend, + Resp: RpcRecv, + Map: Fn(Resp) -> Output + Clone, +{ + fn with_flashblocks_support(self, chain_id: u64) -> Self { + match chain_id { + 8453 | 84532 => self.pending(), // Base Mainnet | Base Sepolia + _ => self, + } + } +} From 09341a41140083bc19ab2e1c04cd82bcfca24241 Mon Sep 17 00:00:00 2001 From: Prithvish Baidya Date: Thu, 11 Sep 2025 21:07:24 +0530 Subject: [PATCH 2/2] Remove unused RpcError import in EIP-7702 executor confirm module --- executors/src/eip7702_executor/confirm.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/executors/src/eip7702_executor/confirm.rs b/executors/src/eip7702_executor/confirm.rs index e8b213e..7972d4e 100644 --- a/executors/src/eip7702_executor/confirm.rs +++ b/executors/src/eip7702_executor/confirm.rs @@ -1,7 +1,6 @@ use alloy::primitives::TxHash; use alloy::providers::Provider; use alloy::rpc::types::TransactionReceipt; -use alloy::transports::RpcError; use engine_core::error::{AlloyRpcErrorToEngineError, EngineError}; use engine_core::rpc_clients::TwGetTransactionHashResponse; use engine_core::{