Repository navigation
feat(id): currency registry schema + ledger-u32 allocator (#2317) - #10658
Conversation
Slice F1 of the #2062 currency control-plane design: Postgres migration creating ledger_allocation, currency, currency_issuer and account with the ratified range split, plus the id-currency-registry crate stating the allocator/registry semantics (monotonic, never recycled, currency_id globally unique, symbol unique per issuer).
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
agent-note:v1
Codex findings gate disposition: the Codex review on this PR FAILED before producing any finding — its summary comment records status "failed" and a second comment states the Codex usage limit for code reviews is reached. Verified this shift: zero Codex review comments (pulls/10658/comments is empty) and zero reviews, so there is no finding to fix or rebut. CodeRabbit likewise posted only a rate-limit notice (free OSS review limit, resets in ~40 min), with no findings. Merging on local verification instead, per the fleet merge rule (CI runs on main; PRs do not wait): cargo test -p id-currency-registry 11/11 pass, clippy clean, fmt clean, and scripts/test-migration.sh PASS against a real Postgres covering every #2317 acceptance item. |
Closes #2317. Slice F1 of the #2062 currency control-plane design — the registry that owns the meaning of a TigerBeetle
ledgeru32.What
New crate
pkgs/id/crates/id-currency-registry(workspace member):migrations/0001_currency_registry.up.sql(+ down) creating the four tables with the constraints the design names:ledger_allocation(§2.1) —ledger_idbigint PK with the0..4294967295check, per-kind range check enforcing the ratified §6 split (1..=0xFFFFFtenancy/system,0x100000..currencies), monotonic allocator sequences +allocate_ledger(kind, owner_ref), and a trigger refusing deletes (ids are never recycled).currency(§2.2) —currency_idglobally UNIQUE,(issuer_id, symbol)UNIQUE (symbol unique per issuer, not globally),graph_object_idlinkage to the signed canonical record (§2.4), supply policy / status / scale per the design.currency_issuerandaccount— drafted from §4.2 / §3 per decision 4 (the design names them but does not tabulate their columns), marked as draft-for-ratification in the migration, crate docs, and README.Storeseam (Allocator,Registry, in-memory store enforcing the same constraints): monotonic non-zero allocation, no recycle (no release API; the store refuses a spent id),currency_idminting at registration with duplicate rejection before a ledger id is spent, issuer-onlygrant_minter, and the factory-account index.Decisions applied (ledger
currency-registry-decisions-2317, answered 2026-11-16, recorded on #2317): Postgres store; bigint + range check;currency_idglobal / symbol per issuer; fleet-draftedcurrency_issuer/accountcolumns.Tests (oracle: #2317 acceptance)
cargo test -p id-currency-registry— 11/11 pass, incl. two issuers both registering symbolABC, duplicatecurrency_idrejected, duplicate(issuer, symbol)rejected, allocator monotonic/non-zero/range-split/no-recycle. Clippy clean,cargo fmtclean.scripts/test-migration.sh— PASS against a real throwaway Postgres: migration applies; allocator hands out 1048576, 1048577, system 1; delete (recycle) refused; two issuers with symbolABCinsert fine; duplicatecurrency_idand duplicate(issuer, symbol)rejected; out-of-range allocation rejected; down migration removes the schema.Queue: task 17444, lane any-a.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.