-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gas optimization certora (ETH-1626) (#252)
* feat: foundry gas diff * fix: updated workflow file * fix: updated gas report workflow * fix: removed fuzz seed for forge gas diff * fix: added make file driven flow * chore: modified make * chore: testing without piping test output * fix: added fix for the gas-diff workflow * chore: changed the % to report * chore: changed the % to report * chore: changed the gas report name * chore: changed the base to compare to * chore: removed report name * chore: removed report name * chore: added report name * fix: lint * fix: more changes * fix: more changes * fix: fixed removeValidators bug * chore: added more tests * fix: added tests for active operators count * fix: github action correction * fix: limit the fuzzing --------- Signed-off-by: Prafful <[email protected]> Co-authored-by: Mischa <[email protected]>
- Loading branch information
Showing
14 changed files
with
150 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Report gas diff | ||
|
||
on: | ||
push: | ||
paths: | ||
- "contracts/**" | ||
- "lib/**" | ||
- ".github/**" | ||
|
||
jobs: | ||
compare_gas_reports: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
# Add any step generating a gas report to a temporary file named gasreport.ansi. For example: | ||
- name: Run tests | ||
run: forge test --gas-report > gasreport.ansi | ||
env: | ||
# make fuzzing semi-deterministic to avoid noisy gas cost estimation | ||
# due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds) | ||
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }} | ||
MAINNET_FORK_RPC_URL: ${{ secrets.MAINNET_FORK_RPC_URL }} | ||
|
||
- name: Compare gas reports | ||
uses: Rubilmax/[email protected] | ||
with: | ||
summaryQuantile: 0.01 # only display the 10% most significant gas diffs in the summary (defaults to 20%) | ||
sortCriteria: avg,max # sort diff rows by criteria | ||
sortOrders: desc,asc # and directions | ||
ignore: test-foundry/**/*,test/**/* # filter out gas reports from specific paths (test/ is included by default) | ||
base: main # branch to compare against (defaults to current branch) | ||
id: gas_diff | ||
|
||
- name: Add gas diff to sticky comment | ||
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
# delete the comment in case changes no longer impact gas costs | ||
delete: ${{ !steps.gas_diff.outputs.markdown }} | ||
message: ${{ steps.gas_diff.outputs.markdown }} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.