Skip to content

Commit

Permalink
migrate benches
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jan 10, 2025
1 parent 82ffabe commit 12f2f39
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions crates/engine/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub use reth_engine_tree::{
};
use reth_evm::execute::BlockExecutorProvider;
use reth_network_p2p::BlockClient;
use reth_node_types::{BlockTy, BodyTy, HeaderTy, NodeTypes, NodeTypesWithEngine};
use reth_node_types::{BlockTy, NodeTypes, NodeTypesWithEngine};
use reth_payload_builder::PayloadBuilderHandle;
use reth_primitives::EthPrimitives;
use reth_provider::{
Expand Down Expand Up @@ -55,7 +55,7 @@ type EngineServiceType<N, Client> = ChainOrchestrator<
pub struct EngineService<N, Client, E>
where
N: EngineNodeTypes,
Client: BlockClient<Header = HeaderTy<N>, Body = BodyTy<N>> + 'static,
Client: BlockClient<Block = BlockTy<N>> + 'static,
E: BlockExecutorProvider + 'static,
{
orchestrator: EngineServiceType<N, Client>,
Expand All @@ -65,7 +65,7 @@ where
impl<N, Client, E> EngineService<N, Client, E>
where
N: EngineNodeTypes,
Client: BlockClient<Header = HeaderTy<N>, Body = BodyTy<N>> + 'static,
Client: BlockClient<Block = BlockTy<N>> + 'static,
E: BlockExecutorProvider<Primitives = N::Primitives> + 'static,
{
/// Constructor for `EngineService`.
Expand Down Expand Up @@ -133,7 +133,7 @@ where
impl<N, Client, E> Stream for EngineService<N, Client, E>
where
N: EngineNodeTypes,
Client: BlockClient<Header = HeaderTy<N>, Body = BodyTy<N>> + 'static,
Client: BlockClient<Block = BlockTy<N>> + 'static,
E: BlockExecutorProvider + 'static,
{
type Item = ChainEvent<BeaconConsensusEngineEvent<N::Primitives>>;
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc/rpc-engine-api/tests/it/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ fn transform_block<F: FnOnce(Block) -> Block>(src: SealedBlock, f: F) -> Executi
transformed.header.transactions_root =
proofs::calculate_transaction_root(&transformed.body.transactions);
transformed.header.ommers_hash = proofs::calculate_ommers_root(&transformed.body.ommers);
block_to_payload(SealedBlock::new(SealedHeader::seal(transformed.header), transformed.body)).0
block_to_payload(SealedBlock::from_sealed_parts(
SealedHeader::seal(transformed.header),
transformed.body,
))
.0
}

#[test]
Expand Down
7 changes: 3 additions & 4 deletions testing/ef-tests/src/cases/blockchain_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ impl Case for BlockchainTestCase {

// Insert initial test state into the provider.
provider.insert_historical_block(
SealedBlock::seal_parts(
case.genesis_block_header.clone(),
SealedBlock::<reth_primitives::Block>::from_sealed_parts(
case.genesis_block_header.clone().into(),
BlockBody::default(),
)
.try_recover()
Expand All @@ -113,8 +113,7 @@ impl Case for BlockchainTestCase {
let last_block = case.blocks.iter().try_fold(None, |_, block| {
let decoded =
SealedBlock::<reth_primitives::Block>::decode(&mut block.rlp.as_ref())?;
provider
.insert_historical_block(decoded.clone().try_with_senders().unwrap())?;
provider.insert_historical_block(decoded.clone().try_recover().unwrap())?;
Ok::<Option<SealedBlock>, Error>(Some(decoded))
})?;
provider
Expand Down

0 comments on commit 12f2f39

Please sign in to comment.