Skip to content

docs: name the transaction submission flow and correct the stale sections - #251

Merged
gregorydemay merged 6 commits into
mainfrom
docs/split-transaction-submission
Oct 9, 2026
Merged

gregorydemay merged 6 commits into
mainfrom
docs/split-transaction-submission

Conversation

@gregorydemay

@gregorydemay gregorydemay commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Audits the documentation against the code and fixes everything that had drifted from it.

The section this branch was opened for is the largest piece. It was titled "Consolidation" and did two jobs: it documented the consolidation mechanism, which the removal of the signature-based deposit flow deleted, and it documented the generic flow that submits a Solana transaction carrying a recent block hash, which sweeps still follow. It now documents only the second and is named after it, and no mention of consolidation is left in the document.

Two sections are removed outright:

  • The walk-through of a getTransaction response for a user's deposit transfer. The ckSOL minter never inspects those transactions: it reads the balance of the deposit address and credits the deposit from the metadata of its own sweep, so the only transactions it parses are the ones it created and signed. The remaining subsections of 3.1 are renumbered accordingly, so the transaction submission flow is now Section 3.1.3.
  • The testing section. Test scenarios and their results do not belong in a design document, and two of its three scenarios credited a deposit from the shape of a user's transfer, which the balance sweep replaced.

The rest were claims the code no longer supports:

  • The frequency of the sweep timer and the number of deposits one round covers, and likewise the interval of the withdrawal processing timer. Whether to close the gap to the originally proposed interval is marked as still open.
  • Batching several transactions into a single HTTPS outcall, stated as fact although it was never implemented. It is now marked as a deviation that is still open.
  • The signature and fee analysis, which read as if it were generic but only ever applied to sweeps. It is scoped to them and contrasted with the single signature of a withdrawal.
  • The commitment levels a sweep uses for its block hash, for its preflight simulation and for its expiry check, which this stack changed and which were documented nowhere.
  • The minContextSlot of the balance check, which is deliberately not set.
  • The response sizes every RPC call is priced with. The minter sets no estimate on any request, so all of them use the SOL RPC canister's defaults, which the document described per method instead. The per-call costs and every total derived from them follow: the recent block attempt, the happy path and worst case of a single-deposit sweep, the withdrawal transaction, and the worked example of the deposit fee. Both fees keep their margin, and the costs the minter absorbs rather than charging are now named.
  • The cost derivation of the automatic deposit fee, dropped together with the flow it sized, which has to derive it again when it is revisited.
  • The API list, which offered an endpoint that does not exist and omitted one that does.
  • The ledger suite, described with archive canisters that the disabled archive trigger threshold never spawns.
  • The owners deposit_sol rejects, which include the minter's own principal and not only the anonymous one.

The README additionally points at the deployment guide, which nothing linked to.

Rebased onto main. The branch predated the durable-nonce stack, so every conflict resolved in favour of main and the section rename was reapplied on current content.

Documentation only, no code changes.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 6, 2026 11:18

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.

Copilot review overview

🟡 Changes recommended

The generic transaction section incorrectly applies the sweep-specific ten-signature limit to withdrawals.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

Renames the obsolete consolidation section to describe shared Solana transaction submission behavior.

Changes:

  • Removes outdated consolidation and automatic-fee documentation.
  • Updates section links and terminology to sweeps.
  • Retains transaction sizing and compute-unit analysis.
File Description
docs/​design.md Updates transaction submission, sweep, finalization, and fee documentation.

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

Comment thread docs/design.md Outdated
Comment thread docs/design.md Outdated
…ions

Section 3.1.4 was titled "Consolidation" and did two jobs: it documented
the consolidation mechanism, which the removal of the signature-based
deposit flow deleted, and it documented the generic flow that submits a
Solana transaction carrying a recent block hash, which sweeps still
follow. It now documents only the second and is named after it, the
cross-references are repointed, and no mention of consolidation is left.

The sections that had drifted from the code are corrected along with it:

- The sweep timer runs every minute, not every ten, and a round covers
  batches of ten deposits up to a hundred rather than a single batch.
- Batching several transactions into one HTTPS outcall is marked as an
  unimplemented deviation instead of being stated as fact.
- The signature and fee analysis is scoped to sweeps, whose signers are
  the deposit addresses, and contrasted with the single signature of a
  withdrawal transaction.
- The block hash of a sweep is read at the confirmed commitment level,
  with the preflight simulation at the same level and the expiry check
  still at finalized, which was previously undocumented.
- The balance check sets no minContextSlot, and the reasons why it does
  not need to replace the claim that it does.
