feat(cketh): sign the authorizations a batched sweep needs - #11360
Merged
gregorydemay merged 7 commits intoAug 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds EIP-7702 authorization signing for attested ckERC20 deposit addresses.
Changes:
- Signs nonce-0 delegation authorizations in batches.
- Adds signing expectations and coverage for authorization tuples.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sweep/mod.rs |
Implements batched authorization signing. |
sweep/tests.rs |
Tests authorization digest, path, and signature count. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gregorydemay
force-pushed
the
gdemay/DEFI-2926-sign-authorizations
branch
from
August 27, 2026 19:01
da8f9c1 to
17b3988
Compare
gregorydemay
force-pushed
the
gdemay/DEFI-2926-sign-authorizations
branch
2 times, most recently
from
August 27, 2026 19:14
d0cfdac to
6f44c38
Compare
gregorydemay
marked this pull request as ready for review
August 27, 2026 20:48
|
✅ No security or compliance issues detected. Reviewed everything up to 4c36bb1. Security Overview
Detected Code Changes
|
This was referenced Aug 28, 2026
Closed
mbjorkqvist
approved these changes
Aug 28, 2026
mbjorkqvist
left a comment
Contributor
There was a problem hiding this comment.
Thanks @gregorydemay!
basvandijk
added a commit
that referenced
this pull request
Aug 28, 2026
## Problem GNU's download infrastructure has been down since ~2026-08-28 00:00 UTC, and every **CI Main / Build IC** job since then fails to fetch the `@mtools` external repo (first seen in run 33131446914 at 01:03Z; e.g. #11360, #11364, #11365): ``` WARNING: Download from https://ftp.gnu.org/gnu/mtools/mtools-4.0.49.tar.gz failed: class java.io.IOException Connect timed out WARNING: Download from https://ftpmirror.gnu.org/mtools/mtools-4.0.49.tar.gz failed: class java.io.IOException GET returned 502 Bad Gateway ERROR: no such package '@@+http_archive+mtools//': ... ``` `ftp.gnu.org` is hard-down (TCP connect timeout on every attempt) and the `ftpmirror.gnu.org` redirector itself intermittently returns 502 (4 out of 8 probes) — so reordering the two existing URLs would not reliably fix CI. Since `bazel-remote` no longer has the blob cached, the fetch falls back to these URLs and fails. `@mtools` is on the IC-OS image build path (`vfat_image`/`fat32_image`) and a runtime dep of every `uvm_config_image`-using system test, so this blocks most of CI. ## Fix Add `mirrors.kernel.org` as the primary URL and demote the two GNU hosts to fallbacks. The kernel.org mirror is fast and reliable (full download in ~2s vs ~27s via ftpmirror when it works at all) and serves a byte-identical tarball matching the pinned `sha256`, so this is risk-free. Precedent: #11134 (pigz via macports mirror when zlib.net was down). ## Verification - Downloaded the tarball from both `mirrors.kernel.org` and `ftpmirror.gnu.org`: both are 569054 bytes with sha256 `10cd1111da87bf2400a380c1639a6cba8bfb937a24f9c51f5f88d393ae5f6f76`, matching the pin. - `bazel build //... --nobuild` passes (full workspace loads/analyzes). - `bazel run //:buildifier` clean. - `bazel fetch --config=local --repository_cache= --force @mtools//...` succeeds with no download warnings, i.e. bazel's own downloader fetched from the new primary URL and the hash verified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Each attested deposit address signs the EIP-7702 tuple delegating its code to the sweeper contract, so the delegate can move the deposit's funds. The tuple names the minter's chain, the configured sweeper contract, and nonce 0 whatever nonce the address actually holds: a deposit address is at nonce 0 exactly while it has never been delegated, so the authorization either installs the delegation or is skipped, both of which are correct in any ordering. That is what lets a sweep authorize every address it touches without tracking which ones are already delegated. Only attested addresses are authorized: a deposit that could not be attested drops out of the sweep anyway, so authorizing it would spend a threshold-ECDSA signature on nothing.
Stores each signed EIP-7702 tuple in the event log, keyed by what was signed, so a later sweep of the same address reuses it rather than paying for another threshold-ECDSA signature. Keying by the request rather than the account means re-pointing the minter at another sweeper contract misses the cache and signs afresh, instead of reusing a tuple delegating the old one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… signing sign_authorizations_batch now takes the requests, signs the ones it has not recorded, and records those — the same steps as its attestation sibling. Building the requests moves onto State, which fills the sweeper contract in itself, so a caller cannot authorize against a contract the minter does not run against; the derivation path moves onto AuthorizationRequest, so the digest and the key that signs it come from the same place. Drops the attested-only filter. It was justified while authorizations were signed afresh for every sweep, but a recorded one is reused once the attestation lands, so signing the two independently wastes nothing and leaves neither batch waiting on the other. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YK3ggw1xtE3HZTGGBu66oD
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YK3ggw1xtE3HZTGGBu66oD
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YK3ggw1xtE3HZTGGBu66oD
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YK3ggw1xtE3HZTGGBu66oD
gregorydemay
force-pushed
the
gdemay/DEFI-2926-sign-authorizations
branch
from
August 28, 2026 15:23
0b12b1c to
4c36bb1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
What
Candid compatibility
CI_OVERRIDE_DIDC_CHECKlabel:get_eventsreturns a variant, andAuthorizedDepositAddressadds a case to it. A variant with more cases is not a Candid subtype of one with fewer, so the check against the merge base rejects it, exactly as it did for the attestation event in feat(cketh): remember the attestations the minter has signed #11319.