-
Notifications
You must be signed in to change notification settings - Fork 20.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/vm: Better handling of static mode violation (ErrWriteProtection) #23968
Comments
|
Related observation: at that point in the code, we have both |
I confirmed that with |
As @axic noted, this will change the trace because the "readOnly" will be checked after "memory". |
There's one thing though... IIRC, parity had a consensus issue, related to the order in which they did certain things. A 'forbidden' op was invoked, but with too few stack items. Depending on whether they errored on 'shallow stack' or 'write protected', they reverted back to the wrong scope. As for trace changing, I'm not sure that matters. The differential fuzzers don't care about the wording of the error messages. |
It was this: https://github.com/openethereum/parity-ethereum/pull/6889/files So if the balance was too low, the create/call simply failed. So remained in the same scope, but with a |
|
My comment was also a bit more general, it changes the order of evaluation for these checks. We discussed order-of-evaluation questions as part of EIP-3860 (limit initcode), and found that for most of the cases state tests do not care about it. |
Detection of static mode violation (
ErrWriteProtection
) should be handled by the affected instructions (operation.writes
), not in the interpreter loop:go-ethereum/core/vm/interpreter.go
Lines 207 to 217 in 66ee942
in.readOnly
can be true only whenin.evm.chainRules.IsByzantium
, so the conditionin.readOnly && in.evm.chainRules.IsByzantium
can be simplified.opCall()
,opSstore()
).operation.writes
field.This should land after #23952.
The text was updated successfully, but these errors were encountered: