pub trait ApplyBlobHooks {
    type Context: Context;
    type BlobResult;

    // Required methods
    fn begin_blob_hook(
        &self,
        sequencer: &[u8],
        raw_blob: &[u8],
        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, sequencer: &[u8], raw_blob: &[u8], working_set: &mut WorkingSet<<Self::Context as Spec>::Storage> ) -> Result<()>

Runs at the beginning of apply_blob, locks the sequencer bond.

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 the sequencer. This method is not invoked if the sequencer has been slashed.

Implementors§