revm icon indicating copy to clipboard operation
revm copied to clipboard

Add distinct error code for state changes triggered during a staticcall

Open dyedm1 opened this issue 3 years ago • 1 comments

The current behavior when a state change is attempted (through sstore, log, selfdestruct, or create) during a static call is to return the NotActive error code, which refers to something not being supported on the current EVM version.

When encountering this, I found it to be confusing and somewhat inaccurate. I think this specific instance should be given its own error code, StateChangeDuringStaticCall.

dyedm1 avatar Sep 17 '22 03:09 dyedm1

I agree it is both confusing and inaccurate, I missed to change it (and didn't put a lot of thought into it), the proposed change is good and would be included but I am kinda in process of modifying how opcodes are called so this is going to be overwritten soon.

https://github.com/bluealloy/revm/blob/bd8eb6c031509a980b37982addb9a19e1f43017a/crates/revm/src/instructions/opcode/jump_table.rs#L248-L251

I will see to update the proper Return error to the proposed one.

rakita avatar Sep 17 '22 10:09 rakita

Finally introduced here: https://github.com/bluealloy/revm/pull/349

rakita avatar Jan 29 '23 01:01 rakita