Trait forest_filecoin::shim::fvm_latest::executor::Executor

source ·
pub trait Executor {
    type Kernel: Kernel;

    // Required methods
    fn execute_message(
        &mut self,
        msg: Message,
        apply_kind: ApplyKind,
        raw_length: usize,
    ) -> Result<ApplyRet, Error>;
    fn flush(&mut self) -> Result<Cid<64>, Error>;
}
Expand description

An executor executes messages on the underlying machine/kernel. It’s responsible for:

  1. Validating messages (nonce, sender, etc).
  2. Creating message receipts.
  3. Charging message inclusion gas, overestimation gas, miner tip, etc.

Required Associated Types§

source

type Kernel: Kernel

The Kernel on which messages will be applied. We specify a Kernel here, not a Machine, because the Kernel implies the Machine.

Required Methods§

source

fn execute_message( &mut self, msg: Message, apply_kind: ApplyKind, raw_length: usize, ) -> Result<ApplyRet, Error>

This is the entrypoint to execute a message.

NOTE: The “raw length” is the length of the message as it appears on-chain and is used to charge message inclusion gas.

source

fn flush(&mut self) -> Result<Cid<64>, Error>

Flushes the state-tree, returning the new root CID.

Implementors§

source§

impl<E> Executor for ThreadedExecutor<E>
where E: Executor + Send,

§

type Kernel = <E as Executor>::Kernel

source§

impl<K> Executor for DefaultExecutor<K>
where K: Kernel,

§

type Kernel = K