Improve eth_getLogs performance for latest block (#6305)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Iraklis Leontiadis
2024-02-25 14:33:12 +02:00
committed by GitHub
parent 2a10306e3b
commit d3d994cedd
3 changed files with 43 additions and 16 deletions

View File

@@ -1,10 +1,16 @@
use crate::{BlockNumber, B256};
use crate::{BlockNumHash, BlockNumber, B256};
/// Current status of the blockchain's head.
#[derive(Default, Clone, Debug, Eq, PartialEq)]
#[derive(Default, Copy, Clone, Debug, Eq, PartialEq)]
pub struct ChainInfo {
/// The block hash of the highest fully synced block.
pub best_hash: B256,
/// The block number of the highest fully synced block.
pub best_number: BlockNumber,
}
impl From<ChainInfo> for BlockNumHash {
fn from(value: ChainInfo) -> Self {
BlockNumHash { number: value.best_number, hash: value.best_hash }
}
}