Skip to content

Commit 1d1dc4d

Browse files
working state
1 parent 018d2bc commit 1d1dc4d

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

executors/src/external_bundler/confirm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ where
202202
tracing::info!(
203203
transaction_id = %job_data.transaction_id,
204204
user_op_hash = ?job_data.user_op_hash,
205+
transaction_hash = ?receipt.receipt.transaction_hash,
205206
success = %receipt.success,
206207
"User operation confirmed on-chain"
207208
);

executors/src/external_bundler/send.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use alloy::{
22
hex::FromHex,
3-
primitives::{Address, Bytes, U256},
3+
primitives::{Address, Bytes, U256}, transports::RpcError,
44
};
55
use engine_aa_core::{
66
account_factory::{AccountFactory, get_account_factory},
@@ -441,16 +441,20 @@ where
441441
needs_init_code,
442442
);
443443

444-
// if is_bundler_error_retryable(&e) {
445-
if job.job.attempts < 100 {
446-
mapped_error.nack(Some(Duration::from_secs(10)), RequeuePosition::Last)
444+
tracing::warn!(
445+
error = serde_json::to_string(&mapped_error).unwrap(),
446+
"error"
447+
);
448+
449+
if is_bundler_error_retryable(mapped_error.to_owned().to_string()) {
450+
if job.job.attempts < 100 {
451+
mapped_error.nack(Some(Duration::from_secs(10)), RequeuePosition::Last)
452+
} else {
453+
mapped_error.fail()
454+
}
447455
} else {
448456
mapped_error.fail()
449457
}
450-
451-
// } else {
452-
// mapped_error.fail()
453-
// }
454458
})?;
455459

456460
tracing::debug!(userop_hash = ?user_op_hash, "User operation sent to bundler");
@@ -680,3 +684,12 @@ fn is_non_retryable_rpc_code(code: i64) -> bool {
680684
_ => false,
681685
}
682686
}
687+
688+
fn is_bundler_error_retryable(e: String) -> bool {
689+
// TODO proper error parsing / handling
690+
if e.contains("AA24") {
691+
return false;
692+
}
693+
694+
return true;
695+
}

thirdweb-core/src/iaw/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,16 +417,11 @@ impl IAWClient {
417417
"message": userop_hash,
418418
"isRaw": true,
419419
"chainId": chain_id,
420-
"originalMessage": userop,
420+
"originalMessage": serde_json::to_string(&userop).unwrap(),
421421
}
422422
});
423423

424-
tracing::warn!(
425-
payload = serde_json::to_string(&payload).unwrap(),
426-
"Payload"
427-
);
428-
429-
// Make the request to IAW service
424+
// Make the request to IAW service with explicit timeout
430425
let url = format!("{}/api/v1/enclave-wallet/sign-message", self._base_url);
431426
let response = self._http_client
432427
.post(&url)

0 commit comments

Comments
 (0)