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.
Draft, for @sorpaas review.
Motivation
Current design provides one entry point per context type -
transact_create
,transact_create2
,transact_call
- that trigger the recursive execution of all opcodes in theRuntime
to finally capture theExitReason
.This works but does not allow stepping the EVM. To enable tracing, we need some sort of interface that allows capturing the state between opcode executions. There is currently another proposal from @nanocryk (imo better one, the only one until now that is purely readonly), this is just an alternative approach so we can evaluate the pros and cons of each one.
This PR proposes decoupling
call_inner
andcreate_inner
in 2 public (prepare, capture) and 1 private (execute) methods.Performance penalty
Overhead of two additional function calls per call stack.
Visibility concerns
This approach modifies the public Api, and there is no guard to guarantee that for example only
call_prepare
is called, with no subsequent calls tocall_execute
andcall_capture
are made.Changes
[pub] call_prepare, create_prepare
The initial gasometer corrections, balance checks, nonce handling, etc
[priv] call_execute, create_execute
Create Runtime instance and trigger the recursive opcode execution.
[pub] call_capture, create_capture
Captures the ExitReason.