Skip to content

fix(forge): reset gas snapshot baseline - #16945

Merged
mattsse merged 1 commit into
masterfrom
fig/snapshot-gas-reset
Sep 20, 2026
Merged

mattsse merged 1 commit into
masterfrom
fig/snapshot-gas-reset

Conversation

@figtracer

Copy link
Copy Markdown
Member

Reset the gas baseline whenever a snapshot window starts so later startSnapshotGas/stopSnapshotGas pairs exclude work performed between windows. Add a regression comparing identical back-to-back windows and a third window after unrelated contract creation and storage writes.

Fixes #16941.

The implementation, regression test, and PR text were authored with Codex assistance.

Reset the previous gas sample when starting each snapshot window so gas spent between windows is excluded. Cover repeated identical windows with unrelated work between them.

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mattsse
mattsse merged commit a6755e6 into master Sep 20, 2026
24 of 26 checks passed
@mattsse
mattsse deleted the fig/snapshot-gas-reset branch September 20, 2026 05:47
@github-project-automation github-project-automation Bot moved this to Done in Foundry Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

startSnapshotGas: every window after the first includes the gas spent between windows

2 participants