Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into devnet-0
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed May 31, 2024
2 parents 6a23646 + d218709 commit dda4648
Show file tree
Hide file tree
Showing 585 changed files with 7,177 additions and 69,798 deletions.
762 changes: 288 additions & 474 deletions Cargo.lock

Large diffs are not rendered by default.

85 changes: 51 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"crates/consensus/consensus/",
"crates/e2e-test-utils/",
"crates/engine-primitives/",
"crates/errors/",
"crates/ethereum-forks/",
"crates/ethereum/consensus/",
"crates/ethereum/engine-primitives/",
Expand All @@ -19,8 +20,8 @@ members = [
"crates/etl/",
"crates/evm/",
"crates/evm/execution-errors",
"crates/evm/execution-types",
"crates/exex/",
"crates/interfaces/",
"crates/metrics/",
"crates/metrics/metrics-derive/",
"crates/net/common/",
Expand All @@ -44,6 +45,7 @@ members = [
"crates/optimism/evm/",
"crates/optimism/node/",
"crates/optimism/payload/",
"crates/optimism/primitives/",
"crates/payload/basic/",
"crates/payload/builder/",
"crates/payload/ethereum/",
Expand All @@ -60,8 +62,8 @@ members = [
"crates/rpc/rpc-types-compat/",
"crates/rpc/rpc-types/",
"crates/rpc/rpc/",
"crates/stages-api",
"crates/stages/",
"crates/stages/api/",
"crates/stages/stages/",
"crates/static-file-types/",
"crates/static-file/",
"crates/storage/codecs/",
Expand All @@ -73,12 +75,14 @@ members = [
"crates/storage/libmdbx-rs/mdbx-sys/",
"crates/storage/nippy-jar/",
"crates/storage/provider/",
"crates/storage/storage-api/",
"crates/tasks/",
"crates/tokio-util/",
"crates/tracing/",
"crates/transaction-pool/",
"crates/trie-parallel/",
"crates/trie/",
"crates/trie/parallel/",
"crates/trie/trie",
"examples/beacon-api-sidecar-fetcher/",
"examples/beacon-api-sse/",
"examples/bsc-p2p",
"examples/custom-dev-node/",
Expand Down Expand Up @@ -148,6 +152,8 @@ uninhabited_references = "warn"
unused_peekable = "warn"
unused_rounding = "warn"
useless_let_if_seq = "warn"
use_self = "warn"
missing_const_for_fn = "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.
Expand All @@ -160,7 +166,6 @@ 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"
Expand All @@ -170,7 +175,6 @@ 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.7"
Expand Down Expand Up @@ -233,6 +237,7 @@ reth-downloaders = { path = "crates/net/downloaders" }
reth-e2e-test-utils = { path = "crates/e2e-test-utils" }
reth-ecies = { path = "crates/net/ecies" }
reth-engine-primitives = { path = "crates/engine-primitives" }
reth-errors = { path = "crates/errors" }
reth-eth-wire = { path = "crates/net/eth-wire" }
reth-eth-wire-types = { path = "crates/net/eth-wire-types" }
reth-ethereum-consensus = { path = "crates/ethereum/consensus" }
Expand All @@ -244,9 +249,9 @@ reth-evm = { path = "crates/evm" }
reth-evm-ethereum = { path = "crates/ethereum/evm" }
reth-evm-optimism = { path = "crates/optimism/evm" }
reth-execution-errors = { path = "crates/evm/execution-errors" }
reth-execution-types = { path = "crates/evm/execution-types" }
reth-exex = { path = "crates/exex" }
reth-fs-util = { path = "crates/fs-util" }
reth-interfaces = { path = "crates/interfaces" }
reth-ipc = { path = "crates/rpc/ipc" }
reth-libmdbx = { path = "crates/storage/libmdbx-rs" }
reth-mdbx-sys = { path = "crates/storage/libmdbx-rs/mdbx-sys" }
Expand All @@ -267,6 +272,7 @@ reth-node-events = { path = "crates/node/events" }
reth-node-optimism = { path = "crates/optimism/node" }
reth-optimism-consensus = { path = "crates/optimism/consensus" }
reth-optimism-payload-builder = { path = "crates/optimism/payload" }
reth-optimism-primitives = { path = "crates/optimism/primitives" }
reth-payload-builder = { path = "crates/payload/builder" }
reth-payload-validator = { path = "crates/payload/validator" }
reth-primitives = { path = "crates/primitives" }
Expand All @@ -281,24 +287,31 @@ reth-rpc-engine-api = { path = "crates/rpc/rpc-engine-api" }
reth-rpc-layer = { path = "crates/rpc/rpc-layer" }
reth-rpc-types = { path = "crates/rpc/rpc-types" }
reth-rpc-types-compat = { path = "crates/rpc/rpc-types-compat" }
reth-stages = { path = "crates/stages" }
reth-stages-api = { path = "crates/stages-api" }
reth-stages = { path = "crates/stages/stages" }
reth-stages-api = { path = "crates/stages/api" }
reth-static-file = { path = "crates/static-file" }
reth-static-file-types = { path = "crates/static-file-types" }
reth-storage-api = { path = "crates/storage/storage-api" }
reth-storage-errors = { path = "crates/storage/errors" }
reth-tasks = { path = "crates/tasks" }
reth-testing-utils = { path = "testing/testing-utils" }
reth-tokio-util = { path = "crates/tokio-util" }
reth-tracing = { path = "crates/tracing" }
reth-transaction-pool = { path = "crates/transaction-pool" }
reth-trie = { path = "crates/trie" }
reth-trie-parallel = { path = "crates/trie-parallel" }
reth-trie = { path = "crates/trie/trie" }
reth-trie-parallel = { path = "crates/trie/parallel" }

# revm
revm = { version = "9.0.0", features = ["std", "secp256k1", "blst"], default-features = false }
revm-primitives = { version = "4.0.0", features = ["std"], default-features = false }
revm = { version = "9.0.0", features = [
"std",
"secp256k1",
"blst",
], default-features = false }
revm-primitives = { version = "4.0.0", features = [
"std",
], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "0f43cf5" }
revm-interpreter = { version = "5.0.0", features = ["std"], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "5a4fd5e" }

# eth
alloy-chains = "0.1.15"
Expand All @@ -307,21 +320,21 @@ alloy-dyn-abi = "0.7.2"
alloy-sol-types = "0.7.2"
alloy-rlp = "0.3.4"
alloy-trie = "0.4"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b", default-features = false, features = [
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c", default-features = false, features = [
"reqwest",
] }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", default-features = false, rev = "64feb9b" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "64feb9b" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", default-features = false, rev = "7320d4c" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "7320d4c" }

# misc
auto_impl = "1"
Expand Down Expand Up @@ -349,8 +362,6 @@ strum = "0.26"
rayon = "1.7"
itertools = "0.12"
parking_lot = "0.12"
# Needed for `metrics-macro` to resolve the crate using `::metrics` notation
metrics = "0.21.1"
modular-bitfield = "0.11.2"
once_cell = "1.17"
syn = "2.0"
Expand All @@ -361,6 +372,12 @@ sha2 = { version = "0.10", default-features = false }
paste = "1.0"
url = "2.3"

# metrics
metrics = "0.22.0"
metrics-exporter-prometheus = { version = "0.14.0", default-features = false }
metrics-util = "0.16.0"
metrics-process = "2.0.0"

# proc-macros
proc-macro2 = "1.0"
quote = "1.0"
Expand Down Expand Up @@ -423,7 +440,7 @@ similar-asserts = "1.5.0"
test-fuzz = "5"

[patch.crates-io]
revm = { git = "https://github.com/bluealloy/revm", rev = "7af1986" }
revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "7af1986" }
revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "7af1986" }
revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "7af1986" }
revm = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "a28a543" }
6 changes: 4 additions & 2 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ reth-provider = { workspace = true }
reth-evm.workspace = true
reth-revm.workspace = true
reth-stages.workspace = true
reth-interfaces = { workspace = true, features = ["clap"] }
reth-errors.workspace = true
reth-transaction-pool.workspace = true
reth-beacon-consensus.workspace = true
reth-cli-runner.workspace = true
Expand All @@ -35,6 +35,7 @@ reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-rpc-api = { workspace = true, features = ["client"] }
reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-network-api.workspace = true
reth-downloaders.workspace = true
reth-tracing.workspace = true
Expand All @@ -58,6 +59,7 @@ reth-db-common.workspace = true
reth-node-builder.workspace = true
reth-node-events.workspace = true
reth-consensus.workspace = true
reth-optimism-primitives.workspace = true

