@@ -4,6 +4,7 @@ use alloy::{
44 consensus:: {
55 SignableTransaction , Signed , TxEip4844Variant , TxEip4844WithSidecar , TypedTransaction ,
66 } ,
7+ eips:: BlockNumberOrTag ,
78 network:: { TransactionBuilder , TransactionBuilder7702 } ,
89 primitives:: { Bytes , U256 } ,
910 providers:: Provider ,
@@ -20,11 +21,16 @@ use engine_core::{
2021} ;
2122
2223use crate :: eoa:: {
24+ EoaTransactionRequest ,
2325 store:: {
2426 BorrowedTransaction , BorrowedTransactionData , PendingTransaction , SubmittedNoopTransaction ,
25- } , worker:: {
26- error:: { is_retryable_preparation_error, is_unsupported_eip1559_error, EoaExecutorWorkerError } , EoaExecutorWorker
27- } , EoaTransactionRequest
27+ } ,
28+ worker:: {
29+ EoaExecutorWorker ,
30+ error:: {
31+ EoaExecutorWorkerError , is_retryable_preparation_error, is_unsupported_eip1559_error,
32+ } ,
33+ } ,
2834} ;
2935
3036// Retry constants for preparation phase
@@ -303,7 +309,13 @@ impl<C: Chain> EoaExecutorWorker<C> {
303309
304310 // Estimate gas if needed
305311 if tx_request. gas . is_none ( ) {
306- match self . chain . provider ( ) . estimate_gas ( tx_request. clone ( ) ) . await {
312+ match self
313+ . chain
314+ . provider ( )
315+ . estimate_gas ( tx_request. clone ( ) )
316+ . block ( BlockNumberOrTag :: Latest . into ( ) )
317+ . await
318+ {
307319 Ok ( gas_limit) => {
308320 tx_request = tx_request. with_gas_limit ( gas_limit * 110 / 100 ) ; // 10% buffer
309321 }
@@ -397,10 +409,13 @@ impl<C: Chain> EoaExecutorWorker<C> {
397409 nonce : u64 ,
398410 ) -> Result < Signed < TypedTransaction > , EoaExecutorWorkerError > {
399411 let typed_tx = self . build_typed_transaction ( request, nonce) . await ?;
400-
412+
401413 // Inject KMS cache into the signing credential (after deserialization from Redis)
402- let credential_with_cache = request. signing_credential . clone ( ) . with_aws_kms_cache ( & self . kms_client_cache ) ;
403-
414+ let credential_with_cache = request
415+ . signing_credential
416+ . clone ( )
417+ . with_aws_kms_cache ( & self . kms_client_cache ) ;
418+
404419 self . sign_transaction ( typed_tx, & credential_with_cache)
405420 . await
406421 }
0 commit comments