mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-08 23:08:19 -05:00
changed possible #[allow()] -> #[expect()] (#15168)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -235,7 +235,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>, Ext: clap::Args + fmt::Debug> Cl
|
||||
|
||||
/// Commands to be executed
|
||||
#[derive(Debug, Subcommand)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[expect(clippy::large_enum_variant)]
|
||||
pub enum Commands<C: ChainSpecParser, Ext: clap::Args + fmt::Debug> {
|
||||
/// Start the node
|
||||
#[command(name = "node")]
|
||||
|
||||
@@ -3,7 +3,7 @@ use reth_exex::ExExContext;
|
||||
use reth_node_ethereum::EthereumNode;
|
||||
|
||||
async fn my_exex<Node: FullNodeComponents>(mut _ctx: ExExContext<Node>) -> eyre::Result<()> {
|
||||
#[allow(clippy::empty_loop)]
|
||||
#[expect(clippy::empty_loop)]
|
||||
loop {}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use tokio::sync::{broadcast, mpsc};
|
||||
use tokio_stream::wrappers::ReceiverStream;
|
||||
use tonic::{transport::Server, Request, Response, Status};
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
struct ExExService {
|
||||
notifications: Arc<broadcast::Sender<ExExNotification>>,
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ impl RemoteExEx for ExExService {
|
||||
}
|
||||
|
||||
// ANCHOR: snippet
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
async fn remote_exex<Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>>(
|
||||
mut ctx: ExExContext<Node>,
|
||||
notifications: Arc<broadcast::Sender<ExExNotification>>,
|
||||
|
||||
@@ -16,7 +16,7 @@ use std::sync::OnceLock;
|
||||
|
||||
/// A state provider that stores references to in-memory blocks along with their state as well as a
|
||||
/// reference of the historical state provider for fallback lookups.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct MemoryOverlayStateProviderRef<
|
||||
'a,
|
||||
N: NodePrimitives = reth_ethereum_primitives::EthPrimitives,
|
||||
|
||||
@@ -242,11 +242,11 @@ struct TableDiffElement<T: Table> {
|
||||
key: T::Key,
|
||||
|
||||
/// The element from the first table
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
first: T::Value,
|
||||
|
||||
/// The element from the second table
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
second: T::Value,
|
||||
}
|
||||
|
||||
@@ -333,11 +333,11 @@ where
|
||||
#[derive(Debug)]
|
||||
enum ExtraTableElement<T: Table> {
|
||||
/// The extra element that is in the first table
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
First { key: T::Key, value: T::Value },
|
||||
|
||||
/// The extra element that is in the second table
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
Second { key: T::Key, value: T::Value },
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ use reth_rpc_eth_api::{
|
||||
EthApiTypes,
|
||||
};
|
||||
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct RpcTestContext<Node: FullNodeComponents, EthApi: EthApiTypes> {
|
||||
pub inner: RpcRegistry<Node, EthApi>,
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ pub trait Action<I>: Send + 'static {
|
||||
}
|
||||
|
||||
/// Simplified action container for storage in tests
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct ActionBox<I>(Box<dyn Action<I>>);
|
||||
|
||||
impl<I: 'static> ActionBox<I> {
|
||||
@@ -262,7 +262,7 @@ where
|
||||
}
|
||||
|
||||
/// Run a sequence of actions in series.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct Sequence<I> {
|
||||
/// Actions to execute in sequence
|
||||
pub actions: Vec<Box<dyn Action<I>>>,
|
||||
|
||||
@@ -60,7 +60,7 @@ impl<I> Default for Environment<I> {
|
||||
}
|
||||
|
||||
/// Builder for creating test scenarios
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
#[derive(Default)]
|
||||
pub struct TestBuilder<I> {
|
||||
setup: Option<Setup<I>>,
|
||||
|
||||
@@ -64,7 +64,7 @@ where
|
||||
N: EngineNodeTypes,
|
||||
{
|
||||
/// Constructor for [`LocalEngineService`].
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new<B, V, C>(
|
||||
consensus: Arc<dyn FullConsensus<N::Primitives, Error = ConsensusError>>,
|
||||
executor_factory: impl BlockExecutorProvider<Primitives = N::Primitives>,
|
||||
|
||||
@@ -45,13 +45,13 @@ impl ForkchoiceStateTracker {
|
||||
}
|
||||
|
||||
/// Returns whether the latest received FCU is valid: [`ForkchoiceStatus::Valid`]
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
pub(crate) fn is_latest_valid(&self) -> bool {
|
||||
self.latest_status().is_some_and(|s| s.is_valid())
|
||||
}
|
||||
|
||||
/// Returns whether the latest received FCU is syncing: [`ForkchoiceStatus::Syncing`]
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
pub(crate) fn is_latest_syncing(&self) -> bool {
|
||||
self.latest_status().is_some_and(|s| s.is_syncing())
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ type EngineServiceType<N, Client> = ChainOrchestrator<
|
||||
|
||||
/// The type that drives the chain forward and communicates progress.
|
||||
#[pin_project]
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
// TODO(mattsse): remove hidde once fixed : <https://github.com/rust-lang/rust/issues/135363>
|
||||
// otherwise rustdoc fails to resolve the alias
|
||||
#[doc(hidden)]
|
||||
@@ -72,7 +72,7 @@ where
|
||||
E: BlockExecutorProvider<Primitives = N::Primitives> + 'static,
|
||||
{
|
||||
/// Constructor for `EngineService`.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new<V, C>(
|
||||
consensus: Arc<dyn FullConsensus<N::Primitives, Error = ConsensusError>>,
|
||||
executor_factory: E,
|
||||
|
||||
@@ -99,7 +99,7 @@ impl<N: ProviderNodeTypes> PipelineSync<N> {
|
||||
}
|
||||
|
||||
/// Returns `true` if a pipeline target is queued and will be triggered on the next `poll`.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
const fn is_pipeline_sync_pending(&self) -> bool {
|
||||
self.pending_pipeline_target.is_some() && self.pipeline_state.is_idle()
|
||||
}
|
||||
@@ -212,7 +212,7 @@ impl<N: ProviderNodeTypes> BackfillSync for PipelineSync<N> {
|
||||
/// blockchain tree any messages that would result in database writes, since it would result in a
|
||||
/// deadlock.
|
||||
#[derive(Debug)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[expect(clippy::large_enum_variant)]
|
||||
enum PipelineState<N: ProviderNodeTypes> {
|
||||
/// Pipeline is idle.
|
||||
Idle(Option<Pipeline<N>>),
|
||||
|
||||
@@ -55,7 +55,7 @@ pub enum DownloadOutcome<B: Block> {
|
||||
}
|
||||
|
||||
/// Basic [`BlockDownloader`].
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct BasicBlockDownloader<Client, B: Block>
|
||||
where
|
||||
Client: BlockClient + 'static,
|
||||
|
||||
@@ -72,7 +72,7 @@ mod metrics;
|
||||
mod payload_processor;
|
||||
mod persistence_state;
|
||||
// TODO(alexey): compare trie updates in `insert_block_inner`
|
||||
#[allow(unused)]
|
||||
#[expect(unused)]
|
||||
mod trie_updates;
|
||||
|
||||
use crate::tree::error::AdvancePersistenceError;
|
||||
@@ -3126,7 +3126,7 @@ mod tests {
|
||||
}
|
||||
|
||||
/// Signals to the channel task that a value should be released
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
fn release(&self) {
|
||||
let _ = self.release.send(());
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ impl ExecutionCache {
|
||||
}
|
||||
|
||||
/// Clears the tracked cache
|
||||
#[allow(unused)]
|
||||
#[expect(unused)]
|
||||
pub(crate) fn clear(&self) {
|
||||
self.inner.write().take();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ const SPARSE_TRIE_INCREMENTAL_LEVEL: usize = 2;
|
||||
/// A task responsible for populating the sparse trie.
|
||||
pub(super) struct SparseTrieTask<BPF> {
|
||||
/// Executor used to spawn subtasks.
|
||||
#[allow(unused)] // TODO use this for spawning trie tasks
|
||||
#[expect(unused)] // TODO use this for spawning trie tasks
|
||||
pub(super) executor: WorkloadExecutor,
|
||||
/// Receives updates from the state root task.
|
||||
pub(super) updates: mpsc::Receiver<SparseTrieUpdate>,
|
||||
|
||||
@@ -162,7 +162,7 @@ pub(super) fn compare_trie_updates(
|
||||
let (mut task, mut regular) =
|
||||
(task.storage_tries.remove(&key), regular.storage_tries.remove(&key));
|
||||
if task != regular {
|
||||
#[allow(clippy::or_fun_call)]
|
||||
#[expect(clippy::or_fun_call)]
|
||||
let storage_diff = compare_storage_trie_updates(
|
||||
|| trie_cursor_factory.storage_trie_cursor(key),
|
||||
// Compare non-existent storage tries as empty.
|
||||
|
||||
@@ -967,7 +967,7 @@ pub(super) mod serde_bincode_compat {
|
||||
/// Bincode-compatible [`super::Transaction`] serde implementation.
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
pub enum Transaction<'a> {
|
||||
Legacy(TxLegacy<'a>),
|
||||
Eip2930(TxEip2930<'a>),
|
||||
|
||||
@@ -498,7 +498,7 @@ impl From<BlockHash> for ChainSplitTarget {
|
||||
|
||||
/// Result of a split chain.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[expect(clippy::large_enum_variant)]
|
||||
pub enum ChainSplit<N: NodePrimitives = reth_ethereum_primitives::EthPrimitives> {
|
||||
/// Chain is not split. Pending chain is returned.
|
||||
/// Given block split is higher than last block.
|
||||
|
||||
@@ -436,7 +436,7 @@ pub(super) mod serde_bincode_compat {
|
||||
bundle: Cow<'a, BundleState>,
|
||||
receipts: Vec<Vec<T::BincodeRepr<'a>>>,
|
||||
first_block: BlockNumber,
|
||||
#[allow(clippy::owned_cow)]
|
||||
#[expect(clippy::owned_cow)]
|
||||
requests: Cow<'a, Vec<Requests>>,
|
||||
}
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ where
|
||||
}
|
||||
|
||||
/// A generic block executor provider that can create executors using a strategy factory.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct BasicBlockExecutorProvider<F> {
|
||||
strategy_factory: F,
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ mod tests {
|
||||
/// <https://github.com/paradigmxyz/reth/issues/12054>
|
||||
#[test]
|
||||
const fn issue_12054() {
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
struct ExEx<Node: FullNodeComponents> {
|
||||
ctx: ExExContext<Node>,
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ pub trait ExExNotificationsStream<N: NodePrimitives = EthPrimitives>:
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[expect(clippy::large_enum_variant)]
|
||||
enum ExExNotificationsInner<P, E>
|
||||
where
|
||||
E: BlockExecutorProvider,
|
||||
|
||||
@@ -96,9 +96,9 @@ pub(super) mod serde_bincode_compat {
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
#[serde(bound = "")]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[expect(clippy::large_enum_variant)]
|
||||
pub enum ExExNotification<'a, N>
|
||||
where
|
||||
N: NodePrimitives,
|
||||
|
||||
@@ -225,7 +225,7 @@ impl Discv5 {
|
||||
|
||||
/// Process an event from the underlying [`discv5::Discv5`] node.
|
||||
pub fn on_discv5_update(&self, update: discv5::Event) -> Option<DiscoveredPeer> {
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[expect(clippy::match_same_arms)]
|
||||
match update {
|
||||
discv5::Event::SocketUpdated(_) | discv5::Event::TalkRequest(_) |
|
||||
// `Discovered` not unique discovered peers
|
||||
@@ -772,8 +772,8 @@ mod test {
|
||||
|
||||
// Copied from sigp/discv5 with slight modification (U256 type)
|
||||
// <https://github.com/sigp/discv5/blob/master/src/kbucket/key.rs#L89-L101>
|
||||
#[allow(unreachable_pub)]
|
||||
#[allow(unused)]
|
||||
#[expect(unreachable_pub)]
|
||||
#[expect(unused)]
|
||||
#[allow(clippy::assign_op_pattern)]
|
||||
mod sigp {
|
||||
use alloy_primitives::U256;
|
||||
|
||||
@@ -90,7 +90,7 @@ impl DnsDiscoveryHandle {
|
||||
|
||||
/// A client that discovers nodes via DNS.
|
||||
#[must_use = "Service does nothing unless polled"]
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct DnsDiscoveryService<R: Resolver = DnsResolver> {
|
||||
/// Copy of the sender half, so new [`DnsDiscoveryHandle`] can be created on demand.
|
||||
command_tx: UnboundedSender<DnsDiscoveryCommand>,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/// A naive concurrent downloader.
|
||||
#[allow(clippy::module_inception)]
|
||||
#[expect(clippy::module_inception)]
|
||||
pub mod bodies;
|
||||
|
||||
/// A body downloader that does nothing. Useful to build unwind-only pipelines.
|
||||
|
||||
@@ -213,7 +213,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
#[allow(clippy::reversed_empty_ranges)]
|
||||
#[expect(clippy::reversed_empty_ranges)]
|
||||
async fn set_download_range_error_returned() {
|
||||
reth_tracing::init_test_tracing();
|
||||
let factory = create_test_provider_factory();
|
||||
|
||||
@@ -37,7 +37,7 @@ where
|
||||
macro_rules! fuzz_type_and_name {
|
||||
( $x:ty, $fuzzname:ident ) => {
|
||||
/// Fuzzes the round-trip encoding of the type.
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
#[test_fuzz]
|
||||
fn $fuzzname(thing: $x) {
|
||||
crate::roundtrip_fuzz::<$x>(thing)
|
||||
@@ -46,7 +46,7 @@ macro_rules! fuzz_type_and_name {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
pub mod fuzz_rlp {
|
||||
use crate::roundtrip_encoding;
|
||||
use alloy_rlp::{RlpDecodableWrapper, RlpEncodableWrapper};
|
||||
|
||||
@@ -26,7 +26,7 @@ impl NetworkInfo for NoopNetwork {
|
||||
}
|
||||
|
||||
async fn network_status(&self) -> Result<NetworkStatus, NetworkError> {
|
||||
#[allow(deprecated)]
|
||||
#[expect(deprecated)]
|
||||
Ok(NetworkStatus {
|
||||
client_version: "reth-test".to_string(),
|
||||
protocol_version: ProtocolVersion::V5 as u64,
|
||||
|
||||
@@ -15,7 +15,7 @@ use tokio::sync::mpsc;
|
||||
pub(crate) const ETH_REQUEST_CHANNEL_CAPACITY: usize = 256;
|
||||
|
||||
/// A builder that can configure all components of the network.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct NetworkBuilder<Tx, Eth, N: NetworkPrimitives = EthNetworkPrimitives> {
|
||||
pub(crate) network: NetworkManager<N>,
|
||||
pub(crate) transactions: Tx,
|
||||
|
||||
@@ -227,7 +227,7 @@ impl NetworkConfigBuilder<EthNetworkPrimitives> {
|
||||
|
||||
// === impl NetworkConfigBuilder ===
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
impl<N: NetworkPrimitives> NetworkConfigBuilder<N> {
|
||||
/// Create a new builder instance with a random secret key.
|
||||
pub fn with_rng_secret_key() -> Self {
|
||||
|
||||
@@ -57,7 +57,7 @@ pub struct EthRequestHandler<C, N: NetworkPrimitives = EthNetworkPrimitives> {
|
||||
client: C,
|
||||
/// Used for reporting peers.
|
||||
// TODO use to report spammers
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
peers: PeersHandle,
|
||||
/// Incoming request from the [`NetworkManager`](crate::NetworkManager).
|
||||
incoming_requests: ReceiverStream<IncomingEthRequest<N>>,
|
||||
|
||||
@@ -443,7 +443,7 @@ impl<N: NetworkPrimitives> NetworkManager<N> {
|
||||
let status = sessions.status();
|
||||
let hello_message = sessions.hello_message();
|
||||
|
||||
#[allow(deprecated)]
|
||||
#[expect(deprecated)]
|
||||
NetworkStatus {
|
||||
client_version: hello_message.client_version,
|
||||
protocol_version: hello_message.protocol_version as u64,
|
||||
|
||||
@@ -375,7 +375,7 @@ pub struct TxTypesCounter {
|
||||
|
||||
impl TxTypesCounter {
|
||||
pub(crate) fn increase_by_tx_type(&mut self, tx_type: TxType) {
|
||||
#[allow(unreachable_patterns)]
|
||||
#[expect(unreachable_patterns)]
|
||||
match tx_type {
|
||||
TxType::Legacy => {
|
||||
self.legacy += 1;
|
||||
|
||||
@@ -51,7 +51,7 @@ pub struct NetworkHandle<N: NetworkPrimitives = EthNetworkPrimitives> {
|
||||
|
||||
impl<N: NetworkPrimitives> NetworkHandle<N> {
|
||||
/// Creates a single new instance.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub(crate) fn new(
|
||||
num_active_peers: Arc<AtomicUsize>,
|
||||
listener_address: Arc<Mutex<SocketAddr>>,
|
||||
|
||||
@@ -76,7 +76,7 @@ const MAX_QUEUED_OUTGOING_RESPONSES: usize = 4;
|
||||
/// - incoming _internal_ requests/broadcasts via the request/command channel
|
||||
/// - incoming requests/broadcasts _from remote_ via the connection
|
||||
/// - responses for handled ETH requests received from the remote peer.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
pub(crate) struct ActiveSession<N: NetworkPrimitives> {
|
||||
/// Keeps track of request ids.
|
||||
pub(crate) next_id: u64,
|
||||
@@ -324,7 +324,7 @@ impl<N: NetworkPrimitives> ActiveSession<N> {
|
||||
/// Send a message back to the [`SessionManager`](super::SessionManager).
|
||||
///
|
||||
/// Returns the message if the bounded channel is currently unable to handle this message.
|
||||
#[allow(clippy::result_large_err)]
|
||||
#[expect(clippy::result_large_err)]
|
||||
fn try_emit_broadcast(&self, message: PeerMessage<N>) -> Result<(), ActiveSessionMessage<N>> {
|
||||
let Some(sender) = self.to_session_manager.inner().get_ref() else { return Ok(()) };
|
||||
|
||||
@@ -350,7 +350,7 @@ impl<N: NetworkPrimitives> ActiveSession<N> {
|
||||
/// covering both broadcasts and incoming requests.
|
||||
///
|
||||
/// Returns the message if the bounded channel is currently unable to handle this message.
|
||||
#[allow(clippy::result_large_err)]
|
||||
#[expect(clippy::result_large_err)]
|
||||
fn try_emit_request(&self, message: PeerMessage<N>) -> Result<(), ActiveSessionMessage<N>> {
|
||||
let Some(sender) = self.to_session_manager.inner().get_ref() else { return Ok(()) };
|
||||
|
||||
@@ -702,7 +702,7 @@ pub(crate) struct ReceivedRequest<N: NetworkPrimitives> {
|
||||
/// Receiver half of the channel that's supposed to receive the proper response.
|
||||
rx: PeerResponse<N>,
|
||||
/// Timestamp when we read this msg from the wire.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
received: Instant,
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ pub struct SessionManager<N: NetworkPrimitives> {
|
||||
|
||||
impl<N: NetworkPrimitives> SessionManager<N> {
|
||||
/// Creates a new empty [`SessionManager`].
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
secret_key: SecretKey,
|
||||
config: SessionsConfig,
|
||||
@@ -818,7 +818,7 @@ pub(crate) async fn pending_session_with_timeout<F, N: NetworkPrimitives>(
|
||||
/// Starts the authentication process for a connection initiated by a remote peer.
|
||||
///
|
||||
/// This will wait for the _incoming_ handshake request and answer it.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub(crate) async fn start_pending_incoming_session<N: NetworkPrimitives>(
|
||||
handshake: Arc<dyn EthRlpxHandshake>,
|
||||
disconnect_rx: oneshot::Receiver<()>,
|
||||
@@ -851,7 +851,7 @@ pub(crate) async fn start_pending_incoming_session<N: NetworkPrimitives>(
|
||||
|
||||
/// Starts the authentication process for a connection initiated by a remote peer.
|
||||
#[instrument(skip_all, fields(%remote_addr, peer_id), target = "net")]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
async fn start_pending_outbound_session<N: NetworkPrimitives>(
|
||||
handshake: Arc<dyn EthRlpxHandshake>,
|
||||
disconnect_rx: oneshot::Receiver<()>,
|
||||
@@ -902,7 +902,7 @@ async fn start_pending_outbound_session<N: NetworkPrimitives>(
|
||||
}
|
||||
|
||||
/// Authenticates a session
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
async fn authenticate<N: NetworkPrimitives>(
|
||||
handshake: Arc<dyn EthRlpxHandshake>,
|
||||
disconnect_rx: oneshot::Receiver<()>,
|
||||
@@ -987,7 +987,7 @@ async fn get_ecies_stream<Io: AsyncRead + AsyncWrite + Unpin>(
|
||||
///
|
||||
/// If additional [`RlpxSubProtocolHandlers`] are provided, the hello message will be updated to
|
||||
/// also negotiate the additional protocols.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
async fn authenticate_stream<N: NetworkPrimitives>(
|
||||
handshake: Arc<dyn EthRlpxHandshake>,
|
||||
stream: UnauthedP2PStream<ECIESStream<TcpStream>>,
|
||||
|
||||
@@ -506,7 +506,7 @@ pub(crate) struct ActivePeer<N: NetworkPrimitives> {
|
||||
/// Best block of the peer.
|
||||
pub(crate) best_hash: B256,
|
||||
/// The capabilities of the remote peer.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
pub(crate) capabilities: Arc<Capabilities>,
|
||||
/// A communication channel directly to the session task.
|
||||
pub(crate) request_tx: PeerRequestSender<PeerRequest<N>>,
|
||||
|
||||
@@ -169,7 +169,7 @@ struct ProtocolState {
|
||||
#[derive(Debug)]
|
||||
enum ProtocolEvent {
|
||||
Established {
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
direction: Direction,
|
||||
peer_id: PeerId,
|
||||
to_connection: mpsc::UnboundedSender<Command>,
|
||||
|
||||
@@ -322,7 +322,7 @@ enum BodyResponse<B> {
|
||||
/// NOTE: this assumes that bodies responses are returned by the client in the same order as the
|
||||
/// hash array used to request them.
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct FetchFullBlockRangeFuture<Client>
|
||||
where
|
||||
Client: BlockClient,
|
||||
|
||||
@@ -49,7 +49,7 @@ pub use states::*;
|
||||
pub type RethFullAdapter<DB, Types> =
|
||||
FullNodeTypesAdapter<Types, DB, BlockchainProvider<NodeTypesWithDBAdapter<Types, DB>>>;
|
||||
|
||||
#[allow(clippy::doc_markdown)]
|
||||
#[expect(clippy::doc_markdown)]
|
||||
#[cfg_attr(doc, aquamarine::aquamarine)]
|
||||
/// Declaratively construct a node.
|
||||
///
|
||||
|
||||
@@ -37,7 +37,7 @@ where
|
||||
}
|
||||
|
||||
/// Sets the hook that is run once the node's components are initialized.
|
||||
#[allow(unused)]
|
||||
#[expect(unused)]
|
||||
pub(crate) fn on_component_initialized<F>(mut self, hook: F) -> Self
|
||||
where
|
||||
F: OnComponentInitializedHook<Node> + 'static,
|
||||
@@ -56,7 +56,7 @@ where
|
||||
}
|
||||
|
||||
/// Sets the hook that is run once the node has started.
|
||||
#[allow(unused)]
|
||||
#[expect(unused)]
|
||||
pub(crate) fn on_node_started<F>(mut self, hook: F) -> Self
|
||||
where
|
||||
F: OnNodeStartedHook<Node, AddOns> + 'static,
|
||||
|
||||
@@ -581,7 +581,7 @@ where
|
||||
}
|
||||
|
||||
/// Creates a `BlockchainProvider` and attaches it to the launch context.
|
||||
#[allow(clippy::complexity)]
|
||||
#[expect(clippy::complexity)]
|
||||
pub fn with_blockchain_db<T, F>(
|
||||
self,
|
||||
create_blockchain_provider: F,
|
||||
@@ -1014,7 +1014,7 @@ pub struct WithMeteredProvider<N: NodeTypesWithDB> {
|
||||
|
||||
/// Helper container to bundle the [`ProviderFactory`], [`FullNodeTypes::Provider`]
|
||||
/// and a metrics sender.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct WithMeteredProviders<T>
|
||||
where
|
||||
T: FullNodeTypes,
|
||||
@@ -1024,7 +1024,7 @@ where
|
||||
}
|
||||
|
||||
/// Helper container to bundle the metered providers container and [`NodeAdapter`].
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct WithComponents<T, CB>
|
||||
where
|
||||
T: FullNodeTypes,
|
||||
|
||||
@@ -77,7 +77,7 @@ where
|
||||
}
|
||||
|
||||
/// Sets the hook that is run once the rpc server is started.
|
||||
#[allow(unused)]
|
||||
#[expect(unused)]
|
||||
pub(crate) fn on_rpc_started<F>(mut self, hook: F) -> Self
|
||||
where
|
||||
F: OnRpcStarted<Node, EthApi> + 'static,
|
||||
@@ -96,7 +96,7 @@ where
|
||||
}
|
||||
|
||||
/// Sets the hook that is run to configure the rpc modules.
|
||||
#[allow(unused)]
|
||||
#[expect(unused)]
|
||||
pub(crate) fn extend_rpc_modules<F>(mut self, hook: F) -> Self
|
||||
where
|
||||
F: ExtendRpcModules<Node, EthApi> + 'static,
|
||||
@@ -187,7 +187,7 @@ where
|
||||
|
||||
/// Helper wrapper type to encapsulate the [`RpcRegistryInner`] over components trait.
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
pub struct RpcRegistry<Node: FullNodeComponents, EthApi: EthApiTypes> {
|
||||
pub(crate) registry: RpcRegistryInner<
|
||||
Node::Provider,
|
||||
@@ -237,7 +237,7 @@ where
|
||||
/// [`reth_rpc::eth::EthApi`], and ultimately merge additional rpc handler into the configured
|
||||
/// transport modules [`TransportRpcModules`] as well as configured authenticated methods
|
||||
/// [`AuthRpcModule`].
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct RpcContext<'a, Node: FullNodeComponents, EthApi: EthApiTypes> {
|
||||
/// The node components.
|
||||
pub(crate) node: Node,
|
||||
|
||||
@@ -24,7 +24,7 @@ use reth_tracing::tracing::debug;
|
||||
use tokio::sync::watch;
|
||||
|
||||
/// Constructs a [Pipeline] that's wired to the network
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn build_networked_pipeline<N, Client, Executor>(
|
||||
config: &StageConfig,
|
||||
client: Client,
|
||||
@@ -70,7 +70,7 @@ where
|
||||
}
|
||||
|
||||
/// Builds the [Pipeline] with the given [`ProviderFactory`] and downloaders.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn build_pipeline<N, H, B, Executor>(
|
||||
provider_factory: ProviderFactory<N>,
|
||||
stage_config: &StageConfig,
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::num::ParseIntError;
|
||||
|
||||
/// Error while parsing a `ReceiptsLogPruneConfig`
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
#[allow(clippy::enum_variant_names)]
|
||||
#[expect(clippy::enum_variant_names)]
|
||||
pub(crate) enum ReceiptsLogError {
|
||||
/// The format of the filter is invalid.
|
||||
#[error("invalid filter format: {0}")]
|
||||
|
||||
@@ -46,7 +46,7 @@ pub struct NetworkArgs {
|
||||
#[command(flatten)]
|
||||
pub discovery: DiscoveryArgs,
|
||||
|
||||
#[allow(clippy::doc_markdown)]
|
||||
#[expect(clippy::doc_markdown)]
|
||||
/// Comma separated enode URLs of trusted peers for P2P connections.
|
||||
///
|
||||
/// --trusted-peers enode://abcd@192.168.0.1:30303
|
||||
|
||||
@@ -19,7 +19,7 @@ pub mod test_vectors;
|
||||
|
||||
/// Commands to be executed
|
||||
#[derive(Debug, Subcommand)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[expect(clippy::large_enum_variant)]
|
||||
pub enum Commands<Spec: ChainSpecParser = OpChainSpecParser, Ext: clap::Args + fmt::Debug = NoArgs>
|
||||
{
|
||||
/// Start the node
|
||||
|
||||
@@ -18,7 +18,7 @@ use reth_downloaders::file_client::FileClientError;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio_util::codec::Decoder;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
/// Specific codec for reading raw block bodies from a file
|
||||
/// with optimism-specific signature handling
|
||||
pub(crate) struct OvmBlockFileCodec;
|
||||
|
||||
@@ -39,7 +39,7 @@ pub struct RollupArgs {
|
||||
pub enable_tx_conditional: bool,
|
||||
}
|
||||
|
||||
#[allow(clippy::derivable_impls)]
|
||||
#[expect(clippy::derivable_impls)]
|
||||
impl Default for RollupArgs {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
||||
@@ -252,7 +252,7 @@ mod compact {
|
||||
tx_type: OpTxType,
|
||||
success: bool,
|
||||
cumulative_gas_used: u64,
|
||||
#[allow(clippy::owned_cow)]
|
||||
#[expect(clippy::owned_cow)]
|
||||
logs: Cow<'a, Vec<Log>>,
|
||||
deposit_nonce: Option<u64>,
|
||||
deposit_receipt_version: Option<u64>,
|
||||
|
||||
@@ -563,7 +563,7 @@ pub(super) mod serde_bincode_compat {
|
||||
bound = "serde_bincode_compat::SealedBlock<'a, T>: Serialize + serde::de::DeserializeOwned"
|
||||
)]
|
||||
block: serde_bincode_compat::SealedBlock<'a, T>,
|
||||
#[allow(clippy::owned_cow)]
|
||||
#[expect(clippy::owned_cow)]
|
||||
senders: Cow<'a, Vec<Address>>,
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ pub mod transaction;
|
||||
#[cfg(any(test, feature = "arbitrary"))]
|
||||
pub use block::{generate_valid_header, valid_header_strategy};
|
||||
pub use block::{Block, BlockBody, SealedBlock};
|
||||
#[allow(deprecated)]
|
||||
#[expect(deprecated)]
|
||||
pub use block::{BlockWithSenders, SealedBlockFor, SealedBlockWithSenders};
|
||||
|
||||
pub use receipt::{gas_spent_by_transactions, Receipt};
|
||||
@@ -50,7 +50,7 @@ pub use transaction::{
|
||||
util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message},
|
||||
InvalidTransactionError, Transaction, TransactionSigned, TxType,
|
||||
};
|
||||
#[allow(deprecated)]
|
||||
#[expect(deprecated)]
|
||||
pub use transaction::{PooledTransactionsElementEcRecovered, TransactionSignedEcRecovered};
|
||||
|
||||
// Re-exports
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use crate::Recovered;
|
||||
pub use alloy_consensus::transaction::PooledTransaction;
|
||||
use once_cell as _;
|
||||
#[allow(deprecated)]
|
||||
#[expect(deprecated)]
|
||||
pub use pooled::PooledTransactionsElementEcRecovered;
|
||||
pub use reth_primitives_traits::{
|
||||
sync::{LazyLock, OnceLock},
|
||||
|
||||
@@ -227,7 +227,7 @@ mod tests {
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
#[allow(clippy::skip_while_next)]
|
||||
#[expect(clippy::skip_while_next)]
|
||||
let pruned = changesets
|
||||
.iter()
|
||||
.enumerate()
|
||||
|
||||
@@ -235,7 +235,7 @@ mod tests {
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
#[allow(clippy::skip_while_next)]
|
||||
#[expect(clippy::skip_while_next)]
|
||||
let pruned = changesets
|
||||
.iter()
|
||||
.enumerate()
|
||||
|
||||
@@ -26,7 +26,7 @@ mod pending_state;
|
||||
pub use pending_state::*;
|
||||
|
||||
/// Reth provider implementing [`RessProtocolProvider`].
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct RethRessProtocolProvider<P, E> {
|
||||
provider: P,
|
||||
block_executor: E,
|
||||
|
||||
@@ -257,7 +257,7 @@ pub struct IpcServerStartError {
|
||||
|
||||
/// Data required by the server to handle requests received via an IPC connection
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
pub(crate) struct ServiceData {
|
||||
/// Registered server methods.
|
||||
pub(crate) methods: Methods,
|
||||
@@ -790,7 +790,7 @@ impl<HttpMiddleware, RpcMiddleware> Builder<HttpMiddleware, RpcMiddleware> {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
pub fn dummy_name() -> String {
|
||||
let num: u64 = rand::Rng::gen(&mut rand::thread_rng());
|
||||
if cfg!(windows) {
|
||||
|
||||
@@ -21,7 +21,7 @@ pub struct RpcService {
|
||||
}
|
||||
|
||||
/// Configuration of the `RpcService`.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) enum RpcServiceCfg {
|
||||
/// The server supports only calls.
|
||||
|
||||
@@ -100,7 +100,7 @@ use reth_rpc::eth::sim_bundle::EthSimBundle;
|
||||
pub mod rate_limiter;
|
||||
|
||||
/// Convenience function for starting a server in one step.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub async fn launch<N, Provider, Pool, Network, Tasks, EvmConfig, EthApi, BlockExecutor>(
|
||||
provider: Provider,
|
||||
pool: Pool,
|
||||
@@ -552,7 +552,7 @@ where
|
||||
/// This behaves exactly as [`RpcModuleBuilder::build`] for the [`TransportRpcModules`], but
|
||||
/// also configures the auth (engine api) server, which exposes a subset of the `eth_`
|
||||
/// namespace.
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
pub fn build_with_auth_server<EthApi>(
|
||||
self,
|
||||
module_config: TransportRpcModuleConfig,
|
||||
@@ -790,7 +790,7 @@ where
|
||||
BlockExecutor: BlockExecutorProvider<Primitives = N>,
|
||||
{
|
||||
/// Creates a new, empty instance.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new<EvmConfig>(
|
||||
provider: Provider,
|
||||
pool: Pool,
|
||||
|
||||
@@ -13,7 +13,7 @@ use reth_primitives_traits::block::Block as _;
|
||||
use reth_rpc_api::clients::EngineApiClient;
|
||||
use reth_rpc_layer::JwtSecret;
|
||||
|
||||
#[allow(unused_must_use)]
|
||||
#[expect(unused_must_use)]
|
||||
async fn test_basic_engine_calls<C>(client: &C)
|
||||
where
|
||||
C: ClientT + SubscriptionClientT + Sync + EngineApiClient<EthEngineTypes>,
|
||||
|
||||
@@ -92,7 +92,7 @@ where
|
||||
ChainSpec: EthereumHardforks + Send + Sync + 'static,
|
||||
{
|
||||
/// Create new instance of [`EngineApi`].
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
provider: Provider,
|
||||
chain_spec: Arc<ChainSpec>,
|
||||
|
||||
4
crates/rpc/rpc-eth-types/src/cache/db.rs
vendored
4
crates/rpc/rpc-eth-types/src/cache/db.rs
vendored
@@ -18,7 +18,7 @@ pub type StateCacheDb<'a> = CacheDB<StateProviderDatabase<StateProviderTraitObjW
|
||||
|
||||
/// Hack to get around 'higher-ranked lifetime error', see
|
||||
/// <https://github.com/rust-lang/rust/issues/100013>
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct StateProviderTraitObjWrapper<'a>(pub &'a dyn StateProvider);
|
||||
|
||||
impl reth_storage_api::StateRootProvider for StateProviderTraitObjWrapper<'_> {
|
||||
@@ -179,7 +179,7 @@ impl StateProvider for StateProviderTraitObjWrapper<'_> {
|
||||
|
||||
/// Hack to get around 'higher-ranked lifetime error', see
|
||||
/// <https://github.com/rust-lang/rust/issues/100013>
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct StateCacheDbRefMutWrapper<'a, 'b>(pub &'b mut StateCacheDb<'a>);
|
||||
|
||||
impl<'a> Database for StateCacheDbRefMutWrapper<'a, '_> {
|
||||
|
||||
@@ -124,7 +124,7 @@ impl EthReceiptBuilder {
|
||||
TxType::Eip1559 => ReceiptEnvelope::Eip1559(receipt_with_bloom),
|
||||
TxType::Eip4844 => ReceiptEnvelope::Eip4844(receipt_with_bloom),
|
||||
TxType::Eip7702 => ReceiptEnvelope::Eip7702(receipt_with_bloom),
|
||||
#[allow(unreachable_patterns)]
|
||||
#[expect(unreachable_patterns)]
|
||||
_ => unreachable!(),
|
||||
},
|
||||
)?;
|
||||
|
||||
@@ -38,7 +38,7 @@ use tower::{Layer, Service};
|
||||
/// .unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct AuthLayer<V> {
|
||||
validator: V,
|
||||
}
|
||||
@@ -104,7 +104,7 @@ where
|
||||
|
||||
/// A future representing the response of an RPC request
|
||||
#[pin_project]
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct ResponseFuture<F> {
|
||||
/// The kind of response future, error or pending
|
||||
#[pin]
|
||||
|
||||
@@ -10,7 +10,7 @@ use tower_http::compression::{Compression, CompressionLayer as TowerCompressionL
|
||||
/// This layer is a wrapper around [`tower_http::compression::CompressionLayer`] that integrates
|
||||
/// with jsonrpsee's HTTP types. It automatically compresses responses based on the client's
|
||||
/// Accept-Encoding header.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
#[derive(Clone)]
|
||||
pub struct CompressionLayer {
|
||||
inner_layer: TowerCompressionLayer,
|
||||
@@ -44,7 +44,7 @@ impl<S> Layer<S> for CompressionLayer {
|
||||
/// Service that performs response compression.
|
||||
///
|
||||
/// Created by [`CompressionLayer`].
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
#[derive(Clone)]
|
||||
pub struct CompressionService<S> {
|
||||
compression: Compression<S>,
|
||||
|
||||
@@ -168,7 +168,7 @@ where
|
||||
ip: enode.address,
|
||||
ports: Ports { discovery: enode.udp_port, listener: enode.tcp_port },
|
||||
listen_addr: enode.tcp_addr(),
|
||||
#[allow(deprecated)]
|
||||
#[expect(deprecated)]
|
||||
protocols: ProtocolInfo {
|
||||
eth: Some(EthProtocolInfo {
|
||||
network: status.eth_protocol_info.network,
|
||||
|
||||
@@ -268,7 +268,7 @@ struct EthBundleInner<Eth> {
|
||||
/// Access to commonly used code of the `eth` namespace
|
||||
eth_api: Eth,
|
||||
// restrict the number of concurrent tracing calls.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
blocking_task_guard: BlockingTaskGuard,
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ where
|
||||
}
|
||||
|
||||
/// Creates a new, shareable instance using the default tokio task spawner.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
provider: Provider,
|
||||
pool: Pool,
|
||||
@@ -247,7 +247,7 @@ where
|
||||
}
|
||||
|
||||
/// Container type `EthApi`
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct EthApiInner<Provider: BlockReader, Pool, Network, EvmConfig> {
|
||||
/// The transaction pool.
|
||||
pool: Pool,
|
||||
@@ -292,7 +292,7 @@ where
|
||||
Provider: BlockReaderIdExt,
|
||||
{
|
||||
/// Creates a new, shareable instance using the default tokio task spawner.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
provider: Provider,
|
||||
pool: Pool,
|
||||
|
||||
@@ -446,7 +446,7 @@ struct EthSimBundleInner<Eth> {
|
||||
#[allow(dead_code)]
|
||||
eth_api: Eth,
|
||||
// restrict the number of concurrent tracing calls.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
blocking_task_guard: BlockingTaskGuard,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#![allow(unreachable_pub)]
|
||||
#![expect(unreachable_pub)]
|
||||
use alloy_primitives::{Address, B256, U256};
|
||||
use itertools::concat;
|
||||
use reth_db::{test_utils::TempDatabase, Database, DatabaseEnv};
|
||||
@@ -90,7 +90,7 @@ where
|
||||
// Returns the path to the database file.
|
||||
pub(crate) fn txs_testdata(num_blocks: u64) -> TestStageDB {
|
||||
// This is way too slow.
|
||||
#[allow(unexpected_cfgs)]
|
||||
#[expect(unexpected_cfgs)]
|
||||
if cfg!(codspeed) {
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
#[cfg(any(test, feature = "test-utils"))]
|
||||
pub mod test_utils;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ where
|
||||
E: BlockExecutorProvider<Primitives: NodePrimitives<BlockHeader = H::Header, Block = B::Block>>,
|
||||
{
|
||||
/// Create a new set of default stages with default values.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
provider: Provider,
|
||||
tip: watch::Receiver<B256>,
|
||||
|
||||
@@ -369,7 +369,7 @@ mod tests {
|
||||
self.clean_threshold = threshold;
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
pub(crate) fn set_commit_threshold(&mut self, threshold: u64) {
|
||||
self.commit_threshold = threshold;
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ pub enum StorageKind {
|
||||
}
|
||||
|
||||
impl StorageKind {
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
const fn is_database(&self) -> bool {
|
||||
matches!(self, Self::Database(_))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/// Stage IDs for all known stages.
|
||||
///
|
||||
/// For custom stages, use [`StageId::Other`]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub enum StageId {
|
||||
#[deprecated(
|
||||
@@ -61,7 +61,7 @@ impl StageId {
|
||||
/// Return stage id formatted as string.
|
||||
pub const fn as_str(&self) -> &str {
|
||||
match self {
|
||||
#[allow(deprecated)]
|
||||
#[expect(deprecated)]
|
||||
Self::StaticFile => "StaticFile",
|
||||
Self::Headers => "Headers",
|
||||
Self::Bodies => "Bodies",
|
||||
|
||||
@@ -98,7 +98,7 @@ pub fn maybe_generate_tests(
|
||||
let mut tests = TokenStream2::default();
|
||||
if !roundtrips.is_empty() {
|
||||
tests = quote! {
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
#[cfg(test)]
|
||||
mod #mod_tests {
|
||||
#(#traits)*
|
||||
|
||||
@@ -90,7 +90,7 @@ pub(crate) fn generate_flag_struct(
|
||||
quote! {
|
||||
#impl_bitflag_encoded_bytes
|
||||
pub use #mod_flags_ident::#flags_ident;
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
mod #mod_flags_ident {
|
||||
use #reth_codecs::__private::Buf;
|
||||
use #reth_codecs::__private::modular_bitfield;
|
||||
|
||||
@@ -63,7 +63,7 @@ pub fn generate_from_to(
|
||||
} else {
|
||||
quote! {
|
||||
#[cfg(test)]
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
#[test_fuzz::test_fuzz]
|
||||
fn #fuzz(obj: #ident) {
|
||||
use #reth_codecs::Compact;
|
||||
@@ -74,7 +74,7 @@ pub fn generate_from_to(
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
pub fn #test() {
|
||||
#fuzz(#ident::default())
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ mod tests {
|
||||
|
||||
pub use TestStruct_flags::TestStructFlags;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
mod TestStruct_flags {
|
||||
use reth_codecs::__private::Buf;
|
||||
use reth_codecs::__private::modular_bitfield;
|
||||
@@ -289,7 +289,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
#[cfg(test)]
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
#[test_fuzz::test_fuzz]
|
||||
fn fuzz_test_test_struct(obj: TestStruct) {
|
||||
use reth_codecs::Compact;
|
||||
@@ -299,7 +299,7 @@ mod tests {
|
||||
assert_eq!(obj, same_obj);
|
||||
}
|
||||
#[test]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
pub fn fuzz_test_struct() {
|
||||
fuzz_test_test_struct(TestStruct::default())
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ macro_rules! impl_fuzzer_with_input {
|
||||
($(($name:tt, $input_type:tt, $encode:tt, $encode_method:tt, $decode:tt, $decode_method:tt)),+) => {
|
||||
$(
|
||||
/// Macro generated module to be used by test-fuzz and `bench` if it applies.
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
#[cfg(any(test, feature = "bench"))]
|
||||
pub mod $name {
|
||||
use crate::table;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
#[expect(unused_imports)]
|
||||
use reth_primitives_traits::*;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
@@ -37,7 +37,7 @@ macro_rules! impl_fuzzer_with_input {
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(dead_code)]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
#[test_fuzz::test_fuzz]
|
||||
pub fn fuzz(obj: $input_type) {
|
||||
let obj: $name = obj.into();
|
||||
@@ -45,7 +45,7 @@ macro_rules! impl_fuzzer_with_input {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(missing_docs)]
|
||||
#[expect(missing_docs)]
|
||||
pub fn test() {
|
||||
fuzz($input_type::default())
|
||||
}
|
||||
@@ -67,7 +67,7 @@ macro_rules! impl_fuzzer_key {
|
||||
|
||||
/// Fuzzer generates a random instance of the object and proceeds to compress and decompress it. It
|
||||
/// then makes sure that it matches the original object.
|
||||
#[allow(unused_macros)]
|
||||
#[expect(unused_macros)]
|
||||
macro_rules! impl_fuzzer_value {
|
||||
($($name:tt),+) => {
|
||||
$(
|
||||
|
||||
@@ -263,7 +263,7 @@ macro_rules! tables {
|
||||
}
|
||||
|
||||
// Need constants to match on in the `FromStr` implementation.
|
||||
#[allow(non_upper_case_globals)]
|
||||
#[expect(non_upper_case_globals)]
|
||||
mod table_names {
|
||||
$(
|
||||
pub(super) const $name: &'static str = stringify!($name);
|
||||
|
||||
@@ -48,7 +48,7 @@ pub fn hash_keys(c: &mut Criterion) {
|
||||
|
||||
for size in [10_000, 100_000, 1_000_000] {
|
||||
// Too slow.
|
||||
#[allow(unexpected_cfgs)]
|
||||
#[expect(unexpected_cfgs)]
|
||||
if cfg!(codspeed) && size > 10_000 {
|
||||
continue;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ where
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
struct TableStats {
|
||||
page_size: usize,
|
||||
leaf_pages: usize,
|
||||
|
||||
@@ -47,7 +47,7 @@ where
|
||||
}
|
||||
|
||||
/// Sets up a clear database at `bench_db_path`.
|
||||
#[allow(clippy::ptr_arg)]
|
||||
#[expect(clippy::ptr_arg)]
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn set_up_db<T>(
|
||||
bench_db_path: &Path,
|
||||
|
||||
@@ -62,7 +62,7 @@ impl<K: TransactionKind, T: Table> Cursor<K, T> {
|
||||
}
|
||||
|
||||
/// Decodes a `(key, value)` pair from the database.
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
pub fn decode<T>(
|
||||
res: Result<Option<(Cow<'_, [u8]>, Cow<'_, [u8]>)>, impl Into<DatabaseErrorInfo>>,
|
||||
) -> PairResult<T>
|
||||
|
||||
@@ -735,7 +735,7 @@ mod tests {
|
||||
assert_eq!(walker.next(), None);
|
||||
}
|
||||
|
||||
#[allow(clippy::reversed_empty_ranges)]
|
||||
#[expect(clippy::reversed_empty_ranges)]
|
||||
#[test]
|
||||
fn db_cursor_walk_range_invalid() {
|
||||
let db: Arc<DatabaseEnv> = create_test_db(DatabaseEnvKind::RW);
|
||||
|
||||
@@ -64,7 +64,7 @@ where
|
||||
}
|
||||
|
||||
/// Returns an iterator over database items.
|
||||
#[allow(clippy::should_implement_trait)]
|
||||
#[expect(clippy::should_implement_trait)]
|
||||
pub fn into_iter<Key, Value>(self) -> IntoIter<K, Key, Value>
|
||||
where
|
||||
Key: TableObject,
|
||||
@@ -211,7 +211,7 @@ where
|
||||
}
|
||||
|
||||
/// Position at next data item
|
||||
#[allow(clippy::should_implement_trait)]
|
||||
#[expect(clippy::should_implement_trait)]
|
||||
pub fn next<Key, Value>(&mut self) -> Result<Option<(Key, Value)>>
|
||||
where
|
||||
Key: TableObject,
|
||||
|
||||
@@ -728,7 +728,7 @@ mod tests {
|
||||
|
||||
const fn assert_send_sync<T: Send + Sync>() {}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
const fn test_txn_send_sync() {
|
||||
assert_send_sync::<Transaction<RO>>();
|
||||
assert_send_sync::<Transaction<RW>>();
|
||||
|
||||
@@ -324,7 +324,7 @@ impl<H: NippyJarHeader> NippyJar<H> {
|
||||
#[derive(Debug)]
|
||||
pub struct DataReader {
|
||||
/// Data file descriptor. Needs to be kept alive as long as `data_mmap` handle.
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
data_file: File,
|
||||
/// Mmap handle for data.
|
||||
data_mmap: Mmap,
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::iter::Peekable;
|
||||
|
||||
/// Iterator over storage reverts.
|
||||
/// See [`StorageRevertsIter::next`] for more details.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct StorageRevertsIter<R: Iterator, W: Iterator> {
|
||||
reverts: Peekable<R>,
|
||||
wiped: Peekable<W>,
|
||||
|
||||
@@ -957,7 +957,7 @@ mod tests {
|
||||
Ok((provider, database_blocks.clone(), in_memory_blocks.clone(), receipts))
|
||||
}
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
fn provider_with_random_blocks(
|
||||
rng: &mut impl Rng,
|
||||
database_blocks: usize,
|
||||
|
||||
@@ -559,7 +559,7 @@ mod tests {
|
||||
b256!("0x0000000000000000000000000000000000000000000000000000000000000001");
|
||||
|
||||
const fn assert_state_provider<T: StateProvider>() {}
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
const fn assert_historical_state_provider<
|
||||
T: DBProvider + BlockNumReader + BlockHashReader + StateCommitmentProvider,
|
||||
>() {
|
||||
|
||||
@@ -219,7 +219,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
const fn assert_state_provider<T: StateProvider>() {}
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
const fn assert_latest_state_provider<
|
||||
T: DBProvider + BlockHashReader + StateCommitmentProvider,
|
||||
>() {
|
||||
|
||||
@@ -412,7 +412,7 @@ mod tests {
|
||||
let file_set_count = 3; // Number of sets of files to create
|
||||
let initial_file_count = files_per_range * file_set_count;
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
fn prune_and_validate(
|
||||
sf_rw: &StaticFileProvider<EthPrimitives>,
|
||||
static_dir: impl AsRef<Path>,
|
||||
|
||||
@@ -71,7 +71,7 @@ impl<'a, ProviderDB, ProviderSF> UnifiedStorageWriter<'a, ProviderDB, ProviderSF
|
||||
/// # Returns
|
||||
/// - `Ok(())` if the static file instance is set.
|
||||
/// - `Err(StorageWriterError::MissingStaticFileWriter)` if the static file instance is not set.
|
||||
#[allow(unused)]
|
||||
#[expect(unused)]
|
||||
const fn ensure_static_file(&self) -> Result<(), UnifiedStorageWriterError> {
|
||||
if self.static_file.is_none() {
|
||||
return Err(UnifiedStorageWriterError::MissingStaticFileWriter)
|
||||
|
||||
@@ -93,7 +93,7 @@ pub trait BlockReader:
|
||||
fn pending_block_with_senders(&self) -> ProviderResult<Option<RecoveredBlock<Self::Block>>>;
|
||||
|
||||
/// Returns the pending block and receipts if available.
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
fn pending_block_and_receipts(
|
||||
&self,
|
||||
) -> ProviderResult<Option<(SealedBlock<Self::Block>, Vec<Self::Receipt>)>>;
|
||||
|
||||
@@ -86,7 +86,7 @@ pub fn create_receipt_decompressor() -> ReusableDecompressor {
|
||||
}
|
||||
|
||||
/// Reusable decompressor that uses its own internal buffer.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[expect(missing_debug_implementations)]
|
||||
pub struct ReusableDecompressor {
|
||||
/// The `zstd` decompressor.
|
||||
decompressor: Decompressor<'static>,
|
||||
|
||||
@@ -164,7 +164,7 @@ pub struct BlobStoreCleanupStat {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[expect(dead_code)]
|
||||
struct DynStore {
|
||||
store: Box<dyn BlobStore>,
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user