feat: add SealedBlock in reth-primitives-traits (#13735)

This commit is contained in:
Matthias Seitz
2025-01-15 02:12:43 +01:00
committed by GitHub
parent 1267718c7e
commit 83b2fb9b41
171 changed files with 3231 additions and 2866 deletions

View File

@ -15,6 +15,7 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-revm = { workspace = true, features = ["witness"] }
reth-transaction-pool.workspace = true
reth-provider.workspace = true

View File

@ -25,9 +25,9 @@ use reth_payload_builder_primitives::PayloadBuilderError;
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_payload_util::{NoopPayloadTransactions, PayloadTransactions};
use reth_primitives::{
proofs, transaction::SignedTransactionIntoRecoveredExt, Block, BlockBody, BlockExt,
SealedHeader, TxType,
proofs, transaction::SignedTransactionIntoRecoveredExt, Block, BlockBody, SealedHeader, TxType,
};
use reth_primitives_traits::block::Block as _;
use reth_provider::{
HashedPostStateProvider, ProviderError, StateProofProvider, StateProviderFactory,
StateRootProvider,

View File

@ -17,7 +17,7 @@ use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_primitives::{OpBlock, OpPrimitives, OpTransactionSigned};
use reth_payload_builder::EthPayloadBuilderAttributes;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
use reth_primitives::{transaction::WithEncoded, SealedBlockFor};
use reth_primitives::{transaction::WithEncoded, SealedBlock};
use reth_rpc_types_compat::engine::payload::{
block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2,
};
@ -135,7 +135,7 @@ pub struct OpBuiltPayload {
/// Identifier of the payload
pub(crate) id: PayloadId,
/// The built block
pub(crate) block: Arc<SealedBlockFor<OpBlock>>,
pub(crate) block: Arc<SealedBlock<OpBlock>>,
/// Block execution data for the payload, if any.
pub(crate) executed_block: Option<ExecutedBlock<OpPrimitives>>,
/// The fees of the block
@ -155,7 +155,7 @@ impl OpBuiltPayload {
/// Initializes the payload with the given initial block.
pub const fn new(
id: PayloadId,
block: Arc<SealedBlockFor<OpBlock>>,
block: Arc<SealedBlock<OpBlock>>,
fees: U256,
chain_spec: Arc<OpChainSpec>,
attributes: OpPayloadBuilderAttributes,
@ -170,7 +170,7 @@ impl OpBuiltPayload {
}
/// Returns the built block(sealed)
pub fn block(&self) -> &SealedBlockFor<OpBlock> {
pub fn block(&self) -> &SealedBlock<OpBlock> {
&self.block
}
@ -188,7 +188,7 @@ impl OpBuiltPayload {
impl BuiltPayload for OpBuiltPayload {
type Primitives = OpPrimitives;
fn block(&self) -> &SealedBlockFor<OpBlock> {
fn block(&self) -> &SealedBlock<OpBlock> {
&self.block
}
@ -208,7 +208,7 @@ impl BuiltPayload for OpBuiltPayload {
impl BuiltPayload for &OpBuiltPayload {
type Primitives = OpPrimitives;
fn block(&self) -> &SealedBlockFor<OpBlock> {
fn block(&self) -> &SealedBlock<OpBlock> {
(**self).block()
}