Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion executors/src/eip7702_executor/confirm.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
22 changes: 13 additions & 9 deletions executors/src/eoa/worker/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
},
};

Expand All @@ -34,6 +37,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
.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);
Expand Down
21 changes: 21 additions & 0 deletions executors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Params, Resp, Output, Map> FlashblocksSupport for alloy::providers::RpcWithBlock<Params, Resp, Output, Map>
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,
}
}
}