#[non_exhaustive]pub enum ProtocolVersion {
V0(ProtocolVersionFormatV0),
}
Expand description
Formatted Superchain Protocol Version.
The Protocol Version documents the progression of the total set of canonical OP-Stack specifications. Components of the OP-Stack implement the subset of their respective protocol component domain, up to a given Protocol Version of the OP-Stack.
The Protocol Version is NOT a hardfork identifier, but rather indicates software-support for a well-defined set of features introduced in past and future hardforks, not the activation of said hardforks.
The Protocol Version is Semver-compatible. It is encoded as a single 32 bytes long protocol version. The version must be encoded as 32 bytes of DATA in JSON RPC usage.
See also: https://specs.optimism.io/protocol/superchain-upgrades.html#protocol-version
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V0(ProtocolVersionFormatV0)
Version-type 0.
Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub fn encode(&self) -> B256
pub fn encode(&self) -> B256
Version-type 0 byte encoding:
<protocol version> ::= <version-type><typed-payload>
<version-type> ::= <uint8>
<typed-payload> ::= <31 bytes>
Sourcepub fn decode(value: B256) -> Result<Self, ProtocolVersionError>
pub fn decode(value: B256) -> Result<Self, ProtocolVersionError>
Version-type 0 byte decoding:
<protocol version> ::= <version-type><typed-payload>
<version-type> ::= <uint8>
<typed-payload> ::= <31 bytes>
Sourcepub const fn inner(&self) -> ProtocolVersionFormatV0
pub const fn inner(&self) -> ProtocolVersionFormatV0
Returns the inner value of the ProtocolVersion enum
Sourcepub const fn as_v0(&self) -> Option<ProtocolVersionFormatV0>
pub const fn as_v0(&self) -> Option<ProtocolVersionFormatV0>
Returns the inner value of the ProtocolVersion enum if it is V0, otherwise None
Sourcepub const fn minor(&self) -> u32
pub const fn minor(&self) -> u32
Identifies additional functionality in backwards compatible manner
Sourcepub const fn pre_release(&self) -> u32
pub const fn pre_release(&self) -> u32
Identifies unstable versions that may not satisfy the above
Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
Source§impl<'de> Deserialize<'de> for ProtocolVersion
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for ProtocolVersion
serde
only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
Source§impl Serialize for ProtocolVersion
Available on crate feature serde
only.
impl Serialize for ProtocolVersion
serde
only.impl Copy for ProtocolVersion
impl Eq for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 more