chore: alloy 0.14 (#15635)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Yash Atreya
2025-04-11 11:58:57 +05:30
committed by GitHub
parent 2563e93d95
commit 58fe204ff2
126 changed files with 968 additions and 868 deletions

View File

@@ -28,7 +28,7 @@ pub use secp256k1::SecretKey;
/// Convenience function to create a new random [`SecretKey`]
pub fn rng_secret_key() -> SecretKey {
SecretKey::new(&mut rand::thread_rng())
SecretKey::new(&mut rand_08::thread_rng())
}
/// All network related initialization settings.
@@ -696,14 +696,13 @@ impl NetworkMode {
mod tests {
use super::*;
use alloy_eips::eip2124::ForkHash;
use rand::thread_rng;
use reth_chainspec::{Chain, MAINNET};
use reth_dns_discovery::tree::LinkEntry;
use reth_storage_api::noop::NoopProvider;
use std::sync::Arc;
fn builder() -> NetworkConfigBuilder {
let secret_key = SecretKey::new(&mut thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
NetworkConfigBuilder::new(secret_key)
}

View File

@@ -338,14 +338,12 @@ impl Discovery {
#[cfg(test)]
mod tests {
use super::*;
use rand::thread_rng;
use secp256k1::SECP256K1;
use std::net::{Ipv4Addr, SocketAddrV4};
#[tokio::test(flavor = "multi_thread")]
async fn test_discovery_setup() {
let mut rng = thread_rng();
let (secret_key, _) = SECP256K1.generate_keypair(&mut rng);
let (secret_key, _) = SECP256K1.generate_keypair(&mut rand_08::thread_rng());
let discovery_addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, 0));
let _discovery = Discovery::new(
discovery_addr,
@@ -364,7 +362,7 @@ mod tests {
use tracing::trace;
async fn start_discovery_node(udp_port_discv4: u16, udp_port_discv5: u16) -> Discovery {
let secret_key = SecretKey::new(&mut thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let discv4_addr = format!("127.0.0.1:{udp_port_discv4}").parse().unwrap();
let discv5_addr: SocketAddr = format!("127.0.0.1:{udp_port_discv5}").parse().unwrap();

View File

@@ -898,7 +898,7 @@ mod tests {
let fork_filter = self.fork_filter.clone();
let local_peer_id = self.local_peer_id;
let mut hello = self.hello.clone();
let key = SecretKey::new(&mut rand::thread_rng());
let key = SecretKey::new(&mut rand_08::thread_rng());
hello.id = pk2id(&key.public_key(SECP256K1));
Box::pin(async move {
let outgoing = TcpStream::connect(local_addr).await.unwrap();
@@ -989,7 +989,7 @@ mod tests {
fn default() -> Self {
let (active_session_tx, active_session_rx) = mpsc::channel(100);
let (secret_key, pk) = SECP256K1.generate_keypair(&mut rand::thread_rng());
let (secret_key, pk) = SECP256K1.generate_keypair(&mut rand_08::thread_rng());
let local_peer_id = pk2id(&pk);
Self {

View File

@@ -195,7 +195,7 @@ impl<N: NetworkPrimitives> NetworkState<N> {
// Shuffle to propagate to a random sample of peers on every block announcement
let mut peers: Vec<_> = self.active_peers.iter_mut().collect();
peers.shuffle(&mut rand::thread_rng());
peers.shuffle(&mut rand::rng());
for (peer_id, peer) in peers {
if peer.blocks.contains(&msg.hash) {

View File

@@ -638,7 +638,7 @@ where
where
C: ChainSpecProvider<ChainSpec: Hardforks>,
{
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let config = Self::network_config_builder(secret_key).build(client.clone());
Self { config, client, secret_key }
}
@@ -658,7 +658,7 @@ where
where
C: ChainSpecProvider<ChainSpec: Hardforks>,
{
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let builder = Self::network_config_builder(secret_key);
let hello_message =

View File

@@ -1911,7 +1911,7 @@ mod tests {
use super::*;
use crate::{test_utils::Testnet, NetworkConfigBuilder, NetworkManager};
use alloy_consensus::{transaction::PooledTransaction, TxEip1559, TxLegacy};
use alloy_primitives::{hex, PrimitiveSignature as Signature, TxKind, U256};
use alloy_primitives::{hex, Signature, TxKind, U256};
use alloy_rlp::Decodable;
use constants::tx_fetcher::DEFAULT_MAX_COUNT_FALLBACK_PEERS;
use futures::FutureExt;
@@ -1940,7 +1940,7 @@ mod tests {
async fn new_tx_manager(
) -> (TransactionsManager<TestPool, EthNetworkPrimitives>, NetworkManager<EthNetworkPrimitives>)
{
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let client = NoopProvider::default();
let config = NetworkConfigBuilder::new(secret_key)
@@ -1998,7 +1998,7 @@ mod tests {
let listener0 = handle0.event_listener();
handle0.add_peer(*handle1.peer_id(), handle1.local_addr());
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let client = NoopProvider::default();
let pool = testing_pool();
@@ -2066,7 +2066,7 @@ mod tests {
let listener0 = handle0.event_listener();
handle0.add_peer(*handle1.peer_id(), handle1.local_addr());
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let client = NoopProvider::default();
let pool = testing_pool();
@@ -2131,7 +2131,7 @@ mod tests {
async fn test_handle_incoming_transactions_hashes() {
reth_tracing::init_test_tracing();
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let client = NoopProvider::default();
let config = NetworkConfigBuilder::new(secret_key)
@@ -2238,7 +2238,7 @@ mod tests {
let listener0 = handle0.event_listener();
handle0.add_peer(*handle1.peer_id(), handle1.local_addr());
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let client = NoopProvider::default();
let pool = testing_pool();
@@ -2314,7 +2314,7 @@ mod tests {
let listener0 = handle0.event_listener();
handle0.add_peer(*handle1.peer_id(), handle1.local_addr());
let secret_key = SecretKey::new(&mut rand::thread_rng());
let secret_key = SecretKey::new(&mut rand_08::thread_rng());
let client = NoopProvider::default();
let pool = testing_pool();

View File

@@ -3,7 +3,7 @@
//! announcements. Validation and filtering of announcements is network dependent.
use crate::metrics::{AnnouncedTxTypesMetrics, TxTypesCounter};
use alloy_primitives::{PrimitiveSignature as Signature, TxHash};
use alloy_primitives::{Signature, TxHash};
use derive_more::{Deref, DerefMut};
use reth_eth_wire::{
DedupPayload, Eth68TxMetadata, HandleMempoolData, PartiallyValidData, ValidAnnouncementData,