GeezerVison is showing github.com — id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) · Issue #3801 · developing-today/code
id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801DescriptionPhase 2 of the RateAuthorisation set tracked by issue #2290 — for the issue #2062 gateway follow-ons to build on. Design record: the task 5741 triage comment on issue #2290 (verification flow steps 1–4). Depends on the Phase 1 schema/fold issue in this set.
Build in the control plane / gateway:
- Verification flow: (1) chain decode + signature, header verifying key == body issuer_id; (2) LP-tier eligibility from the control-plane registry (issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §3 tiers); (3) account-control chain — the conversion's source/dest liquidity accounts must be exactly the account-factory binding records for the issuer, neither closing/closed; (4) live-state checks at submission: highest version folded, not revoked, window, caller authorisation, min/max, remaining_volume.
- Revocation-set materialisation: fold
currency.rate_authorisation_revoke events into the set the gateway consults at submission time. Revocation stops new conversions only; posted conversions are untouched (issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §4.4).
- Every failure is pre-flight (FAILED_PRE_SUBMIT) with no TigerBeetle writes.
Acceptance: tests cover each step failing closed (bad signature, wrong issuer, unbound account, revoked, expired, cap-exhausted, unauthorised caller) with zero ledger writes. Activitydeveloping-today commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026 agent-note:v1 — state=picked-up; worker=repo-worker-code; task=5790; at=2026-11-01T17:09:05Z. Queue claim acquired. Fresh GitHub state: #3801 is OPEN with no matching PR; prerequisite #3800 is OPEN and currently claimed/in progress under queue task 5789 (its worker posted a pickup note). Packet requires Phase 1 types to be merged first. Next: park 30 minutes; resume only after fresh verification that #3800 has merged. dezren39 commented on Nov 1, 2026 agent-note:v1 — state=picked-up; worker=repo-worker-code; task=5790; at=2026-11-01T17:42:48Z. Queue claim acquired by OpenChamber scheduled lane. Fresh GitHub verification: #3801 is OPEN with no matching PR. Its prerequisite #3800 remains OPEN and parked; PR #3888 is OPEN, Drew-authored, and has mergeStateStatus=DIRTY. We will not touch that PR. Next: park for 30 minutes; resume only after fresh verification that #3800 is merged and the Phase 1 types are available. dezren39 commented on Nov 1, 2026 agent-note:v1 — state=parked; worker=repo-worker-code; task=5790; at=2026-11-01T17:43:33Z. Parked for 30 minutes because prerequisite #3800 is still OPEN and PR #3888 is Drew-authored, OPEN, and DIRTY; no work was started on this task and the PR was not touched. Resume condition: freshly verify #3800 merged and Phase 1 types available, then revalidate #3801 and ownership. dezren39 commented on Nov 1, 2026 agent-note:v1
{"v":1,"kind":"parked","task":5790,"lane":"f","note":"Task 5790 prerequisite re-verified fresh 2026-11-01T19:1xZ: #3800 still OPEN; its PR #3888 still OPEN (not merged), so the Phase 1 RateAuthorisation types are not on main and Phase 2 (#3801) cannot start. PR #3888 was not touched by this lane. Parked 1h. Resume: fresh-verify #3800 CLOSED / PR #3888 MERGED, then implement the gateway verification flow + revocation-set check per the packet."} dezren39 commented on Nov 21, 2026
Agent note — task 16675 picked up (lane oc-code-07)
dezren39 commented on Nov 21, 2026
Triage update — task 16675 blocked as packet_defect
Fresh state on origin/main fd1d273f8b invalidates the 2026-11-14 dependency premise: #2298 is CLOSED (PR #9803 merged), #2317 and #2318 are CLOSED, and the #2319 envelope is present through merged PR #7650 (fa7412cfd7). #3801 remains OPEN; no matching open PR exists. The core #3801 work is still missing: the currency gateway does not yet verify RateAuthorisation against live folded/revocation state at submission or enforce the specified pre-submit no-ledger-write failures.
The claimed queue packet cannot safely route this result: its title/body demand triage and a coherent re-packet, while payload.kind is small_fix; its acceptance is generic, and its 20-minute timebox cannot represent the multi-part integration acceptance. The old blocker text also falsely says the registry/factory/gateway modules are absent. No code or worktree changes were made. Repair the packet into a scoped triage/follow-up route before re-claiming; do not use the stale dependency block. dezren39 commented on Nov 23, 2026 Lane felix, queue task 21437 — claim + done check (2026-11-23).
Done check against current main (ab82a4d):
Already landed — not to be rebuilt:
- Phase 1 (id(currency): RateAuthorisation + revoke schema types and fold in pkgs/id (Phase 1 of #2290) #3800) is on main in
pkgs/id/src/currency.rs: RateAuthorisation / RateAuthorisationRevoke bodies, validate() (body issuer == event author, rate/window/fee/ledger/cap/allowlist rules), and fold_authorisation — the revocation-set materialisation over the signed objects: highest valid version folds live, an issuer-signed revoke covering it folds AuthorisationState::Revoked (earliest effective covering revoke wins; foreign-sign revokes ignored; a foreign signer cannot hijack an authorisation_id). AuthorisedCallers::allows and apply_rate are there. All covered by tests in the same module.
- F3 envelope (id(currency): gateway request envelope — canonical encoding, verify_strict, nonce window, idempotency IDs (from #2062) #2319) verifies/converts the
Convert op shape in currency/gateway.rs, but its authorize() Convert arm checks only: source currency active, non-zero amount, caller controls the source account.
The remainder (this issue's actual work, not present anywhere on main):
- A gateway verification flow for a conversion submission composing, in order: chain decode + signature with header verifying key == body
issuer_id (step 1); LP-tier eligibility from the control-plane registry (id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §3) (step 2); account-control chain — the conversion's source/dest liquidity accounts are exactly the account-factory binding records for the issuer, neither closing/closed (step 3); live-state checks at submission over the Phase 1 fold — highest version folded, not revoked, inside the window, caller authorised, amount within min/max, within remaining_volume (step 4).
- The gateway-side revocation consult at submission time (the fold exists; nothing in the gateway consults it).
- Every failure typed pre-flight (FAILED_PRE_SUBMIT) with zero TigerBeetle writes, with tests per failure mode: bad signature, wrong issuer, unbound account, revoked, expired, cap-exhausted, unauthorised caller.
gateway_service.rs states the same scope line: "convert is phase 5 (id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801/id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802)" and the service does not execute it.
Status: implementation paused at the done check — the lane's worktree creation tripped an execution-risk flag in this seat's sandbox and the lane is not permitted to run git/build/test operations in that checkout until the flag is cleared by the operator. The done check above is read-only and complete; the implementation shape is fully determined by it. No PR yet. dezren39 commented on Nov 23, 2026 Lane felix resuming queue task 21437 under Drewry's standing approval (2026-11-22 01:06 CST: worktree work is always approved, including when an automated execution-risk flag fires on a new checkout). The done check above (comment 7111812054) stands and is the implementation spec: gateway verification flow (steps 1–4 in the issue's order), gateway-side revocation consult at submission, typed FAILED_PRE_SUBMIT failures with zero TigerBeetle writes, and one acceptance test per failure mode. Building on gateway_service.rs (PR #13343) and the F3 envelope; Phase 1 in currency.rs is not being rebuilt. dezren39 commented on Nov 23, 2026 Lane felix, queue task 21437 — implementation complete: PR #13667 (says Closes #3801; left unmerged for Felix's review).
Landed in pkgs/id/src/currency/conversion.rs: the verification flow composing steps 1–4 in the issue's order (chain decode + signature with header key == body issuer_id; LP-tier eligibility over a control-plane seam; account-control chain requiring the named liquidity accounts to equal the issuer's account-factory binding records exactly, neither closing/closed; live-state checks over the Phase 1 fold consulted at submission time — highest version, revocation with effective_at semantics, window, caller, min/max, remaining_volume over the new gateway-side ConversionUsage state). Every failure is a typed FailedPreSubmit (disposition FAILED_PRE_SUBMIT) with zero TigerBeetle writes.
Evidence: remote run 45251458466 — cargo test --manifest-path pkgs/id/Cargo.toml --lib currency:: success, 110 passed / 0 failed; all 15 new currency::conversion tests verified by name in the log, including one per acceptance failure mode (bad signature, wrong issuer, unbound account, revoked, expired, cap-exhausted, unauthorised caller), each asserting the usage book is untouched and a standby ledger holds zero accounts/transfers.
Named remainder (not in this issue's acceptance): settlement — composing the verified conversion into the linked transfer chain and wiring the flow into the gateway service pipeline — is #3802; the F3 Convert op carries no authorisation reference, so this slice's submission shape is the input that one adapts. No new dependencies; no schedules touched.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|