mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: bump alloy (#12215)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -74,14 +74,17 @@ impl BenchContext {
|
||||
let first_block = match benchmark_mode {
|
||||
BenchMode::Continuous => {
|
||||
// fetch Latest block
|
||||
block_provider.get_block_by_number(BlockNumberOrTag::Latest, true).await?.unwrap()
|
||||
block_provider
|
||||
.get_block_by_number(BlockNumberOrTag::Latest, true.into())
|
||||
.await?
|
||||
.unwrap()
|
||||
}
|
||||
BenchMode::Range(ref mut range) => {
|
||||
match range.next() {
|
||||
Some(block_number) => {
|
||||
// fetch first block in range
|
||||
block_provider
|
||||
.get_block_by_number(block_number.into(), true)
|
||||
.get_block_by_number(block_number.into(), true.into())
|
||||
.await?
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
@ -43,16 +43,17 @@ impl Command {
|
||||
let (sender, mut receiver) = tokio::sync::mpsc::channel(1000);
|
||||
tokio::task::spawn(async move {
|
||||
while benchmark_mode.contains(next_block) {
|
||||
let block_res = block_provider.get_block_by_number(next_block.into(), true).await;
|
||||
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.inner).unwrap().seal(block_hash);
|
||||
let block = Block::try_from(block).unwrap().seal(block_hash);
|
||||
let head_block_hash = block.hash();
|
||||
let safe_block_hash = block_provider
|
||||
.get_block_by_number(block.number.saturating_sub(32).into(), false);
|
||||
.get_block_by_number(block.number.saturating_sub(32).into(), false.into());
|
||||
|
||||
let finalized_block_hash = block_provider
|
||||
.get_block_by_number(block.number.saturating_sub(64).into(), false);
|
||||
.get_block_by_number(block.number.saturating_sub(64).into(), false.into());
|
||||
|
||||
let (safe, finalized) = tokio::join!(safe_block_hash, finalized_block_hash,);
|
||||
|
||||
|
||||
@ -43,10 +43,11 @@ impl Command {
|
||||
let (sender, mut receiver) = tokio::sync::mpsc::channel(1000);
|
||||
tokio::task::spawn(async move {
|
||||
while benchmark_mode.contains(next_block) {
|
||||
let block_res = block_provider.get_block_by_number(next_block.into(), true).await;
|
||||
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.inner).unwrap().seal(block_hash);
|
||||
let block = Block::try_from(block).unwrap().seal(block_hash);
|
||||
|
||||
next_block += 1;
|
||||
sender.send(block).await.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user