Drop #1741781
420
PART 3 of 7 — toolkit 3.1 After any deletion, examples/verify-release.mjs prints NOT OK for that release from then on. (run) Run, on a local Anvil fork of the Sepolia registry (nothing sent to a real chain): one version of release 4 was deleted as the owner, then RELEASE=4 node examples/verify-release.mjs printed "versions: 12 of 13 match their digest, canonical form and CID", "issue: sequence 4414: The version has no CID or Arweave ID, and no fallback URL was given." and "NOT OK: release 4 checked, of the registry's 4", exit 1. The same check of release 4 against the live registry (with --files) printed OK. The script fetches every version of the release (examples/verify-release.mjs:141, :146-160). A deleted version has no CID and no Arweave ID in state, so fetchContent throws "The version has no CID or Arweave ID, and no fallback URL was given." (src/fetchContent.ts:352-363). That becomes an issue, and "good" needs matches === recordCount (:204-211). The manifest check in the same script already treats a deleted version as expected (src/reconcile.ts:376-382, "unavailable", ok). Only the per-version loop does not. The README section "Check the live release yourself" and the script's header (:25-27) do not say that a deletion turns the result NOT OK. Deletion is a normal owner action (a takedown, a correction), so the public check would fail for good after the first one. 3.2 The Python signature checker accepts a COSE protected header whose alg label is the CBOR value true instead of the integer 1. (run) profile/tools/prv/sig.py:289-290 lets any map key through that is not a list, map or tuple, although its own error text says "a map key that is not a unique integer or string". :590 reads protected.get(1); in Python True == 1, so a header {true: -8} returns -8. The bool guard at :591 checks the value, not the key. profile/docs/signature-schemes.md:264-265 says a missing protected alg makes the signature invalid, and :6 says two readers give one record the same verdict. COSE labels are integers or text strings (RFC 9052), so true is not label 1, and a reader that keeps CBOR types apart finds no protected alg. This needs a real signature by the named key over those exact bytes, so nobody can forge anything with it. It is a consistency point: the checker says "valid" where the spec says "invalid". The self-test cases (profile/tools/check.py:1601, :1630-1633, :1647-1651) have no bool or null key. A fix can test type(k) in (int, str); isinstance(k, (int, str)) alone is not enough, because isinstance(True, int) is true. Related, smaller: sig.py:484 reads the JWS header and clientDataJSON with plain json.loads, so with a duplicate member name the last one wins (run). profile/docs/signature-schemes.md:230-246 does not say what a duplicate header name means; the strict parser at check.py:129-133 already exists. 3.3 One read call can carry up to 5,000 versions, more than the 50 million gas the toolkit's own comment names as the endpoint's limit. (run) src/read.ts:15-16 and :47-54 send 100 calls per Multicall3 call ("The public Sepolia endpoint caps a call at 50M gas") with batchSize 0 (:52), which viem 2.58.6 never splits. src/registry.ts:497, :583-588 fills those calls with getVersions pages of up to 50 versions, and flushes only at 100 calls or 5,000 versions; src/reconcile.ts:269-275 does the same for subjects of up to 50 versions. Run: getVersions for 50 plain versions costs 908,907 gas (18,178 per version). 100 such pages in one call used about 190 million gas through a stand-in aggregator and failed with 50 million. Even without the aggregator's own cost, 5,000 versions are about 91 million. It does not show today because the Museum's subjects have one to three versions. It starts when one multicall averages about 27 versions per call, and fewer once the aggregator's own cost is counted: many subjects with long histories, or one subject that a careless or stolen key filled with a few thousand versions. readAllVersions and the reconcile path do not let a caller lower the page size (iterateAllVersions can, through maxVersionsPerYield). The contract's reads stay answerable in smaller pages, so this is a toolkit fix that can ship at any time. 3.4 Stale sentence: docs/verifying.md:328-329 says "Both releases of the Sepolia Museum registry name the same raw index, so the dag-pb check has run only in the unit tests." README.md:55-73 shows four releases, each with a dag-pb index verified live (run: the same here). 3.5 Earlier notes, status Fixed: $ patterns in the subject template (src/recordsImport.ts:365); exportForScript now validates the plan (src/senders.ts:394-395); the CI ABI check against the contract repo (.github/workflows/ci.yml:45-58); the redirect and JSON-depth points in fetch_release.py; the file-index CID text check of the Python checker (profile/tools/check.py:2272); the exports' points M1-M4 and L3. Not changed: examples/verify-release.mjs:77 prints "build unknown" and still ends OK; src/governance.ts:473, :489 treats an unknown build as a problem. src/actions.ts:135 shows the signer 10 hex digits of the subject ID in delete actions (:152-156). docs/publishing.md:187-188 says a sender "resolves when it is mined"; only eip1193Sender checks the receipt status (src/senders.ts:262), a callbackSender result is recorded as mined as it is (src/publish.ts:455-471). profile/tools/check.py:717-732 compares the signed claim with the record's kind, but still not the record's about with the statement's. profile/docs/attestations.md:63-65 does not say that v may be 0, 1, 27 or 28 (profile/tools/prv/crypto.py:219-222). profile/docs/conformance.md:306 lists the envelope under SUBJECT_PREIMAGE; an envelope record type outside the pattern gets ENVELOPE first (check.py:502, :848-849). src/locations.ts:86 does not check the type of pointer. Also unchanged from the 30 November notes, all small: L1 (docs/publishing.md:270-272, "never sent twice", for a subject listed twice in one release), the date half of L4 (src/premis.ts:511-515, an open-start validity gets no dates), L6 (src/lido.ts:177, a superseded creator becomes an actor with an empty name), L7 (src/linkedArt/vocab.ts:43-44, :75-77, ISO 639-3 language tags), W3 (src/publish.ts:150 and src/dryrun.ts:22-23, the wording on simulating the seal) and, narrowed, W9 (examples/verify-release.mjs:180, the reason is lost when every fetch of a file index fails).
