Skip to content

docs: align the automatic deposit flow documentation with the implementation - #292

Merged
mbjorkqvist merged 170 commits into
mainfrom
mathias/automatic-flow-docs-consistency
Nov 11, 2026
Merged

mbjorkqvist merged 170 commits into
mainfrom
mathias/automatic-flow-docs-consistency

Conversation

@mbjorkqvist

Copy link
Copy Markdown
Contributor

Follow-up to #274, from a consistency pass over the design, the deployment guide, the changelog and the Candid comments of the automatic deposit flow. It only touches documentation and comments.

  • The design still described getMultipleAccounts as not yet offered by the SOL RPC canister, while the flow already uses the typed method.
  • The changelog said the watchlist is recorded before every upgrade; it is recorded only when it holds entries, which is what keeps an upgrade without the flow enabled reversible.
  • The deployment guide said to set the automatic deposit fee "once it is complete", next to the section that enables it in the installing upgrade.
  • The manual flow diagram applied the minimum deposit amount to the sweepable amount instead of the balance.
  • Smaller alignments: the overview figure lacks watch_deposit_address, the crediting of a sweep is not specific to the manual flow, the Quarantined error of deposit_sol names only one of the two causes, the cycle figures in the constants differ from the design, and the repository structure omits the automatic flow.

🤖 Generated with Claude Code

gregorydemay and others added 30 commits October 14, 2026 06:41
Replace the outdated section 3.1.1, which described per-transaction
crediting with getSignaturesForAddress and quotas replenished by the
removed process_deposit endpoint, with a design that builds on the
balance sweep of deposit_sol: a free registration endpoint, a scan
timer reading watched deposit addresses in batches with
getMultipleAccounts, a schedule adapted from the ckETH minter, a fixed
fee in SOL deducted from the minted amount, and a watchlist persisted
only as a bounded snapshot at pre_upgrade. Every change to the
interface, the arguments and the event log is additive, since the
minter is deployed on mainnet.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
State that a re-armed account is reported as watching again, that the
main account receives the sweepable amount minus the fee share, correct
the worst-case cost arithmetic and state its success assumption, and
distinguish a failed upgrade from a reinstallation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ring

Move the sequence diagram of the automatic flow ahead of its
explanation, remove the semicolon that broke the mermaid parser on
GitHub, and define the deposit id where it is first used in the section.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…he constraint

State that scan ticks are guarded like the other timers so that they
never overlap, and base the automatic deposit fee constraint on the
single-signature fee share that a pending mint actually bears.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Drop the separate status query: calling the registration endpoint again
returns the stored registration or the id of the deposit in flight, as
deposit_eth does in the ckETH minter.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… signature lookup

Spell out that scan ticks never overlap, that the fee derivation is a
single-attempt estimate with re-arm costs absorbed by the minter, and
that only manual deposits are retried by the caller. Remove
getSignaturesForAddress from the RPC inventory and cost tables, since
the minter no longer uses it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A re-armed entry restarts its schedule from the first gap, bounded by
the remaining window, and a re-arm only ever follows a detection.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Record the watchlist snapshot on every upgrade so that an older one
cannot be replayed after the watchlist emptied, and let the transaction
submission section account for deposits queued by the balance scan.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The window ends with the last scan, and the next registration call
starts a new window rather than reporting a registration without a
next scan.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…it ids

Follow the ckETH minter: a registration freezes neither the minimum
deposit amount nor the automatic deposit fee, both are quoted and the
values in force at detection apply, the fee being recorded with the
queued deposit. deposit_sol compares the latest deposit id of the
account before and after its balance read, and a registration is
allowed while a deposit_sol call is in progress.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…edule

Measure gaps from the previous scan as before, but end the window at a
fixed 24 hours after registration, as the ckETH minter does, so that
the accumulated tick and call delays have slack and clients and the
re-arm share one unambiguous boundary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ence

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…owner rationale

