You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's first try to get an overview of which types and implementations already exist, to avoid 927.
SystemCall is an alias for FnMut(Address, Vec<u8>) -> Result<Vec<u8>, String> + 'a. It takes a contract address and encoded parameters and returns the result. It's meant for system calls, i.e. calls by the system address outside of transactions.
SystemOrCodeCall is similar, but it allows you alternatively to pass in the code to be executed, instead of the address of the code.
EthereumMachine::execute_as_system resp. EthereumMachine::execute_code_as_system executes code at an address resp. passed in code on a specified block with the sender equal to SYSTEM_ADDRESS, modifying the block state, but not storing a transaction or logs on the block, or counting towards the gas limit.
OpenBlock::push_transaction, on the other hand, takes a transaction, stores it on the block, executes it and stores the receipt and traces as well. (It can do that because OpenBlock wraps not only a block but also an engine.)
Client::call_contract runs a constant call on a specified block number and returns the result. (Internally, it creates a transaction, but it doesn't actually queue it or push it onto any block.) It takes the block number, address and encoded input data, and returns the encoded output data. Internally it uses the somewhat lower-level:
Executive, which wraps a state and a machine, and can use them to execute a transaction. (Note that transact_virtual seems to do the same thing but with unlimited gas; it's not really virtual…)
We need an
Executor
trait for executing calls from Rust to the EVM.The text was updated successfully, but these errors were encountered: