Skip to content

perf(cketh): stop making a detected deposit wait to be swept - #11260

Closed
gregorydemay wants to merge 2 commits into
greg/DEFI-2926-anvil-sweep-harnessfrom
greg/DEFI-2926-sweep-without-waiting
Closed

perf(cketh): stop making a detected deposit wait to be swept#11260
gregorydemay wants to merge 2 commits into
greg/DEFI-2926-anvil-sweep-harnessfrom
greg/DEFI-2926-sweep-without-waiting

Conversation

@gregorydemay

@gregorydemay gregorydemay commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Why

  • A freshly enqueued sweep waited for the send task's next interval before being sent, and under the decided design the mint follows the sweep — so that wait is crediting latency a user sees.

What

  • enqueue_batched_sweep kicks the send task immediately after enqueueing, instead of leaving the new sweeps for its next tick.

@github-actions github-actions Bot added the perf label Aug 21, 2026
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from aaa2e91 to 2f95092 Compare August 21, 2026 14:46
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch 2 times, most recently from d741cac to 4d0133d Compare August 25, 2026 07:16
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from 2f95092 to 5f0941a Compare August 25, 2026 07:16
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 4d0133d to 461eaba Compare August 25, 2026 10:05
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from 5f0941a to 83a984a Compare August 25, 2026 10:05
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 461eaba to 954ac72 Compare August 25, 2026 11:21
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from 83a984a to f5efe4d Compare August 25, 2026 11:21
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 954ac72 to cd56d0a Compare August 25, 2026 12:55
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from f5efe4d to 4756f7b Compare August 25, 2026 12:55
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from cd56d0a to a988856 Compare August 25, 2026 13:05
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from 4756f7b to b492cc9 Compare August 25, 2026 13:05
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from a988856 to b02f84d Compare August 25, 2026 13:17
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from b492cc9 to f501df0 Compare August 25, 2026 13:17
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from b02f84d to 741e33a Compare August 25, 2026 14:27
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch 2 times, most recently from 2acbeef to ed49cc6 Compare August 25, 2026 14:32
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from bf87e2e to 80c65bb Compare August 25, 2026 15:45
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from ed49cc6 to b60e904 Compare August 25, 2026 15:45
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 80c65bb to 6814d95 Compare August 25, 2026 15:50
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from b60e904 to a5631ab Compare August 25, 2026 15:50
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 6814d95 to 104b780 Compare August 26, 2026 05:55
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from a5631ab to 41b9eda Compare August 26, 2026 05:55
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 104b780 to f16ec5a Compare August 26, 2026 06:00
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch 3 times, most recently from 22394cb to a64d29f Compare August 26, 2026 07:10
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch 2 times, most recently from 3da307d to bd26fcc Compare August 26, 2026 07:22
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch 2 times, most recently from abaf601 to ba23dc2 Compare August 26, 2026 07:29
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from bd26fcc to f8885cf Compare August 26, 2026 07:29
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from ba23dc2 to bb9503d Compare August 26, 2026 08:01
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from f8885cf to 90bd109 Compare August 26, 2026 08:01
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from bb9503d to 50a28dd Compare August 26, 2026 08:36
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 90bd109 to 8983b73 Compare August 26, 2026 08:36
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from 50a28dd to f98677a Compare August 26, 2026 08:56
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 8983b73 to 2295f0b Compare August 26, 2026 08:56
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from f98677a to 4cc740b Compare August 26, 2026 11:51
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch 2 times, most recently from 2bb495f to 7dbcf5e Compare August 26, 2026 16:38
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from 4cc740b to 678e89c Compare August 26, 2026 16:38
@gregorydemay
gregorydemay requested a balanced review from Copilot August 26, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Reduces ckETH deposit-crediting latency by triggering sweep processing immediately after enqueueing.

Changes:

  • Schedules immediate sweeper transaction processing.
  • Documents interaction with the periodic sender.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/sweep/mod.rs Adds immediate processing trigger.
src/main.rs Clarifies periodic timer behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +347 to +349
ic_cdk_timers::set_timer(Duration::from_secs(0), async {
process_sweeper_transactions().await;
});
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 7dbcf5e to 76e5ad9 Compare August 26, 2026 17:03
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch 2 times, most recently from 46d43d8 to 9c030ed Compare August 26, 2026 17:38
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 76e5ad9 to 56379f6 Compare August 26, 2026 17:38
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-anvil-sweep-harness branch from 56379f6 to 4ba45e6 Compare August 27, 2026 07:56
@gregorydemay
gregorydemay force-pushed the greg/DEFI-2926-sweep-without-waiting branch from 9c030ed to 3999da2 Compare August 27, 2026 07:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

rs/ethereum/cketh/minter/src/sweep/mod.rs:357

  • This kick can be lost when the interval-driven send task is already running. process_sweeper_transactions returns immediately if its SweeperSend guard is held (lines 75–84); if that task has already taken its request batch, it will only notice this newly enqueued request in its final pending check and schedule the normal 3-minute retry. Thus a fresh deposit can still incur substantial avoidable latency exactly when enqueue and send ticks overlap. Please make the wake-up coalescing: an enqueue that races with an active sender must cause another prompt pass after that sender releases its guard, rather than relying on the normal retry interval.
    ic_cdk_timers::set_timer(Duration::from_secs(0), async {
        process_sweeper_transactions().await;
    });

@gregorydemay

Copy link
Copy Markdown
Contributor Author

🤖 Closing: superseded by the restructured stack #11353 (PRs #11359#11360#11362#11363#11342).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants