penumbra_sct::component::tree

Trait SctManager

Source
pub trait SctManager: StateWrite {
    // Provided methods
    fn write_sct<'life0, 'async_trait>(
        &'life0 mut self,
        height: u64,
        sct: Tree,
        block_root: Root,
        epoch_root: Option<Root>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn add_sct_commitment<'life0, 'async_trait>(
        &'life0 mut self,
        commitment: StateCommitment,
        source: CommitmentSource,
    ) -> Pin<Box<dyn Future<Output = Result<Position>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn nullify<'life0, 'async_trait>(
        &'life0 mut self,
        nullifier: Nullifier,
        source: CommitmentSource,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn end_sct_block<'life0, 'async_trait>(
        &'life0 mut self,
        end_epoch: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(Root, Option<Root>)>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn write_sct_cache(&mut self, tree: Tree) { ... }
    fn persist_sct_cache(&mut self) { ... }
}
Available on crate feature component only.
Expand description

Provides write access to the state commitment tree and related data.

Provided Methods§

Source

fn write_sct<'life0, 'async_trait>( &'life0 mut self, height: u64, sct: Tree, block_root: Root, epoch_root: Option<Root>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Write an SCT instance to nonverifiable storage and record the block and epoch roots in the JMT.

§Panics

If the epoch has not been set, or if a serialization failure occurs.

Source

fn add_sct_commitment<'life0, 'async_trait>( &'life0 mut self, commitment: StateCommitment, source: CommitmentSource, ) -> Pin<Box<dyn Future<Output = Result<Position>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Add a state commitment into the SCT, emitting an event recording its source, and return the insert position in the tree.

Source

fn nullify<'life0, 'async_trait>( &'life0 mut self, nullifier: Nullifier, source: CommitmentSource, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Record a nullifier as spent in the verifiable storage.

Source

fn end_sct_block<'life0, 'async_trait>( &'life0 mut self, end_epoch: bool, ) -> Pin<Box<dyn Future<Output = Result<(Root, Option<Root>)>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Seal the current block in the SCT, and produce an epoch root if we are ending an epoch as well.

§Panics

This method panic if the block is full, or if a serialization failure occurs.

Source

fn write_sct_cache(&mut self, tree: Tree)

Source

fn persist_sct_cache(&mut self)

Persist the object-store SCT instance to nonverifiable storage. Note that this doesn’t actually persist the SCT to disk, see the cndiarium documentation for more information.

§Panics

This method panics if a serialization failure occurs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§