mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(cli): move utils to reth-cli-utils crate (#9297)
This commit is contained in:
133
Cargo.lock
generated
133
Cargo.lock
generated
@ -1569,9 +1569,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.102"
|
version = "1.0.104"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "779e6b7d17797c0b42023d417228c02889300190e700cb074c3438d9c541d332"
|
checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jobserver",
|
"jobserver",
|
||||||
"libc",
|
"libc",
|
||||||
@ -1611,7 +1611,7 @@ dependencies = [
|
|||||||
"num-traits",
|
"num-traits",
|
||||||
"serde",
|
"serde",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3765,9 +3765,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper"
|
name = "hyper"
|
||||||
version = "1.3.1"
|
version = "1.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d"
|
checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
@ -3806,9 +3806,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper-util"
|
name = "hyper-util"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56"
|
checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
@ -4560,7 +4560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
|
checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -5458,7 +5458,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"redox_syscall 0.5.2",
|
"redox_syscall 0.5.2",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -5495,9 +5495,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pest"
|
name = "pest"
|
||||||
version = "2.7.10"
|
version = "2.7.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8"
|
checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@ -6300,6 +6300,7 @@ dependencies = [
|
|||||||
"reth-chainspec",
|
"reth-chainspec",
|
||||||
"reth-cli-commands",
|
"reth-cli-commands",
|
||||||
"reth-cli-runner",
|
"reth-cli-runner",
|
||||||
|
"reth-cli-util",
|
||||||
"reth-config",
|
"reth-config",
|
||||||
"reth-consensus",
|
"reth-consensus",
|
||||||
"reth-consensus-common",
|
"reth-consensus-common",
|
||||||
@ -6619,6 +6620,19 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "reth-cli-util"
|
||||||
|
version = "1.0.0"
|
||||||
|
dependencies = [
|
||||||
|
"eyre",
|
||||||
|
"proptest",
|
||||||
|
"reth-fs-util",
|
||||||
|
"reth-network",
|
||||||
|
"reth-primitives",
|
||||||
|
"secp256k1",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reth-codecs"
|
name = "reth-codecs"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@ -7643,6 +7657,7 @@ dependencies = [
|
|||||||
"reth-beacon-consensus",
|
"reth-beacon-consensus",
|
||||||
"reth-blockchain-tree",
|
"reth-blockchain-tree",
|
||||||
"reth-chainspec",
|
"reth-chainspec",
|
||||||
|
"reth-cli-util",
|
||||||
"reth-config",
|
"reth-config",
|
||||||
"reth-consensus",
|
"reth-consensus",
|
||||||
"reth-consensus-debug-client",
|
"reth-consensus-debug-client",
|
||||||
@ -7703,6 +7718,7 @@ dependencies = [
|
|||||||
"proptest",
|
"proptest",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"reth-chainspec",
|
"reth-chainspec",
|
||||||
|
"reth-cli-util",
|
||||||
"reth-config",
|
"reth-config",
|
||||||
"reth-consensus-common",
|
"reth-consensus-common",
|
||||||
"reth-db",
|
"reth-db",
|
||||||
@ -7732,7 +7748,6 @@ dependencies = [
|
|||||||
"secp256k1",
|
"secp256k1",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
"thiserror",
|
|
||||||
"tikv-jemalloc-ctl",
|
"tikv-jemalloc-ctl",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower",
|
"tower",
|
||||||
@ -8927,9 +8942,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "roaring"
|
name = "roaring"
|
||||||
version = "0.10.5"
|
version = "0.10.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7699249cc2c7d71939f30868f47e9d7add0bdc030d90ee10bfd16887ff8bb1c8"
|
checksum = "8f4b84ba6e838ceb47b41de5194a60244fac43d9fe03b71dbe8c5a201081d6d1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
@ -9067,9 +9082,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls-native-certs"
|
name = "rustls-native-certs"
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792"
|
checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"openssl-probe",
|
"openssl-probe",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile",
|
||||||
@ -9123,9 +9138,9 @@ checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls-webpki"
|
name = "rustls-webpki"
|
||||||
version = "0.102.4"
|
version = "0.102.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e"
|
checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ring",
|
"ring",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
@ -9351,9 +9366,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.118"
|
version = "1.0.120"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4"
|
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.2.6",
|
"indexmap 2.2.6",
|
||||||
"itoa",
|
"itoa",
|
||||||
@ -9395,9 +9410,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_with"
|
name = "serde_with"
|
||||||
version = "3.8.1"
|
version = "3.8.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20"
|
checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -9413,9 +9428,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_with_macros"
|
name = "serde_with_macros"
|
||||||
version = "3.8.1"
|
version = "3.8.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2"
|
checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@ -10934,7 +10949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
|
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-core 0.52.0",
|
"windows-core 0.52.0",
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -10944,7 +10959,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
|
checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-core 0.57.0",
|
"windows-core 0.57.0",
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -10953,7 +10968,7 @@ version = "0.52.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
|
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -10965,7 +10980,7 @@ dependencies = [
|
|||||||
"windows-implement",
|
"windows-implement",
|
||||||
"windows-interface",
|
"windows-interface",
|
||||||
"windows-result",
|
"windows-result",
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -10996,7 +11011,7 @@ version = "0.1.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
|
checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -11014,7 +11029,7 @@ version = "0.52.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-targets 0.52.5",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -11034,18 +11049,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-targets"
|
name = "windows-targets"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
|
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_gnullvm 0.52.5",
|
"windows_aarch64_gnullvm 0.52.6",
|
||||||
"windows_aarch64_msvc 0.52.5",
|
"windows_aarch64_msvc 0.52.6",
|
||||||
"windows_i686_gnu 0.52.5",
|
"windows_i686_gnu 0.52.6",
|
||||||
"windows_i686_gnullvm",
|
"windows_i686_gnullvm",
|
||||||
"windows_i686_msvc 0.52.5",
|
"windows_i686_msvc 0.52.6",
|
||||||
"windows_x86_64_gnu 0.52.5",
|
"windows_x86_64_gnu 0.52.6",
|
||||||
"windows_x86_64_gnullvm 0.52.5",
|
"windows_x86_64_gnullvm 0.52.6",
|
||||||
"windows_x86_64_msvc 0.52.5",
|
"windows_x86_64_msvc 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -11056,9 +11071,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_gnullvm"
|
name = "windows_aarch64_gnullvm"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
|
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
@ -11068,9 +11083,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
|
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
@ -11080,15 +11095,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
|
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnullvm"
|
name = "windows_i686_gnullvm"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
|
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
@ -11098,9 +11113,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
|
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
@ -11110,9 +11125,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
|
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
@ -11122,9 +11137,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
|
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
@ -11134,9 +11149,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.52.5"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winnow"
|
name = "winnow"
|
||||||
@ -11251,18 +11266,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy"
|
name = "zerocopy"
|
||||||
version = "0.7.34"
|
version = "0.7.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087"
|
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zerocopy-derive",
|
"zerocopy-derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy-derive"
|
name = "zerocopy-derive"
|
||||||
version = "0.7.34"
|
version = "0.7.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
|
checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|||||||
@ -17,6 +17,7 @@ members = [
|
|||||||
"crates/cli/cli/",
|
"crates/cli/cli/",
|
||||||
"crates/cli/commands/",
|
"crates/cli/commands/",
|
||||||
"crates/cli/runner/",
|
"crates/cli/runner/",
|
||||||
|
"crates/cli/util/",
|
||||||
"crates/config/",
|
"crates/config/",
|
||||||
"crates/consensus/auto-seal/",
|
"crates/consensus/auto-seal/",
|
||||||
"crates/consensus/beacon/",
|
"crates/consensus/beacon/",
|
||||||
@ -276,6 +277,7 @@ reth-chainspec = { path = "crates/chainspec" }
|
|||||||
reth-cli = { path = "crates/cli/cli" }
|
reth-cli = { path = "crates/cli/cli" }
|
||||||
reth-cli-commands = { path = "crates/cli/commands" }
|
reth-cli-commands = { path = "crates/cli/commands" }
|
||||||
reth-cli-runner = { path = "crates/cli/runner" }
|
reth-cli-runner = { path = "crates/cli/runner" }
|
||||||
|
reth-cli-util = { path = "crates/cli/util" }
|
||||||
reth-codecs = { path = "crates/storage/codecs" }
|
reth-codecs = { path = "crates/storage/codecs" }
|
||||||
reth-codecs-derive = { path = "crates/storage/codecs/derive" }
|
reth-codecs-derive = { path = "crates/storage/codecs/derive" }
|
||||||
reth-config = { path = "crates/config" }
|
reth-config = { path = "crates/config" }
|
||||||
|
|||||||
@ -31,6 +31,7 @@ reth-transaction-pool.workspace = true
|
|||||||
reth-beacon-consensus.workspace = true
|
reth-beacon-consensus.workspace = true
|
||||||
reth-cli-runner.workspace = true
|
reth-cli-runner.workspace = true
|
||||||
reth-cli-commands.workspace = true
|
reth-cli-commands.workspace = true
|
||||||
|
reth-cli-util.workspace = true
|
||||||
reth-consensus-common.workspace = true
|
reth-consensus-common.workspace = true
|
||||||
reth-blockchain-tree.workspace = true
|
reth-blockchain-tree.workspace = true
|
||||||
reth-rpc-builder.workspace = true
|
reth-rpc-builder.workspace = true
|
||||||
|
|||||||
@ -1,15 +1,12 @@
|
|||||||
//! Command for debugging execution.
|
//! Command for debugging execution.
|
||||||
|
|
||||||
use crate::{
|
use crate::{args::NetworkArgs, macros::block_executor, utils::get_single_header};
|
||||||
args::{get_secret_key, NetworkArgs},
|
|
||||||
macros::block_executor,
|
|
||||||
utils::get_single_header,
|
|
||||||
};
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use futures::{stream::select as stream_select, StreamExt};
|
use futures::{stream::select as stream_select, StreamExt};
|
||||||
use reth_beacon_consensus::EthBeaconConsensus;
|
use reth_beacon_consensus::EthBeaconConsensus;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
use reth_consensus::Consensus;
|
use reth_consensus::Consensus;
|
||||||
use reth_db::DatabaseEnv;
|
use reth_db::DatabaseEnv;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//! Command for debugging in-memory merkle trie calculation.
|
//! Command for debugging in-memory merkle trie calculation.
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
args::{get_secret_key, NetworkArgs},
|
args::NetworkArgs,
|
||||||
macros::block_executor,
|
macros::block_executor,
|
||||||
utils::{get_single_body, get_single_header},
|
utils::{get_single_body, get_single_header},
|
||||||
};
|
};
|
||||||
@ -9,6 +9,7 @@ use backon::{ConstantBuilder, Retryable};
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
use reth_db::DatabaseEnv;
|
use reth_db::DatabaseEnv;
|
||||||
use reth_errors::BlockValidationError;
|
use reth_errors::BlockValidationError;
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
//! Command for debugging merkle trie calculation.
|
//! Command for debugging merkle trie calculation.
|
||||||
use crate::{
|
use crate::{args::NetworkArgs, macros::block_executor, utils::get_single_header};
|
||||||
args::{get_secret_key, NetworkArgs},
|
|
||||||
macros::block_executor,
|
|
||||||
utils::get_single_header,
|
|
||||||
};
|
|
||||||
use backon::{ConstantBuilder, Retryable};
|
use backon::{ConstantBuilder, Retryable};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_beacon_consensus::EthBeaconConsensus;
|
use reth_beacon_consensus::EthBeaconConsensus;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
use reth_consensus::Consensus;
|
use reth_consensus::Consensus;
|
||||||
use reth_db::{tables, DatabaseEnv};
|
use reth_db::{tables, DatabaseEnv};
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
use crate::{
|
use crate::{args::NetworkArgs, macros::block_executor};
|
||||||
args::{get_secret_key, NetworkArgs},
|
|
||||||
macros::block_executor,
|
|
||||||
};
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use eyre::Context;
|
use eyre::Context;
|
||||||
use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig};
|
use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig};
|
||||||
@ -11,6 +8,7 @@ use reth_blockchain_tree::{
|
|||||||
};
|
};
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
use reth_consensus::Consensus;
|
use reth_consensus::Consensus;
|
||||||
use reth_db::DatabaseEnv;
|
use reth_db::DatabaseEnv;
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
//! Main node command for launching a node
|
//! Main node command for launching a node
|
||||||
|
|
||||||
use crate::args::{
|
use crate::args::{
|
||||||
utils::{chain_help, chain_value_parser, parse_socket_address, SUPPORTED_CHAINS},
|
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
|
||||||
DatabaseArgs, DatadirArgs, DebugArgs, DevArgs, NetworkArgs, PayloadBuilderArgs, PruningArgs,
|
DatabaseArgs, DatadirArgs, DebugArgs, DevArgs, NetworkArgs, PayloadBuilderArgs, PruningArgs,
|
||||||
RpcServerArgs, TxPoolArgs,
|
RpcServerArgs, TxPoolArgs,
|
||||||
};
|
};
|
||||||
use clap::{value_parser, Args, Parser};
|
use clap::{value_parser, Args, Parser};
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
|
use reth_cli_util::parse_socket_address;
|
||||||
use reth_db::{init_db, DatabaseEnv};
|
use reth_db::{init_db, DatabaseEnv};
|
||||||
use reth_node_builder::{NodeBuilder, WithLaunchContext};
|
use reth_node_builder::{NodeBuilder, WithLaunchContext};
|
||||||
use reth_node_core::{node_config::NodeConfig, version};
|
use reth_node_core::{node_config::NodeConfig, version};
|
||||||
|
|||||||
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
args::{
|
args::{
|
||||||
get_secret_key,
|
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
|
||||||
utils::{chain_help, chain_value_parser, hash_or_num_value_parser, SUPPORTED_CHAINS},
|
|
||||||
DatabaseArgs, NetworkArgs,
|
DatabaseArgs, NetworkArgs,
|
||||||
},
|
},
|
||||||
utils::get_single_header,
|
utils::get_single_header,
|
||||||
@ -11,6 +10,7 @@ use crate::{
|
|||||||
use backon::{ConstantBuilder, Retryable};
|
use backon::{ConstantBuilder, Retryable};
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
|
use reth_cli_util::{get_secret_key, hash_or_num_value_parser};
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
use reth_network::NetworkConfigBuilder;
|
use reth_network::NetworkConfigBuilder;
|
||||||
use reth_network_p2p::bodies::client::BodiesClient;
|
use reth_network_p2p::bodies::client::BodiesClient;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
//!
|
//!
|
||||||
//! Stage debugging tool
|
//! Stage debugging tool
|
||||||
use crate::{
|
use crate::{
|
||||||
args::{get_secret_key, NetworkArgs, StageEnum},
|
args::{NetworkArgs, StageEnum},
|
||||||
macros::block_executor,
|
macros::block_executor,
|
||||||
prometheus_exporter,
|
prometheus_exporter,
|
||||||
};
|
};
|
||||||
@ -10,6 +10,7 @@ use clap::Parser;
|
|||||||
use reth_beacon_consensus::EthBeaconConsensus;
|
use reth_beacon_consensus::EthBeaconConsensus;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::config::{HashingConfig, SenderRecoveryConfig, TransactionLookupConfig};
|
use reth_config::config::{HashingConfig, SenderRecoveryConfig, TransactionLookupConfig};
|
||||||
use reth_downloaders::bodies::bodies::BodiesDownloaderBuilder;
|
use reth_downloaders::bodies::bodies::BodiesDownloaderBuilder;
|
||||||
use reth_exex::ExExManagerHandle;
|
use reth_exex::ExExManagerHandle;
|
||||||
|
|||||||
23
crates/cli/util/Cargo.toml
Normal file
23
crates/cli/util/Cargo.toml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
[package]
|
||||||
|
name = "reth-cli-util"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
exclude.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
reth-fs-util.workspace = true
|
||||||
|
reth-network.workspace = true
|
||||||
|
reth-primitives.workspace = true
|
||||||
|
secp256k1.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
eyre.workspace = true
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
proptest.workspace = true
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
17
crates/cli/util/src/lib.rs
Normal file
17
crates/cli/util/src/lib.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//! This crate defines a set of commonly used cli utils.
|
||||||
|
|
||||||
|
#![doc(
|
||||||
|
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||||
|
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||||
|
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
|
||||||
|
)]
|
||||||
|
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||||
|
|
||||||
|
/// Helper function to load a secret key from a file.
|
||||||
|
pub mod load_secret_key;
|
||||||
|
pub use load_secret_key::get_secret_key;
|
||||||
|
|
||||||
|
/// Cli parsers functions.
|
||||||
|
pub mod parsers;
|
||||||
|
pub use parsers::{hash_or_num_value_parser, parse_duration_from_secs, parse_socket_address};
|
||||||
96
crates/cli/util/src/parsers.rs
Normal file
96
crates/cli/util/src/parsers.rs
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
use reth_primitives::{BlockHashOrNumber, B256};
|
||||||
|
use std::{
|
||||||
|
net::{IpAddr, Ipv4Addr, SocketAddr, ToSocketAddrs},
|
||||||
|
str::FromStr,
|
||||||
|
time::Duration,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Helper to parse a [Duration] from seconds
|
||||||
|
pub fn parse_duration_from_secs(arg: &str) -> eyre::Result<Duration, std::num::ParseIntError> {
|
||||||
|
let seconds = arg.parse()?;
|
||||||
|
Ok(Duration::from_secs(seconds))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Parse [`BlockHashOrNumber`]
|
||||||
|
pub fn hash_or_num_value_parser(value: &str) -> eyre::Result<BlockHashOrNumber, eyre::Error> {
|
||||||
|
match B256::from_str(value) {
|
||||||
|
Ok(hash) => Ok(BlockHashOrNumber::Hash(hash)),
|
||||||
|
Err(_) => Ok(BlockHashOrNumber::Number(value.parse()?)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Error thrown while parsing a socket address.
|
||||||
|
#[derive(thiserror::Error, Debug)]
|
||||||
|
pub enum SocketAddressParsingError {
|
||||||
|
/// Failed to convert the string into a socket addr
|
||||||
|
#[error("could not parse socket address: {0}")]
|
||||||
|
Io(#[from] std::io::Error),
|
||||||
|
/// Input must not be empty
|
||||||
|
#[error("cannot parse socket address from empty string")]
|
||||||
|
Empty,
|
||||||
|
/// Failed to parse the address
|
||||||
|
#[error("could not parse socket address from {0}")]
|
||||||
|
Parse(String),
|
||||||
|
/// Failed to parse port
|
||||||
|
#[error("could not parse port: {0}")]
|
||||||
|
Port(#[from] std::num::ParseIntError),
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Parse a [`SocketAddr`] from a `str`.
|
||||||
|
///
|
||||||
|
/// The following formats are checked:
|
||||||
|
///
|
||||||
|
/// - If the value can be parsed as a `u16` or starts with `:` it is considered a port, and the
|
||||||
|
/// hostname is set to `localhost`.
|
||||||
|
/// - If the value contains `:` it is assumed to be the format `<host>:<port>`
|
||||||
|
/// - Otherwise it is assumed to be a hostname
|
||||||
|
///
|
||||||
|
/// An error is returned if the value is empty.
|
||||||
|
pub fn parse_socket_address(value: &str) -> eyre::Result<SocketAddr, SocketAddressParsingError> {
|
||||||
|
if value.is_empty() {
|
||||||
|
return Err(SocketAddressParsingError::Empty)
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(port) = value.strip_prefix(':').or_else(|| value.strip_prefix("localhost:")) {
|
||||||
|
let port: u16 = port.parse()?;
|
||||||
|
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port))
|
||||||
|
}
|
||||||
|
if let Ok(port) = value.parse::<u16>() {
|
||||||
|
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port))
|
||||||
|
}
|
||||||
|
value
|
||||||
|
.to_socket_addrs()?
|
||||||
|
.next()
|
||||||
|
.ok_or_else(|| SocketAddressParsingError::Parse(value.to_string()))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use proptest::prelude::Rng;
|
||||||
|
use secp256k1::rand::thread_rng;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_socket_addresses() {
|
||||||
|
for value in ["localhost:9000", ":9000", "9000"] {
|
||||||
|
let socket_addr = parse_socket_address(value)
|
||||||
|
.unwrap_or_else(|_| panic!("could not parse socket address: {value}"));
|
||||||
|
|
||||||
|
assert!(socket_addr.ip().is_loopback());
|
||||||
|
assert_eq!(socket_addr.port(), 9000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_socket_address_random() {
|
||||||
|
let port: u16 = thread_rng().gen();
|
||||||
|
|
||||||
|
for value in [format!("localhost:{port}"), format!(":{port}"), port.to_string()] {
|
||||||
|
let socket_addr = parse_socket_address(&value)
|
||||||
|
.unwrap_or_else(|_| panic!("could not parse socket address: {value}"));
|
||||||
|
|
||||||
|
assert!(socket_addr.ip().is_loopback());
|
||||||
|
assert_eq!(socket_addr.port(), port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -46,6 +46,7 @@ reth-consensus.workspace = true
|
|||||||
reth-consensus-debug-client.workspace = true
|
reth-consensus-debug-client.workspace = true
|
||||||
reth-rpc-types.workspace = true
|
reth-rpc-types.workspace = true
|
||||||
reth-engine-util.workspace = true
|
reth-engine-util.workspace = true
|
||||||
|
reth-cli-util.workspace = true
|
||||||
|
|
||||||
## async
|
## async
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
|
|||||||
@ -11,6 +11,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use futures::Future;
|
use futures::Future;
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_db::{
|
use reth_db::{
|
||||||
test_utils::{create_test_rw_db_with_path, tempdir_path, TempDatabase},
|
test_utils::{create_test_rw_db_with_path, tempdir_path, TempDatabase},
|
||||||
DatabaseEnv,
|
DatabaseEnv,
|
||||||
@ -25,7 +26,7 @@ use reth_network::{
|
|||||||
};
|
};
|
||||||
use reth_node_api::{FullNodeTypes, FullNodeTypesAdapter, NodeTypes};
|
use reth_node_api::{FullNodeTypes, FullNodeTypesAdapter, NodeTypes};
|
||||||
use reth_node_core::{
|
use reth_node_core::{
|
||||||
args::{get_secret_key, DatadirArgs},
|
args::DatadirArgs,
|
||||||
cli::config::{PayloadBuilderConfig, RethTransactionPoolConfig},
|
cli::config::{PayloadBuilderConfig, RethTransactionPoolConfig},
|
||||||
dirs::{ChainPath, DataDirPath, MaybePlatformPath},
|
dirs::{ChainPath, DataDirPath, MaybePlatformPath},
|
||||||
node_config::NodeConfig,
|
node_config::NodeConfig,
|
||||||
|
|||||||
@ -14,6 +14,7 @@ workspace = true
|
|||||||
# reth
|
# reth
|
||||||
reth-chainspec.workspace = true
|
reth-chainspec.workspace = true
|
||||||
reth-primitives.workspace = true
|
reth-primitives.workspace = true
|
||||||
|
reth-cli-util.workspace = true
|
||||||
reth-fs-util.workspace = true
|
reth-fs-util.workspace = true
|
||||||
reth-db = { workspace = true, features = ["mdbx"] }
|
reth-db = { workspace = true, features = ["mdbx"] }
|
||||||
reth-db-api.workspace = true
|
reth-db-api.workspace = true
|
||||||
@ -57,7 +58,6 @@ metrics-util.workspace = true
|
|||||||
eyre.workspace = true
|
eyre.workspace = true
|
||||||
clap = { workspace = true, features = ["derive"] }
|
clap = { workspace = true, features = ["derive"] }
|
||||||
humantime.workspace = true
|
humantime.workspace = true
|
||||||
thiserror.workspace = true
|
|
||||||
const_format.workspace = true
|
const_format.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
derive_more.workspace = true
|
derive_more.workspace = true
|
||||||
|
|||||||
@ -24,9 +24,6 @@ pub use database::DatabaseArgs;
|
|||||||
mod log;
|
mod log;
|
||||||
pub use log::{ColorMode, LogArgs};
|
pub use log::{ColorMode, LogArgs};
|
||||||
|
|
||||||
mod secret_key;
|
|
||||||
pub use secret_key::{get_secret_key, SecretKeyError};
|
|
||||||
|
|
||||||
/// `PayloadBuilderArgs` struct for configuring the payload builder
|
/// `PayloadBuilderArgs` struct for configuring the payload builder
|
||||||
mod payload_builder;
|
mod payload_builder;
|
||||||
pub use payload_builder::PayloadBuilderArgs;
|
pub use payload_builder::PayloadBuilderArgs;
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
use crate::{
|
use crate::{cli::config::PayloadBuilderConfig, version::default_extradata};
|
||||||
args::utils::parse_duration_from_secs, cli::config::PayloadBuilderConfig,
|
|
||||||
version::default_extradata,
|
|
||||||
};
|
|
||||||
use clap::{
|
use clap::{
|
||||||
builder::{RangedU64ValueParser, TypedValueParser},
|
builder::{RangedU64ValueParser, TypedValueParser},
|
||||||
Arg, Args, Command,
|
Arg, Args, Command,
|
||||||
};
|
};
|
||||||
|
use reth_cli_util::parse_duration_from_secs;
|
||||||
use reth_primitives::constants::{
|
use reth_primitives::constants::{
|
||||||
ETHEREUM_BLOCK_GAS_LIMIT, MAXIMUM_EXTRA_DATA_SIZE, SLOT_DURATION,
|
ETHEREUM_BLOCK_GAS_LIMIT, MAXIMUM_EXTRA_DATA_SIZE, SLOT_DURATION,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,14 +3,7 @@
|
|||||||
use alloy_genesis::Genesis;
|
use alloy_genesis::Genesis;
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_fs_util as fs;
|
use reth_fs_util as fs;
|
||||||
use reth_primitives::{BlockHashOrNumber, B256};
|
use std::{path::PathBuf, sync::Arc};
|
||||||
use std::{
|
|
||||||
net::{IpAddr, Ipv4Addr, SocketAddr, ToSocketAddrs},
|
|
||||||
path::PathBuf,
|
|
||||||
str::FromStr,
|
|
||||||
sync::Arc,
|
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
|
|
||||||
use reth_chainspec::DEV;
|
use reth_chainspec::DEV;
|
||||||
|
|
||||||
@ -27,12 +20,6 @@ pub const SUPPORTED_CHAINS: &[&str] = &["optimism", "optimism-sepolia", "base",
|
|||||||
/// Chains supported by reth. First value should be used as the default.
|
/// Chains supported by reth. First value should be used as the default.
|
||||||
pub const SUPPORTED_CHAINS: &[&str] = &["mainnet", "sepolia", "goerli", "holesky", "dev"];
|
pub const SUPPORTED_CHAINS: &[&str] = &["mainnet", "sepolia", "goerli", "holesky", "dev"];
|
||||||
|
|
||||||
/// Helper to parse a [Duration] from seconds
|
|
||||||
pub fn parse_duration_from_secs(arg: &str) -> eyre::Result<Duration, std::num::ParseIntError> {
|
|
||||||
let seconds = arg.parse()?;
|
|
||||||
Ok(Duration::from_secs(seconds))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The help info for the --chain flag
|
/// The help info for the --chain flag
|
||||||
pub fn chain_help() -> String {
|
pub fn chain_help() -> String {
|
||||||
format!("The chain this node is running.\nPossible values are either a built-in chain or the path to a chain specification file.\n\nBuilt-in chains:\n {}", SUPPORTED_CHAINS.join(", "))
|
format!("The chain this node is running.\nPossible values are either a built-in chain or the path to a chain specification file.\n\nBuilt-in chains:\n {}", SUPPORTED_CHAINS.join(", "))
|
||||||
@ -83,64 +70,9 @@ pub fn chain_value_parser(s: &str) -> eyre::Result<Arc<ChainSpec>, eyre::Error>
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse [`BlockHashOrNumber`]
|
|
||||||
pub fn hash_or_num_value_parser(value: &str) -> eyre::Result<BlockHashOrNumber, eyre::Error> {
|
|
||||||
match B256::from_str(value) {
|
|
||||||
Ok(hash) => Ok(BlockHashOrNumber::Hash(hash)),
|
|
||||||
Err(_) => Ok(BlockHashOrNumber::Number(value.parse()?)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Error thrown while parsing a socket address.
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
|
||||||
pub enum SocketAddressParsingError {
|
|
||||||
/// Failed to convert the string into a socket addr
|
|
||||||
#[error("could not parse socket address: {0}")]
|
|
||||||
Io(#[from] std::io::Error),
|
|
||||||
/// Input must not be empty
|
|
||||||
#[error("cannot parse socket address from empty string")]
|
|
||||||
Empty,
|
|
||||||
/// Failed to parse the address
|
|
||||||
#[error("could not parse socket address from {0}")]
|
|
||||||
Parse(String),
|
|
||||||
/// Failed to parse port
|
|
||||||
#[error("could not parse port: {0}")]
|
|
||||||
Port(#[from] std::num::ParseIntError),
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Parse a [`SocketAddr`] from a `str`.
|
|
||||||
///
|
|
||||||
/// The following formats are checked:
|
|
||||||
///
|
|
||||||
/// - If the value can be parsed as a `u16` or starts with `:` it is considered a port, and the
|
|
||||||
/// hostname is set to `localhost`.
|
|
||||||
/// - If the value contains `:` it is assumed to be the format `<host>:<port>`
|
|
||||||
/// - Otherwise it is assumed to be a hostname
|
|
||||||
///
|
|
||||||
/// An error is returned if the value is empty.
|
|
||||||
pub fn parse_socket_address(value: &str) -> eyre::Result<SocketAddr, SocketAddressParsingError> {
|
|
||||||
if value.is_empty() {
|
|
||||||
return Err(SocketAddressParsingError::Empty)
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(port) = value.strip_prefix(':').or_else(|| value.strip_prefix("localhost:")) {
|
|
||||||
let port: u16 = port.parse()?;
|
|
||||||
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port))
|
|
||||||
}
|
|
||||||
if let Ok(port) = value.parse::<u16>() {
|
|
||||||
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port))
|
|
||||||
}
|
|
||||||
value
|
|
||||||
.to_socket_addrs()?
|
|
||||||
.next()
|
|
||||||
.ok_or_else(|| SocketAddressParsingError::Parse(value.to_string()))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use proptest::prelude::Rng;
|
|
||||||
use secp256k1::rand::thread_rng;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_known_chain_spec() {
|
fn parse_known_chain_spec() {
|
||||||
@ -148,28 +80,4 @@ mod tests {
|
|||||||
chain_value_parser(chain).unwrap();
|
chain_value_parser(chain).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn parse_socket_addresses() {
|
|
||||||
for value in ["localhost:9000", ":9000", "9000"] {
|
|
||||||
let socket_addr = parse_socket_address(value)
|
|
||||||
.unwrap_or_else(|_| panic!("could not parse socket address: {value}"));
|
|
||||||
|
|
||||||
assert!(socket_addr.ip().is_loopback());
|
|
||||||
assert_eq!(socket_addr.port(), 9000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn parse_socket_address_random() {
|
|
||||||
let port: u16 = thread_rng().gen();
|
|
||||||
|
|
||||||
for value in [format!("localhost:{port}"), format!(":{port}"), port.to_string()] {
|
|
||||||
let socket_addr = parse_socket_address(&value)
|
|
||||||
.unwrap_or_else(|_| panic!("could not parse socket address: {value}"));
|
|
||||||
|
|
||||||
assert!(socket_addr.ip().is_loopback());
|
|
||||||
assert_eq!(socket_addr.port(), port);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user