Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions executors/src/eoa/events.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::fmt::Display;

use alloy::primitives::Address;
use serde::{Deserialize, Serialize};
use twmq::job::RequeuePosition;

Expand All @@ -16,6 +17,7 @@ use crate::{

pub struct EoaExecutorEvent {
pub transaction_id: String,
pub address: Address,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this eoa_address so it matches the 7702 one?

}

#[derive(Serialize, Deserialize, Debug, Clone, thiserror::Error)]
Expand All @@ -34,6 +36,13 @@ pub struct EoaSendAttemptNackData {
pub error: EoaExecutorWorkerError,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EoaSendAttemptSuccessData {
#[serde(flatten)]
pub submitted_transaction: SubmittedTransactionDehydrated,
pub address: Address,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EoaExecutorConfirmedTransaction {
pub receipt: alloy::rpc::types::TransactionReceipt,
Expand All @@ -60,15 +69,17 @@ impl EoaExecutorEvent {
pub fn send_attempt_success_envelope(
&self,
submitted_transaction: SubmittedTransactionDehydrated,
) -> BareWebhookNotificationEnvelope<SerializableSuccessData<SubmittedTransactionDehydrated>>
{
) -> BareWebhookNotificationEnvelope<SerializableSuccessData<EoaSendAttemptSuccessData>> {
BareWebhookNotificationEnvelope {
transaction_id: self.transaction_id.clone(),
executor_name: EXECUTOR_NAME.to_string(),
stage_name: EoaExecutorStage::Send.to_string(),
event_type: StageEvent::Success,
payload: SerializableSuccessData {
result: submitted_transaction.clone(),
result: EoaSendAttemptSuccessData {
submitted_transaction: submitted_transaction.clone(),
address: self.address,
},
},
}
}
Expand Down
1 change: 1 addition & 0 deletions executors/src/eoa/store/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ impl AtomicEoaExecutorStore {

let event = EoaExecutorEvent {
transaction_id: pending_transaction.transaction_id.clone(),
address: pending_transaction.user_request.from,
};

let fail_envelope = event.transaction_failed_envelope(error.clone(), 1);
Expand Down
3 changes: 3 additions & 0 deletions executors/src/eoa/store/borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ impl SafeRedisTransaction for ProcessBorrowedTransactions<'_> {

// Queue webhook event using user_request from SubmissionResult
let event = EoaExecutorEvent {
address: result.transaction.user_request.from,
transaction_id: transaction_id.to_string(),
};

Expand Down Expand Up @@ -177,6 +178,7 @@ impl SafeRedisTransaction for ProcessBorrowedTransactions<'_> {
// Queue webhook event using user_request from SubmissionResult
let event = EoaExecutorEvent {
transaction_id: transaction_id.to_string(),
address: result.transaction.user_request.from,
};
let envelope = event.send_attempt_nack_envelope(nonce, err.clone(), 1);

Expand Down Expand Up @@ -208,6 +210,7 @@ impl SafeRedisTransaction for ProcessBorrowedTransactions<'_> {
// Queue webhook event using user_request from SubmissionResult
let event = EoaExecutorEvent {
transaction_id: transaction_id.to_string(),
address: result.transaction.user_request.from,
};
let envelope = event.transaction_failed_envelope(err.clone(), 1);
if !result.transaction.user_request.webhook_options.is_empty() {
Expand Down
2 changes: 2 additions & 0 deletions executors/src/eoa/store/submitted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ impl SafeRedisTransaction for CleanSubmittedTransactions<'_> {
if !tx.user_request.webhook_options.is_empty() {
let event = EoaExecutorEvent {
transaction_id: tx.transaction_id.clone(),
address: tx.user_request.from,
};

let success_envelope =
Expand Down Expand Up @@ -309,6 +310,7 @@ impl SafeRedisTransaction for CleanSubmittedTransactions<'_> {
if !tx.user_request.webhook_options.is_empty() {
let event = EoaExecutorEvent {
transaction_id: tx.transaction_id.clone(),
address: tx.user_request.from,
};

let success_envelope =
Expand Down
9 changes: 5 additions & 4 deletions executors/src/eoa/worker/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
time_since_movement = time_since_movement,
stall_timeout = NONCE_STALL_TIMEOUT,
current_chain_nonce = current_chain_transaction_count,
cached_transaction_count = cached_transaction_count,
"Nonce has been stalled, attempting gas bump"
);

Expand All @@ -85,13 +86,13 @@ impl<C: Chain> EoaExecutorWorker<C> {
}
}

tracing::debug!("No nonce progress, skipping confirm flow");
return Ok(CleanupReport::default());
tracing::debug!("No nonce progress, still going ahead with confirm flow");
// return Ok(CleanupReport::default());
}

tracing::info!(
current_chain_nonce = current_chain_transaction_count,
cached_nonce = cached_transaction_count,
cached_transaction_count = cached_transaction_count,
"Processing confirmations"
);

Expand Down Expand Up @@ -140,7 +141,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
ConfirmedTransaction {
transaction_hash: tx.transaction_hash,
transaction_id: tx.transaction_id,
receipt: tx.receipt.into(),
receipt: tx.receipt,
receipt_serialized: receipt_data,
}
})
Expand Down