Skip to content

Commit

Permalink
fix some lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Dec 24, 2024
1 parent 250adef commit 5bf228c
Show file tree
Hide file tree
Showing 22 changed files with 40 additions and 73 deletions.
24 changes: 2 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ eyre.workspace = true
clap = { workspace = true, features = ["derive", "env"] }
backon.workspace = true
similar-asserts.workspace = true
test-fuzz.workspace = true

[dev-dependencies]
tempfile.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/consensus/beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ reth-tasks.workspace = true
reth-payload-builder.workspace = true
reth-payload-builder-primitives.workspace = true
reth-payload-primitives.workspace = true
reth-payload-validator.workspace = true
reth-prune.workspace = true
reth-static-file.workspace = true
reth-tokio-util.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/beacon/src/engine/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use crate::{BeaconConsensusEngineEvent, BeaconForkChoiceUpdateError};
use alloy_rpc_types_engine::{
ExecutionPayload, ExecutionPayloadSidecar, ForkchoiceState, ForkchoiceUpdated, PayloadStatus,
ExecutionPayloadSidecar, ForkchoiceState, ForkchoiceUpdated, PayloadStatus,
};
use futures::TryFutureExt;
use reth_engine_primitives::{
Expand Down
3 changes: 1 addition & 2 deletions crates/consensus/beacon/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloy_consensus::{BlockHeader, Header};
use alloy_eips::{merge::EPOCH_SLOTS, BlockNumHash};
use alloy_primitives::{BlockNumber, B256};
use alloy_rpc_types_engine::{
ExecutionPayload, ExecutionPayloadSidecar, ForkchoiceState, PayloadStatus, PayloadStatusEnum,
ExecutionPayloadSidecar, ForkchoiceState, PayloadStatus, PayloadStatusEnum,
PayloadValidationError,
};
use futures::{stream::BoxStream, Future, StreamExt};
Expand All @@ -25,7 +25,6 @@ use reth_node_types::{Block, BlockTy, HeaderTy, NodeTypesWithEngine};
use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_builder_primitives::PayloadBuilder;
use reth_payload_primitives::{PayloadAttributes, PayloadBuilderAttributes};
use reth_payload_validator::ExecutionPayloadValidator;
use reth_primitives::{EthPrimitives, Head, SealedBlock, SealedHeader};
use reth_provider::{
providers::ProviderNodeTypes, BlockIdReader, BlockReader, BlockSource, CanonChainTracker,
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/beacon/src/engine/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use reth_static_file::StaticFileProducer;
use reth_tasks::TokioTaskExecutor;
use std::{collections::VecDeque, sync::Arc};
use tokio::sync::{oneshot, watch};
use reth_stages_api::ExecOutput;

type DatabaseEnv = TempDatabase<DE>;

Expand Down Expand Up @@ -73,7 +74,7 @@ impl<DB> TestEnv<DB> {
payload: T,
sidecar: ExecutionPayloadSidecar,
) -> Result<PayloadStatus, BeaconOnNewPayloadError> {
self.engine_handle.new_payload(payload.into(), sidecar).await
self.engine_handle.new_payload(payload, sidecar).await
}

/// Sends the `ExecutionPayload` message to the consensus engine and retries if the engine
Expand Down
4 changes: 0 additions & 4 deletions crates/engine/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@ workspace = true
# reth
reth-primitives.workspace = true
reth-errors.workspace = true
reth-consensus-common.workspace = true
reth-fs-util.workspace = true
reth-rpc-types-compat.workspace = true
reth-engine-primitives.workspace = true
reth-payload-validator.workspace = true
reth-evm.workspace = true
reth-revm.workspace = true
reth-provider.workspace = true
reth-ethereum-forks.workspace = true
revm-primitives.workspace = true
reth-trie.workspace = true

# taiko
reth-taiko-engine-types.workspace = true
reth-taiko-payload-validator.workspace = true

# alloy
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-consensus.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/engine/util/src/engine_store.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Stores engine API messages to disk for later inspection and replay.
use alloy_rpc_types_engine::{ExecutionPayload, ExecutionPayloadSidecar, ForkchoiceState};
use alloy_rpc_types_engine::{ExecutionPayloadSidecar, ForkchoiceState};
use futures::{Stream, StreamExt};
use reth_engine_primitives::{BeaconEngineMessage, EngineTypes};
use reth_fs_util as fs;
Expand Down
2 changes: 0 additions & 2 deletions crates/engine/util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
use futures::Stream;
use reth_engine_primitives::{BeaconEngineMessage, EngineTypes};
use reth_payload_validator::ExecutionPayloadValidator;
use reth_taiko_payload_validator::TaikoExecutionPayloadValidator;
use std::path::PathBuf;
use tokio_util::either::Either;

Expand Down
3 changes: 1 addition & 2 deletions crates/engine/util/src/reorg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use alloy_consensus::{Header, Transaction};
use alloy_primitives::U256;
use alloy_rpc_types_engine::{
CancunPayloadFields, ExecutionPayload, ExecutionPayloadSidecar, ForkchoiceState, PayloadStatus,
CancunPayloadFields, ExecutionPayloadSidecar, ForkchoiceState, PayloadStatus,
};
use futures::{stream::FuturesUnordered, Stream, StreamExt, TryFutureExt};
use itertools::Either;
Expand All @@ -17,7 +17,6 @@ use reth_evm::{
state_change::post_block_withdrawals_balance_increments, system_calls::SystemCaller,
ConfigureEvm,
};
use reth_payload_validator::ExecutionPayloadValidator;
use reth_primitives::{
proofs, transaction::SignedTransactionIntoRecoveredExt, Block, BlockBody, BlockExt, Receipt,
Receipts,
Expand Down
9 changes: 4 additions & 5 deletions crates/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,7 @@ mod tests {

fn execute_transactions(
&mut self,
_block: &BlockWithSenders,
_total_difficulty: U256,
_input: BlockExecutionInput<'_, BlockWithSenders>,
) -> Result<ExecuteOutput<Receipt>, Self::Error> {
Ok(self.execute_transactions_result.clone())
}
Expand Down Expand Up @@ -750,7 +749,7 @@ mod tests {
let provider = TestExecutorProvider;
let db = CacheDB::<EmptyDBTyped<ProviderError>>::default();
let executor = provider.executor(db);
let _ = executor.execute(BlockExecutionInput::new(&mut Default::default(), U256::ZERO));
let _ = executor.execute(BlockExecutionInput::new(&Default::default(), U256::ZERO));
}

#[test]
Expand All @@ -776,7 +775,7 @@ mod tests {
let db = CacheDB::<EmptyDBTyped<ProviderError>>::default();
let executor = provider.executor(db);
let result =
executor.execute(BlockExecutionInput::new(&mut Default::default(), U256::ZERO));
executor.execute(BlockExecutionInput::new(&Default::default(), U256::ZERO));

assert!(result.is_ok());
let block_execution_output = result.unwrap();
Expand Down Expand Up @@ -809,7 +808,7 @@ mod tests {
tx_env.nonce.take();
}));
let result =
executor.execute(BlockExecutionInput::new(&mut Default::default(), U256::ZERO));
executor.execute(BlockExecutionInput::new(&Default::default(), U256::ZERO));
assert!(result.is_ok());
}

Expand Down
16 changes: 16 additions & 0 deletions crates/evm/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ mod tests {
receipts: vec![],
requests: Requests::default(),
gas_used: 0,
target_list: vec![],
skipped_list: vec![],
})
}
fn execute_with_state_closure<F>(
Expand All @@ -192,6 +194,8 @@ mod tests {
receipts: vec![],
requests: Requests::default(),
gas_used: 0,
target_list: vec![],
skipped_list: vec![],
})
}
fn execute_with_state_hook<F>(
Expand All @@ -210,6 +214,8 @@ mod tests {
receipts: vec![],
requests: Requests::default(),
gas_used: 0,
target_list: vec![],
skipped_list: vec![],
})
}
}
Expand Down Expand Up @@ -240,6 +246,11 @@ mod tests {
let input = BlockExecutionInput {
block: &BlockWithSenders::default(),
total_difficulty: Default::default(),
enable_anchor: false,
enable_skip: false,
enable_build: false,
max_bytes_per_tx_list: 0,
max_transactions_lists: 0,
};

let (tx, _rx) = mpsc::channel();
Expand Down Expand Up @@ -293,6 +304,11 @@ mod tests {
let input = BlockExecutionInput {
block: &BlockWithSenders::default(),
total_difficulty: Default::default(),
enable_anchor: false,
enable_skip: false,
enable_build: false,
max_bytes_per_tx_list: 0,
max_transactions_lists: 0,
};

let (tx, rx) = mpsc::channel();
Expand Down
5 changes: 3 additions & 2 deletions crates/optimism/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use reth_primitives::{BlockWithSenders, Receipt, TransactionSigned, TxType};
use reth_revm::{Database, State};
use revm_primitives::{db::DatabaseCommit, EnvWithHandlerCfg, ResultAndState, U256};
use tracing::trace;
use reth_execution_types::BlockExecutionInput;

/// Factory for [`OpExecutionStrategy`].
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -161,9 +162,9 @@ where

fn execute_transactions(
&mut self,
block: &BlockWithSenders,
total_difficulty: U256,
input: BlockExecutionInput<'_, BlockWithSenders>,
) -> Result<ExecuteOutput<Receipt>, Self::Error> {
let BlockExecutionInput { block, total_difficulty, .. } = input;
let env = self.evm_env_for_block(&block.header, total_difficulty);
let mut evm = self.evm_config.evm_with_env(&mut self.state, env);

Expand Down
8 changes: 0 additions & 8 deletions crates/taiko/chainspec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-ethereum-forks.workspace = true
reth-primitives-traits.workspace = true
reth-network-peers.workspace = true

# taiko-reth
Expand All @@ -26,32 +25,25 @@ alloy-chains.workspace = true
alloy-genesis.workspace = true
alloy-primitives.workspace = true
alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-serde.workspace = true


# io
serde.workspace = true
serde_json.workspace = true

# misc
derive_more.workspace = true
once_cell.workspace = true


[features]
default = ["std"]
std = [
"alloy-chains/std",
"alloy-genesis/std",
"alloy-primitives/std",
"alloy-eips/std",
"reth-chainspec/std",
"reth-ethereum-forks/std",
"reth-primitives-traits/std",
"reth-taiko-forks/std",
"alloy-consensus/std",
"once_cell/std",
"derive_more/std",
"reth-network-peers/std",
]
Loading

0 comments on commit 5bf228c

Please sign in to comment.