- The getTransaction and getSignatureStatuses response sizes and cycle
  costs follow the SOL RPC canister defaults, and the withdrawal fee is
  derived from the corrected figures.
- The cost derivation of the automatic deposit fee is dropped: the
  parameter it sized does not exist, and the automated flow has to
  derive its fee again when it is revisited.
- The API list no longer offers update_balance, which does not exist,
  and lists get_events.
- Section 3.1.1 is marked outdated, since the minter only ever parses
  transactions it created and signed itself.

The README now points at the deployment guide, which nothing linked to.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gregorydemay
gregorydemay force-pushed the docs/split-transaction-submission branch from 63ce023 to c36073c Compare October 9, 2026 07:47
Copilot AI balanced review requested due to automatic review settings October 9, 2026 07:47
@gregorydemay gregorydemay changed the title docs: name the generic transaction submission flow after what it does docs: name the transaction submission flow and correct the stale sections Oct 9, 2026

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.

🟡 Changes recommended

The manual-deposit RPC total is stale, and the PR description contradicts the documented withdrawal flow.

2 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread docs/design.md Outdated
Comment thread docs/design.md Outdated
Comment thread docs/design.md Outdated
The section walked through a `getTransaction` response for a user's
deposit transfer. The ckSOL minter never inspects those transactions: it
reads the balance of the deposit address and credits the deposit from the
metadata of its own sweep, so the only transactions it parses are the
ones it created and signed. The remaining subsections of 3.1 are
renumbered and the references to them follow.

The worst-case RPC cost that the deposit_sol fee must cover drops to
12.0B cycles with the corrected `getTransaction` estimate, leaving the
45B fee a wider margin over the 38.2B it has to pay for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 09:04

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.

🟡 Changes recommended

The fee derivation omits configured block-fetch retries that can exceed the stated 45B-cycle coverage.

1 open finding
2 resolved since last review

🧠 Review effort: Balanced

Comment thread docs/design.md Outdated
The 12.0B figure is what a single-deposit sweep costs when every RPC call
succeeds on its first attempt, not its worst case. Fetching a recent
block is configured for up to three attempts of one getSlot and one
getBlock each, so it can cost 12.9B rather than 4.3B cycles, which brings
such a sweep to about 46.8B cycles and past the 45B fee.

The derivation now says which case the fee covers and groups the block
fetch retries with the two costs the minter already absorbed, the
getTransaction retries and the batched status checks of the finalization
timer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 09:17

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.

🔵 Needs a closer look

Two documentation inconsistencies remain around supported deposit flows and status-check fee accounting.

0 open findings

1 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Low severity Clarify supported deposit flow versus deferred automated design

docs/​design.md:84

This still says two deposit flows are supported, but Section 3.1.1 immediately states that the automated flow is not implemented, and the Candid service exposes no update_balance endpoint. Please distinguish the deferred design from the single supported manual flow.

Low severity Clarify fee coverage for additional signature status checks

docs/​design.md:574

This conflicts with the preceding derivation, which explicitly includes one getSignatureStatuses call in the 12.0B happy-path cost covered by the fee. Only subsequent status checks are absorbed by the minter; qualify this as “additional” checks so the fee accounting is internally consistent.

🧠 Review effort: Balanced

@gregorydemay
gregorydemay marked this pull request as ready for review October 9, 2026 09:23
@gregorydemay
gregorydemay requested a review from a team as a code owner October 9, 2026 09:23
@zeropath-ai

zeropath-ai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

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

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► README.md
The diff updates deployment and design references in docs/design.md and docs/deployment.md, and modifies wording in various design sections to reflect updated flow terminology.
Enhancement ► docs/design.md
    Rename and reorganize sections: Automated Flow, Manual Flow, Transaction Submission, and Sweep/Finalization references updated to reflect new section numbering and flow descriptions
► docs/deployment.md
    Add deployment guide reference and cross-linking to design changes in design.md

@mbjorkqvist mbjorkqvist left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @gregorydemay! A few comments from me and Claude.

Comment thread docs/design.md Outdated
Comment thread docs/design.md
Comment thread docs/design.md Outdated
Comment thread docs/design.md
Comment thread docs/design.md Outdated
Comment thread docs/design.md
Comment thread docs/design.md
Comment thread docs/design.md
The ckSOL minter sets no response size estimate on any request, so every
call is priced with the SOL RPC canister's default for that method, not
only getTransaction and getSignatureStatuses. The list of sizes that the
costs were derived from is replaced by that statement, and a paragraph
reconciles the smaller default for getTransaction with the much larger
response measured over arbitrary mainnet transactions: the minter only
ever fetches the transactions it built itself, which are capped at the
maximum transaction size, and an underestimate is retried with double the
estimate anyway.

The per-call costs of getAccountInfo, getBalance, getSlot and getBlock
follow, and with them every total derived from those figures: the recent
block attempt, the happy path and worst case of a single-deposit sweep,
the withdrawal transaction, and the worked example of the deposit fee.
No conclusion changes; both fees keep their margin.

Also corrected in the same pass:

- The withdrawal processing timer runs every minute with a 10 second
  retry, rather than the 10 second interval originally proposed, and the
  gap is marked as still open.
- A diagram note pointed at section 3.2.2 for the finalization timer,
  which is now the nonce account setup.
- The transaction submission flow is introduced for sweeps rather than
  for all transactions, since withdrawals carry a durable nonce value.
- The ledger suite is described without archive canisters, which the
  disabled archive trigger threshold never spawns.
- deposit_sol rejects the minter's own principal as the deposit owner,
  not only the anonymous principal.
- The last test scenario of the testing section, which had no content,
  is dropped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:34

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.

🟡 Changes recommended

Two deposit-flow statements remain inaccurate or internally contradictory.

1 open finding

🧠 Review effort: Balanced

Comment thread docs/design.md Outdated
Test scenarios and their results do not belong in a design document. The
section also no longer described the minter: two of its three scenarios
credited a deposit from the shape of a user's transfer, which the balance
sweep replaced, and the sample transactions under them were recorded
against that flow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:40
The overview of the deposit flows said that two of them are supported,
and the manual flow derived its deposit address "as in the automated
flow", while the automated flow is deferred to a post-launch upgrade and
carries a warning saying so. The overview now names which of the two is
implemented, and the manual flow no longer compares itself to a flow that
does not exist.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

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.

🔵 Needs a closer look

Several updated passages remain internally inconsistent or technically inaccurate.

0 open findings

1 resolved since last review
Previously missed (4)

In code that hasn't changed since last review

Low severity Avoid claiming archiving can never spawn

docs/​design.md:31

The configured threshold is 4,200,000,000 blocks (docs/deployment.md:171-175), which makes archiving effectively disabled but does not place it beyond the ledger's nat64 block range or guarantee that archives can never spawn. Please avoid the absolute claim and describe the operational intent instead.

Low severity Distinguish implemented and proposed deposit flows

docs/​design.md:83

This says two deposit flows are supported, but the warning immediately below states that the automated flow is not implemented, and the API list correctly omits update_balance. Distinguish the implemented manual flow from the proposed automated flow so this overview does not advertise an unavailable feature.

Low severity Correct the explanation of deposit address derivation

docs/​design.md:242

The rejection is documented correctly, but its explanation is not: every account address, including one owned by the minter principal, uses the non-empty schema-v1 derivation path (minter/src/address/mod.rs:139-145), while the main address uses the empty path (minter/src/address/mod.rs:19-22). Remove this causal clause rather than identifying that derived deposit address as the main address.

Low severity Clarify included versus additional status checks

docs/​design.md:566

The preceding 12.3B happy-path total explicitly includes one getSignatureStatuses call, but this sentence says the finalization timer's status checks are outside the fee. Qualify this as additional checks after the first one included in the estimate so the fee derivation is internally consistent.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:44

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.

🔵 Needs a closer look

Two statements remain inaccurate regarding deposit-address derivation and RPC cost inputs.

0 open findings

Previously missed (2)

In code that hasn't changed since last review

Low severity Correct inaccurate rationale for rejecting the minter principal

docs/​design.md:242

The rationale for rejecting the minter principal is incorrect: its account still derives a schema-v1 deposit address, and address/tests.rs:78-82 explicitly verifies that this address differs from the main address. This also contradicts the invariant documented above on line 83 that every deposit address uses a non-empty path. Remove this false explanation (or document the actual ledger-level reason for the rejection).

Low severity Clarify getTransaction cost uses the 10 KiB default estimate

docs/​design.md:551

This says the estimates use the measured response sizes listed above, but the new getTransaction cost of 3.2B is based on the SOL RPC canister's 10 KiB default, not the listed 31,985-byte measurement. That contradicts lines 547-549 and makes the cost derivation ambiguous; identify the default estimates as the inputs instead.

🧠 Review effort: Balanced

@gregorydemay
gregorydemay enabled auto-merge October 9, 2026 11:55
@gregorydemay
gregorydemay added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit 92aed5c Oct 9, 2026
15 checks passed
@gregorydemay
gregorydemay deleted the docs/split-transaction-submission branch October 9, 2026 12:07
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.

3 participants