chore: delete the stale .gas-snapshot - #40
Conversation
`.gas-snapshot` was committed and licensed in `REUSE.toml` as a deliberate artifact, but nothing in CI regenerates it or diffs it, so it drifted silently and cannot be relied on as a gas regression record. The committed file records the chain suite at 1419 gas; CI on `main` at 5c165a8 measures the same test at 1213223. 1419 is what the test costs when `checkDeployedOnSupportedNetworks` returns early on an empty `derived` list, i.e. it was captured before this repo declared any releases. The `Git is clean` job runs `forge script ./script/Build.sol`, `forge build` and `forge fmt` before `git diff --exit-code`; none of those writes `.gas-snapshot`, which needs `forge snapshot`. `rainix-sol-test.yaml` runs `forge test -vvv`, not `forge snapshot --check`. Deleted rather than wired into the currency check: most lines here are fuzzed mu and median values that move with the fuzz seed, so a plain regenerate-and-diff would red PRs at random and a tolerance would have to be wide enough to hide the regressions the file exists to catch. Also drops the now-dangling `.soldeerignore` entry, which named the same deleted file. Closes #36 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe pull request deletes the committed ChangesGas snapshot cleanup
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other · Severity of issue fixed: Low 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI landed. Recording it so the red check is not misread.
PR #39 is the fix for that |
Resolves the `REUSE.toml` conflict: #39 reindented the `path` array from four spaces to two, and this branch deletes the `.gas-snapshot` entry from it. Kept #39's two-space indentation for every remaining entry and dropped only the `.gas-snapshot` line, so the diff against main is the one deletion. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Picks up #39 (pre-commit formatter re-sync) and #40 (stale .gas-snapshot deletion), which is what `rainix-sol / static` was red on: this branch predates the REUSE.toml/.coderabbitai.yaml formatting fix and the job's `pre-commit run --all-files` step reformatted them on every run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Closes #36.
.gas-snapshotwas committed and licensed inREUSE.tomlas a deliberateartifact, but nothing in CI regenerates it or diffs it. It drifted silently and
cannot be relied on as a gas regression record, so it is deleted rather than
wired into the currency check.
What changed
.gas-snapshotdeleted.REUSE.tomlannotation entry removed..soldeerignoreentry removed. This is one line beyond the issue'stext, called out here so it is a decision and not a surprise:
.soldeerignorenamed.gas-snapshottoo, and an ignore rule for a file thatno longer exists is the same dead reference as the REUSE annotation. Say the
word and I will drop it back in.
After this,
grep -rn gas-snapshotover the tree (excluding.git) returnsnothing.
Verifying the diagnosis
The issue's evidence holds, and there is more of it than the issue claims.
Nothing regenerates or checks the file.
rainix-copy-artifacts.yaml(theGit is cleanjob) runs, in order:forge soldeer install,script/build-meta.sh(absent here),forge script ./script/Build.sol,forge build,script/CopyArtifacts.sol(absent),script/build.sh(absent),forge fmt, thengit diff --exit-code. This repo'sscript/holds onlyBuild.solandDeploy.sol, so the three conditional hooks never fire, andnone of the steps that do fire writes
.gas-snapshot-- that needsforge snapshot.rainix-sol-test.yamlends atforge test -vvv, notforge snapshot --check. Confirmed by reading bothworkflows at the rev CI pins,
8657b83b68f41957ab85da91132c3f652c1f32c0.The chain line is stale by a factor of 855. Committed:
CloneFactoryDeployChainTest:testSuitesLiveOnEverySupportedNetwork() (gas: 1419).The green
mainrun 34518046909, head5c165a8, measures:And the cause the issue names checks out from source.
RainDeployVerifyChain.checkDeployedOnSupportedNetworksopens with:so it costs nothing when no releases are declared.
.gas-snapshotwas lastwritten at
dda91a7(2026-08-20). At that commitLibCloneFactoryReleased.releasedSuites()returnednew DeploySuite[](0)andsrc/generated/contained onlycandidate/.dda91a7is an ancestor of0f0d86b, the first release. So the 1419 wascaptured when
derivedwas genuinely empty, before0_1_9,0_1_10and0_1_1existed. Exactly as diagnosed.What a fresh measurement says about the rest of the file
forge snapshot --snap /tmp/fresh.gas-snapshotat this branch's head (chainsuite excluded: it needs RPC secrets not available locally) against the
committed file:
zero-variance line, which is why the file looks current at a glance.
is right that those cannot be called stale on their own.
The remaining three are not fuzz lines at all. They are plain
(gas: N), theyare deterministic, and they are wrong:
testSuitesLiveOnEverySupportedNetworktestEveryFrozenSnapshotIsReleasedtestSnapshotInternallyConsistentAnd one test that runs on
mainhas no line in the file at all:CloneFactoryDeploySnapshotTest:testSupportedNetworksAreFullyConfigured()(75096 gas), inherited from
rain-deploy-0.1.8'sRainDeployVerifySnapshot.The snapshot predates the dependency bump that added it.
So the file is staler than filed: three deterministic lines wrong and one test
missing, not one line wrong.
Why delete rather than wire in
forge snapshotPer the triage decision on the issue. The fresh-measurement result above is the
concrete argument for it: 12 of 28 lines are fuzzed values that move run to run
with no code change, so a plain regenerate-and-diff in the currency check would
red PRs at random, and a
--tolerancewide enough to absorb a μ swinging614794 → 603140 is wide enough to hide the regressions the file exists to catch.
The lines that are genuinely deterministic are already pinned by real
assertions (
testExpectedCodeHash,testDeployAddress,testCandidateReproducesItsDeployment), which fail loudly rather than printinga number.
CI expectation on this PR
rainix-sol / staticwill still be red here, for the reason in #38 and not foranything in this diff:
pre-commit run --all-filesreformatsREUSE.tomland.coderabbitai.yamlon every branch cut frommain. PR #39 fixes that. Thisbranch is cut from
mainas asked, so it does not carry the fix.Because PR #39 also rewrites the
REUSE.tomlpatharray (reindenting it),whichever of the two merges second will conflict there. Mechanical resolution:
2-space indent from #39, minus the
.gas-snapshotline.QA
reuse lint(thelegaljob) passes 36/36 after the deletion, andforge test --no-match-contract CloneFactoryDeployChainTestis 28 passed / 0 failed with.gas-snapshotstill absent afterwards, confirmingforge testneither reads nor rewrites it. The chain suite is excluded locally only because it needs RPC secrets; CI runs it.reuse lint. (1) file absent + annotation KEPT ->reuse lintexit 0, 36/36 - SURVIVES, so nothing in CI catches a dangling REUSE entry and removing it is hygiene rather than a lint requirement; stated plainly rather than claimed as a catch. (2) file PRESENT + annotation removed ->reuse lintexit 1, 36/37, "not compliant" - KILLED, which proves the annotation is load-bearing while the file exists and that the two lines must move together. Baseline (main, both present) is exit 0 at 37/37; this PR (both absent) is exit 0 at 36/36. Each of the four states was asserted on disk before linting, because a first attempt at this matrix mislabelled two rows whengit checkout HEAD -- .failed to delete a path absent from HEAD.forge snapshotre-measuring the same tests now, plus the greenmainCI run 34518046909 at5c165a8for the chain test. The causal explanation comes from readingRainDeployVerifyChain.checkDeployedOnSupportedNetworksand the repo's own git history (dda91a7had zero released suites and onlysrc/generated/candidate/), not from the issue's assertion of it. "Nothing regenerates it" comes from readingrainix-copy-artifacts.yamlandrainix-sol-test.yamlat the pinned rainix rev against this repo's actualscript/contents..gas-snapshotstale, (b) does anything in CI regenerate or check it, (c) delete it with itsREUSE.tomlannotation, or wire inforge snapshot. Covered (a) confirmed and extended - three deterministic lines wrong plus one test with no line at all, where the issue names one; (b) confirmed by reading both workflows; (c) deleted, per the triage decision, with the fresh-measurement fuzz spread as the evidence against the--tolerancealternative the issue itself flags. One line beyond the ask: the.soldeerignoreentry, called out above.🤖 Generated with Claude Code
Summary by CodeRabbit