-
Notifications
You must be signed in to change notification settings - Fork 118
Description
Problem
In the current precompile implementation, journals are recorded after logic execution rather than before, unlike in go-ethereum, which causes revert failures during errors—a fundamental issue that was patched by forcing immediate reverts, though it deviates from Geth VM’s intended behavior.
Closing criteria
- pass all test cases without using
RunAtomic()method. - pass all test cases without immediate revert for
OutOfGaserror inHandleGasErrormethod.
Problem details
-
In the original go-ethereum code, when a contract call fails, it processes a revert by traversing the journals that were recorded during the execution. [ref1][ref2] Therefore, journals are written before the logic is executed. [ref3]
-
However, in the current precompile implementation, journals are recorded after the logic is executed.[ref4] As a result, if an error occurs during execution, there are no journals to revert, which is the root cause of the previously reported vulnerability.
-
For now, the vulnerability has been patched by triggering a revert immediately upon precompile logic failure.[ref5] However, this approach is not natural from the perspective of how the Geth VM is designed to function.