04Sheet 04.03 · Hazards

Layer B: Values and encodings

Every hazard in layer B of the registry, each with its evidence and the test the corpus holds or will hold for it.

Asset ordering, map keys that collide, amounts past 2⁵³, wide integers, invalid UTF-8, maximum lengths and nesting depth: values that change, or break, when they are converted or decoded.

H-B1in the corpusconformance
Asset ordering by strkey text instead of XDR bytes
TestAPI vectors (exist); a pool whose issuers sort differently by text and bytes, as a real ledger: c-base pool-issuers-sort-differently-by-text-and-bytes
H-B2in the corpusconformance
ScMap keys that collide after native conversion
TestAs value S19 (shipped), as key S20, in events, return value
H-B3in the corpusconformancereplay probe
Amounts: int64 max, precision beyond 2^53, float conversion
Evidencestellar-etl#454; js #1785 (offer id > 2^53)
TestTrustline limit i64::MAX C9/S5; balances > 2^53 stroops: c-base create-whale-1e9-xlm, payment-above-2-pow-53-stroops; offer ids above 2^53 (API vector)
H-B4in the corpusconformancereplay probe
Wide integers (u128/i128/u256/i256), timepoint, duration at extremes
EvidenceSoroban token amounts are i128 (stellar-etl#454)
TestEvery type at min/max: s-base scval-every-number-and-time-type; boundaries where a signed reading of the low 64 bits goes wrong (i128 2^63, -2^63, -1; u256 2^127; timepoint 2^63): scval-wide-integer-boundaries; a SAC balance held by a contract above int64 max: sac-mint-to-contract-beyond-int64
H-B5in the corpusconformanceguidereplay probe
Bytes that are not valid UTF-8 in "string" fields
Evidencejs-stellar-sdk#1823; core output becomes invalid JSON (R08)
TestMemo text C26 + mainnet M:memo-text-non-utf8; ScString S28; manage-data binary C24 + mainnet; home domain and data name cannot hold non-ASCII: core requires printable ASCII (SetOptionsOpFrame.cpp:320, ManageDataOpFrame.cpp:115, util/types.cpp isStringValid)
H-B6in the corpusconformance
Maximum lengths (VecM limits), and one past them
Evidencers-stellar-xdr#581, #598
Test20 signatures + 32-byte symbol S26; 64-byte data value C24; 32-byte home domain C8; 28-byte memo C26; 100 operations c-base operations-100-muxed-ids; max signers 20 S25; over-length as lane S (SDK only), planned in B5
H-B7in the corpusconformancelinterreplay probe
Nesting depth: auth trees, nested ScVal; caps that fail the ledger
Evidencewallet-backend#820; R03 depth ladders
TestAuth depth 6 S21, 245 S22, 246 S23; nested ScVal ladder (API vectors exist); a contract deploy whose auth root carries a 245-deep chain (the walk patched for #820 runs only when an instance is created): s-base deploy-with-auth-tree-depth-245
H-B8conformance
Non-canonical encodings decoders disagree on
Evidencers-stellar-xdr#622 / stellar-core#5509 (bool word 2), js-xdr#165 (float discriminants)
TestLane S synthetic vectors, SDK-only todo
H-B9in the corpusconformancereplay probe
Alphanumeric-12 asset codes; codes like "xlm"
TestAlphanum-12 C9, C11, C14; mainnet M:alphanum12-asset; issued "xlm" code c-base trust-issued-xlm-code, payment-issued-xlm-code
H-B10in the corpusconformance
JSON number vs string for 64-bit values
TestCovered by facts on 64-bit fields (exact strings)
H-B11in the corpusconformanceverify facts
Offer price edges: Price{n,d} at int32 extremes; prices as floats
TestmanageSellOffer at n = 2^31−1/d = 1 and n = 1/d = 2^31−1
H-B12in the corpusconformanceverify facts
Maximum lengths not yet tested: path<5>, claimants<10>, extraSigners<2>, dataName 64, operations<100>, AllowTrust 12-char code
EvidenceRFP F14 "vectors at their maximum length"
TestOne ledger of vectors at their XDR maximum: path<5> (six offers crossed), claimants<10> with a depth-4 predicate (the core limit, CreateClaimableBalanceOpFrame.cpp:78), extraSigners<2>, 64-byte data name with a 64-byte value, AllowTrust with a 12-character code: c-base vectors-at-maximum-length; operations<100> alone in its ledger (the classic set holds exactly 100 operations): operations-100-muxed-ids
H-B13in the corpusconformance
A valid ledger common decoders cannot read (depth)
Evidencemeasured: stellar-xdr-json WASM fails on S22/S23; Python 512 and Java 200 default depths
Testplanned: the S22/S23 recipe ledgers (s-base auth-tree-depth-245-max, auth-tree-depth-246-trapped) as entries in B4, expected divergences pre-registered in B5
H-B14in the corpusconformancelinter
Recursive delegate signatures (CAP-0071 nestedDelegates)
Evidencecap-index.md:120; randxdr preset
TestCustom accounts that authenticate only by delegation (kit2 __check_auth with delegate_auth): CA1 -> CA2 -> CA3 -> bob, three levels of nestedDelegates in SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES, payload bound to CA1: s-base custom-account-nested-delegates; XP002 recursive types include it
H-B15in the corpusconformancereplay probelinter
SorobanCredentials arms beyond ADDRESS (CAP-0071): ADDRESS_V2 binds the signature payload to the address
EvidenceCAP-0071-02 (SOROBAN_CREDENTIALS_ADDRESS_V2 = 2); measured on s-base address-v2-credentials. Readers that parse credentials as source-account or ADDRESS only, or recompute the payload without the address, fail
Tests-base address-v2-credentials; ADDRESS_WITH_DELEGATES in custom-account-nested-delegates (H-B14)

The hazards come straight from caps/registry.json. A tag says which check will exercise each one: replay probe, conformance, linter, guide or verify facts. In the corpus means an entry already targets it.