Skip to main content

HookHost

Trait HookHost 

Source
pub trait HookHost {
    // Required method
    fn invoke(&self, ctx: &mut HookContext<'_>) -> Result<(), HookError>;
}
Expand description

Pre-submit hook host — the L2 service that runs registered hooks against an in-flight submission’s extra_bytes buffer.

§Backends

The runtime selects between two backends:

  • NoopHookHost (always available) — pass-through that returns Ok(()) without mutation.
  • WasmtimeHookHost (feature tier-2-hook-host-v2) — wasmtime preview-2 sandbox with fuel-metered execution + capability- whitelisted host-fns.

Required Methods§

Source

fn invoke(&self, ctx: &mut HookContext<'_>) -> Result<(), HookError>

Invoke the hook bound to the given submission. Implementations may mutate ctx.extra; they may read ctx.capabilities. The no-op pass-through skips invocation entirely.

Implementors§