Skip to content

Commit 5f8cefd

Browse files
authored
Enhance error handling in EIP-7702 executor for transaction hash retrieval (#42)
- Updated error handling logic to differentiate between error responses and other errors when fetching transaction hashes from the bundler. - Improved the failure response mechanism by implementing specific handling for error responses, allowing for more granular control over job failures and retries. These changes enhance the robustness of the EIP-7702 executor's error management during transaction hash retrieval.
1 parent 3a2b65c commit 5f8cefd

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

executors/src/eip7702_executor/confirm.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use alloy::primitives::TxHash;
22
use alloy::providers::Provider;
33
use alloy::rpc::types::TransactionReceipt;
4+
use alloy::transports::RpcError;
45
use engine_core::error::{AlloyRpcErrorToEngineError, EngineError};
56
use engine_core::rpc_clients::TwGetTransactionHashResponse;
67
use engine_core::{
@@ -204,11 +205,19 @@ where
204205
error = ?e,
205206
"Failed to get transaction hash from bundler"
206207
);
207-
Eip7702ConfirmationError::TransactionHashError {
208-
message: e.to_string(),
208+
209+
if e.is_error_resp() {
210+
Eip7702ConfirmationError::TransactionHashError {
211+
message: e.to_string(),
212+
}
213+
.fail()
214+
} else {
215+
Eip7702ConfirmationError::TransactionHashError {
216+
message: e.to_string(),
217+
}
218+
.nack(Some(Duration::from_secs(10)), RequeuePosition::Last)
209219
}
210-
})
211-
.map_err_nack(Some(Duration::from_secs(10)), RequeuePosition::Last)?;
220+
})?;
212221

213222
let transaction_hash = match transaction_hash_res {
214223
TwGetTransactionHashResponse::Success { transaction_hash } => {

0 commit comments

Comments
 (0)