Conversation
allow tolerance in snapshot check.
6c6fe5c to
7385dab
Compare
l1-contracts/test/MultiProof.t.sol
Outdated
| ) | ||
| ) | ||
| ); | ||
| // skip blob check if forge gas report is true |
There was a problem hiding this comment.
This and the rollup.t.sol are both pulling from the rollup base. We could instead have a value that is written in the constructor or so to set it up neatly across all of them and not having multiple places needing to go look for env vars? Could also mean that this value is just set in that one place and not even needed in the others which seems nice
There was a problem hiding this comment.
An extra reason for this is that it would be inherited 👀 so we would avoid an issue as just encountered hehe where the ignition ones are using the blobs so it fails because not updated.
l1-contracts/README.md
Outdated
|
|
||
| When your PR is ready for review, run `./bootstrap.sh snapshot` to update the snapshot, then `./bootstrap.sh test` to make sure you're good. | ||
|
|
||
| You can also run `./bootstrap.sh gas_report` to get a gas report for the current state. |
There was a problem hiding this comment.
Think it would be fine to mention the FORGE_GAS_REPORT here. Also we should just have a general note that a bunch of the blob logic is skipped in the gas reports so they are not exact
l1-contracts/README.md
Outdated
|
|
||
| ## Gas snapshots and CI | ||
|
|
||
| CI will run `forge snapshot --check`. This means that as you develop, you should run `./bootstrap.sh snapshot --diff` to make sure you understand the gas cost of your changes. |
There was a problem hiding this comment.
I'm not really sure how much I would care about the gas spent on tests, but more the gas spent on the functions in the contracts. e.g., a test spending 15M gas is not super important for me, but if it is a function that we use that is spending 15M gas that is something that is important
l1-contracts/bootstrap.sh
Outdated
| echo "$hash cd l1-contracts && forge test --no-match-contract UniswapPortalTest" | ||
| # Test the things that fail with --gas-report (due to forge issues) separately | ||
| # need to chain these together, otherwise we get a "bus error (core dumped)" occasionally. | ||
| echo "$hash cd l1-contracts && forge test --match-test \"(testInvalidBlobHash)|(testInvalidBlobProof)\" && forge test --match-contract \"(FeeRollupTest)|(MinimalFeeModelTest)\" && ./bootstrap.sh gas_report check" |
There was a problem hiding this comment.
I think this way of doing it is too convoluted and easy to mess up such that we are not running a bunch of tests.
Also we know that gas-report and test don't behave the same so i would not tempt fate.
Can you run test and then afterwards doing the gas report instead?
There was a problem hiding this comment.
I think the gas report should also run with isolate and force a rebuild to make sure that you got the matching things, otherwise I would expect the diff to mess you up sometimes (it does in this pr actually)
There was a problem hiding this comment.
yes, but we then need to pull it out of here and not run through the parallelize
edit: nevermind- I misunderstood your rebuild comment.
l1-contracts/foundry.toml
Outdated
| mainnet_fork="https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c" | ||
|
|
||
| [fuzz] | ||
| seed = "0000000000000000000000000000000000000000000000000000000000000042" |
There was a problem hiding this comment.
I'm not sure we would generally do that, was thinking only for the gas reporting to not have the checks and such be messed up.
Generally think it is nice for tests and such that seed is not static, sometimes new things come up because of it.
There was a problem hiding this comment.
Ah I didn't see that you could specify --fuzz-seed. Yes for sure. This made me nervous too.
| } | ||
| blobHashes[0] = blobHash; | ||
| vm.blobhashes(blobHashes); | ||
| // https://github.com/foundry-rs/foundry/issues/10074 |
88401df to
f7cf45b
Compare
6901067 to
a3d5df5
Compare
a3d5df5 to
c3e5e47
Compare
* master: fix: filter for empty attestations when pulling from block (#12740) feat: one-way noir sync (#12592) feat(avm): Address derivation gadget (#12721) chore(ci): add workflow dispatch to masternet (#12739) feat: add default accounts (#12734) feat: gas reports and snapshots (#12724) fix(avm): fix vm1 fake proof size (#12733) feat(bb): extend_edges optimization for zero values past end_index (#12703) fix: remove hard coding of constructor for account manager (#12678) git subrepo push --branch=master noir-projects/aztec-nr git_subrepo.sh: Fix parent in .gitrepo file. [skip ci] chore: replace relative paths to noir-protocol-circuits git subrepo push --branch=master barretenberg fix: verify_honk_proof inputs generation in bootstrap (#12457) fix: Patches to cycle_group and cycle_group fuzzer (#12385)
Skips the uniswap test in ci again as we deleted that part by mistake in #12724


Gas Reports
You can run
./bootstrap.sh gas_reportto generate a detailed gas report for the current state and update the gas_report.md file.When running CI or tests with
./bootstrap.sh test, the script will automatically check if gas usage has changed by running./bootstrap.sh gas_report check. If gas usage has changed, the test will fail and show a diff of the changes.If the changes in gas usage are expected and desired:
./bootstrap.sh gas_reportto update the gas report fileNOTE: Our gas reporting excludes certain tests due to Forge limitations:
This is related to this Foundry issue.
This means that we don't report gas for blob validation (currently 50k gas per blob, and we use 3 blobs per propose in production).
If you want to run gas reports directly with
forge, you must use the environment variableFORGE_GAS_REPORT=trueinstead of the--gas-reportflag. The./bootstrap.sh gas_reportcommand does this for you automatically.