CULTURE gas baseline review — 2026-10-03
The committed snapshot was last updated in 357afcaf (2025-10-22). The later arena integration in 3420e56a replaced the fixture and lifecycle: it added JobRegistry provenance checks, ValidationModule calls, participant job IDs, and aggregated result/reward storage. The snapshot still named three removed tests and omitted the replacement tests. It was not a measurement of the current implementation.
This review restores submission, authorization, and deterministic operation-sequence checks, adds ownership/configuration/boundary regressions, and fixes signed-difficulty arithmetic. It does not remove contract behavior to meet an obsolete measurement.
Reviewed scenario budgets
These numbers measure complete Foundry test functions, including mock calls and assertions. They are regression ceilings, not per-transaction gas estimates or a production throughput claim.
| Scenario | Previous ceiling | Current measured gas | Reviewed ceiling |
|---|---|---|---|
| Configure maximum citations | 560,000 | 543,259 | 560,000 |
| Restored deterministic operation sequence | 900,000 | 569,237 | 900,000 |
| Lifecycle with provenance, validation, and result storage | 500,000 | 682,641 | 750,000 |
| Validator misconduct with current participant fixture | 520,000 | 612,935 | 675,000 |
The last two ceilings explicitly increase to cover the existing integrated behavior, with approximately 10% headroom. The Solidity arithmetic fix changes lifecycle cost by only 101 gas relative to the prior reviewed main baseline (682,540); it does not explain the historical mismatch. The bytecode ceilings remain 24,000 bytes, below EIP-170's 24,576-byte limit.
Reproduction
Use Foundry v1.4.4, Solidity 0.8.25, the committed optimizer/viaIR profile, and the frozen pnpm lockfile:
pnpm run test:contracts
pnpm run test:contracts:gas
pnpm run check:budgetsAll fuzz tests still run in test:contracts. Snapshot comparison covers deterministic tests; random fuzz means are excluded from the exact comparison because independent seeds produce different costs. New measurements use pnpm run test:contracts:gas:update and require reviewing the diff and ceilings. Production Foundry output uses out/forge, separate from Hardhat's artifacts. Coverage uses separate out/coverage artifacts so instrumentation cannot replace production bytecode in the budget check.
Gas and coverage evidence does not establish live settlement or production integration. The external contract adapters, deployment configuration, release signing, and end-to-end commissioning remain separate requirements.