Commit Graph

1 Commits

Author SHA1 Message Date
Jamie Lokier 10807bce39
EVMC: Binary compatibility on the VM side for calling `execute`
This provides the functions a loadable VM must provide for a host to use it.
The main access to a loaded EVM is `evmc_create_nimbus_evm`, and this meant to
be the only exported function the caller starts with.

That provides access to other functions, also defined in this patch, to
configure the EVM and then the key interesting function is `execute`.

`execute` runs a full computation, here using Nimbus EVM `Computation`.

(Note, even though everything is EVMC binary-compatible, there is a small
dependency on `TransactionHost` in `execute` here, which prevents this being
used by a host that is not Nimbus at the moment.  It is necessary for some
tests, and will eventually go away.)

Although this provides the VM-side functionality needed by the host, it does
not contain the glue functions for `Computation` to call the host, which are
already part of the Nimbus EVM in `nimbus/vm/evmc_api.nim`.

Signed-off-by: Jamie Lokier <jamie@shareable.org>
2021-06-08 18:29:39 +01:00