Replies: 1 comment 1 reply
-
|
Very good thanks 👍 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Starting point: EVMC
EVMC was created long time ago to support some use-cases which are less relevant nowadays. In was used in cpp-ethereum client to support multiple EVM implementations. Therefore EVMC is as low level as possible to leave only instructions execution to EVM implementations. Any other EVM property was abstracted if possible, in particular:
Moreover, EVMC is "polymorphic" API allowing easily using multiple EVM implementations with the single unified API.
Design goals
Design
Execute transaction
Instead of executing individual internal calls focus on executing whole transactions. This should hide many internals of EVM from Client:
CALLandCREATEinstructions.Only access cold state
Transaction execution has notion of cold/warm state access. EVM should only ask Client about cold items and keep the already accessed values in a transaction-level state cache. This may play nicely with the gas schedule where cold access is more expensive: EVM implementation will call Client (possibly an expensive FFI call) only in case of cold access.
Receipt + State changes
In EVMC state changes are kept by the Client. Client is also responsible of state changes reverts. If we move the state journal / reverts to EVM it can easily keep the record of all changes made to the state by the current transaction. The transaction receipt (gas cost + logs) and state diff (unified state journal) may be the result of the transaction execution API.
Reusable ExecutionContext
The ExecutionContext is an object allowing thread-safe EVM execution. It is owned but opaque to Client. Can be reused for serial transactions execution or multiple ExecutionContext can be created to support parallel execution.
It allows cross-call optimizations, e.g. #481.
Rollout in stages
Beta Was this translation helpful? Give feedback.
All reactions