# crypto
alloy-rlp.workspace = true
Expand All @@ -73,7 +75,7 @@ confy.workspace = true
toml = { workspace = true, features = ["display"] }

# metrics
metrics-process = "=1.0.14"
metrics-process.workspace = true

# test vectors generation
proptest.workspace = true
Expand Down
22 changes: 11 additions & 11 deletions bin/reth/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//! CLI definition and entrypoint to executable
#[cfg(feature = "optimism")]
use crate::commands::import_op;
use crate::{
args::{
utils::{chain_help, genesis_value_parser, SUPPORTED_CHAINS},
LogArgs,
},
commands::{
config_cmd, db, debug_cmd, dump_genesis, import, import_receipts, init_cmd, init_state,
config_cmd, db, debug_cmd, dump_genesis, import, init_cmd, init_state,
node::{self, NoArgs},
p2p, recover, stage, test_vectors,
},
Expand Down Expand Up @@ -84,7 +82,7 @@ impl Cli {
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
{
Cli::try_parse_from(itr)
Self::try_parse_from(itr)
}
}

Expand Down Expand Up @@ -150,11 +148,12 @@ impl<Ext: clap::Args + fmt::Debug> Cli<Ext> {
Commands::Init(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::InitState(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Import(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::ImportReceipts(command) => {
runner.run_blocking_until_ctrl_c(command.execute())
}
#[cfg(feature = "optimism")]
Commands::ImportOp(command) => runner.run_blocking_until_ctrl_c(command.execute()),
#[cfg(feature = "optimism")]
Commands::ImportReceiptsOp(command) => {
runner.run_blocking_until_ctrl_c(command.execute())
}
Commands::DumpGenesis(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Stage(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Expand Down Expand Up @@ -191,13 +190,14 @@ pub enum Commands<Ext: clap::Args + fmt::Debug = NoArgs> {
/// This syncs RLP encoded blocks from a file.
#[command(name = "import")]
Import(import::ImportCommand),
/// This imports RLP encoded receipts from a file.
#[command(name = "import-receipts")]
ImportReceipts(import_receipts::ImportReceiptsCommand),
/// This syncs RLP encoded OP blocks below Bedrock from a file, without executing.
#[cfg(feature = "optimism")]
#[command(name = "import-op")]
ImportOp(import_op::ImportOpCommand),
ImportOp(crate::commands::import_op::ImportOpCommand),
/// This imports RLP encoded receipts from a file.
#[cfg(feature = "optimism")]
#[command(name = "import-receipts-op")]
ImportReceiptsOp(crate::commands::import_receipts_op::ImportReceiptsOpCommand),
/// Dumps genesis block JSON configuration to stdout.
DumpGenesis(dump_genesis::DumpGenesisCommand),
/// Database debugging utilities
Expand Down
22 changes: 9 additions & 13 deletions bin/reth/src/commands/db/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ impl Command {
start_key: self.start_key,
end_key: self.end_key,
limit: self.limit,
})
})?;
Ok(())
}
}

Expand All @@ -55,11 +56,15 @@ pub(crate) struct ChecksumViewer<'a, DB: Database> {
}

impl<DB: Database> ChecksumViewer<'_, DB> {
pub(crate) fn new(tool: &'_ DbTool<DB>) -> ChecksumViewer<'_, DB> {
pub(crate) const fn new(tool: &'_ DbTool<DB>) -> ChecksumViewer<'_, DB> {
ChecksumViewer { tool, start_key: None, end_key: None, limit: None }
}
}

impl<DB: Database> TableViewer<(u64, Duration)> for ChecksumViewer<'_, DB> {
type Error = eyre::Report;

pub(crate) fn get_checksum<T: Table>(&self) -> Result<(u64, Duration), eyre::Report> {
fn view<T: Table>(&self) -> Result<(u64, Duration), Self::Error> {
let provider =
self.tool.provider_factory.provider()?.disable_long_read_transaction_safety();
let tx = provider.tx_ref();
Expand Down Expand Up @@ -124,17 +129,8 @@ impl<DB: Database> ChecksumViewer<'_, DB> {
let checksum = hasher.finish();
let elapsed = start_time.elapsed();

Ok((checksum, elapsed))
}
}

impl<DB: Database> TableViewer<()> for ChecksumViewer<'_, DB> {
type Error = eyre::Report;

fn view<T: Table>(&self) -> Result<(), Self::Error> {
let (checksum, elapsed) = self.get_checksum::<T>()?;
info!("Checksum for table `{}`: {:#x} (elapsed: {:?})", T::NAME, checksum, elapsed);

Ok(())
Ok((checksum, elapsed))
}
}
Loading

0 comments on commit dda4648

Please sign in to comment.