cartesi / rollups-contracts

Smart Contracts for Cartesi Rollups
https://cartesi.github.io/rollups-contracts/
Apache License 2.0
17 stars 37 forks source link

Refactor output validation tests #264

Closed guidanoli closed 2 months ago

guidanoli commented 2 months ago

Closes #266 and #265

guidanoli commented 2 months ago

Gas analysis

It seems that the gas cost of validating (and, therefore, executing) outputs has decreased significantly with these changes. Maybe it has something to do with the fact that we're now calling internal library functions (which translate to JUMP instructions) rather than calling external library functions (which translate to DELEGATECALL instructions, which are more expensive)?

Minimum Average Median Maximum
Before 32662 33509 32687 44163
After 16464 18009 16554 22965
Difference -49.6% -46.2% -49.4% -48.0%
guidanoli commented 2 months ago

I've also broken long lines in CONTRACTS.md so that future diffs (which are often line-oriented) are easier to read.