Trait mithril_aggregator::services::EpochService
source · pub trait EpochService: Sync + Send {
// Required methods
fn inform_epoch<'life0, 'async_trait>(
&'life0 mut self,
epoch: Epoch
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_protocol_parameters<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn precompute_epoch_data<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn epoch_of_current_data(&self) -> StdResult<Epoch>;
fn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>;
fn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>;
fn upcoming_protocol_parameters(&self) -> StdResult<&ProtocolParameters>;
fn current_aggregate_verification_key(
&self
) -> StdResult<&ProtocolAggregateVerificationKey>;
fn next_aggregate_verification_key(
&self
) -> StdResult<&ProtocolAggregateVerificationKey>;
fn current_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>;
fn next_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>;
fn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>;
}
Expand description
Service that aggregates all data that don’t change in a given epoch.
Required Methods§
sourcefn inform_epoch<'life0, 'async_trait>(
&'life0 mut self,
epoch: Epoch
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inform_epoch<'life0, 'async_trait>(
&'life0 mut self,
epoch: Epoch
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Inform the service a new epoch has been detected, telling it to update its internal state for the new epoch.
sourcefn update_protocol_parameters<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_protocol_parameters<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert future protocol parameters in the store based on this service current epoch.
Note: must be called after inform_epoch
.
sourcefn precompute_epoch_data<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn precompute_epoch_data<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Inform the service that it can precompute data for its current epoch.
Note: must be called after inform_epoch
.
sourcefn epoch_of_current_data(&self) -> StdResult<Epoch>
fn epoch_of_current_data(&self) -> StdResult<Epoch>
Get the current epoch for which the data stored in this service are computed.
sourcefn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
fn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
Get protocol parameters used in current epoch (associated with the previous epoch)
sourcefn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
fn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
Get next protocol parameters used in next epoch (associated with the actual epoch)
sourcefn upcoming_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
fn upcoming_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
Get upcoming protocol parameters used in next epoch (associated with the next epoch)
sourcefn current_aggregate_verification_key(
&self
) -> StdResult<&ProtocolAggregateVerificationKey>
fn current_aggregate_verification_key( &self ) -> StdResult<&ProtocolAggregateVerificationKey>
Get aggregate verification key for current epoch
sourcefn next_aggregate_verification_key(
&self
) -> StdResult<&ProtocolAggregateVerificationKey>
fn next_aggregate_verification_key( &self ) -> StdResult<&ProtocolAggregateVerificationKey>
Get next aggregate verification key for next epoch
sourcefn current_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
fn current_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
Get signers with stake for the current epoch
sourcefn next_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
fn next_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
Get signers with stake for the next epoch
sourcefn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>
fn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>
Get the protocol multi signer for the current epoch