Trait mithril_aggregator::EpochSettingsStorer

source ·
pub trait EpochSettingsStorer:
    EpochPruningTask
    + Sync
    + Send {
    // Required methods
    fn save_epoch_settings<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
        epoch_settings: AggregatorEpochSettings,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<AggregatorEpochSettings>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_protocol_parameters<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<ProtocolParameters>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_epoch_settings<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<AggregatorEpochSettings>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn handle_discrepancies_at_startup<'life0, 'life1, 'async_trait>(
        &'life0 self,
        current_epoch: Epoch,
        epoch_settings_configuration: &'life1 AggregatorEpochSettings,
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Store and get aggregator epoch settings for given epoch.

Required Methods§

source

fn save_epoch_settings<'life0, 'async_trait>( &'life0 self, epoch: Epoch, epoch_settings: AggregatorEpochSettings, ) -> Pin<Box<dyn Future<Output = StdResult<Option<AggregatorEpochSettings>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Save the given AggregatorEpochSettings for the given Epoch.

source

fn get_protocol_parameters<'life0, 'async_trait>( &'life0 self, epoch: Epoch, ) -> Pin<Box<dyn Future<Output = StdResult<Option<ProtocolParameters>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the saved ProtocolParameter for the given Epoch if any.

source

fn get_epoch_settings<'life0, 'async_trait>( &'life0 self, epoch: Epoch, ) -> Pin<Box<dyn Future<Output = StdResult<Option<AggregatorEpochSettings>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the saved AggregatorEpochSettings for the given Epoch if any.

Provided Methods§

source

fn handle_discrepancies_at_startup<'life0, 'life1, 'async_trait>( &'life0 self, current_epoch: Epoch, epoch_settings_configuration: &'life1 AggregatorEpochSettings, ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle discrepancies at startup in the epoch settings store. In case an aggregator has been launched after some epochs of not being up or at initial startup, the discrepancies in the epoch settings store needs to be fixed. The epoch settings needs to be recorded for the working epoch and the next 2 epochs.

Implementors§