feat: use alloy block types (#13518)

This commit is contained in:
Matthias Seitz
2024-12-31 10:30:15 +01:00
committed by GitHub
parent 9a062c0844
commit f163b3d3f9
8 changed files with 111 additions and 388 deletions

View File

@ -18,7 +18,7 @@ use clap::Parser;
use csv::Writer;
use reth_cli_runner::CliContext;
use reth_node_core::args::BenchmarkArgs;
use reth_primitives::{Block, BlockExt};
use reth_primitives::SealedBlock;
use reth_rpc_types_compat::engine::payload::block_to_payload;
use std::time::Instant;
use tracing::{debug, info};
@ -46,8 +46,7 @@ impl Command {
let block_res =
block_provider.get_block_by_number(next_block.into(), true.into()).await;
let block = block_res.unwrap().unwrap();
let block_hash = block.header.hash;
let block = Block::try_from(block).unwrap().seal(block_hash);
let block: SealedBlock = block.try_into().unwrap();
let head_block_hash = block.hash();
let safe_block_hash = block_provider
.get_block_by_number(block.number.saturating_sub(32).into(), false.into());

View File

@ -16,7 +16,7 @@ use clap::Parser;
use csv::Writer;
use reth_cli_runner::CliContext;
use reth_node_core::args::BenchmarkArgs;
use reth_primitives::{Block, BlockExt};
use reth_primitives::SealedBlock;
use reth_rpc_types_compat::engine::payload::block_to_payload;
use std::time::Instant;
use tracing::{debug, info};
@ -46,8 +46,7 @@ impl Command {
let block_res =
block_provider.get_block_by_number(next_block.into(), true.into()).await;
let block = block_res.unwrap().unwrap();
let block_hash = block.header.hash;
let block = Block::try_from(block).unwrap().seal(block_hash);
let block: SealedBlock = block.try_into().unwrap();
next_block += 1;
sender.send(block).await.unwrap();