-
Notifications
You must be signed in to change notification settings - Fork 8
Compute eoa worker ID independent of twmq lease token #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8d8ccb1
987515d
fc0e88a
2386c9f
da71664
cc9bb23
236b1ea
20b52bf
a2a7561
1547da0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,7 +27,7 @@ pub struct ConfirmedTransactionWithRichReceipt { | |||||||||
|
|
||||||||||
| impl<C: Chain> EoaExecutorWorker<C> { | ||||||||||
| // ========== CONFIRM FLOW ========== | ||||||||||
| #[tracing::instrument(skip_all)] | ||||||||||
| #[tracing::instrument(skip_all, fields(worker_id = self.store.worker_id))] | ||||||||||
| pub async fn confirm_flow(&self) -> Result<CleanupReport, EoaExecutorWorkerError> { | ||||||||||
|
Comment on lines
+30
to
31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix tracing field: call the accessor and format properly Same as send flow: use the accessor and - #[tracing::instrument(skip_all, fields(worker_id = self.store.worker_id))]
+ #[tracing::instrument(skip_all, fields(worker_id = %self.store.worker_id()))]📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| // Get fresh on-chain transaction count | ||||||||||
| let current_chain_transaction_count = self | ||||||||||
|
|
@@ -53,6 +53,10 @@ impl<C: Chain> EoaExecutorWorker<C> { | |||||||||
| let cached_transaction_count = match self.store.get_cached_transaction_count().await { | ||||||||||
| Err(e) => match e { | ||||||||||
| TransactionStoreError::NonceSyncRequired { .. } => { | ||||||||||
| tracing::warn!( | ||||||||||
| cached_transaction_count = current_chain_transaction_count, | ||||||||||
| "Nonce sync required, store was uninitialized, updating cached transaction count with current chain transaction count" | ||||||||||
| ); | ||||||||||
| self.store | ||||||||||
| .update_cached_transaction_count(current_chain_transaction_count) | ||||||||||
| .await?; | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: deriving new_optimistic_tx_count from
last()is order-dependent; use max nonce instead.self.transactions.last()assumes the input slice is sorted by nonce. Validation guarantees the set of nonces is sequential, but not thatself.transactionsis ordered. If the slice is unsorted, the optimistic nonce can be set too low, leading to duplicate/non-monotonic optimistic nonces on the next enqueue. Compute from the maximum nonce instead.Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents