code wiki / (root) / nx_blocklist_store.nx

nx_blocklist_store.nx

buildroot/runtime/nx_blocklist_store.nx

4840 B103 linesdepth 3pulls 3 transitivereach 7 importersview sourcekind librarytopic blocklist
docsdependenciesstructsconstsfunctions

about

nx_blocklist_store.nx -- the do-not-recover blocklist on the sovereign seg_store (NOT a TSV). Modeled on nx_app_store. Append-only / immutable: each entry is a record under key "bl:<id>"; status changes (pending -> approved -> retracted) are NEW versions, so the full SUPERVISED history is preserved by construction (additive law) and tamper-evident by content-address. A "__blidx__" index record (newline-separated ids), advanced in the SAME commit, enumerates the whole list atomically. PENDING BY DEFAULT: bl_put writes status=pending and does NOT block; only an operator approve flips it to approved. Record (tab-separated): dhash_hex16 <TAB> threshold <TAB> category <TAB> authority <TAB> date <TAB> ref <TAB> status license_tier: ORIGINAL

dependencies 1 imports · 4 importers

nx_seg_store.nx nx_blocklist_store.nx nx_blocklist_seed_demo.nx nx_blocklist_store_gate.nx nx_blocklist_view.nx nx_recovery_guard.nx

imports: nx_seg_store.nx

imported by: nx_blocklist_seed_demo.nxnx_blocklist_store_gate.nxnx_blocklist_view.nxnx_recovery_guard.nx

structs

none

consts

10const BL_MAGIC_1048576: i64 = 1048576
12const BL_PREFIX: *u8 = "knowledge/blocklist-" as *u8

functions

14func bls_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[off+i]=s[i]; i=i+1 } return off+i }
15func bls_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: bl_put_pfx
17func bl_key(kbuf: *u8, id: *u8) -> i64
called by 2: bl_put_pfxbl_get_pfx calls 1: bls_cat
25func bl_id_present(buf: *u8, n: i64, id: *u8, idlen: i64) -> i64
called by 2: bl_put_pfxmain
40func bl_put_pfx(prefix: *u8, id: *u8, record: *u8, reclen: i64) -> i64
65func bl_get_pfx(prefix: *u8, id: *u8, ptrout: *i64, lenout: *i64) -> i64
72func bl_index_pfx(prefix: *u8, idxbuf: *u8) -> i64
82func bl_set_status_pfx(prefix: *u8, id: *u8, status: *u8) -> i64
99func bl_put(id: *u8, record: *u8, reclen: i64) -> i64 { return bl_put_pfx(BL_PREFIX, id, record, reclen) }
called by 1: main calls 1: bl_put_pfx
100func bl_get(id: *u8, ptrout: *i64, lenout: *i64) -> i64 { return bl_get_pfx(BL_PREFIX, id, ptrout, lenout) }
called by 1: main calls 1: bl_get_pfx
101func bl_index(idxbuf: *u8) -> i64 { return bl_index_pfx(BL_PREFIX, idxbuf) }
calls 1: bl_index_pfx
102func bl_approve(id: *u8) -> i64 { return bl_set_status_pfx(BL_PREFIX, id, "approved" as *u8) }
103func bl_retract(id: *u8) -> i64 { return bl_set_status_pfx(BL_PREFIX, id, "retracted" as *u8) }