Skip to content

Commit 298b60e

Browse files
committed
Update comments on the new logic of BatchTxPool
1 parent f9c164b commit 298b60e

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

services/requester/batch_tx_pool.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ const (
7070
// # Fix
7171
//
7272
// For all incoming transactions, we are now inspecting the EOA's current nonce
73-
// in the local state index:
74-
// 1. If it matches the transaction nonce, we submit it right away, and record
75-
// this activity in the EOA's dedicated queue, for use in future submissions.
76-
// 2. If the transaction nonce is higher, we check for any recent submissions
77-
// to see if we can form a valid sequence. This could happen from in-flight
78-
// transaction submission, that have not yet been index by the local state
79-
// index. In this case we optimistically submit right away. and record this
80-
// activity in the EOA's dedicated queue, for use in future submissions.
73+
// in the local state index, as well as the elapsed spacing from any recent
74+
// submission:
75+
// 1. If enough spacing has elapsed and the current nonce matches the transaction
76+
// nonce, we submit it right away, and record this activity in the EOA's dedicated
77+
// queue, for use in future submissions.
78+
// 2. If enough spacing has elapsed and the transaction nonce is higher, we check
79+
// for any recent submissions to see if we can form a valid sequence. This could
80+
// happen from in-flight transaction submission, that have not yet been indexed
81+
// by the local state index. In this case we optimistically submit right away and
82+
// record this activity in the EOA's dedicated queue, for use in future submissions.
8183
// 3. If none of the above 2 conditions are met, we enqueue the transaction
8284
// in the pool. The flush timer (TxBatchInterval) is the sole submission trigger.
8385
// This guarantees that parallel transactions from the same wallet accumulate

0 commit comments

Comments
 (0)