Skip to content

Commit

Permalink
Merge branch 'main' into dani/bump-secp256k1-0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Mar 27, 2024
2 parents 988f813 + 09de0ac commit 5135881
Show file tree
Hide file tree
Showing 197 changed files with 4,293 additions and 2,852 deletions.
456 changes: 232 additions & 224 deletions Cargo.lock

Large diffs are not rendered by default.

104 changes: 76 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,67 @@ rust.unreachable_pub = "warn"
rustdoc.all = "warn"
rust.unused_must_use = "deny"
rust.rust_2018_idioms = "deny"
clippy.empty_line_after_outer_attr = "deny"
clippy.derive_partial_eq_without_eq = "deny"
clippy.redundant_clone = "deny"
clippy.trait_duplication_in_bounds = "deny"
clippy.uninlined_format_args = "deny"
clippy.equatable_if_let = "deny"
clippy.or_fun_call = "deny"
clippy.branches_sharing_code = "deny"
clippy.useless_let_if_seq = "deny"

[workspace.lints.clippy]
# These are some of clippy's nursery (i.e., experimental) lints that we like.
# By default, nursery lints are allowed. Some of the lints below have made good
# suggestions which we fixed. The others didn't have any findings, so we can
# assume they don't have that many false positives. Let's enable them to
# prevent future problems.
branches_sharing_code = "warn"
clear_with_drain = "warn"
derive_partial_eq_without_eq = "warn"
empty_line_after_outer_attr = "warn"
equatable_if_let = "warn"
imprecise_flops = "warn"
iter_on_empty_collections = "warn"
iter_with_drain = "warn"
large_stack_frames = "warn"
manual_clamp = "warn"
mutex_integer = "warn"
needless_pass_by_ref_mut = "warn"
nonstandard_macro_braces = "warn"
or_fun_call = "warn"
path_buf_push_overwrite = "warn"
read_zero_byte_vec = "warn"
redundant_clone = "warn"
suboptimal_flops = "warn"
suspicious_operation_groupings = "warn"
trailing_empty_array = "warn"
trait_duplication_in_bounds = "warn"
transmute_undefined_repr = "warn"
trivial_regex = "warn"
tuple_array_conversions = "warn"
uninhabited_references = "warn"
unused_peekable = "warn"
unused_rounding = "warn"
useless_let_if_seq = "warn"

# These are nursery lints which have findings. Allow them for now. Some are not
# quite mature enough for use in our codebase and some we don't really want.
# Explicitly listing should make it easier to fix in the future.
as_ptr_cast_mut = "allow"
cognitive_complexity = "allow"
collection_is_never_read = "allow"
debug_assert_with_mut_call = "allow"
empty_line_after_doc_comments = "allow"
fallible_impl_from = "allow"
future_not_send = "allow"
iter_on_single_items = "allow"
missing_const_for_fn = "allow"
needless_collect = "allow"
non_send_fields_in_send_ty = "allow"
option_if_let_else = "allow"
redundant_pub_crate = "allow"
significant_drop_in_scrutinee = "allow"
significant_drop_tightening = "allow"
string_lit_as_bytes = "allow"
type_repetition_in_bounds = "allow"
unnecessary_struct_initialization = "allow"
use_self = "allow"

[workspace.package]
version = "0.2.0-beta.3"
version = "0.2.0-beta.4"
edition = "2021"
rust-version = "1.76"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -195,32 +244,28 @@ reth-trie = { path = "crates/trie" }
reth-trie-parallel = { path = "crates/trie-parallel" }

# revm
revm = { version = "7.1.0", features = ["std", "secp256k1"], default-features = false }
revm-primitives = { version = "3.0.0", features = ["std"], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "f96bc1f" }
revm = { version = "7.2.0", features = ["std", "secp256k1"], default-features = false }
revm-primitives = { version = "3.1.0", features = ["std"], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "0ad0338" }

# eth
alloy-chains = { version = "0.1", feature = ["serde", "rlp", "arbitrary"] }
alloy-primitives = "0.6"
alloy-dyn-abi = "0.6"
alloy-sol-types = "0.6"
alloy-rlp = "0.3"
alloy-primitives = "0.6.4"
alloy-dyn-abi = "0.6.4"
alloy-sol-types = "0.6.4"
alloy-rlp = "0.3.4"
alloy-trie = "0.3"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "410850b" }
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "410850b" }
alloy-rpc-engine-types = { git = "https://github.com/alloy-rs/alloy", rev = "410850b" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "410850b" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "410850b" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "410850b" }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }
alloy-rpc-engine-types = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }

# TODO: Remove
ethers-core = { version = "2.0.14", default-features = false }
ethers-providers = { version = "2.0.14", default-features = false }

