Skip to content

chore: delete the stale .gas-snapshot - #40

Merged
thedavidmeister merged 2 commits into
mainfrom
36-delete-stale-gas-snapshot
Sep 20, 2026
Merged

thedavidmeister merged 2 commits into
mainfrom
36-delete-stale-gas-snapshot

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Closes #36.

.gas-snapshot was committed and licensed in REUSE.toml as a deliberate
artifact, 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-snapshot deleted.
  • Its REUSE.toml annotation entry removed.
  • Its .soldeerignore entry removed. This is one line beyond the issue's
    text
    , called out here so it is a decision and not a surprise:
    .soldeerignore named .gas-snapshot too, and an ignore rule for a file that
    no 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-snapshot over the tree (excluding .git) returns
nothing.

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 (the
Git is clean job) 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, then git diff --exit-code. This repo's script/ holds only
Build.sol and Deploy.sol, so the three conditional hooks never fire, and
none of the steps that do fire writes .gas-snapshot -- that needs
forge snapshot. rainix-sol-test.yaml ends at
forge test -vvv, not forge snapshot --check. Confirmed by reading both
workflows at the rev CI pins, 8657b83b68f41957ab85da91132c3f652c1f32c0.

The chain line is stale by a factor of 855. Committed:
CloneFactoryDeployChainTest:testSuitesLiveOnEverySupportedNetwork() (gas: 1419).
The green main run 34518046909, head 5c165a8, measures:

[PASS] testSuitesLiveOnEverySupportedNetwork() (gas: 1213223)

And the cause the issue names checks out from source.
RainDeployVerifyChain.checkDeployedOnSupportedNetworks opens with:

if (derived.length == 0) {
    return;
}

so it costs nothing when no releases are declared. .gas-snapshot was last
written at dda91a7 (2026-08-20). At that commit
LibCloneFactoryReleased.releasedSuites() returned
new DeploySuite[](0) and src/generated/ contained only candidate/.
dda91a7 is an ancestor of 0f0d86b, the first release. So the 1419 was
captured when derived was genuinely empty, before 0_1_9, 0_1_10 and
0_1_1 existed. Exactly as diagnosed.

What a fresh measurement says about the rest of the file

forge snapshot --snap /tmp/fresh.gas-snapshot at this branch's head (chain
suite excluded: it needs RPC secrets not available locally) against the
committed file:

  • 13 of 28 committed lines reproduce byte-exactly. These include every
    zero-variance line, which is why the file looks current at a glance.
  • 15 do not. Twelve are fuzzed μ/median that move with the seed -- the issue
    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), they
are deterministic, and they are wrong:

Test (non-fuzz) Committed Measured now
testSuitesLiveOnEverySupportedNetwork 1419 1213223 (CI, run 34518046909)
testEveryFrozenSnapshotIsReleased 16144 220127
testSnapshotInternallyConsistent 454020 1598067

And one test that runs on main has no line in the file at all:
CloneFactoryDeploySnapshotTest:testSupportedNetworksAreFullyConfigured()
(75096 gas), inherited from rain-deploy-0.1.8's RainDeployVerifySnapshot.
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 snapshot

Per 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 --tolerance wide enough to absorb a μ swinging
614794 → 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 printing
a number.

CI expectation on this PR

rainix-sol / static will still be red here, for the reason in #38 and not for
anything in this diff: pre-commit run --all-files reformats REUSE.toml and
.coderabbitai.yaml on every branch cut from main. PR #39 fixes that. This
branch is cut from main as asked, so it does not carry the fix.

Because PR #39 also rewrites the REUSE.toml path array (reindenting it),
whichever of the two merges second will conflict there. Mechanical resolution:
2-space indent from #39, minus the .gas-snapshot line.