The fee recorded at detection matters for deposits an upgrade finds not
yet credited; a credited deposit has its mint amount in CreditedSweep.
The minter's principal is excluded as a deposit owner because its
default account is the ledger's minting account, not because of an
address collision.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…xample with the automatic flow

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…er a concurrent scan

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…n delay and the fee worst case

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…or to new registrations

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…vents the automatic flow adds

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…tric to alert on

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… of chaining gaps

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The re-arm registers the account again instead of restoring the original window, so the
queued deposit carries only the automatic deposit fee.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… classification from deposit_sol

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mbjorkqvist and others added 9 commits November 10, 2026 14:25
…between tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ics' into DEFI-2780-automatic-deposit-flow-impl
…ad advances

A registration removed, replaced or expired while the read was in flight was
counted, unlike after a successful read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t of the automatic flow

Qualify when the id of the latest deposit is returned, list the user-visible
changes of the stack in the changelogs, and enable the flow in a second upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hen the watchlist is full

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ept together

The minter's interval timers keep the schedule of its installation, so after a plain
advance of time the next sweep tick could come anywhere within a minute and split the
four deposits over two sweep transactions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntation

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@mbjorkqvist
mbjorkqvist marked this pull request as ready for review November 11, 2026 12:59
@mbjorkqvist
mbjorkqvist requested a review from a team as a code owner November 11, 2026 12:59
Copilot AI balanced review requested due to automatic review settings November 11, 2026 13:00
@zeropath-ai

zeropath-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to f2d0a26.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► libs/types-internal/src/event.rs
    Update TransactionPurpose description to include deposits swept by balance scans in addition to those queued by deposit_sol
Enhancement ► minter/src/constants.rs
    Adjust cycle cost commentary: getBalance, getAccountInfo, and related constants to reflect updated values (2.3B vs 2.1B, 23M per address)
Enhancement ► minter/src/state/event.rs
    Update TransactionPurpose description to include deposits swept by balance scans
Enhancement ► minter/CHANGELOG.md
    Update note about watchlist upgrade behavior and related wording
Enhancement ► minter/cksol_minter.did
    Reflect updated TransactionPurpose documentation for swept deposits (including balance scans) in DID
Enhancement ► minter/src/constants.rs (duplicate entry in diff context)
    Align comments for per-address and total cycle estimates with updated values
Enhancement ► libs/types/src/lib.rs
    Update error description for quarantined deposits to mention DepositSolStatus and clarify quarantine conditions

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.

🟢 Approval recommended

No active review issues remain in the documentation and API-comment updates for the automatic deposit flow.

No open issues 🎉

What changed in this PR

Aligns documentation and API comments with the automatic deposit flow introduced in #274. No runtime behavior or interface definitions change.

Changes:

  • Updates the design to reflect typed RPC support, balance-based deposit eligibility, and shared sweep processing.
  • Clarifies automatic-flow enablement and watchlist persistence during upgrades.
  • Aligns quarantine descriptions, cycle-cost comments, and the repository layout documentation.
File Description
minter/​src/​constants.rs Aligns RPC cycle-cost comments with the design estimates.
minter/​cksol_minter.did Documents both causes of deposit quarantine.
minter/​CHANGELOG.md Clarifies that empty watchlists are not recorded before upgrades.
libs/​types/​src/​lib.rs Aligns Rust quarantine documentation with Candid comments.
docs/​src/​development/​repository-structure.md Adds the automatic deposit module to the layout.
docs/​src/​development/​design.md Updates deposit diagrams, RPC availability, sweep descriptions, and cost-estimate wording.
docs/​src/​development/​deployment.md Clarifies how setting the automatic deposit fee enables the flow.

Review effort: Balanced

Comment thread docs/src/development/design.md Resolved
Comment thread docs/src/development/design.md Resolved
… in the sweep event

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 14:30

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.

🟢 Approval recommended

No active review issues were identified for the documentation updates clarifying the automatic deposit flow.

No open issues 🎉

Review effort: Balanced

Base automatically changed from DEFI-2780-automatic-deposit-flow-impl to main November 11, 2026 14:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 14:40

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.

🟢 Approval recommended

No active review issues are reported for the documentation and comment updates describing automatic deposits.

No open issues 🎉

Review effort: Balanced

@mbjorkqvist
mbjorkqvist added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit a4d1f03 Nov 11, 2026
17 checks passed
@mbjorkqvist
mbjorkqvist deleted the mathias/automatic-flow-docs-consistency branch November 11, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants