feat: bump alloy (#12215)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Arsenii Kulikov
2024-11-06 18:50:25 +04:00
committed by GitHub
parent 12b0637485
commit 38fdc93a12
52 changed files with 588 additions and 1046 deletions

View File

@ -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()
}

View File

@ -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,);

View File

@ -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();