pub trait ApplyBlobHooks<B: BlobReaderTrait> {
    type Context: Context;
    type BlobResult;

    // Required methods
    fn begin_blob_hook(
        &self,
        blob: &mut B,
        working_set: &mut WorkingSet<<Self::Context as Spec>::Storage>
    ) -> Result<()>;
    fn end_blob_hook(
        &self,
        result: Self::BlobResult,
        working_set: &mut WorkingSet<<Self::Context as Spec>::Storage>
    ) -> Result<()>;
}
Expand description

Hooks related to the Sequencer functionality. In essence, the sequencer locks a bond at the beginning of the StateTransitionFunction::apply_blob, and is rewarded once a blob of transactions is processed.

Required Associated Types§

Required Methods§

source

fn begin_blob_hook( &self, blob: &mut B, working_set: &mut WorkingSet<<Self::Context as Spec>::Storage> ) -> Result<()>

Runs at the beginning of apply_blob, locks the sequencer bond. If this hook returns Err, batch is not applied

source

fn end_blob_hook( &self, result: Self::BlobResult, working_set: &mut WorkingSet<<Self::Context as Spec>::Storage> ) -> Result<()>

Executes at the end of apply_blob and rewards or slashed the sequencer If this hook returns Err rollup panics

Implementors§