Skip to content

Commit 4771763

Browse files
committed
Clippy expects
1 parent 2f31d16 commit 4771763

File tree

13 files changed

+23
-10
lines changed

13 files changed

+23
-10
lines changed

crates/eth-sparse-mpt/src/reth_sparse_trie/hash.rs

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub enum RootHashError {
5454
HashingAccountsTrie { err: ErrSparseNodeNotFound },
5555
}
5656

57+
#[expect(clippy::result_large_err)]
5758
impl EthSparseTries {
5859
pub fn calculate_root_hash(
5960
&mut self,
@@ -172,6 +173,7 @@ impl EthSparseTries {
172173
}
173174
}
174175

176+
#[expect(clippy::result_large_err)]
175177
fn hash_storage_trie(
176178
storage_trie: &mut DiffTrie,
177179
account: &Bytes,

crates/eth-sparse-mpt/src/reth_sparse_trie/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ impl ChangedAccountData {
7777
}
7878
}
7979

80+
#[expect(clippy::result_large_err)]
8081
/// Prefetches data
8182
pub fn prefetch_tries_for_accounts<'a, Provider>(
8283
consistent_db_view: ConsistentDbView<Provider>,

crates/rbuilder/src/building/block_orders/prioritized_order_store.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ use super::{OrderPriority, SimulatedOrderSink};
1616
/// Order must implement BlockOrdersOrder which has priority(). This priority is used to sort the simulated orders.
1717
/// Usage:
1818
/// - Add new order (a little bit complex):
19-
/// ALWAYS BE SURE THAT YOU CALLED update_onchain_nonces and updated the current state of all the needed nonces by the order
20-
/// call insert_order
19+
/// ALWAYS BE SURE THAT YOU CALLED update_onchain_nonces and updated the current state of all the needed nonces by the order
20+
/// call insert_order
2121
/// - Get best order to execute
22-
/// call pop_order to get the best order
23-
/// if the order is executed call update_onchain_nonces to update all the changed nonces.
22+
/// call pop_order to get the best order
23+
/// if the order is executed call update_onchain_nonces to update all the changed nonces.
2424
/// - Remove orders: remove_orders. This is useful if we think this orders are no really good (failed to execute to often)
2525
#[derive(Debug, Clone)]
2626
pub struct PrioritizedOrderStore<OrderPriorityType> {

crates/rbuilder/src/building/builders/block_building_helper.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ pub trait BlockBuildingHelper: Send + Sync {
5555
/// This is the maximum profit that can reach the final fee recipient (max bid!).
5656
/// Maximum payout_tx_value value to pass to finalize_block.
5757
/// The main reason to get an error is if profit is so low that we can't pay the payout tx (that would mean negative block value!).
58+
#[expect(clippy::result_large_err)]
5859
fn true_block_value(&self) -> Result<U256, BlockBuildingHelperError>;
5960

6061
/// Eats the BlockBuildingHelper since once it's finished you should not use it anymore.
6162
/// payout_tx_value: If Some, added at the end of the block from coinbase to the final fee recipient.
6263
/// This only works if can_add_payout_tx.
64+
#[expect(clippy::result_large_err)]
6365
fn finalize_block(
6466
self: Box<Self>,
6567
payout_tx_value: Option<U256>,
@@ -99,6 +101,7 @@ impl Clone for BiddableUnfinishedBlock {
99101
}
100102

101103
impl BiddableUnfinishedBlock {
104+
#[expect(clippy::result_large_err)]
102105
pub fn new(block: Box<dyn BlockBuildingHelper>) -> Result<Self, BlockBuildingHelperError> {
103106
let true_block_value = block.true_block_value()?;
104107
Ok(Self {
@@ -192,7 +195,7 @@ impl BlockBuildingHelperFromProvider {
192195
/// - Query fee_recipient_balance_start.
193196
/// - pre_block_call.
194197
/// - Estimate payout tx cost.
195-
#[allow(clippy::too_many_arguments)]
198+
#[expect(clippy::result_large_err)]
196199
pub fn new(
197200
state_provider: Arc<dyn StateProvider>,
198201
building_ctx: BlockBuildingContext,
@@ -279,6 +282,7 @@ impl BlockBuildingHelperFromProvider {
279282
}
280283

281284
/// Inserts payout tx if necessary and updates built_block_trace.
285+
#[expect(clippy::result_large_err)]
282286
fn finalize_block_execution(
283287
&mut self,
284288
payout_tx_value: Option<U256>,

crates/rbuilder/src/building/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ impl<Tracer: SimulationTracer> PartialBlock<Tracer> {
617617
}
618618

619619
/// returns (requests, withdrawals_root)
620+
#[expect(clippy::result_large_err)]
620621
pub fn process_requests(
621622
&self,
622623
state: &mut BlockState,
@@ -678,7 +679,7 @@ impl<Tracer: SimulationTracer> PartialBlock<Tracer> {
678679
}
679680

680681
/// Mostly based on reth's (v1.2) default_ethereum_payload_builder.
681-
#[allow(clippy::too_many_arguments)]
682+
#[expect(clippy::result_large_err)]
682683
pub fn finalize(
683684
self,
684685
state: &mut BlockState,

crates/rbuilder/src/building/sim.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use std::{
2323
};
2424
use tracing::{error, trace};
2525

26+
#[expect(clippy::large_enum_variant)]
2627
#[derive(Debug)]
2728
pub enum OrderSimResult {
2829
Success(SimulatedOrder, Vec<(Address, u64)>),

crates/rbuilder/src/live_builder/order_input/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ impl OrderInputConfig {
171171
}
172172

173173
/// Commands we can get from RPC or mempool fetcher.
174+
#[expect(clippy::large_enum_variant)]
174175
#[derive(Debug, Clone)]
175176
pub enum ReplaceableOrderPoolCommand {
176177
/// New or update order

crates/rbuilder/src/live_builder/order_input/order_sink.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Drop for OrderPrinter {
4646
}
4747

4848
///////////////////////
49-
49+
#[expect(clippy::large_enum_variant)]
5050
#[derive(Debug, Clone)]
5151
pub enum OrderPoolCommand {
5252
//OrderSink::insert_order

crates/rbuilder/src/primitives/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ impl ShareBundleTx {
339339

340340
/// Body element of a mev share bundle.
341341
/// [`ShareBundleInner::body`] is formed by several of these.
342+
#[expect(clippy::large_enum_variant)]
342343
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
343344
pub enum ShareBundleBody {
344345
Tx(ShareBundleTx),

crates/rbuilder/src/primitives/order_builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use super::{
77
};
88

99
/// Helper object to build Orders for testing.
10+
#[expect(clippy::large_enum_variant)]
1011
#[derive(Debug)]
1112
pub enum OrderBuilder {
1213
MempoolTx(Option<TransactionSignedEcRecoveredWithBlobs>),

crates/rbuilder/src/provider/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub trait RootHasher: std::fmt::Debug + Send + Sync {
4848
cancel: CancellationToken,
4949
);
5050

51+
#[expect(clippy::result_large_err)]
5152
/// State root for changes outcome on top of parent block.
5253
fn state_root(&self, outcome: &ExecutionOutcome) -> Result<B256, RootHashError>;
5354
}

crates/rbuilder/src/roothash/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ where
109109
parallel_root_calculator.incremental_root()
110110
}
111111

112-
#[allow(clippy::too_many_arguments)]
112+
#[expect(clippy::result_large_err)]
113113
pub fn calculate_state_root<P, HasherType>(
114114
provider: P,
115115
hasher: &HasherType,

crates/rbuilder/src/telemetry/servers/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Telemetry contains two servers.
22
//!
33
//! - [full]: verbose server exposing detailed operational information about the
4-
//! builder.
4+
//! builder.
55
//! - [redacted]: deliberately redacted server serves information suitable for
6-
//! tdx builders to expose in real-time.
6+
//! tdx builders to expose in real-time.
77
//!
88
//! The redacted server is seperate from the debug server because it may be desirable
99
//! to expose debug and redacted data differently in tdx builders. e.g. redacted data

0 commit comments

Comments
 (0)