Skip to content

Commit 333c7c2

Browse files
committed
Revert "Explicitly specify Latest block for RPC calls (#81)"
This reverts commit 90c7255.
1 parent 3320297 commit 333c7c2

File tree

2 files changed

+11
-34
lines changed

2 files changed

+11
-34
lines changed

executors/src/eoa/worker/transaction.rs

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use alloy::{
44
consensus::{
55
SignableTransaction, Signed, TxEip4844Variant, TxEip4844WithSidecar, TypedTransaction,
66
},
7-
eips::BlockNumberOrTag,
87
network::{TransactionBuilder, TransactionBuilder7702},
98
primitives::{Bytes, U256},
109
providers::Provider,
@@ -21,16 +20,11 @@ use engine_core::{
2120
};
2221

2322
use crate::eoa::{
24-
EoaTransactionRequest,
2523
store::{
2624
BorrowedTransaction, BorrowedTransactionData, PendingTransaction, SubmittedNoopTransaction,
27-
},
28-
worker::{
29-
EoaExecutorWorker,
30-
error::{
31-
EoaExecutorWorkerError, is_retryable_preparation_error, is_unsupported_eip1559_error,
32-
},
33-
},
25+
}, worker::{
26+
error::{is_retryable_preparation_error, is_unsupported_eip1559_error, EoaExecutorWorkerError}, EoaExecutorWorker
27+
}, EoaTransactionRequest
3428
};
3529

3630
// Retry constants for preparation phase
@@ -309,13 +303,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
309303

310304
// Estimate gas if needed
311305
if tx_request.gas.is_none() {
312-
match self
313-
.chain
314-
.provider()
315-
.estimate_gas(tx_request.clone())
316-
.block(BlockNumberOrTag::Latest.into())
317-
.await
318-
{
306+
match self.chain.provider().estimate_gas(tx_request.clone()).await {
319307
Ok(gas_limit) => {
320308
tx_request = tx_request.with_gas_limit(gas_limit * 110 / 100); // 10% buffer
321309
}
@@ -409,13 +397,10 @@ impl<C: Chain> EoaExecutorWorker<C> {
409397
nonce: u64,
410398
) -> Result<Signed<TypedTransaction>, EoaExecutorWorkerError> {
411399
let typed_tx = self.build_typed_transaction(request, nonce).await?;
412-
400+
413401
// Inject KMS cache into the signing credential (after deserialization from Redis)
414-
let credential_with_cache = request
415-
.signing_credential
416-
.clone()
417-
.with_aws_kms_cache(&self.kms_client_cache);
418-
402+
let credential_with_cache = request.signing_credential.clone().with_aws_kms_cache(&self.kms_client_cache);
403+
419404
self.sign_transaction(typed_tx, &credential_with_cache)
420405
.await
421406
}

server/src/http/routes/contract_read.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,7 @@ async fn execute_direct_contract_calls<C: engine_core::chain::Chain>(
455455
call_request = call_request.from(*from_address);
456456
}
457457

458-
match provider
459-
.call(call_request)
460-
.block(BlockNumberOrTag::Latest.into())
461-
.await
462-
{
458+
match provider.call(call_request).await {
463459
Ok(result) => {
464460
// Decode the result
465461
match prepared_call.function.abi_decode_output(&result) {
@@ -516,13 +512,9 @@ async fn execute_multicall(
516512
.to(*multicall_address)
517513
.input(multicall_call.abi_encode().into());
518514

519-
let result = provider
520-
.call(call_request)
521-
.block(BlockNumberOrTag::Latest.into())
522-
.await
523-
.map_err(|e| {
524-
EngineError::contract_multicall_error(chain_id, format!("Multicall failed: {e}"))
525-
})?;
515+
let result = provider.call(call_request).await.map_err(|e| {
516+
EngineError::contract_multicall_error(chain_id, format!("Multicall failed: {e}"))
517+
})?;
526518

527519
let decoded = aggregate3Call::abi_decode_returns(&result).map_err(|e| {
528520
EngineError::contract_multicall_error(

0 commit comments

Comments
 (0)