fix: compilation errors due to api breakages

follow up from https://github.com/paradigmxyz/reth/pull/888 merge conflict fix failure
This commit is contained in:
Georgios Konstantopoulos
2023-01-17 18:19:00 -08:00
parent 37ca7e0b33
commit e9792c1b46
4 changed files with 14 additions and 3 deletions

View File

@ -35,10 +35,12 @@ impl Config {
let peer_config = reth_network::PeersConfig::default()
.with_trusted_nodes(self.peers.trusted_nodes.clone())
.with_connect_trusted_nodes_only(self.peers.connect_trusted_nodes_only);
let discv4 =
Discv4Config::builder().external_ip_resolver(Some(nat_resolution_method)).clone();
NetworkConfig::builder(Arc::new(ProviderImpl::new(db)), rng_secret_key())
.boot_nodes(bootnodes.unwrap_or_else(mainnet_nodes))
.peer_config(peer_config)
.discovery(Discv4Config::builder().external_ip_resolver(Some(nat_resolution_method)))
.discovery(discv4)
.chain_spec(chain_spec)
.set_discovery(disable_discovery)
.build()

View File

@ -7,6 +7,7 @@ use crate::{
use backon::{ConstantBackoff, Retryable};
use clap::{Parser, Subcommand};
use reth_db::mdbx::{Env, EnvKind, WriteMap};
use reth_discv4::NatResolver;
use reth_interfaces::p2p::{
bodies::client::BodiesClient,
headers::client::{HeadersClient, HeadersRequest},
@ -57,6 +58,9 @@ pub struct Command {
#[clap(subcommand)]
command: Subcommands,
#[arg(long, default_value = "any")]
nat: NatResolver,
}
#[derive(Subcommand, Debug)]
@ -94,7 +98,7 @@ impl Command {
config.peers.connect_trusted_nodes_only = self.trusted_only;
let network = config
.network_config(noop_db, self.chain.clone(), self.disable_discovery, None)
.network_config(noop_db, self.chain.clone(), self.disable_discovery, None, self.nat)
.start_network()
.await?;

View File

@ -11,6 +11,7 @@ use crate::{
use reth_consensus::BeaconConsensus;
use reth_downloaders::bodies::concurrent::ConcurrentDownloader;
use reth_net_nat::NatResolver;
use reth_primitives::ChainSpec;
use reth_stages::{
metrics::HeaderMetrics,
@ -84,6 +85,9 @@ pub struct Command {
#[clap(flatten)]
network: NetworkOpts,
#[arg(long, default_value = "any")]
nat: NatResolver,
}
#[derive(Debug, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, ValueEnum)]
@ -141,6 +145,7 @@ impl Command {
self.chain.clone(),
self.network.disable_discovery,
None,
self.nat,
)
.start_network()
.await?;

View File

@ -135,7 +135,7 @@ impl Default for Discv4Config {
}
/// Builder type for [`Discv4Config`]
#[derive(Debug, Default)]
#[derive(Clone, Debug, Default)]
pub struct Discv4ConfigBuilder {
config: Discv4Config,
}