fix(revm): extra return in EIP3155 inspector #563
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Additional RETURN when leaving the subcontext of a CREATE opcode.
The additional RETURN does not disrupt the logic of the subsequent opcodes and so appears
to be confined to the logging apparatus.
Change
Skip the
create_end()
component of the tracer.This results in the omission of the extraneous RETURN from the trace.
Discussion
Setup
To reproduce, the CREATE opcode needs to be logged. See:
Transaction with index 185 in block 17190873 is an example.
Transaction visualisation
This is a visual summary showing what the transaction does (created by filtering/parsing the 3155 trace)
The tranaction creates 5 contracts as follows. The issue is on the return from the CREATE context,
as noted with asterisks
Pattern observed
The pattern is that an additional RETURN opcode is inserted, which does not disrupt the otherwise
correct context depth or gas accounting.
Transaction trace
The transaction is traced with REVM (inspector-3155). The output is filtered for
relevant opcodes and includes the subsequent EVM step for each:
REVM has been modified to include a debug note for clarity to show when the end of the create
operation is reached:
This shows that the created address is being pushed onto the stack:
Full (filtered) transaction trace (without fix):
Effect
The (filtered) trace after the change:
Note the patterns is now: