pub struct OutputRoot {
pub state_root: B256,
pub bridge_storage_root: B256,
pub block_hash: B256,
}Expand description
The OutputRoot is a high-level commitment to an L2 block. It lifts the state root from the
block header as well as the storage root of the Predeploys::L2_TO_L1_MESSAGE_PASSER account
into the top-level commitment construction.
https://specs.optimism.io/protocol/proposals.html#l2-output-commitment-construction
Fields§
§state_root: B256The state root of the block corresponding to the output root.
bridge_storage_root: B256The storage root of the L2ToL1MessagePasser predeploy at the block corresponding to the
output root.
block_hash: B256The block hash that the output root represents.
Implementations§
Source§impl OutputRoot
impl OutputRoot
Sourcepub const ENCODED_LENGTH: usize = 128usize
pub const ENCODED_LENGTH: usize = 128usize
The encoded length of a V0 output root.
Sourcepub const VERSION: u8 = 0u8
pub const VERSION: u8 = 0u8
The version of the OutputRoot. Currently, the protocol only supports one version of this
commitment.
Sourcepub const fn version(&self) -> B256
pub const fn version(&self) -> B256
Returns the version of the OutputRoot. Currently, the protocol only supports the version
number 0.
Sourcepub const fn from_parts(
state_root: B256,
bridge_storage_root: B256,
block_hash: B256,
) -> Self
pub const fn from_parts( state_root: B256, bridge_storage_root: B256, block_hash: B256, ) -> Self
Constructs a V0 OutputRoot from its parts.
Sourcepub fn encode(&self) -> [u8; 128]
pub fn encode(&self) -> [u8; 128]
Encodes the OutputRoot.
Sourcepub fn hash(&self) -> B256
pub fn hash(&self) -> B256
Encodes and hashes the OutputRoot.
Trait Implementations§
Source§impl Clone for OutputRoot
impl Clone for OutputRoot
Source§fn clone(&self) -> OutputRoot
fn clone(&self) -> OutputRoot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OutputRoot
impl Debug for OutputRoot
Source§impl Display for OutputRoot
impl Display for OutputRoot
Source§impl Hash for OutputRoot
impl Hash for OutputRoot
Source§impl PartialEq for OutputRoot
impl PartialEq for OutputRoot
impl Copy for OutputRoot
impl Eq for OutputRoot
impl StructuralPartialEq for OutputRoot
Auto Trait Implementations§
impl Freeze for OutputRoot
impl RefUnwindSafe for OutputRoot
impl Send for OutputRoot
impl Sync for OutputRoot
impl Unpin for OutputRoot
impl UnwindSafe for OutputRoot
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§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