feat: add gas/s and tx/s throughput metrics to invariant test output#13898
Open
danieljrc888 wants to merge 1 commit intofoundry-rs:masterfrom
Open
feat: add gas/s and tx/s throughput metrics to invariant test output#13898danieljrc888 wants to merge 1 commit intofoundry-rs:masterfrom
danieljrc888 wants to merge 1 commit intofoundry-rs:masterfrom
Conversation
Add throughput metrics (gas/s, tx/s) to invariant test output to support benchmarking tools like scfuzzbench. Metrics are shown in the human-readable test report, inline JSON progress logging, and per-selector metrics table. - Track cumulative gas and elapsed time during invariant campaigns - Add `gas` field to `InvariantMetrics` for per-selector gas tracking - Add `total_gas` and `elapsed` to `InvariantFuzzTestResult` - Add `total_gas` and `elapsed_secs` to `TestKind::Invariant` - Compute and display `gas/s` and `tx/s` in `TestKindReport` display - Add Gas column to invariant metrics table - Extend inline JSON progress with throughput fields - Update snapshot regex to parse new format Closes foundry-rs#13575
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gas/s,tx/s) to invariant test output for benchmarking tools like scfuzzbenchgasfield toInvariantMetricsfor per-selector gas tracking in the metrics tabletotal_txs,total_gas,tx_per_sec,gas_per_secgas/sandtx/sin the human-readable test report lineExample output
Closes #13575
Test plan
TestKindReport::Invariantdisplay (normal, zero elapsed, optimization mode, failed corpus replays)cargo build -p forgepassescargo test -p forge --libpasses (36 tests)