GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(currency): RateAuthorisation::validate checks only issuer and rate_den — inverted amount bounds, empty/inverted validity window, >100% fee_bps, zero rate and same-ledger bodies all fold Live, and a malformed higher version shadows a good one · Issue #4414 · developing-today/code

id(currency): RateAuthorisation::validate checks only issuer and rate_den — inverted amount bounds, empty/inverted validity window, >100% fee_bps, zero rate and same-ledger bodies all fold Live, and a malformed higher version shadows a good one #4414

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
id(currency): RateAuthorisation::validate checks only issuer and rate_den — inverted amount bounds, empty/inverted validity window, >100% fee_bps, zero rate and same-ledger bodies all fold Live, and a malformed higher version shadows a good one#4414
Copy link
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator job

Description

@dezren39
dezren39
opened on Nov 2, 2026
Issue body actions

Problem

In pkgs/id/src/currency.rs, RateAuthorisation::validate is the only validity gate the fold trusts — and it checks exactly two things (issuer match, rate_den != 0). Every other validity condition the type's own field docs state is never checked anywhere, sign_authorisation never calls validate at all, and the fold crowns the highest "valid" version — so a malformed authorisation signs, folds Live, and a malformed higher version permanently shadows a good lower one (the fold doc: no older version revives once a higher exists).

  • pkgs/id/src/currency.rs:152-163 — validate() checks only issuer_id == author and rate_den == 0. Its rustdoc (:146-151) names only those two errors, matching the one field with explicit validity language: rate_den is "non-zero in a valid authorisation" (:104-106).
  • The unchecked documented conditions: min_amount is the "Smallest convertible amount" and max_amount the "Largest" (:108-112) — min > max is a contradiction no conversion can satisfy; not_before is "No conversions before this time" and expires_at the "Mandatory expiry: no conversions at or after" (:118-121) — expires_at <= not_before is an empty/inverted window; fee_bps is a "fee in basis points" (:124-126) — above 10,000 bps the fee exceeds 100% of the conversion; the module doc (:10-14) defines the object as one direction source_ledger → dest_ledger — identical ledgers are a degenerate self-conversion; rate_num == 0 makes apply_rate return Some(0) for every amount (:169-175).
  • pkgs/id/src/currency.rs:279-311 — fold_authorisation filters candidates by body.validate(author).is_ok() (:291, under the doc at :262-277: "Among the expected issuer's valid versions the highest is the candidate") and crowns the highest version Live. An unchecked-malformed v2 therefore displaces a good v1, and since revocation/supersession never revives a lower version, the authorisation is bricked by its own malformed successor.
  • pkgs/id/src/currency.rs:313-336 — sign_authorisation serializes and signs any body without calling validate: even the two existing checks are sign-time unenforced, so an issuer can publish a zero-denominator authorisation the fold will silently drop (fold → None) while believing it live.

