Drop #1741780
420
PART 2 of 7 — contract and its docs 2.1 Compiler: the pinned solc 0.8.37 has known bugs on Solidity's official list; none changes this contract; the docs do not record the check. (run) foundry.toml pins 0.8.37 with the optimizer on and viair off. Solidity's bugsby_version.json lists four known bugs for 0.8.37. Two were fixed in 0.8.38 and 0.8.39 (YulOptimizerKnowledgeBaseStaleBookkeeping, low; OverlappingRecursiveStorageStructCopyCorruption, medium). The other two need ABI coder v1 or via-IR, which this build does not use. Run: the registry built with 0.8.38 and with 0.8.39 (in throwaway copies, with only the compiler version pins changed) gives runtime code and constructor code byte-identical to the 0.8.37 build, apart from the 53-byte metadata trailer. So the two fixes do not touch this contract's code. By reading, src/ also has no recursive struct, and the three assembly blocks in SSTORE2.sol all use Solidity variables. Suggestion: one sentence in docs/development.md or docs/security/ saying the pinned compiler was checked against the known-bug list, and how. docs/security/slither-triage.md:14-18 speaks only of the interfaces' ^0.8.4 range. 2.2 docs/gas.md: the first-release estimate is for an older, much smaller catalog. gas.md:5-6 says the Museum's first release, deployment included, "comes to an estimated 104 million gas". gas.md:120-139 shows the basis: about 525 records at Museum commit 3926d78f, and "about 8 transactions". The catalog on the Sepolia registry now has 3,476 subjects (docs/deployments.md:355). A first release of that catalog on a new registry carries each subject once, at version 1, as release 1 of the beta.3 registry did (deployments.md:3-5). With gas.md's own Osaka figures (154,000 to 223,000 gas per new subject) that is about 535 to 775 million gas, plus about 12 million for deployment, registrations, open and seal (gas.md:130-131): 5 to 7.5 times the stated figure, about 0.55 to 0.8 ether at 1 gwei and 5.5 to 8 ether at 10 gwei. Publishing the 938 later versions as well would add about 110 million. The transaction count grows the same way. gas.md was re-measured on 4 December (:27), but :5-8, :120-139 and :184 still use the old count. 2.3 No page states the largest schema document one registerSchema call can store on mainnet. (run) registerSchema stores the document on chain in one call (ProvenanceRegistry.sol:246-254, :268). docs/gas.md:74 measures a 21,984-byte document at 4,896,632 gas (about 223 gas per byte, :135), and :52 names the 16,777,216 gas cap per transaction. Run: a binary search under that cap, with the transaction's own data cost modelled, gives about 72,570 bytes as the largest document for a direct call (less through a Safe). test/Registries.t.sol:226-236 registers 70,000 bytes with no gas limit, so it does not show the bound. 2.4 Small doc lines docs/testing.md:14 says "The full suite runs 211 tests". Run: 216 pass (the 4 Safe fork tests are skipped without FORKRPCURL). docs/integrators.md:328 says "While the repository is private, forge install needs a GitHub account with access to it." The repository is public. docs/deploying.md:152: the command block sets CHAIN_ID=11155111, while :145-146 says the value is 1 for mainnet. A copied block would name Sepolia; the script's own chain check then stops a mainnet run, so this is a convenience point only. docs/deploying.md:89-106 (step 2) checks the owner Safe with getOwners() and getThreshold() only. A Safe can also be moved by an enabled module, and its guard and fallback handler change what it does. The step does not ask to read them (for example getModulesPaginated), and no other page in the contract or toolkit repository does. docs/design.md:43 gives the deployment as 5,222,404 gas, the figure of the previous build; docs/gas.md:40 says 5,226,726. 2.5 Can the registry get stuck for good on mainnet? Not found. (run) A separate read looked only for permanent states: every external function's gas growth against the 16,777,216 cap, every counter at its maximum, every one-way state a publisher key can cause, and anything in the bytecode that depends on the chain. Result: no state reachable by the owner or by a publisher key makes a needed owner action impossible, and every read keeps a bounded-cost path (findCurrent where current grows). Every loop that grows has a piecewise path, and the docs already name each one. Run: with 1,100 live versions deleteSubject does not fit under the cap; two deleteVersions halves and then deleteSubject do. With 8,999 deleted versions above one live version, current and deleteSubject do not fit; deleteVersion(1) then deleteSubject, and findCurrent in pages of 1,000, do. Run: an opcode scan of the runtime code finds no CHAINID, CALL, DELEGATECALL, SELFDESTRUCT, CREATE2 or transient storage; it uses PUSH0 (Shanghai) and MCOPY (Cancun), which mainnet has. Doc points from that read: docs/gas.md:68-71 were measured with a zero reason digest (test/Gas.t.sol:148, :168, :189, :230). A real deletion carries a digest and writes one more word. Run: deleteVersion costs 117,625 gas with a zero digest and 137,525 with a real one, so :68 and :71 rise by about 19,900. No batch size or cap is affected. docs/gas.md:93-100 gives a figure only for the plain version shape (about 930 versions per call) and says a label or an Arweave ID means fewer (:99-100). Run: for the largest shape a publisher can write (64-byte CID, Arweave ID, 256-byte label), deleteVersions costs 74,856 gas per version, about 224 versions per call. One more table row would say it. docs/publishing.md:135-137 says: revoke the key, then seal its release. It does not say that the revocation should be its own Safe transaction. Run: if revoke and seal go in one batch and the key adds a record first, the seal reverts on the count and takes the revocation with it; setPublisher alone lands whatever the key does. 2.6 Earlier notes, status Fixed since the earlier rounds: the freeze at block time 0 (ProvenanceRegistry.sol:959-964); the UnchangedRecord NatSpec (IProvenanceRegistry.sol:410-411); the owner can correct a subject's record type after a wrong first version (rule PUB-6). Documented since: a transaction's input can decode differently from what the registry stored, so integrators read state and events (docs/integrators.md:274-286). Changed in part (round 2, point 1(b)): each release now records sealedBy beside openedBy, so a reader can filter releases a key opened or sealed. The header such a key wrote (label up to 256 bytes, manifest CID and hash, root CID, Arweave ID, source commit) still can never be changed or cleared, also after the key is revoked (run), and SECURITY.md's stolen-key rows (:58-60) still do not say so. Unchanged, all harmless wording: mutation-triage.md:29 (the 1/64 gas reason); specification.md:135 AUT-4 (a caller without the role gets NotOwner / NotPublisher before RegistryFrozen); IProvenanceRegistry.sol:599-600 ("is not listed here"); specification.md:163 RD-1 (the second sentence is about single-version reads); the rule rows AUT-2 and DEL-4 are still shorter than the error NatSpec.
