privacy-scaling-explorations / zkevm-circuits

https://privacy-scaling-explorations.github.io/zkevm-circuits/
Other
821 stars 841 forks source link

Fix TStore for reverts and in static calls #1811

Closed z2trillion closed 2 months ago

z2trillion commented 2 months ago

Description

The bus mapping TSTORE did not handle the cases where the opcode's effect is revert and the error that happens if TSTORE is called in a static call. This adds tests for those two cases and then fixes the bus mapping.

Type of change

How Has This Been Tested?

Added tests that fail before the bus mapping fixes are applied.

This PR contains:
- [Add failing revert test](https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1811/commits/be4b13dd1251a370456c6ed86f04226af48aea08)
- [Add failing write protection test for TStore](https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1811/commits/18845eb1a5fd624bddb0ac626c22a5d32389ea8f)
- [Handle reverts and write protection failure for TSTORE in bus mapping](https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1811/commits/01050195879550fa68d9abd3d669ffc7b658d3f5)