GeezerVison is showing github.com — feat(hf4): signed archive intake verifier by liqdmetal · Pull Request #142 · DEROFDN/derohe
Conversation
liqdmetal
commented
Oct 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Purpose
Production intake for community-supplied HF4 supply archives. This is the gate
that turns a submitted archive into evidence the checkpoint can use: canonical
signed manifest, hashed block/body catalogs, content-addressed transaction
bodies, full genesis-to-anchor coverage, and exact pairwise agreement between
independently pinned sources.
It implements the archive format described in
docs/hf4-supply-checkpoint.md (#138) and is complementary to the HF4
consensus/supply work in #139.
One commit
This PR is one signed commit (10 files, +2,357) so it can be reviewed, tested,
or cherry-picked as a unit. It supersedes #140 and #141; the fork blocks
force-push, so a fresh branch was required to present the final tree as a single
commit. No code was dropped in the process.
What it adds
hf4archive/ — standalone verifier package:
- canonical manifest decode with unknown-field rejection
- Ed25519 signature verification over the exact manifest bytes
- SHA-256 catalog checks and content-addressed body verification
- strict topo/transaction ordering, full prefix coverage, duplicate and
omission rejection
- genesis and anchor block hashes tied to the signed manifest
- safe identifier charset and credential/private-endpoint rejection
- pairwise agreement with distinct source, operator, and signing key
cmd/hf4-archive-verify/ — verify-one, verify-pair, canonicalize,
template
docs/hf4-evidence-intake.md — submission format, signing commands, review
checklist, and explicit limits
docs/hf4-evidence-index.md — accepted-archive index (currently empty)
.github/workflows/hf4-intake-ci.yml — build, vet, tests, race, CLI smoke,
gofmt
Verification
Run on this branch:
go test -count=1 ./hf4archive/ — 42 test functions / 45 cases pass
go test -race -count=1 ./hf4archive/ — ok
go vet ./hf4archive/... ./cmd/hf4-archive-verify/ — clean
gofmt -l hf4archive/*.go cmd/hf4-archive-verify/*.go — clean
go build ./... — passes
- Fuzz targets, no crashes:
FuzzDecodeStrictJSON — 2,205,017 execs (10s)
FuzzScanArchiveJSONL — 778,053 execs (10s)
FuzzValidateEndpointLabel — 4,535,834 execs (10s), plus 3,251,246 execs
after the endpoint-bypass fix (5s)
- CLI:
verify-one and verify-pair on two independently signed fixtures → exit 0
- tampered body file → exit 1 with a size/SHA failure
- missing
-anchor-topo → exit 2
Hardening
- Reject duplicate block hashes across the catalog.
- Bind the topo-0 and top-of-range block hashes to the signed genesis/anchor IDs.
- Restrict archive/source/operator IDs to a safe ASCII charset.
- Reject private/internal endpoint hosts, URL userinfo, and credential query
parameters.
- Reject protocol-relative URLs, bare
host:port labels, numeric host forms
(decimal, dotted-short, and hex), trailing-dot hosts, and private ipfs/ipns
hosts.
- Reject credential-like strings in the collection command.
- Require
-anchor-topo explicitly instead of defaulting to zero.
- Cap
canonicalize input at the 1 MiB manifest limit.
- Hash and scan the same open descriptors to avoid a path-swap window.
- Require manifest, signature, and body files to be regular non-symlink files.
- Enforce LF-only JSONL, exact row order, full body coverage, and per-body size
and hash checks.
What this does not do
- Does not compute a supply total or make a tokenomics claim.
- Does not set or propose an activation height.
- Does not prove operator independence or archive truth; those remain human
review decisions.
- Does not change consensus, wallet, DVM, or node behavior.
Review notes
- Trust pins (source ID, operator ID, signing key, anchor tuple) are supplied
out-of-band, never read from the bundle.
- A valid signature proves possession of the key, not honesty.
- The pair gate requires distinct source/operator/key and byte-identical
blocks.jsonl and bodies.jsonl.
- The verifier is deliberately limited to integrity and agreement; replay,
supply accounting, and restoration eligibility are separate steps.
Follow-ups
- Publish and approve the mainnet anchor tuple.
- Add a reference collector or operator export recipe.
- Run a WAN pair from genuinely independent operators.
- Record accepted summaries in
docs/hf4-evidence-index.md.
Section mode
Archives may now cover an approved checkpoint-to-anchor section instead of
genesis. A section sets first_topo_height > 0, adds start_block_id and
start_state_root, and omits genesis_block_id. The CLI takes -first-topo,
-start-block, and -start-state-root in place of -genesis-block. Full
genesis prefixes are unchanged, and mixed genesis/section fields are rejected.
A section is only as trustworthy as its start checkpoint; it does not establish
total supply before that checkpoint. Real mainnet check: heights
7,813,860-7,813,870, 11 blocks, 5 transactions, 38,477 body bytes, accepted by
verify-one and verify-pair; a tampered body was rejected.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add a standalone verifier for the HF4 supply-archive bundle format: canonical signed manifest, hashed block/body catalogs, content-addressed transaction bodies, full genesis-to-anchor coverage, and exact pairwise agreement between independently pinned sources.
Includes the CLI (verify-one, verify-pair, canonicalize, template), 42 test functions (45 cases) plus 3 fuzz targets, intake documentation and evidence index, and CI.
Hardening: duplicate block hashes, genesis/anchor block binding, safe identifier charset, credential/private-endpoint rejection (userinfo, query credentials, protocol-relative URLs, host:port labels, numeric forms, trailing dots, private ipfs hosts), explicit anchor height, canonicalize size cap, and same-descriptor hashing.
This does not compute supply, set an activation height, or prove operator independence.
This was referenced Oct 26, 2026
Sections may start at an explicitly approved checkpoint instead of genesis. The verifier requires start_block_id and start_state_root when first_topo_height is non-zero, rejects mixed genesis/section fields, and keeps full-prefix archives byte-compatible.
Adds 11 section tests covering start-checkpoint mismatch, missing fields, mixed fields, gaps, pair agreement, and pair start-state mismatch. Documents the trusted-start model and its supply limitation.
|
Section mode added in 8689e77.
- Sections:
first_topo_height > 0 plus approved start_block_id and start_state_root; genesis_block_id omitted.
- Genesis prefixes unchanged; mixed genesis/section fields rejected.
- 11 new tests; package and race suites green.
- Real mainnet section 7,813,860-7,813,870: 11 blocks, 5 transactions, 38,477 body bytes;
verify-one and verify-pair pass, tampered body rejected.
- Trust boundary: a section is only as strong as its approved start checkpoint and does not establish total supply before it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Adds cmd/hf4-archive-collect: JSON-RPC collection, canonical catalogs, content-addressed bodies, section and genesis modes, approved start/anchor checks, and a signed manifest. Verified on a real mainnet section; blocks.jsonl and bodies.jsonl match the existing fixture byte-for-byte.
|
Reference collector added in 6e2bbb0 (cmd/hf4-archive-collect).
- Section and genesis modes, approved start/anchor checks, streaming catalogs, content-addressed bodies, signed manifest.
- Real mainnet section 7,813,860-7,813,870: produced
blocks.jsonl and bodies.jsonl byte-identical to the tested fixture; verify-one passes.
- Docs:
docs/hf4-archive-collection.md; CI now builds/vets/gofmts the collector.
RFC for community collection and review: #143. Candidate anchor is in the RFC; it is not approved and needs a third state-root confirmation.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|