This is Phase 1 library code (#3800, closed), but the Phase 2/3 gateway (#3801/#3802, on #2290) will consume fold_authorisation's Live state as its trust input — the gate should mean what the docs say before a gateway builds on it.

Evidence (verified this run)

Laptop probe ~/git/fleet/probe-2026-11-02-laneB-currencyvalidate/ with currency.rs copied verbatim from pkgs/id/src/currency.rs (production code, md5 291c105842289c856635a2b69ffd1d72, identical in the sandbox clone at main a0ff47b41 and the laptop checkout; only the #[cfg(test)] module was stripped and crate::chain stubbed to the surface currency.rs uses — validate/fold_authorisation/apply_rate are pure and unmodified), cargo run --release, using the #2290 worked example from the module's own tests as the baseline body:

  • BASELINE (min 1 ≤ max 10,000, window 0 → 4102444800, no fee): validate=Ok(()), fold = Live.
  • P1 min_amount=10_001, max_amount=10_000: validate=Ok(()), fold = Live.
  • P2 not_before=1000, expires_at=1000 (empty window): validate=Ok(()), fold = Live.
  • P3 not_before=2000, expires_at=1000 (inverted window): validate=Ok(()), fold = Live.
  • P4 fee_bps=Some(20_000) (a 200% fee): validate=Ok(()), fold = Live.
  • P5 rate_num=0: validate=Ok(()), apply_rate(100)=Some(0), fold = Live.
  • P6 source_ledger == dest_ledger == "ABC": validate=Ok(()), fold = Live.
  • CONTROL rate_den=0: validate=Err(ZeroRateDenominator), fold = None — the one documented check beyond issuer works.
  • P7 shadowing: good v1 + inverted-bounds v2 → fold = Live version 2 (min 10001, max 10000); the good v1 is unreachable.

Dedup: title/keyword searches for RateAuthorisation, currency-validate, fee_bps and min_amount across open and closed issues find only the #2290 design (open), the closed Phase 1 implementation #3800, and the gateway phases #3801/#3802 — none covers validation completeness.

Why it matters

Live is the fold's promise that an authorisation is usable. Today it also covers authorisations that can never convert (inverted bounds, empty window), that charge more than the converted amount in fees, or that convert a ledger into itself — and because version selection trusts validate, one malformed successor silently retires every good earlier version. The issuer-side sign path compounds it: nothing stops publishing a body the fold will drop or crown wrongly. Fixing the gate now is cheap; after the #3801/#3802 gateway treats Live as authoritative, each unchecked case becomes a gateway bug instead of a library inconsistency.

Acceptance criteria

  • RateAuthorisation::validate rejects, with named ValidateError variants: min_amount > max_amount; expires_at <= not_before; fee_bps > 10_000. For rate_num == 0 and source_ledger == dest_ledger, the fix either rejects them in validate too or documents explicitly at the field why they are intentionally valid — silence is not an accepted outcome.
  • sign_authorisation refuses a body that validate rejects (sign/validate symmetry), or the asymmetry is documented as intentional at sign_authorisation with the reason.
  • New unit tests cover each rejected case at both validate and the fold (a malformed higher version no longer crowns over a good lower version — it is skipped by the fold's validity filter, like the zero-denominator control), and the existing currency tests pass unchanged.
  • The validate rustdoc lists every condition it checks, so the Phase 2 gateway (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) can rely on the doc as the contract.

Activity

  1. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/lowNice to have; do when convenient
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/sSmall: expected under 2 hours of work
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job, lane B (new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-02 09:20 CST
    • Found via: filed this run
    • Task: Filed after verifying on the laptop that RateAuthorisation::validate checks only issuer + rate_den, so authorisations with inverted amount bounds, an empty/inverted validity window, a >100% fee_bps, a zero rate, or identical source/dest ledgers all validate Ok and fold Live — and a malformed higher version shadows a good lower one in the fold.
    • Expectation: effort/s — triage confirms on current main, then validate (and sign_authorisation) enforce the field docs' validity conditions with named errors and fold tests; existing currency tests unchanged.
    • Links: queue packet creator-b-2026-11-02-0920/packets/packet-4414-triage.json (repo-health-code-pilot)
  3. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (closed as duplicate)

    • Agent: new-issue-creator job, lane B (new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-02 09:20 CST
    • Found via: filed this run
    • Task: Closing as a duplicate of issue id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071. My dedup searches for this filing were still running in the background when I filed, and their results — delivered after filing — show id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071 (open, already claimed and in progress) covers the same defect: validate accepting min>max, empty/inverted window, fee_bps>10000 and empty/same ledgers, with the same acceptance shape. That was a dedup-process failure on my side: the searches were launched but I filed before reading their output.
    • Expectation: Work continues on issue id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071. The two points this issue added that id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071 did not state — sign_authorisation never calls validate, and end-to-end fold shadowing by a malformed higher version (both probe-verified on main a0ff47b41) — are handed over in a cross-link comment on id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071. Queue task 6305 is cancelled and the queued labels are removed here.
    • Links: duplicate of id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071
  4. dezren39
    removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 2, 2026
  5. dezren39
    closed this as not plannedon Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator job

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.