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§
Sourcefn subscribe_head_changes(&self) -> Receiver<PathChanges<Tipset>>
fn subscribe_head_changes(&self) -> Receiver<PathChanges<Tipset>>
Update Mpool’s cur_tipset whenever there is a change to the provider
Sourcefn get_heaviest_tipset(&self) -> Tipset
fn get_heaviest_tipset(&self) -> Tipset
Get the heaviest Tipset in the provider
Sourcefn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>
fn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>
Add a message to the MpoolProvider, return either Cid or Error
depending on successful put
Sourcefn get_actor_after(
&self,
addr: &Address,
ts: &Tipset,
) -> Result<ActorState, Error>
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
Sourcefn messages_for_block(
&self,
h: &CachingBlockHeader,
) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>
fn messages_for_block( &self, h: &CachingBlockHeader, ) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>
Return the signed messages for given block header
Sourcefn load_tipset(&self, tsk: &TipsetKey) -> Result<Tipset, Error>
fn load_tipset(&self, tsk: &TipsetKey) -> Result<Tipset, Error>
Return a tipset given the tipset keys from the ChainStore
Sourcefn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>
fn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>
Computes the base fee
Sourcefn resolve_to_deterministic_address_at_finality(
&self,
addr: &Address,
ts: &Tipset,
) -> Result<Address, Error>
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.
Sourcefn messages_for_tipset(
&self,
ts: &Tipset,
) -> Result<Arc<Vec<ChainMessage>>, Error>
fn messages_for_tipset( &self, ts: &Tipset, ) -> Result<Arc<Vec<ChainMessage>>, Error>
Return all messages included in the given tipset.