alloy_eips/eip7594/
mod.rs

1//! Types and constants for PeerDAS.
2//!
3//! See also [EIP-7594](https://eips.ethereum.org/EIPS/eip-7594): PeerDAS - Peer Data Availability Sampling
4use crate::eip4844::{FIELD_ELEMENTS_PER_BLOB, FIELD_ELEMENT_BYTES};
5use alloy_primitives::FixedBytes;
6
7/// Number of field elements in a Reed-Solomon extended blob.
8pub const FIELD_ELEMENTS_PER_EXT_BLOB: usize = FIELD_ELEMENTS_PER_BLOB as usize * 2;
9
10/// Number of field elements in a cell.
11pub const FIELD_ELEMENTS_PER_CELL: usize = 64;
12
13/// The number of bytes in a cell.
14pub const BYTES_PER_CELL: usize = FIELD_ELEMENTS_PER_CELL * FIELD_ELEMENT_BYTES as usize;
15
16/// The number of cells in an extended blob.
17pub const CELLS_PER_EXT_BLOB: usize = FIELD_ELEMENTS_PER_EXT_BLOB / FIELD_ELEMENTS_PER_CELL;
18
19/// A wrapper version for EIP-7594 sidecar encoding.
20pub const EIP_7594_WRAPPER_VERSION: u8 = 1;
21
22/// Maximum number of blobs per transaction after Fusaka hardfork activation.
23pub const MAX_BLOBS_PER_TX_FUSAKA: u64 = 6;
24
25/// A commitment/proof serialized as 0x-prefixed hex string
26pub type Cell = FixedBytes<BYTES_PER_CELL>;
27
28mod rlp;
29pub use rlp::*;
30
31#[cfg(feature = "kzg-sidecar")]
32mod sidecar;
33#[cfg(feature = "kzg-sidecar")]
34pub use sidecar::*;