chore: remove total difficulty from HeaderProvider (#19151)

This commit is contained in:
joshieDo
2025-10-21 11:56:36 +01:00
committed by GitHub
parent f0c0b3db4e
commit e21048314c
28 changed files with 87 additions and 315 deletions

View File

@@ -1,6 +1,6 @@
use alloc::vec::Vec;
use alloy_eips::BlockHashOrNumber;
use alloy_primitives::{BlockHash, BlockNumber, U256};
use alloy_primitives::{BlockHash, BlockNumber};
use core::ops::RangeBounds;
use reth_primitives_traits::{BlockHeader, SealedHeader};
use reth_storage_errors::provider::ProviderResult;
@@ -44,12 +44,6 @@ pub trait HeaderProvider: Send + Sync {
}
}
/// Get total difficulty by block hash.
fn header_td(&self, hash: BlockHash) -> ProviderResult<Option<U256>>;
/// Get total difficulty by block number.
fn header_td_by_number(&self, number: BlockNumber) -> ProviderResult<Option<U256>>;
/// Get headers in range of block numbers
fn headers_range(
&self,

View File

@@ -15,7 +15,7 @@ use alloc::{boxed::Box, string::String, sync::Arc, vec::Vec};
use alloy_consensus::transaction::TransactionMeta;
use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
use alloy_primitives::{
Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, B256, U256,
Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, B256,
};
use core::{
fmt::Debug,
@@ -356,14 +356,6 @@ impl<C: Send + Sync, N: NodePrimitives> HeaderProvider for NoopProvider<C, N> {
Ok(None)
}
fn header_td(&self, _hash: BlockHash) -> ProviderResult<Option<U256>> {
Ok(None)
}
fn header_td_by_number(&self, _number: BlockNumber) -> ProviderResult<Option<U256>> {
Ok(None)
}
fn headers_range(
&self,
_range: impl RangeBounds<BlockNumber>,