0xPolygonZero / zk_evm

Apache License 2.0
85 stars 37 forks source link

Fix contract call reversion #709

Closed Nashtare closed 1 month ago

Nashtare commented 1 month ago

Contract creations mark a checkpoint prior deployment, but regular contract calls do not, which can cause discrepancies in final state tries upon reversion if the recipient does not have enough funds to send back the initial txn amount to the sender. This unfortunately wasn't caught with the original Eth test suite because TO targets were always funded enough at the start.

This added checkpoint now makes sure every transfers are being reverted, before sending the initial value back to the initial.

@praetoriansentry 3.5/5

Nashtare commented 1 month ago

I'll add a regression test covering this in the follow-up PR as it needs DDOS protection to run.