#[repr(C)]pub struct BlobTransactionSidecar {
pub blobs: Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>>,
pub commitments: Vec<FixedBytes<48>>,
pub proofs: Vec<FixedBytes<48>>,
}
Expand description
This represents a set of blobs, and its corresponding commitments and proofs.
This type encodes and decodes the fields without an rlp header.
Fields§
§blobs: Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>>
The blob data.
commitments: Vec<FixedBytes<48>>
The blob commitments.
proofs: Vec<FixedBytes<48>>
The blob proofs.
Implementations§
§impl BlobTransactionSidecar
impl BlobTransactionSidecar
pub const fn new(
blobs: Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>>,
commitments: Vec<FixedBytes<48>>,
proofs: Vec<FixedBytes<48>>,
) -> BlobTransactionSidecar
pub const fn new( blobs: Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>>, commitments: Vec<FixedBytes<48>>, proofs: Vec<FixedBytes<48>>, ) -> BlobTransactionSidecar
Constructs a new BlobTransactionSidecar from a set of blobs, commitments, and proofs.
pub fn from_kzg(
blobs: Vec<Blob>,
commitments: Vec<Bytes48>,
proofs: Vec<Bytes48>,
) -> BlobTransactionSidecar
Available on crate feature kzg
only.
pub fn from_kzg( blobs: Vec<Blob>, commitments: Vec<Bytes48>, proofs: Vec<Bytes48>, ) -> BlobTransactionSidecar
kzg
only.Creates a new instance from the given KZG types.
pub fn validate(
&self,
blob_versioned_hashes: &[FixedBytes<32>],
proof_settings: &KZGSettings,
) -> Result<(), BlobTransactionValidationError>
Available on crate feature kzg
only.
pub fn validate( &self, blob_versioned_hashes: &[FixedBytes<32>], proof_settings: &KZGSettings, ) -> Result<(), BlobTransactionValidationError>
kzg
only.Verifies that the versioned hashes are valid for this sidecar’s blob data, commitments, and proofs.
Takes as input the KzgSettings, which should contain the parameters derived from the KZG trusted setup.
This ensures that the blob transaction payload has the same number of blob data elements, commitments, and proofs. Each blob data element is verified against its commitment and proof.
Returns [BlobTransactionValidationError::InvalidProof] if any blob KZG proof in the response fails to verify, or if the versioned hashes in the transaction do not match the actual commitment versioned hashes.
pub fn versioned_hashes(&self) -> impl Iterator<Item = FixedBytes<32>>
pub fn versioned_hashes(&self) -> impl Iterator<Item = FixedBytes<32>>
Returns an iterator over the versioned hashes of the commitments.
pub fn versioned_hash_for_blob(
&self,
blob_index: usize,
) -> Option<FixedBytes<32>>
pub fn versioned_hash_for_blob( &self, blob_index: usize, ) -> Option<FixedBytes<32>>
Returns the versioned hash for the blob at the given index, if it exists.
pub fn fields_len(&self) -> usize
pub fn fields_len(&self) -> usize
Outputs the RLP length of the BlobTransactionSidecar fields, without a RLP header.
pub fn size(&self) -> usize
pub fn size(&self) -> usize
Calculates a size heuristic for the in-memory size of the BlobTransactionSidecar.
Trait Implementations§
§impl<'a> Arbitrary<'a> for BlobTransactionSidecar
Available on crate feature arbitrary
only.
impl<'a> Arbitrary<'a> for BlobTransactionSidecar
arbitrary
only.§fn arbitrary(u: &mut Unstructured<'a>) -> Result<BlobTransactionSidecar, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<BlobTransactionSidecar, Error>
Self
from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read more§impl Arbitrary for BlobTransactionSidecar
impl Arbitrary for BlobTransactionSidecar
§type Parameters = (<Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>> as Arbitrary>::Parameters, <Vec<FixedBytes<48>> as Arbitrary>::Parameters, <Vec<FixedBytes<48>> as Arbitrary>::Parameters)
type Parameters = (<Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>> as Arbitrary>::Parameters, <Vec<FixedBytes<48>> as Arbitrary>::Parameters, <Vec<FixedBytes<48>> as Arbitrary>::Parameters)
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<(<Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>> as Arbitrary>::Strategy, <Vec<FixedBytes<48>> as Arbitrary>::Strategy, <Vec<FixedBytes<48>> as Arbitrary>::Strategy), fn(_: (Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>>, Vec<FixedBytes<48>>, Vec<FixedBytes<48>>)) -> BlobTransactionSidecar>
type Strategy = Map<(<Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>> as Arbitrary>::Strategy, <Vec<FixedBytes<48>> as Arbitrary>::Strategy, <Vec<FixedBytes<48>> as Arbitrary>::Strategy), fn(_: (Vec<FixedBytes<alloy_eips::::eip4844::Blob::{constant#0}>>, Vec<FixedBytes<48>>, Vec<FixedBytes<48>>)) -> BlobTransactionSidecar>
Strategy
used to generate values of type Self
.§fn arbitrary_with(
_top: <BlobTransactionSidecar as Arbitrary>::Parameters,
) -> <BlobTransactionSidecar as Arbitrary>::Strategy
fn arbitrary_with( _top: <BlobTransactionSidecar as Arbitrary>::Parameters, ) -> <BlobTransactionSidecar as Arbitrary>::Strategy
§impl Clone for BlobTransactionSidecar
impl Clone for BlobTransactionSidecar
§fn clone(&self) -> BlobTransactionSidecar
fn clone(&self) -> BlobTransactionSidecar
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for BlobTransactionSidecar
impl Debug for BlobTransactionSidecar
§impl Decodable for BlobTransactionSidecar
impl Decodable for BlobTransactionSidecar
§fn decode(buf: &mut &[u8]) -> Result<BlobTransactionSidecar, Error>
fn decode(buf: &mut &[u8]) -> Result<BlobTransactionSidecar, Error>
Decodes the inner BlobTransactionSidecar fields from RLP bytes, without a RLP header.
§impl Default for BlobTransactionSidecar
impl Default for BlobTransactionSidecar
§fn default() -> BlobTransactionSidecar
fn default() -> BlobTransactionSidecar
§impl<'de> Deserialize<'de> for BlobTransactionSidecar
impl<'de> Deserialize<'de> for BlobTransactionSidecar
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlobTransactionSidecar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlobTransactionSidecar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Encodable for BlobTransactionSidecar
impl Encodable for BlobTransactionSidecar
§impl Hash for BlobTransactionSidecar
impl Hash for BlobTransactionSidecar
§impl PartialEq for BlobTransactionSidecar
impl PartialEq for BlobTransactionSidecar
§fn eq(&self, other: &BlobTransactionSidecar) -> bool
fn eq(&self, other: &BlobTransactionSidecar) -> bool
self
and other
values to be equal, and is used
by ==
.§impl Serialize for BlobTransactionSidecar
impl Serialize for BlobTransactionSidecar
§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 Eq for BlobTransactionSidecar
impl StructuralPartialEq for BlobTransactionSidecar
Auto Trait Implementations§
impl Freeze for BlobTransactionSidecar
impl RefUnwindSafe for BlobTransactionSidecar
impl Send for BlobTransactionSidecar
impl Sync for BlobTransactionSidecar
impl Unpin for BlobTransactionSidecar
impl UnwindSafe for BlobTransactionSidecar
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> 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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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: 72 bytes