-
Notifications
You must be signed in to change notification settings - Fork 3
Proper treatment of YUL's invalid() in resolc/PVM #206
Copy link
Copy link
Closed
paritytech/polkadot-sdk
#10849Labels
PVMProblem occurs at the execution stage for PVMProblem occurs at the execution stage for PVM
Description
The semantics of YUL's invalid() is the semantics of the INVALID opcode, which reverts the current call and consumes all available gas.
This works correctly when compiling to EVM and executing with our EVM backend. But it does not work with resolc/PVM.
Expected Behavior
When compiling to PVM via resolc, then contract should end up calling the consume_all_gas host function. This function will ensure that all available gas in this frame is consumed.
Actual Behavior
When compiling to PVM and executing on pallet-revive, not all available gas is consumed.
Additional Bonus
This will allow us to un-ignore the call_invalid_opcode test. These tests work correctly in the cases "solc->solc" and resolc->solc" but not in the cases "solc->resolc" or "resolc->resolc".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PVMProblem occurs at the execution stage for PVMProblem occurs at the execution stage for PVM