Struct StorageSettings
pub struct StorageSettings {
pub storage_v2: bool,
}Expand description
Storage configuration settings for this node.
Controls whether this node uses v2 storage layout (static files + RocksDB routing)
or v1/legacy layout (everything in MDBX).
These should be set during init_genesis or init_db depending on whether we want dictate
behaviour of new or old nodes respectively.
Fields§
§storage_v2: boolWhether this node uses v2 storage layout.
When true, enables all v2 storage features:
- Receipts and transaction senders in static files
- History indices in
RocksDB(accounts, storages, transaction hashes) - Account and storage changesets in static files
- Hashed state tables as canonical state representation
When false, uses v1/legacy layout (everything in MDBX).
Implementations§
§impl StorageSettings
impl StorageSettings
pub const fn bitflag_encoded_bytes() -> usize
pub const fn bitflag_encoded_bytes() -> usize
Used bytes by StorageSettingsFlags
pub const fn bitflag_unused_bits() -> usize
pub const fn bitflag_unused_bits() -> usize
Unused bits for new fields by StorageSettingsFlags
§impl StorageSettings
impl StorageSettings
pub const fn base() -> StorageSettings
pub const fn base() -> StorageSettings
Returns the default base StorageSettings.
pub const fn v2() -> StorageSettings
pub const fn v2() -> StorageSettings
Creates StorageSettings for v2 nodes with all storage features enabled:
- Receipts and transaction senders in static files
- History indices in
RocksDB(storages, accounts, transaction hashes) - Account and storage changesets in static files
- Hashed state as canonical state representation
Use this when the --storage.v2 CLI flag is set.
pub const fn v1() -> StorageSettings
pub const fn v1() -> StorageSettings
Creates StorageSettings for v1/legacy nodes.
This keeps all data in MDBX, matching the original storage layout.
pub const fn receipts_in_static_files(&self) -> bool
pub const fn receipts_in_static_files(&self) -> bool
Whether receipts are stored in static files.
pub const fn transaction_senders_in_static_files(&self) -> bool
pub const fn transaction_senders_in_static_files(&self) -> bool
Whether transaction senders are stored in static files.
pub const fn storages_history_in_rocksdb(&self) -> bool
pub const fn storages_history_in_rocksdb(&self) -> bool
Whether storages history is stored in RocksDB.
pub const fn transaction_hash_numbers_in_rocksdb(&self) -> bool
pub const fn transaction_hash_numbers_in_rocksdb(&self) -> bool
Whether transaction hash numbers are stored in RocksDB.
pub const fn account_history_in_rocksdb(&self) -> bool
pub const fn account_history_in_rocksdb(&self) -> bool
Whether account history is stored in RocksDB.
pub const fn use_hashed_state(&self) -> bool
pub const fn use_hashed_state(&self) -> bool
Whether to use hashed state tables (HashedAccounts/HashedStorages) as the canonical
state representation instead of plain state tables. Implied by v2 storage layout.
pub const fn any_in_rocksdb(&self) -> bool
pub const fn any_in_rocksdb(&self) -> bool
Returns true if any tables are configured to be stored in RocksDB.
Trait Implementations§
§impl<'arbitrary> Arbitrary<'arbitrary> for StorageSettings
impl<'arbitrary> Arbitrary<'arbitrary> for StorageSettings
§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<StorageSettings, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<StorageSettings, Error>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<StorageSettings, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<StorageSettings, Error>
Self from the entirety of the given
unstructured data. Read more§impl Clone for StorageSettings
impl Clone for StorageSettings
§fn clone(&self) -> StorageSettings
fn clone(&self) -> StorageSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Compact for StorageSettings
impl Compact for StorageSettings
§fn to_compact<B>(&self, buf: &mut B) -> usize
fn to_compact<B>(&self, buf: &mut B) -> usize
§fn from_compact(buf: &[u8], len: usize) -> (StorageSettings, &[u8])
fn from_compact(buf: &[u8], len: usize) -> (StorageSettings, &[u8])
buf with its internal cursor
advanced (eg..advance(len)). Read more§fn specialized_to_compact<B>(&self, buf: &mut B) -> usize
fn specialized_to_compact<B>(&self, buf: &mut B) -> usize
§fn specialized_from_compact(buf: &[u8], len: usize) -> (Self, &[u8])
fn specialized_from_compact(buf: &[u8], len: usize) -> (Self, &[u8])
impl Copy for StorageSettings
§impl Debug for StorageSettings
impl Debug for StorageSettings
§impl Default for StorageSettings
impl Default for StorageSettings
§fn default() -> StorageSettings
fn default() -> StorageSettings
§impl<'de> Deserialize<'de> for StorageSettings
impl<'de> Deserialize<'de> for StorageSettings
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StorageSettings, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StorageSettings, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for StorageSettings
§impl PartialEq for StorageSettings
impl PartialEq for StorageSettings
§impl Serialize for StorageSettings
impl Serialize for StorageSettings
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for StorageSettings
Auto Trait Implementations§
impl Freeze for StorageSettings
impl RefUnwindSafe for StorageSettings
impl Send for StorageSettings
impl Sync for StorageSettings
impl Unpin for StorageSettings
impl UnsafeUnpin for StorageSettings
impl UnwindSafe for StorageSettings
Blanket Implementations§
impl<A> ArbInterop for A
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeCompact for Twhere
T: Compact,
impl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> NippyJarHeader for T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte