Struct massa_versioning::versioning::MipStoreRaw
source · pub struct MipStoreRaw {
pub(crate) store: BTreeMap<MipInfo, MipState>,
pub(crate) stats: MipStoreStats,
}Expand description
Store of all versioning info
Fields§
§store: BTreeMap<MipInfo, MipState>§stats: MipStoreStatsImplementations§
source§impl MipStoreRaw
impl MipStoreRaw
sourcepub fn update_with(
&mut self,
store_raw: &MipStoreRaw,
) -> Result<(Vec<MipInfo>, BTreeMap<MipInfo, MipState>), UpdateWithError>
pub fn update_with( &mut self, store_raw: &MipStoreRaw, ) -> Result<(Vec<MipInfo>, BTreeMap<MipInfo, MipState>), UpdateWithError>
Update our store with another (usually after a bootstrap where we received another store) Return list of updated / added if successful, UpdateWithError otherwise
fn update_network_version_stats( &mut self, slot_timestamp: MassaTime, network_versions: Option<(u32, Option<u32>)>, )
sourcefn advance_states_on_updated_stats(&mut self, slot_timestamp: MassaTime)
fn advance_states_on_updated_stats(&mut self, slot_timestamp: MassaTime)
Used internally by update_network_version_stats
sourcefn get_latest_component_version_at(
&self,
component: &MipComponent,
ts: MassaTime,
) -> u32
fn get_latest_component_version_at( &self, component: &MipComponent, ts: MassaTime, ) -> u32
Get latest version at given timestamp (e.g. slot)
sourcefn get_all_active_component_versions(
&self,
component: &MipComponent,
) -> Vec<u32>
fn get_all_active_component_versions( &self, component: &MipComponent, ) -> Vec<u32>
Get all versions in ‘Active state’ for the given MipComponent
sourcefn get_all_component_versions(
&self,
component: &MipComponent,
) -> BTreeMap<u32, ComponentStateTypeId>
fn get_all_component_versions( &self, component: &MipComponent, ) -> BTreeMap<u32, ComponentStateTypeId>
Get all versions (at any state) for the given MipComponent
sourcefn is_consistent_with_shutdown_period(
&self,
shutdown_start: Slot,
shutdown_end: Slot,
thread_count: u8,
t0: MassaTime,
genesis_timestamp: MassaTime,
) -> Result<(), IsConsistentWithShutdownPeriodError>
fn is_consistent_with_shutdown_period( &self, shutdown_start: Slot, shutdown_end: Slot, thread_count: u8, t0: MassaTime, genesis_timestamp: MassaTime, ) -> Result<(), IsConsistentWithShutdownPeriodError>
Check if store is consistent with given last network shutdown On a network shutdown, the MIP infos will be edited but we still need to check if this is consistent See https://github.com/massalabs/massa-functional-tests/blob/main/tests_versioning_network_restart.py for an example
fn update_for_network_shutdown( &mut self, shutdown_start: Slot, shutdown_end: Slot, thread_count: u8, t0: MassaTime, genesis_timestamp: MassaTime, ) -> Result<(), ModelsError>
pub fn get_network_versions_stats(&self) -> HashMap<u32, u64>
pub fn is_key_value_valid( &self, serialized_key: &[u8], serialized_value: &[u8], ) -> bool
pub fn _is_key_value_valid( &self, serialized_key: &[u8], serialized_value: &[u8], ) -> Result<(), IsKVValidError>
sourcefn update_batches(
&self,
batch: &mut DBBatch,
versioning_batch: &mut DBBatch,
between: Option<(&MassaTime, &MassaTime)>,
) -> Result<(), SerializeError>
fn update_batches( &self, batch: &mut DBBatch, versioning_batch: &mut DBBatch, between: Option<(&MassaTime, &MassaTime)>, ) -> Result<(), SerializeError>
Get MIP store changes between 2 timestamps - used by the db to update the disk
sourcefn extend_from_db(
&mut self,
db: ShareableMassaDBController,
) -> Result<(Vec<MipInfo>, BTreeMap<MipInfo, MipState>), ExtendFromDbError>
fn extend_from_db( &mut self, db: ShareableMassaDBController, ) -> Result<(Vec<MipInfo>, BTreeMap<MipInfo, MipState>), ExtendFromDbError>
Extend MIP store with what is written on the disk
sourcefn try_from_db(
db: ShareableMassaDBController,
cfg: MipStatsConfig,
) -> Result<Self, ExtendFromDbError>
fn try_from_db( db: ShareableMassaDBController, cfg: MipStatsConfig, ) -> Result<Self, ExtendFromDbError>
Create a MIP store raw with what is written on the disk
Trait Implementations§
source§impl Clone for MipStoreRaw
impl Clone for MipStoreRaw
source§fn clone(&self) -> MipStoreRaw
fn clone(&self) -> MipStoreRaw
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for MipStoreRaw
impl Debug for MipStoreRaw
source§impl Deserializer<MipStoreRaw> for MipStoreRawDeserializer
impl Deserializer<MipStoreRaw> for MipStoreRawDeserializer
source§fn deserialize<'a, E: ParseError<&'a [u8]> + ContextError<&'a [u8]>>(
&self,
buffer: &'a [u8],
) -> IResult<&'a [u8], MipStoreRaw, E>
fn deserialize<'a, E: ParseError<&'a [u8]> + ContextError<&'a [u8]>>( &self, buffer: &'a [u8], ) -> IResult<&'a [u8], MipStoreRaw, E>
source§impl PartialEq for MipStoreRaw
impl PartialEq for MipStoreRaw
source§fn eq(&self, other: &MipStoreRaw) -> bool
fn eq(&self, other: &MipStoreRaw) -> bool
self and other values to be equal, and is used
by ==.source§impl Serializer<MipStoreRaw> for MipStoreRawSerializer
impl Serializer<MipStoreRaw> for MipStoreRawSerializer
source§impl<const N: usize> TryFrom<([(MipInfo, MipState); N], MipStatsConfig)> for MipStoreRaw
impl<const N: usize> TryFrom<([(MipInfo, MipState); N], MipStatsConfig)> for MipStoreRaw
impl StructuralPartialEq for MipStoreRaw
Auto Trait Implementations§
impl Freeze for MipStoreRaw
impl RefUnwindSafe for MipStoreRaw
impl Send for MipStoreRaw
impl Sync for MipStoreRaw
impl Unpin for MipStoreRaw
impl UnwindSafe for MipStoreRaw
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.