Skip to content

Commit 0311adc

Browse files
authored
Pb/silence more webhooks (#71)
* Update health timestamps in EoaExecutorWorker and ResetNoncesTransaction - Added logic to update health timestamps for nonce movement and confirmations in both the EoaExecutorWorker and ResetNoncesTransaction implementations. - Ensured health data reflects the latest nonce movement even when confirmations are ahead of the latest state. * Implement transaction hash pending error handling in EIP-7702 executor - Added a new error variant for pending transaction hashes to improve clarity in error reporting. - Updated the error handling logic to return the new error when a transaction hash is not yet available, enhancing the overall robustness of the confirmation process. - Adjusted webhook queuing logic to account for the new pending state, ensuring efficient handling of transaction confirmations.
1 parent 436b1f4 commit 0311adc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

executors/src/eip7702_executor/confirm.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ pub enum Eip7702ConfirmationError {
8181
#[error("Failed to get transaction hash from bundler: {message}")]
8282
TransactionHashError { message: String },
8383

84+
#[error("Transaction hash is pending: {message}")]
85+
TransactionHashPending { message: String },
86+
8487
#[error("Failed to confirm transaction: {message}")]
8588
#[serde(rename_all = "camelCase")]
8689
ConfirmationError {
@@ -229,8 +232,8 @@ where
229232
}
230233

231234
TwGetTransactionHashResponse::Pending => {
232-
return Err(Eip7702ConfirmationError::TransactionHashError {
233-
message: "Transaction not yet confirmed".to_string(),
235+
return Err(Eip7702ConfirmationError::TransactionHashPending {
236+
message: "Transaction hash not yet available".to_string(),
234237
})
235238
.map_err_nack(Some(Duration::from_secs(1)), RequeuePosition::Last);
236239
}
@@ -332,11 +335,12 @@ where
332335
tx: &mut TransactionContext<'_>,
333336
) {
334337
// Don't modify transaction registry on NACK - job will be retried
335-
338+
336339
// Only queue webhook for actual errors, not for "waiting for receipt" states
337340
let should_queue_webhook = !matches!(
338341
nack_data.error,
339342
Eip7702ConfirmationError::ReceiptNotAvailable { .. }
343+
| Eip7702ConfirmationError::TransactionHashPending { .. }
340344
);
341345

342346
if should_queue_webhook {

0 commit comments

Comments
 (0)