Skip to content

gas: stop committing a snapshot nothing regenerates or checks - #259

Open
thedavidmeister wants to merge 1 commit into
mainfrom
2026-09-21-issue-115-drop-committed-gas-snapshot
Open

thedavidmeister wants to merge 1 commit into
mainfrom
2026-09-21-issue-115-drop-committed-gas-snapshot

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #115

.gas-snapshot was a committed forge snapshot output that nothing regenerates
and nothing checks, and it was already wrong. Measured at this branch's base:

$ grep -oE '^[A-Za-z0-9_]+:test[A-Za-z0-9_]*' .gas-snapshot | sed 's/.*://' | sort -u | wc -l
48
$ grep -rhoE 'function (test[A-Za-z0-9_]*)' test/ | sed 's/function //' | sort -u | wc -l
78
$ comm -13 snapshot.txt tests.txt | wc -l   # in the suite, absent from the file
30
$ comm -23 snapshot.txt tests.txt | wc -l   # in the file, absent from the suite
0
$ git log -1 --format='%h %ad' -- .gas-snapshot
9327e9a Mon Aug 24 12:57:57 2026 +0000

30 of 78 test functions are missing — testCheckImplementationCodeSingleByte,
testCloneDeterministicNonceOnlyCollisionReverts, the whole
cloneAndInitialize and ICloneableV2.initialize contracts among them — and
nothing is stale in the other direction, so the drift reads as a smaller suite
rather than as an out-of-date file. That is the harm: a reader treats it as the
record of what the suite costs and what it covers, and it is neither.

Nothing produces or verifies it. Read at rainix @main, which is what this
repo's workflows call: rainix-sol-test.yaml ends at forge test -vvv;
rainix-sol-static.yaml runs no-ignored-tests, no-submodules,
agent-context-cap, frozen-snapshots-append-only (a src/generated/<tag>/
deploy-pin check that no-ops here), mutation-ledger, no-custom-natspec,
slither, forge fmt --check, forge lint -D warnings, pre-commit and
rainix-sol-single-contract. No snapshot step anywhere, and no pre-commit hook
for one. CLAUDE.md and README.md never mention forge snapshot.

The one check that would keep it honest — forge snapshot --check — pins
absolute gas figures, which is exactly what this repo's standing ruling rejects,
since a consumer compiles this library at its own optimizer settings. An
artifact whose only possible enforcement is forbidden should not be committed.

So it is deleted, with the annotation that only existed to license it
(REUSE.toml line 5). .gas-snapshot moves to .gitignore instead: a local
forge snapshot is still useful, it just must not become a committed record
again. Its .soldeerignore line stays, which is how every other generated path
is handled there — /out, /cache, /dependencies, /remappings.txt are all
gitignored and excluded from the package, so a publish from a tree where someone
has run forge snapshot still cannot ship it.

QA

  • Discriminating tests: n/a - deleting an unreferenced artifact. Nothing in
    src/ or test/ reads .gas-snapshot. grep -rn gas-snapshot over the tree
    returns REUSE.toml and .soldeerignore, both handled here, plus
    .audit/scope.json:14, which is a stamp of the file list as it stood at the
    audited commit and is left as the record it is.
  • Mutations applied: n/a - no src/ or test/ change, so there is no behaviour
    to mutate.
  • Oracle: the suite itself. The entry set and the function test* set are
    derived independently and compared with comm, so the staleness figure is not
    a reading of the file.
  • Category check: the issue asks for (A) the stale committed artifact, (B) its
    REUSE.toml entry and (C) its .soldeerignore entry. Covered A,B; C is
    deliberately kept rather than removed - with the file gitignored the entry is
    no longer a dangling reference to a path that cannot exist, it is the same
    belt-and-braces the other four generated paths get, and dropping it would
    leave a publish from a dirty tree able to ship the file.

🤖 Generated with Claude Code

48 entries against 78 tests, last touched at 9327e9a, with no CI or hook that
can ever say so. The one check that would is `forge snapshot --check`, which
pins absolute gas figures. Gitignored so a local run cannot re-commit it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a847d413-141c-409f-86e0-e0286c3abe4e

📥 Commits

Reviewing files that changed from the base of the PR and between 710dff5 and dd065c6.

📒 Files selected for processing (3)
  • .gas-snapshot
  • .gitignore
  • REUSE.toml

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.

This branch has not been deployed

No deployments
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.

[F11] [LOW] .gas-snapshot is a committed generated artifact that nothing regenerates, checks or documents, and it is stale by 30 of 78 tests

1 participant