Skip to content

Commit a4bf607

Browse files
committed
add comment
1 parent fe07fba commit a4bf607

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/batcher/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,15 @@ impl Batcher {
570570
);
571571

572572
// Check if user has proofs in queue
573+
//
573574
// Double-check that funds are still unlocked by calling the contract
574575
// This is necessary because we query events over a block range, and the
575576
// user’s state may have changed (e.g., funds could be locked again) after
576577
// the event was emitted. Verifying on-chain ensures we don’t act on stale data.
578+
//
579+
// There is a brief period between the checks and the removal during which the user's
580+
// proofs could be sent. This is acceptable, as the removal will not fail;
581+
// it will simply clear the user's state.
577582
if self.user_has_proofs_in_queue(user_address).await
578583
&& self.user_balance_is_unlocked(&user_address).await
579584
{

0 commit comments

Comments
 (0)