#[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§
source§impl BlobTransactionSidecar
impl BlobTransactionSidecar
sourcepub 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.
sourcepub 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.
sourcepub 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.
sourcepub 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.
sourcepub 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.
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Calculates a size heuristic for the in-memory size of the BlobTransactionSidecar.
sourcepub fn try_from_blobs(blobs: Vec<Blob>) -> Result<BlobTransactionSidecar, Error>
Available on crate features kzg
and arbitrary
only.
pub fn try_from_blobs(blobs: Vec<Blob>) -> Result<BlobTransactionSidecar, Error>
kzg
and arbitrary
only.Tries to create a new BlobTransactionSidecar
from the given blobs.
sourcepub fn rlp_encoded_length(&self) -> usize
pub fn rlp_encoded_length(&self) -> usize
Calculates the length of the BlobTransactionSidecar when encoded as RLP.
sourcepub fn rlp_encode(&self, out: &mut dyn BufMut)
pub fn rlp_encode(&self, out: &mut dyn BufMut)
Encodes the BlobTransactionSidecar as RLP bytes.
sourcepub fn rlp_decode(buf: &mut &[u8]) -> Result<BlobTransactionSidecar, Error>
pub fn rlp_decode(buf: &mut &[u8]) -> Result<BlobTransactionSidecar, Error>
Decodes the BlobTransactionSidecar from RLP bytes.
Trait Implementations§
source§impl<'a> Arbitrary<'a> for BlobTransactionSidecar
Available on crate feature arbitrary
only.
impl<'a> Arbitrary<'a> for BlobTransactionSidecar
arbitrary
only.source§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 moresource§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 moresource§impl Clone for BlobTransactionSidecar
impl Clone for BlobTransactionSidecar
source§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 moresource§impl Debug for BlobTransactionSidecar
impl Debug for BlobTransactionSidecar
source§impl Decodable for BlobTransactionSidecar
impl Decodable for BlobTransactionSidecar
source§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.
source§impl Default for BlobTransactionSidecar
impl Default for BlobTransactionSidecar
source§fn default() -> BlobTransactionSidecar
fn default() -> BlobTransactionSidecar
source§impl<'de> Deserialize<'de> for BlobTransactionSidecar
impl<'de> Deserialize<'de> for BlobTransactionSidecar
source§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>,
source§impl Encodable for BlobTransactionSidecar
impl Encodable for BlobTransactionSidecar
source§impl Hash for BlobTransactionSidecar
impl Hash for BlobTransactionSidecar
source§impl IntoIterator for BlobTransactionSidecar
impl IntoIterator for BlobTransactionSidecar
source§type Item = BlobTransactionSidecarItem
type Item = BlobTransactionSidecarItem
source§type IntoIter = IntoIter<BlobTransactionSidecarItem>
type IntoIter = IntoIter<BlobTransactionSidecarItem>
source§fn into_iter(self) -> <BlobTransactionSidecar as IntoIterator>::IntoIter
fn into_iter(self) -> <BlobTransactionSidecar as IntoIterator>::IntoIter
source§impl PartialEq for BlobTransactionSidecar
impl PartialEq for BlobTransactionSidecar
source§impl Serialize for BlobTransactionSidecar
impl Serialize for BlobTransactionSidecar
source§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> 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
)