registry/trie

What the trie refuses for an edge, read off the trie itself (#177, #183).

Responsibility

The named refusals a fold raises when the leaf an edge needs is not the leaf the trie binds: terminalFault for a retirement (updateTerminal), registration refuses every occupied key. Each is the one construction site of its reasons, so a test asserting a reason asserts the value the validator traces. An insert on a key the trie already binds keeps its construction site in lib (occupiedRefusal, key-exists).

Dependencies

Imports the Merkle Patricia Forestry library and lib (the edge table’s leaf bytes). Imported by registry/fold, which decides when to ask, and by the Aiken suite. It knows nothing of requests, duties or values.

Assumptions

Invariants

Functions

terminalFault(
  trie: MerklePatriciaForestry,
  key: ByteArray,
  proof: mpf.Proof,
) -> Option<String>

Why the trie refuses this updateTerminal, or None when the leaf it binds is the Active one the edge moves (#177 I177-CHAIN).

The subject is the leaf the trie ACTUALLY binds — established here, against this request’s own proof, with the MPF library’s own TOTAL checks. miss and has answer for every input instead of crashing, so a wrong leaf becomes an attributable refusal rather than a death inside mpf.update, which says only that the script died.

It is NOT a leaf the request states — edge-only requests state none: a claim by the requester says nothing about the trie.

One construction site, so a test asserting a reason asserts the value this validator traces rather than a helper nothing calls (#173 A-006, applied to this edge). The names are Lean’s, from update_terminal_transaction_row.

None is the residue, and it is also where an INVALID proof lands: a proof matching no root matches none of the three checks either. That case then dies in mpf.update exactly as it does on every other edge. The three leaves Lean names are what this classifies.

Search Document