code wiki / (root) / nx_ledger_scale_gate.nx

nx_ledger_scale_gate.nx

buildroot/runtime/nx_ledger_scale_gate.nx

6045 B144 linesdepth 8pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic ledger
docsdependenciesstructsconstsfunctions

about

nx_ledger_scale_gate.nx -- F981 SCALE RUNG: prove the per-account index returns the SAME answer as the full-book scan, on a book big enough that the two paths genuinely differ in work done. The scale claim is only worth anything if the fast path is EQUIVALENT, so the full scan is kept as the ORACLE and every assertion below compares fast-vs-oracle rather than fast-vs-a-number-I-typed. A book of NOISE accounts is built around the account under test specifically so that the global index is much longer than the per-account index -- if led_sums_fast were secretly still scanning everything, or scanning the WRONG index, these would diverge. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_ledger_lib.nx nx_ledger_scale_gate.nx

imports: nx_ledger_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sc_puts sc_id mt_catcopy mt_catn nxi_buf led_xfer mt_streq mt_catn ↻ canon_encode sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ cc_cmp cc_w32 cc_len sys_munmap reg_put reg_put_x sts_lock sts_mm sys_mmap ↻ sts_werr sys_exit ↻ ss_cat sys_openat_append sts_werr ↻ sys_flock

structs

none

consts

13const SC_NOISE: i64 = 12 // noise transfers surrounding the account under test (bisecting a measured ceiling)

functions

15func sc_puts(s: *u8) -> i64
called by 2: sc_ckmain
21func sc_putn(v: i64) -> i64
called by 2: sc_ckmain
35func sc_ck(cnt: *i64, name: *u8, got: i64, want: i64) -> i64
called by 1: main calls 2: sc_putssc_putn
46func sc_id(tag: *u8, nonce: i64, n: i64, out: *u8) -> i64
called by 1: main calls 2: mt_catcopymt_catn
56func main(argc: i64, argv: *i64) -> i64