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/// A commitment/proof serialized as 0x-prefixed hex string
23pub type Cell = FixedBytes<BYTES_PER_CELL>;
24
25/// CL-enforced target blobs per block after Fusaka hardfork activation.
26pub const TARGET_BLOBS_PER_BLOCK_FULU: u64 = 48;
27
28/// CL-enforced maximum blobs per block after Fusaka hardfork activation.
29pub const MAX_BLOBS_PER_BLOCK_FULU: u64 = 64;
30
31mod rlp;
32pub use rlp::*;
33
34#[cfg(feature = "kzg-sidecar")]
35mod sidecar;
36#[cfg(feature = "kzg-sidecar")]
37pub use sidecar::*;