mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
chore(deps): bump breaking deps (#14570)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
426
Cargo.lock
generated
426
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
20
Cargo.toml
20
Cargo.toml
@ -502,7 +502,7 @@ bytes = { version = "1.5", default-features = false }
|
|||||||
cfg-if = "1.0"
|
cfg-if = "1.0"
|
||||||
clap = "4"
|
clap = "4"
|
||||||
dashmap = "6.0"
|
dashmap = "6.0"
|
||||||
derive_more = { version = "1", default-features = false, features = ["full"] }
|
derive_more = { version = "2", default-features = false, features = ["full"] }
|
||||||
dirs-next = "2.0.0"
|
dirs-next = "2.0.0"
|
||||||
dyn-clone = "1.0.17"
|
dyn-clone = "1.0.17"
|
||||||
eyre = "0.6"
|
eyre = "0.6"
|
||||||
@ -510,10 +510,10 @@ fdlimit = "0.3.0"
|
|||||||
generic-array = "0.14"
|
generic-array = "0.14"
|
||||||
humantime = "2.1"
|
humantime = "2.1"
|
||||||
humantime-serde = "1.1"
|
humantime-serde = "1.1"
|
||||||
itertools = { version = "0.13", default-features = false }
|
itertools = { version = "0.14", default-features = false }
|
||||||
linked_hash_set = "0.1"
|
linked_hash_set = "0.1"
|
||||||
modular-bitfield = "0.11.2"
|
modular-bitfield = "0.11.2"
|
||||||
notify = { version = "6.1.1", default-features = false, features = ["macos_fsevent"] }
|
notify = { version = "8.0.0", default-features = false, features = ["macos_fsevent"] }
|
||||||
nybbles = { version = "0.3.0", default-features = false }
|
nybbles = { version = "0.3.0", default-features = false }
|
||||||
once_cell = { version = "1.19", default-features = false, features = ["critical-section"] }
|
once_cell = { version = "1.19", default-features = false, features = ["critical-section"] }
|
||||||
parking_lot = "0.12"
|
parking_lot = "0.12"
|
||||||
@ -528,7 +528,7 @@ serde_with = { version = "3", default-features = false, features = ["macros"] }
|
|||||||
sha2 = { version = "0.10", default-features = false }
|
sha2 = { version = "0.10", default-features = false }
|
||||||
shellexpand = "3.0.0"
|
shellexpand = "3.0.0"
|
||||||
smallvec = "1"
|
smallvec = "1"
|
||||||
strum = { version = "0.26", default-features = false }
|
strum = { version = "0.27", default-features = false }
|
||||||
syn = "2.0"
|
syn = "2.0"
|
||||||
thiserror = { version = "2.0.0", default-features = false }
|
thiserror = { version = "2.0.0", default-features = false }
|
||||||
tracing = "0.1.0"
|
tracing = "0.1.0"
|
||||||
@ -569,7 +569,7 @@ tower = "0.4"
|
|||||||
tower-http = "0.6"
|
tower-http = "0.6"
|
||||||
|
|
||||||
# p2p
|
# p2p
|
||||||
discv5 = "0.8.0"
|
discv5 = "0.9"
|
||||||
if-addrs = "0.13"
|
if-addrs = "0.13"
|
||||||
|
|
||||||
# rpc
|
# rpc
|
||||||
@ -587,9 +587,9 @@ jsonwebtoken = "9"
|
|||||||
proptest-arbitrary-interop = "0.1.0"
|
proptest-arbitrary-interop = "0.1.0"
|
||||||
|
|
||||||
# crypto
|
# crypto
|
||||||
enr = { version = "0.12.1", default-features = false }
|
enr = { version = "0.13", default-features = false }
|
||||||
k256 = { version = "0.13", default-features = false, features = ["ecdsa"] }
|
k256 = { version = "0.13", default-features = false, features = ["ecdsa"] }
|
||||||
secp256k1 = { version = "0.29", default-features = false, features = ["global-context", "recovery"] }
|
secp256k1 = { version = "0.30", default-features = false, features = ["global-context", "recovery"] }
|
||||||
|
|
||||||
# for eip-4844
|
# for eip-4844
|
||||||
c-kzg = "1.0.0"
|
c-kzg = "1.0.0"
|
||||||
@ -607,13 +607,13 @@ proptest-derive = "0.5"
|
|||||||
serial_test = { default-features = false, version = "3" }
|
serial_test = { default-features = false, version = "3" }
|
||||||
similar-asserts = { version = "1.5.0", features = ["serde"] }
|
similar-asserts = { version = "1.5.0", features = ["serde"] }
|
||||||
tempfile = "3.8"
|
tempfile = "3.8"
|
||||||
test-fuzz = "6"
|
test-fuzz = "7"
|
||||||
rstest = "0.23.0"
|
rstest = "0.24.0"
|
||||||
|
|
||||||
# allocators
|
# allocators
|
||||||
tikv-jemalloc-ctl = "0.6"
|
tikv-jemalloc-ctl = "0.6"
|
||||||
tikv-jemallocator = "0.6"
|
tikv-jemallocator = "0.6"
|
||||||
tracy-client = "0.17.3"
|
tracy-client = "0.18.0"
|
||||||
snmalloc-rs = { version = "0.3.7", features = ["build_cc"] }
|
snmalloc-rs = { version = "0.3.7", features = ["build_cc"] }
|
||||||
|
|
||||||
# TODO: When we build for a windows target on an ubuntu runner, crunchy tries to
|
# TODO: When we build for a windows target on an ubuntu runner, crunchy tries to
|
||||||
|
|||||||
@ -68,7 +68,7 @@ serde.workspace = true
|
|||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
backon.workspace = true
|
backon.workspace = true
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
|
|
||||||
# io
|
# io
|
||||||
fdlimit.workspace = true
|
fdlimit.workspace = true
|
||||||
@ -77,7 +77,7 @@ toml = { workspace = true, features = ["display"] }
|
|||||||
# tui
|
# tui
|
||||||
comfy-table = "7.0"
|
comfy-table = "7.0"
|
||||||
crossterm = "0.28.0"
|
crossterm = "0.28.0"
|
||||||
ratatui = { version = "0.28", default-features = false, features = ["crossterm"] }
|
ratatui = { version = "0.29", default-features = false, features = ["crossterm"] }
|
||||||
|
|
||||||
# reth test-vectors
|
# reth test-vectors
|
||||||
proptest = { workspace = true, optional = true }
|
proptest = { workspace = true, optional = true }
|
||||||
|
|||||||
@ -22,7 +22,7 @@ reth-network-peers = { workspace = true, features = ["secp256k1"] }
|
|||||||
alloy-primitives = { workspace = true, features = ["rand"] }
|
alloy-primitives = { workspace = true, features = ["rand"] }
|
||||||
alloy-rlp = { workspace = true, features = ["derive"] }
|
alloy-rlp = { workspace = true, features = ["derive"] }
|
||||||
discv5.workspace = true
|
discv5.workspace = true
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery", "serde"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery", "serde"] }
|
||||||
enr.workspace = true
|
enr.workspace = true
|
||||||
|
|
||||||
# async/futures
|
# async/futures
|
||||||
|
|||||||
@ -122,7 +122,7 @@ impl Message {
|
|||||||
// Serialize the signature and append it to the signature bytes
|
// Serialize the signature and append it to the signature bytes
|
||||||
let (rec, sig) = signature.serialize_compact();
|
let (rec, sig) = signature.serialize_compact();
|
||||||
sig_bytes.extend_from_slice(&sig);
|
sig_bytes.extend_from_slice(&sig);
|
||||||
sig_bytes.put_u8(rec.to_i32() as u8);
|
sig_bytes.put_u8(i32::from(rec) as u8);
|
||||||
sig_bytes.unsplit(payload);
|
sig_bytes.unsplit(payload);
|
||||||
|
|
||||||
// Calculate the hash of the signature bytes and append it to the datagram
|
// Calculate the hash of the signature bytes and append it to the datagram
|
||||||
@ -156,7 +156,7 @@ impl Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let signature = &packet[32..96];
|
let signature = &packet[32..96];
|
||||||
let recovery_id = RecoveryId::from_i32(packet[96] as i32)?;
|
let recovery_id = RecoveryId::try_from(packet[96] as i32)?;
|
||||||
let recoverable_sig = RecoverableSignature::from_compact(signature, recovery_id)?;
|
let recoverable_sig = RecoverableSignature::from_compact(signature, recovery_id)?;
|
||||||
|
|
||||||
// recover the public key
|
// recover the public key
|
||||||
|
|||||||
@ -42,4 +42,4 @@ metrics.workspace = true
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
reth-tracing.workspace = true
|
reth-tracing.workspace = true
|
||||||
tokio = { workspace = true, features = ["rt-multi-thread"] }
|
tokio = { workspace = true, features = ["rt-multi-thread"] }
|
||||||
secp256k1 = { workspace = true, features = ["rand-std"] }
|
secp256k1 = { workspace = true, features = ["std", "rand"] }
|
||||||
|
|||||||
@ -655,8 +655,8 @@ pub async fn lookup(
|
|||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use ::enr::{CombinedKey, EnrKey};
|
use ::enr::{CombinedKey, EnrKey};
|
||||||
|
use rand::thread_rng;
|
||||||
use reth_chainspec::MAINNET;
|
use reth_chainspec::MAINNET;
|
||||||
use secp256k1::rand::thread_rng;
|
|
||||||
use tracing::trace;
|
use tracing::trace;
|
||||||
|
|
||||||
fn discv5_noop() -> Discv5 {
|
fn discv5_noop() -> Discv5 {
|
||||||
@ -729,16 +729,12 @@ mod test {
|
|||||||
node_1.with_discv5(|discv5| discv5.send_ping(node_2_enr.clone())).await.unwrap();
|
node_1.with_discv5(|discv5| discv5.send_ping(node_2_enr.clone())).await.unwrap();
|
||||||
|
|
||||||
// verify node_1:discv5 is connected to node_2:discv5 and vv
|
// verify node_1:discv5 is connected to node_2:discv5 and vv
|
||||||
let event_2_v5 = stream_2.recv().await.unwrap();
|
|
||||||
let event_1_v5 = stream_1.recv().await.unwrap();
|
let event_1_v5 = stream_1.recv().await.unwrap();
|
||||||
|
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
event_1_v5,
|
event_1_v5,
|
||||||
discv5::Event::SessionEstablished(node, socket) if node == node_2_enr && socket == node_2_enr.udp4_socket().unwrap().into()
|
discv5::Event::SessionEstablished(node, socket) if node == node_2_enr && socket == node_2_enr.udp4_socket().unwrap().into()
|
||||||
));
|
));
|
||||||
assert!(matches!(
|
|
||||||
event_2_v5,
|
|
||||||
discv5::Event::SessionEstablished(node, socket) if node == node_1_enr && socket == node_1_enr.udp4_socket().unwrap().into()
|
|
||||||
));
|
|
||||||
|
|
||||||
// verify node_1 is in KBuckets of node_2:discv5
|
// verify node_1 is in KBuckets of node_2:discv5
|
||||||
let event_2_v5 = stream_2.recv().await.unwrap();
|
let event_2_v5 = stream_2.recv().await.unwrap();
|
||||||
|
|||||||
@ -19,7 +19,7 @@ reth-tokio-util = { workspace = true, features = ["time"] }
|
|||||||
|
|
||||||
# ethereum
|
# ethereum
|
||||||
alloy-primitives.workspace = true
|
alloy-primitives.workspace = true
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery", "serde"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery", "serde"] }
|
||||||
enr.workspace = true
|
enr.workspace = true
|
||||||
|
|
||||||
# async/futures
|
# async/futures
|
||||||
@ -27,7 +27,7 @@ tokio = { workspace = true, features = ["io-util", "net", "time"] }
|
|||||||
tokio-stream.workspace = true
|
tokio-stream.workspace = true
|
||||||
|
|
||||||
# trust-dns
|
# trust-dns
|
||||||
hickory-resolver = { version = "0.25.0-alpha.4" }
|
hickory-resolver = { version = "0.25.0-alpha.5" }
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
data-encoding = "2"
|
data-encoding = "2"
|
||||||
|
|||||||
@ -34,7 +34,7 @@ byteorder.workspace = true
|
|||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
ctr = "0.9.2"
|
ctr = "0.9.2"
|
||||||
digest = "0.10.5"
|
digest = "0.10.5"
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery", "rand"] }
|
||||||
concat-kdf = "0.1.0"
|
concat-kdf = "0.1.0"
|
||||||
sha2.workspace = true
|
sha2.workspace = true
|
||||||
sha3 = "0.10.5"
|
sha3 = "0.10.5"
|
||||||
|
|||||||
@ -421,7 +421,7 @@ impl ECIES {
|
|||||||
|
|
||||||
let mut sig_bytes = [0u8; 65];
|
let mut sig_bytes = [0u8; 65];
|
||||||
sig_bytes[..64].copy_from_slice(&sig);
|
sig_bytes[..64].copy_from_slice(&sig);
|
||||||
sig_bytes[64] = rec_id.to_i32() as u8;
|
sig_bytes[64] = i32::from(rec_id) as u8;
|
||||||
|
|
||||||
let id = pk2id(&self.public_key);
|
let id = pk2id(&self.public_key);
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ impl ECIES {
|
|||||||
let sigdata = data.get_next::<[u8; 65]>()?.ok_or(ECIESErrorImpl::InvalidAuthData)?;
|
let sigdata = data.get_next::<[u8; 65]>()?.ok_or(ECIESErrorImpl::InvalidAuthData)?;
|
||||||
let signature = RecoverableSignature::from_compact(
|
let signature = RecoverableSignature::from_compact(
|
||||||
&sigdata[..64],
|
&sigdata[..64],
|
||||||
RecoveryId::from_i32(sigdata[64] as i32)?,
|
RecoveryId::try_from(sigdata[64] as i32)?,
|
||||||
)?;
|
)?;
|
||||||
let remote_id = data.get_next()?.ok_or(ECIESErrorImpl::InvalidAuthData)?;
|
let remote_id = data.get_next()?.ok_or(ECIESErrorImpl::InvalidAuthData)?;
|
||||||
self.remote_id = Some(remote_id);
|
self.remote_id = Some(remote_id);
|
||||||
|
|||||||
@ -53,7 +53,7 @@ test-fuzz.workspace = true
|
|||||||
tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
|
tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
|
||||||
tokio-util = { workspace = true, features = ["io", "codec"] }
|
tokio-util = { workspace = true, features = ["io", "codec"] }
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
|
|
||||||
arbitrary = { workspace = true, features = ["derive"] }
|
arbitrary = { workspace = true, features = ["derive"] }
|
||||||
proptest.workspace = true
|
proptest.workspace = true
|
||||||
|
|||||||
@ -65,7 +65,7 @@ rustc-hash.workspace = true
|
|||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
parking_lot.workspace = true
|
parking_lot.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
derive_more.workspace = true
|
derive_more.workspace = true
|
||||||
schnellru.workspace = true
|
schnellru.workspace = true
|
||||||
itertools.workspace = true
|
itertools.workspace = true
|
||||||
@ -96,6 +96,7 @@ alloy-consensus.workspace = true
|
|||||||
serial_test.workspace = true
|
serial_test.workspace = true
|
||||||
tempfile.workspace = true
|
tempfile.workspace = true
|
||||||
url.workspace = true
|
url.workspace = true
|
||||||
|
secp256k1 = { workspace = true, features = ["rand"] }
|
||||||
|
|
||||||
## Benchmarks
|
## Benchmarks
|
||||||
pprof = { workspace = true, features = ["criterion", "flamegraph"] }
|
pprof = { workspace = true, features = ["criterion", "flamegraph"] }
|
||||||
|
|||||||
@ -68,7 +68,7 @@ tokio = { workspace = true, features = ["sync", "macros", "time", "rt-multi-thre
|
|||||||
tokio-stream.workspace = true
|
tokio-stream.workspace = true
|
||||||
|
|
||||||
## crypto
|
## crypto
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
|
|
||||||
## misc
|
## misc
|
||||||
aquamarine.workspace = true
|
aquamarine.workspace = true
|
||||||
|
|||||||
@ -61,7 +61,7 @@ shellexpand.workspace = true
|
|||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
|
|
||||||
# crypto
|
# crypto
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
|
|
||||||
# async
|
# async
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
|
|||||||
@ -29,7 +29,7 @@ eyre.workspace = true
|
|||||||
tikv-jemalloc-ctl = { workspace = true, optional = true, features = ["stats"] }
|
tikv-jemalloc-ctl = { workspace = true, optional = true, features = ["stats"] }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
procfs = "0.16.0"
|
procfs = "0.17.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
reqwest.workspace = true
|
reqwest.workspace = true
|
||||||
@ -40,6 +40,3 @@ workspace = true
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
jemalloc = ["dep:tikv-jemalloc-ctl"]
|
jemalloc = ["dep:tikv-jemalloc-ctl"]
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] }
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ use alloy_genesis::Genesis;
|
|||||||
use alloy_primitives::{B256, U256};
|
use alloy_primitives::{B256, U256};
|
||||||
pub use base::BASE_MAINNET;
|
pub use base::BASE_MAINNET;
|
||||||
pub use base_sepolia::BASE_SEPOLIA;
|
pub use base_sepolia::BASE_SEPOLIA;
|
||||||
use derive_more::{Constructor, Deref, Display, From, Into};
|
use derive_more::{Constructor, Deref, From, Into};
|
||||||
pub use dev::OP_DEV;
|
pub use dev::OP_DEV;
|
||||||
pub use op::OP_MAINNET;
|
pub use op::OP_MAINNET;
|
||||||
pub use op_sepolia::OP_SEPOLIA;
|
pub use op_sepolia::OP_SEPOLIA;
|
||||||
@ -215,7 +215,7 @@ impl EthChainSpec for OpChainSpec {
|
|||||||
self.inner.prune_delete_limit()
|
self.inner.prune_delete_limit()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn display_hardforks(&self) -> Box<dyn Display> {
|
fn display_hardforks(&self) -> Box<dyn core::fmt::Display> {
|
||||||
Box::new(ChainSpec::display_hardforks(self))
|
Box::new(ChainSpec::display_hardforks(self))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ use alloy_rlp::Header;
|
|||||||
use core::{
|
use core::{
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
mem,
|
mem,
|
||||||
|
ops::Deref,
|
||||||
};
|
};
|
||||||
use derive_more::{AsRef, Deref};
|
use derive_more::{AsRef, Deref};
|
||||||
use op_alloy_consensus::{
|
use op_alloy_consensus::{
|
||||||
|
|||||||
@ -81,7 +81,7 @@ mod impl_secp256k1 {
|
|||||||
msg: &[u8; 32],
|
msg: &[u8; 32],
|
||||||
) -> Result<Address, Error> {
|
) -> Result<Address, Error> {
|
||||||
let sig =
|
let sig =
|
||||||
RecoverableSignature::from_compact(&sig[0..64], RecoveryId::from_i32(sig[64] as i32)?)?;
|
RecoverableSignature::from_compact(&sig[0..64], RecoveryId::try_from(sig[64] as i32)?)?;
|
||||||
|
|
||||||
let public = SECP256K1.recover_ecdsa(&Message::from_digest(*msg), &sig)?;
|
let public = SECP256K1.recover_ecdsa(&Message::from_digest(*msg), &sig)?;
|
||||||
Ok(public_key_to_address(public))
|
Ok(public_key_to_address(public))
|
||||||
@ -97,7 +97,7 @@ mod impl_secp256k1 {
|
|||||||
let signature = Signature::new(
|
let signature = Signature::new(
|
||||||
U256::try_from_be_slice(&data[..32]).expect("The slice has at most 32 bytes"),
|
U256::try_from_be_slice(&data[..32]).expect("The slice has at most 32 bytes"),
|
||||||
U256::try_from_be_slice(&data[32..64]).expect("The slice has at most 32 bytes"),
|
U256::try_from_be_slice(&data[32..64]).expect("The slice has at most 32 bytes"),
|
||||||
rec_id.to_i32() != 0,
|
i32::from(rec_id) != 0,
|
||||||
);
|
);
|
||||||
Ok(signature)
|
Ok(signature)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ workspace = true
|
|||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
convert_case = "0.6.0"
|
convert_case = "0.7.0"
|
||||||
proc-macro2.workspace = true
|
proc-macro2.workspace = true
|
||||||
quote.workspace = true
|
quote.workspace = true
|
||||||
syn.workspace = true
|
syn.workspace = true
|
||||||
|
|||||||
@ -37,7 +37,7 @@ thiserror.workspace = true
|
|||||||
tempfile = { workspace = true, optional = true }
|
tempfile = { workspace = true, optional = true }
|
||||||
derive_more.workspace = true
|
derive_more.workspace = true
|
||||||
rustc-hash = { workspace = true, optional = true }
|
rustc-hash = { workspace = true, optional = true }
|
||||||
sysinfo = { version = "0.32", default-features = false, features = ["system"] }
|
sysinfo = { version = "0.33", default-features = false, features = ["system"] }
|
||||||
parking_lot = { workspace = true, optional = true }
|
parking_lot = { workspace = true, optional = true }
|
||||||
|
|
||||||
# arbitrary utils
|
# arbitrary utils
|
||||||
|
|||||||
@ -112,7 +112,7 @@ impl ProcessUID {
|
|||||||
system.refresh_processes_specifics(
|
system.refresh_processes_specifics(
|
||||||
sysinfo::ProcessesToUpdate::Some(&[pid2]),
|
sysinfo::ProcessesToUpdate::Some(&[pid2]),
|
||||||
true,
|
true,
|
||||||
ProcessRefreshKind::new(),
|
ProcessRefreshKind::nothing(),
|
||||||
);
|
);
|
||||||
system.process(pid2).map(|process| Self { pid, start_time: process.start_time() })
|
system.process(pid2).map(|process| Self { pid, start_time: process.start_time() })
|
||||||
}
|
}
|
||||||
@ -141,9 +141,11 @@ impl ProcessUID {
|
|||||||
|
|
||||||
/// Whether a process with this `pid` and `start_time` exists.
|
/// Whether a process with this `pid` and `start_time` exists.
|
||||||
fn is_active(&self) -> bool {
|
fn is_active(&self) -> bool {
|
||||||
System::new_with_specifics(RefreshKind::new().with_processes(ProcessRefreshKind::new()))
|
System::new_with_specifics(
|
||||||
.process(self.pid.into())
|
RefreshKind::nothing().with_processes(ProcessRefreshKind::nothing()),
|
||||||
.is_some_and(|p| p.start_time() == self.start_time)
|
)
|
||||||
|
.process(self.pid.into())
|
||||||
|
.is_some_and(|p| p.start_time() == self.start_time)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Writes `pid` and `start_time` to a file.
|
/// Writes `pid` and `start_time` to a file.
|
||||||
|
|||||||
@ -34,7 +34,6 @@ read-tx-timeouts = ["dep:dashmap"]
|
|||||||
pprof = { workspace = true, features = ["flamegraph", "frame-pointer", "criterion"] }
|
pprof = { workspace = true, features = ["flamegraph", "frame-pointer", "criterion"] }
|
||||||
criterion.workspace = true
|
criterion.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
rand_xorshift = "0.3"
|
|
||||||
tempfile.workspace = true
|
tempfile.workspace = true
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
|
|||||||
@ -2,8 +2,7 @@
|
|||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
use criterion::{criterion_group, criterion_main, Criterion};
|
use criterion::{criterion_group, criterion_main, Criterion};
|
||||||
use rand::{prelude::SliceRandom, SeedableRng};
|
use rand::{prelude::SliceRandom, rngs::StdRng, SeedableRng};
|
||||||
use rand_xorshift::XorShiftRng;
|
|
||||||
use reth_libmdbx::{ffi::*, ObjectLength, WriteFlags};
|
use reth_libmdbx::{ffi::*, ObjectLength, WriteFlags};
|
||||||
use std::{hint::black_box, ptr};
|
use std::{hint::black_box, ptr};
|
||||||
use utils::*;
|
use utils::*;
|
||||||
@ -15,7 +14,7 @@ fn bench_get_rand(c: &mut Criterion) {
|
|||||||
let db = txn.open_db(None).unwrap();
|
let db = txn.open_db(None).unwrap();
|
||||||
|
|
||||||
let mut keys: Vec<String> = (0..n).map(get_key).collect();
|
let mut keys: Vec<String> = (0..n).map(get_key).collect();
|
||||||
keys.shuffle(&mut XorShiftRng::from_seed(Default::default()));
|
keys.shuffle(&mut StdRng::from_seed(Default::default()));
|
||||||
|
|
||||||
c.bench_function("bench_get_rand", |b| {
|
c.bench_function("bench_get_rand", |b| {
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
@ -35,7 +34,7 @@ fn bench_get_rand_raw(c: &mut Criterion) {
|
|||||||
let db = txn.open_db(None).unwrap();
|
let db = txn.open_db(None).unwrap();
|
||||||
|
|
||||||
let mut keys: Vec<String> = (0..n).map(get_key).collect();
|
let mut keys: Vec<String> = (0..n).map(get_key).collect();
|
||||||
keys.shuffle(&mut XorShiftRng::from_seed(Default::default()));
|
keys.shuffle(&mut StdRng::from_seed(Default::default()));
|
||||||
|
|
||||||
let dbi = db.dbi();
|
let dbi = db.dbi();
|
||||||
|
|
||||||
@ -71,7 +70,7 @@ fn bench_put_rand(c: &mut Criterion) {
|
|||||||
let db = txn.commit_and_rebind_open_dbs().unwrap().2.remove(0);
|
let db = txn.commit_and_rebind_open_dbs().unwrap().2.remove(0);
|
||||||
|
|
||||||
let mut items: Vec<(String, String)> = (0..n).map(|n| (get_key(n), get_data(n))).collect();
|
let mut items: Vec<(String, String)> = (0..n).map(|n| (get_key(n), get_data(n))).collect();
|
||||||
items.shuffle(&mut XorShiftRng::from_seed(Default::default()));
|
items.shuffle(&mut StdRng::from_seed(Default::default()));
|
||||||
|
|
||||||
c.bench_function("bench_put_rand", |b| {
|
c.bench_function("bench_put_rand", |b| {
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
@ -88,7 +87,7 @@ fn bench_put_rand_raw(c: &mut Criterion) {
|
|||||||
let (_dir, env) = setup_bench_db(0);
|
let (_dir, env) = setup_bench_db(0);
|
||||||
|
|
||||||
let mut items: Vec<(String, String)> = (0..n).map(|n| (get_key(n), get_data(n))).collect();
|
let mut items: Vec<(String, String)> = (0..n).map(|n| (get_key(n), get_data(n))).collect();
|
||||||
items.shuffle(&mut XorShiftRng::from_seed(Default::default()));
|
items.shuffle(&mut StdRng::from_seed(Default::default()));
|
||||||
|
|
||||||
let dbi = env.begin_ro_txn().unwrap().open_db(None).unwrap().dbi();
|
let dbi = env.begin_ro_txn().unwrap().open_db(None).unwrap().dbi();
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,10 @@ use alloy_primitives::{
|
|||||||
map::{HashMap, HashSet},
|
map::{HashMap, HashSet},
|
||||||
BlockNumber, B256,
|
BlockNumber, B256,
|
||||||
};
|
};
|
||||||
use core::{marker::PhantomData, ops::RangeInclusive};
|
use core::{
|
||||||
use derive_more::Deref;
|
marker::PhantomData,
|
||||||
|
ops::{Deref, RangeInclusive},
|
||||||
|
};
|
||||||
use reth_db_api::{
|
use reth_db_api::{
|
||||||
cursor::DbCursorRO,
|
cursor::DbCursorRO,
|
||||||
models::{AccountBeforeTx, BlockNumberAddress},
|
models::{AccountBeforeTx, BlockNumberAddress},
|
||||||
|
|||||||
@ -16,7 +16,7 @@ reth-network-peers.workspace = true
|
|||||||
reth-primitives.workspace = true
|
reth-primitives.workspace = true
|
||||||
reth-tracing.workspace = true
|
reth-tracing.workspace = true
|
||||||
|
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
|
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
tokio-stream.workspace = true
|
tokio-stream.workspace = true
|
||||||
|
|||||||
@ -16,7 +16,7 @@ reth-network-peers.workspace = true
|
|||||||
|
|
||||||
alloy-consensus.workspace = true
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
|
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|||||||
@ -8,7 +8,7 @@ license.workspace = true
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
|
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
reth-network.workspace = true
|
reth-network.workspace = true
|
||||||
reth-chainspec.workspace = true
|
reth-chainspec.workspace = true
|
||||||
|
|||||||
Reference in New Issue
Block a user