Skip to content

Proper treatment of YUL's invalid() in resolc/PVM #206

@TorstenStueber

Description

@TorstenStueber

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".

Metadata

Metadata

Assignees

Labels

PVMProblem occurs at the execution stage for PVM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions