Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

use alloc::vec::Vec;
use alloy_consensus::{Header, TxEnvelope};
use alloy_primitives::{Address, BlockHash, BlockNumber, B256};
use alloy_eips::eip4895::Withdrawal;
use alloy_primitives::{BlockHash, BlockNumber, B256};

use alloy_rlp::{RlpDecodable, RlpEncodable};
use op_alloy_consensus::OpTxEnvelope;
Expand Down Expand Up @@ -132,19 +133,3 @@ pub struct OpBlock {
/// Block withdrawals.
pub withdrawals: Option<Vec<Withdrawal>>,
}

/// Withdrawal represents a validator withdrawal from the consensus layer.
///
/// Taken from [reth-primitives](https://github.com/paradigmxyz/reth)
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, PartialEq, Eq, Default, Hash, RlpEncodable, RlpDecodable)]
pub struct Withdrawal {
/// Monotonically increasing identifier issued by consensus layer.
pub index: u64,
/// Index of validator associated with withdrawal.
pub validator_index: u64,
/// Target address for withdrawn ether.
pub address: Address,
/// Value of the withdrawal in gwei.
pub amount: u64,
}
7 changes: 6 additions & 1 deletion crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@

extern crate alloc;

/// Re-export the [Withdrawal] type from the [alloy_eips] crate.
///
/// [Withdrawal]: alloy_eips::eip4895::Withdrawal
pub use alloy_eips::eip4895::Withdrawal;

pub mod block;
pub use block::{Block, BlockID, BlockInfo, BlockKind, L2BlockInfo, OpBlock, Withdrawal};
pub use block::{Block, BlockID, BlockInfo, BlockKind, L2BlockInfo, OpBlock};

pub mod block_info;
pub use block_info::{L1BlockInfoBedrock, L1BlockInfoEcotone, L1BlockInfoTx};
Expand Down