QA

  • Discriminating tests: n/a - the diff deletes a file that no code reads and no test asserts on, so there is no behaviour a new test could discriminate. The standing checks stand in: reuse lint (the legal job) passes 36/36 after the deletion, and forge test --no-match-contract CloneFactoryDeployChainTest is 28 passed / 0 failed with .gas-snapshot still absent afterwards, confirming forge test neither reads nor rewrites it. The chain suite is excluded locally only because it needs RPC secrets; CI runs it.
  • Mutations applied: the two halves of the deletion, broken one at a time, against reuse lint. (1) file absent + annotation KEPT -> reuse lint exit 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 lint exit 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 when git checkout HEAD -- . failed to delete a path absent from HEAD.
  • Oracle: independent of the file and of the issue. Staleness comes from forge snapshot re-measuring the same tests now, plus the green main CI run 34518046909 at 5c165a8 for the chain test. The causal explanation comes from reading RainDeployVerifyChain.checkDeployedOnSupportedNetworks and the repo's own git history (dda91a7 had zero released suites and only src/generated/candidate/), not from the issue's assertion of it. "Nothing regenerates it" comes from reading rainix-copy-artifacts.yaml and rainix-sol-test.yaml at the pinned rainix rev against this repo's actual script/ contents.
  • Category check: issue asks (a) is .gas-snapshot stale, (b) does anything in CI regenerate or check it, (c) delete it with its REUSE.toml annotation, or wire in forge 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 --tolerance alternative the issue itself flags. One line beyond the ask: the .soldeerignore entry, called out above.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed the recorded gas measurement snapshot.
    • Updated project file-handling and compliance configurations to no longer reference the gas snapshot.

`.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>
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 8e970a7e-2aec-47c8-9245-287e703ade0f

📥 Commits

Reviewing files that changed from the base of the PR and between 6fb9019 and 5b69cc8.

📒 Files selected for processing (3)
  • .gas-snapshot
  • .soldeerignore
  • REUSE.toml
💤 Files with no reviewable changes (3)
  • .soldeerignore
  • REUSE.toml
  • .gas-snapshot

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The pull request deletes the committed .gas-snapshot file. It also removes .gas-snapshot from .soldeerignore and REUSE.toml.

Changes

Gas snapshot cleanup

Layer / File(s) Summary
Remove gas snapshot and annotations
.gas-snapshot, .soldeerignore, REUSE.toml
The CloneFactory and LibCloneFactory gas snapshot entries are deleted. The .gas-snapshot path is removed from Soldeer ignore patterns and REUSE annotations.

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: deleting the stale .gas-snapshot file.
Linked Issues check ✅ Passed PR #36 requires either a maintained snapshot workflow or deletion of the stale snapshot with its REUSE.toml annotation. The PR deletes .gas-snapshot, removes its REUSE.toml annotation, and remov…
Out of Scope Changes check ✅ Passed The reported changes are limited to .gas-snapshot, .soldeerignore, and REUSE.toml. These changes remove the stale artifact and its related management entries. They directly support the resolutio…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thedavidmeister

Copy link
Copy Markdown
Contributor Author

CI landed. Recording it so the red check is not misread.

rainix-sol run 35509302483 on this branch:

  • legalsuccess. This is the check this diff actually puts at risk:
    reuse lint after the REUSE.toml annotation is removed. It passes.

  • testsuccess, including CloneFactoryDeployChainTest, which I could
    not run locally (RPC secrets).

  • staticfailure, and it is the rainix-sol / static is red on every PR from pre-commit formatter drift #38 drift verbatim, not this diff:

    prettier-rainix..........................................................Passed
    taplo....................................................................Failed
    - files were modified by this hook
    yamlfmt..................................................................Failed
    - files were modified by this hook
    

    with the shown diff touching .coderabbitai.yaml and REUSE.toml — the same
    two hooks and the same two files as the pre-existing failure on main and on
    PR test: cover the deploy declaration's metadata #37. slither ., forge fmt --check and forge lint -D warnings all pass.

Git is clean (run 35509302421) is also green, which is the direct check that
deleting .gas-snapshot leaves nothing for the currency job to regenerate —
consistent with no CI step ever having written it.

PR #39 is the fix for that static failure; its own rainix-sol run
(35508706625) is green on all three jobs, static included.

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>
@thedavidmeister
thedavidmeister merged commit 3c19a6a into main Sep 20, 2026
5 checks passed
thedavidmeister pushed a commit that referenced this pull request Sep 20, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.gas-snapshot is stale and no CI job regenerates or checks it

1 participant