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.
This PR enhances the coverage of the test-gas test. This test will now measure the L1 and L2 gas usage for all four types of nightfall transaction (deposit, single transfer, double transfer, withdraw) and also for the finalise withdraw. The latter is already covered by the e2e tests, but it uses minimal resources, and so I included it here so that this test provides a complete measure of all gas used.
To use this test locally, you will need to set the environment variable
TRANSACTIONS_PER_BLOCK
to the value that you want to use in the test run. For example:export TRANSACTIONS_PER_BLOCK=32
Do this in both the window from which you start nightfall and the window from which you run the test. Do not forget to set it back to 2 when you have finished (same command as above but with 2, rather than 32) otherwise you'll spend half a day wondering why none of your other tests pass any more. Closing the windows will also work as the export does not persist past logout.
Other than that, the test is completely standard
./start-nightfall -g -s -d
andnpm run test-gas
.