espresso-sequencer
espresso-sequencer copied to clipboard
Improve gas consumption for the `updateHistory` function
As reported by @alxiong
--- using `forge test --gas-report --mt "testCorrectUpdateBench"` with gradually uncommented logic in `newFinalizedState()`----
39.6k for pre-verifier logic
556.8k for verifier
27k for `states[finalizedState] = newState;`
77.6k for `updateStateHistory()` (75k for `stateHistoryCommitments.push()`)
1.9k for `emit NewState()`
Total: ~703k