Skip to main content

Provider

Trait Provider 

Source
pub trait Provider {
    // Required methods
    fn subscribe_head_changes(&self) -> Receiver<PathChanges<Tipset>>;
    fn get_heaviest_tipset(&self) -> Tipset;
    fn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>;
    fn get_actor_after(
        &self,
        addr: &Address,
        ts: &Tipset,
    ) -> Result<ActorState, Error>;
    fn messages_for_block(
        &self,
        h: &CachingBlockHeader,
    ) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>;
    fn load_tipset(&self, tsk: &TipsetKey) -> Result<Tipset, Error>;
    fn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>;
    fn resolve_to_deterministic_address_at_finality(
        &self,
        addr: &Address,
        ts: &Tipset,
    ) -> Result<Address, Error>;
    fn messages_for_tipset(
        &self,
        ts: &Tipset,
    ) -> Result<Arc<Vec<ChainMessage>>, Error>;

    // Provided methods
    fn max_actor_pending_messages(&self) -> u64 { ... }
    fn max_untrusted_actor_pending_messages(&self) -> u64 { ... }
}
Expand description

Provider Trait. This trait will be used by the message pool to interact with some medium in order to do the operations that are listed below that are required for the message pool.

Required Methods§

Source

fn subscribe_head_changes(&self) -> Receiver<PathChanges<Tipset>>

Update Mpool’s cur_tipset whenever there is a change to the provider

Source

fn get_heaviest_tipset(&self) -> Tipset

Get the heaviest Tipset in the provider

Source

fn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>

Add a message to the MpoolProvider, return either Cid or Error depending on successful put

Source

fn get_actor_after( &self, addr: &Address, ts: &Tipset, ) -> Result<ActorState, Error>

Return state actor for given address given the tipset that the a temp StateTree will be rooted at. Return ActorState or Error depending on whether or not ActorState is found

Source

fn messages_for_block( &self, h: &CachingBlockHeader, ) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>

Return the signed messages for given block header

Source

fn load_tipset(&self, tsk: &TipsetKey) -> Result<Tipset, Error>

Return a tipset given the tipset keys from the ChainStore

Source

fn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>

Computes the base fee

Source

fn resolve_to_deterministic_address_at_finality( &self, addr: &Address, ts: &Tipset, ) -> Result<Address, Error>

Similar to crate::state_manager::StateManager::resolve_to_deterministic_address but fails if the ID address being resolved isn’t reorg-stable yet. It should not be used for consensus-critical subsystems.

Source

fn messages_for_tipset( &self, ts: &Tipset, ) -> Result<Arc<Vec<ChainMessage>>, Error>

Return all messages included in the given tipset.

Provided Methods§

Implementations on Foreign Types§

Source§

impl<T: Provider + ?Sized> Provider for Arc<T>

Implementors§