# js
boa_engine = "0.17"
boa_gc = "0.17"

# misc
aquamarine = "0.5"
bytes = "1.5"
Expand All @@ -233,6 +278,7 @@ tracing-appender = "0.2"
thiserror = "1.0"
serde_json = "1.0.94"
serde = { version = "1.0", default-features = false }
serde_with = "3.3.0"
humantime-serde = "1.1"
rand = "0.8.5"
schnellru = "0.2"
Expand All @@ -248,6 +294,8 @@ syn = "2.0"
nybbles = "0.2.1"
smallvec = "1"
dyn-clone = "1.0.17"
sha2 = { version = "0.10", default-features = false }
paste = "1.0"

# proc-macros
proc-macro2 = "1.0"
Expand Down Expand Up @@ -285,7 +333,7 @@ secp256k1 = { version = "0.28", default-features = false, features = [
enr = { version = "0.10", default-features = false, features = ["k256"] }

# for eip-4844
c-kzg = "0.4.2"
c-kzg = "1.0.0"

# config
confy = "0.6"
Expand Down
3 changes: 0 additions & 3 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ reth-network-api.workspace = true
reth-downloaders.workspace = true
reth-tracing.workspace = true
reth-tasks.workspace = true
reth-optimism-payload-builder = { workspace = true, optional = true }
reth-ethereum-payload-builder.workspace = true
reth-payload-builder.workspace = true
reth-payload-validator.workspace = true
Expand Down Expand Up @@ -129,8 +128,6 @@ optimism = [
"reth-network/optimism",
"reth-network-api/optimism",
"reth-blockchain-tree/optimism",
"reth-payload-builder/optimism",
"reth-optimism-payload-builder/optimism",
"dep:reth-node-optimism",
"reth-node-core/optimism",
]
Expand Down
6 changes: 3 additions & 3 deletions bin/reth/src/commands/db/static_files/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ impl Command {
},
|provider| {
Ok(provider
.header_by_number(num as u64)?
.ok_or(ProviderError::HeaderNotFound((num as u64).into()))?)
.header_by_number(num)?
.ok_or(ProviderError::HeaderNotFound((num).into()))?)
},
)?;
}

// BENCHMARK QUERYING A RANDOM HEADER BY HASH
{
let num = row_indexes[rng.gen_range(0..row_indexes.len())] as u64;
let num = row_indexes[rng.gen_range(0..row_indexes.len())];
let header_hash = provider_factory
.header_by_number(num)?
.ok_or(ProviderError::HeaderNotFound(num.into()))?
Expand Down
20 changes: 8 additions & 12 deletions bin/reth/src/commands/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ use reth_interfaces::{consensus::Consensus, RethResult};
use reth_node_api::PayloadBuilderAttributes;
#[cfg(not(feature = "optimism"))]
use reth_node_ethereum::EthEvmConfig;
#[cfg(feature = "optimism")]
use reth_node_optimism::OptimismEvmConfig;
use reth_payload_builder::database::CachedReads;
#[cfg(not(feature = "optimism"))]
use reth_payload_builder::EthPayloadBuilderAttributes;
#[cfg(feature = "optimism")]
use reth_payload_builder::OptimismPayloadBuilderAttributes;
use reth_primitives::{
constants::eip4844::{LoadKzgSettingsError, MAINNET_KZG_TRUSTED_SETUP},
fs,
Expand Down Expand Up @@ -167,7 +161,7 @@ impl Command {
let consensus: Arc<dyn Consensus> = Arc::new(BeaconConsensus::new(Arc::clone(&self.chain)));

#[cfg(feature = "optimism")]
let evm_config = OptimismEvmConfig::default();
let evm_config = reth_node_optimism::OptimismEvmConfig::default();

#[cfg(not(feature = "optimism"))]
let evm_config = EthEvmConfig::default();
Expand Down Expand Up @@ -265,7 +259,7 @@ impl Command {
Arc::clone(&best_block),
Bytes::default(),
#[cfg(feature = "optimism")]
OptimismPayloadBuilderAttributes::try_new(
reth_node_optimism::OptimismPayloadBuilderAttributes::try_new(
best_block.hash(),
OptimismPayloadAttributes {
payload_attributes: payload_attrs,
Expand All @@ -275,7 +269,10 @@ impl Command {
},
)?,
#[cfg(not(feature = "optimism"))]
EthPayloadBuilderAttributes::try_new(best_block.hash(), payload_attrs)?,
reth_payload_builder::EthPayloadBuilderAttributes::try_new(
best_block.hash(),
payload_attrs,
)?,
self.chain.clone(),
);

Expand All @@ -289,9 +286,8 @@ impl Command {
);

#[cfg(feature = "optimism")]
let payload_builder =
reth_optimism_payload_builder::OptimismPayloadBuilder::new(self.chain.clone())
.compute_pending_block();
let payload_builder = reth_node_optimism::OptimismPayloadBuilder::new(self.chain.clone())
.compute_pending_block();

#[cfg(not(feature = "optimism"))]
let payload_builder = reth_ethereum_payload_builder::EthereumPayloadBuilder::default();
Expand Down
9 changes: 3 additions & 6 deletions bin/reth/src/commands/debug_cmd/replay_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ use reth_network_api::NetworkInfo;
use reth_node_core::engine_api_store::{EngineApiStore, StoredEngineApiMessage};
#[cfg(not(feature = "optimism"))]
use reth_node_ethereum::{EthEngineTypes, EthEvmConfig};
#[cfg(feature = "optimism")]
use reth_node_optimism::{OptimismEngineTypes, OptimismEvmConfig};
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
use reth_primitives::{fs, ChainSpec, PruneModes};
use reth_provider::{providers::BlockchainProvider, CanonStateSubscriptions, ProviderFactory};
Expand Down Expand Up @@ -129,7 +127,7 @@ impl Command {
let evm_config = EthEvmConfig::default();

#[cfg(feature = "optimism")]
let evm_config = OptimismEvmConfig::default();
let evm_config = reth_node_optimism::OptimismEvmConfig::default();

// Configure blockchain tree
let tree_externals = TreeExternals::new(
Expand Down Expand Up @@ -163,8 +161,7 @@ impl Command {

// Optimism's payload builder is implemented on the OptimismPayloadBuilder type.
#[cfg(feature = "optimism")]
let payload_builder =
reth_optimism_payload_builder::OptimismPayloadBuilder::new(self.chain.clone());
let payload_builder = reth_node_optimism::OptimismPayloadBuilder::new(self.chain.clone());

let payload_generator = BasicPayloadJobGenerator::with_builder(
blockchain_db.clone(),
Expand All @@ -178,7 +175,7 @@ impl Command {
#[cfg(feature = "optimism")]
let (payload_service, payload_builder): (
_,
PayloadBuilderHandle<OptimismEngineTypes>,
PayloadBuilderHandle<reth_node_optimism::OptimismEngineTypes>,
) = PayloadBuilderService::new(payload_generator, blockchain_db.canonical_state_stream());

#[cfg(not(feature = "optimism"))]
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl ImportCommand {
tokio::select! {
res = pipeline.run() => res?,
_ = tokio::signal::ctrl_c() => {},
};
}

info!(target: "reth::cli", "Finishing up");
Ok(())
Expand Down
6 changes: 0 additions & 6 deletions bin/reth/src/commands/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ pub struct NodeCommand<Ext: clap::Args + fmt::Debug = NoArgs> {
#[arg(long, conflicts_with = "instance", global = true)]
pub with_unused_ports: bool,

/// Overrides the KZG trusted setup by reading from the supplied file.
#[arg(long, value_name = "PATH")]
pub trusted_setup_file: Option<PathBuf>,

/// All networking related arguments
#[command(flatten)]
pub network: NetworkArgs,
Expand Down Expand Up @@ -150,7 +146,6 @@ impl<Ext: clap::Args + fmt::Debug> NodeCommand<Ext> {
config,
chain,
metrics,
trusted_setup_file,
instance,
with_unused_ports,
network,
Expand All @@ -170,7 +165,6 @@ impl<Ext: clap::Args + fmt::Debug> NodeCommand<Ext> {
chain,
metrics,
instance,
trusted_setup_file,
network,
rpc,
txpool,
Expand Down
4 changes: 2 additions & 2 deletions bin/reth/src/commands/p2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
use backon::{ConstantBuilder, Retryable};
use clap::{Parser, Subcommand};
use reth_config::Config;
use reth_db::open_db;
use reth_db::create_db;
use reth_discv4::NatResolver;
use reth_interfaces::p2p::bodies::client::BodiesClient;
use reth_primitives::{BlockHashOrNumber, ChainSpec, NodeRecord};
Expand Down Expand Up @@ -100,7 +100,7 @@ impl Command {
/// Execute `p2p` command
pub async fn execute(&self) -> eyre::Result<()> {
let tempdir = tempfile::TempDir::new()?;
let noop_db = Arc::new(open_db(&tempdir.into_path(), self.db.database_args())?);
let noop_db = Arc::new(create_db(tempdir.into_path(), self.db.database_args())?);

// add network name to data dir
let data_dir = self.datadir.unwrap_or_chain_default(self.chain.chain);
Expand Down
Loading

0 comments on commit 5135881

Please sign in to comment.