mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: remove trusted setups (#7274)
This commit is contained in:
@ -76,10 +76,6 @@ pub struct NodeCommand<Ext: clap::Args + fmt::Debug = NoArgs> {
|
||||
#[arg(long, conflicts_with = "instance", global = true)]
|
||||
pub with_unused_ports: bool,
|
||||
|
||||
/// Overrides the KZG trusted setup by reading from the supplied file.
|
||||
#[arg(long, value_name = "PATH")]
|
||||
pub trusted_setup_file: Option<PathBuf>,
|
||||
|
||||
/// All networking related arguments
|
||||
#[command(flatten)]
|
||||
pub network: NetworkArgs,
|
||||
@ -150,7 +146,6 @@ impl<Ext: clap::Args + fmt::Debug> NodeCommand<Ext> {
|
||||
config,
|
||||
chain,
|
||||
metrics,
|
||||
trusted_setup_file,
|
||||
instance,
|
||||
with_unused_ports,
|
||||
network,
|
||||
@ -170,7 +165,6 @@ impl<Ext: clap::Args + fmt::Debug> NodeCommand<Ext> {
|
||||
chain,
|
||||
metrics,
|
||||
instance,
|
||||
trusted_setup_file,
|
||||
network,
|
||||
rpc,
|
||||
txpool,
|
||||
|
||||
@ -41,10 +41,7 @@ use reth_node_core::{
|
||||
primitives::{kzg::KzgSettings, Head},
|
||||
utils::write_peers_to_file,
|
||||
};
|
||||
use reth_primitives::{
|
||||
constants::eip4844::{LoadKzgSettingsError, MAINNET_KZG_TRUSTED_SETUP},
|
||||
format_ether, ChainSpec,
|
||||
};
|
||||
use reth_primitives::{constants::eip4844::MAINNET_KZG_TRUSTED_SETUP, format_ether, ChainSpec};
|
||||
use reth_provider::{providers::BlockchainProvider, ChainSpecProvider, ProviderFactory};
|
||||
use reth_prune::PrunerBuilder;
|
||||
use reth_revm::EvmProcessorFactory;
|
||||
@ -1104,16 +1101,9 @@ impl<Node: FullNodeTypes> BuilderContext<Node> {
|
||||
self.config().txpool.pool_config()
|
||||
}
|
||||
|
||||
/// Loads the trusted setup params from a given file path or falls back to
|
||||
/// `MAINNET_KZG_TRUSTED_SETUP`.
|
||||
/// Loads `MAINNET_KZG_TRUSTED_SETUP`.
|
||||
pub fn kzg_settings(&self) -> eyre::Result<Arc<KzgSettings>> {
|
||||
if let Some(ref trusted_setup_file) = self.config().trusted_setup_file {
|
||||
let trusted_setup = KzgSettings::load_trusted_setup_file(trusted_setup_file)
|
||||
.map_err(LoadKzgSettingsError::KzgError)?;
|
||||
Ok(Arc::new(trusted_setup))
|
||||
} else {
|
||||
Ok(Arc::clone(&MAINNET_KZG_TRUSTED_SETUP))
|
||||
}
|
||||
Ok(Arc::clone(&MAINNET_KZG_TRUSTED_SETUP))
|
||||
}
|
||||
|
||||
/// Returns the config for payload building.
|
||||
|
||||
@ -41,9 +41,7 @@ use reth_network::{
|
||||
};
|
||||
use reth_node_api::ConfigureEvm;
|
||||
use reth_primitives::{
|
||||
constants::eip4844::{LoadKzgSettingsError, MAINNET_KZG_TRUSTED_SETUP},
|
||||
kzg::KzgSettings,
|
||||
stage::StageId,
|
||||
constants::eip4844::MAINNET_KZG_TRUSTED_SETUP, kzg::KzgSettings, stage::StageId,
|
||||
BlockHashOrNumber, BlockNumber, ChainSpec, Head, SealedHeader, TxHash, B256, MAINNET,
|
||||
};
|
||||
use reth_provider::{
|
||||
@ -169,9 +167,6 @@ pub struct NodeConfig {
|
||||
/// - WS_RPC_PORT: default + `instance` * 2 - 2
|
||||
pub instance: u16,
|
||||
|
||||
/// Overrides the KZG trusted setup by reading from the supplied file.
|
||||
pub trusted_setup_file: Option<PathBuf>,
|
||||
|
||||
/// All networking related arguments
|
||||
pub network: NetworkArgs,
|
||||
|
||||
@ -235,12 +230,6 @@ impl NodeConfig {
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the trusted setup file for the node
|
||||
pub fn with_trusted_setup_file(mut self, trusted_setup_file: impl Into<PathBuf>) -> Self {
|
||||
self.trusted_setup_file = Some(trusted_setup_file.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the network args for the node
|
||||
pub fn with_network(mut self, network: NetworkArgs) -> Self {
|
||||
self.network = network;
|
||||
@ -594,16 +583,9 @@ impl NodeConfig {
|
||||
Ok(pipeline)
|
||||
}
|
||||
|
||||
/// Loads the trusted setup params from a given file path or falls back to
|
||||
/// `MAINNET_KZG_TRUSTED_SETUP`.
|
||||
/// Loads 'MAINNET_KZG_TRUSTED_SETUP'
|
||||
pub fn kzg_settings(&self) -> eyre::Result<Arc<KzgSettings>> {
|
||||
if let Some(ref trusted_setup_file) = self.trusted_setup_file {
|
||||
let trusted_setup = KzgSettings::load_trusted_setup_file(trusted_setup_file)
|
||||
.map_err(LoadKzgSettingsError::KzgError)?;
|
||||
Ok(Arc::new(trusted_setup))
|
||||
} else {
|
||||
Ok(Arc::clone(&MAINNET_KZG_TRUSTED_SETUP))
|
||||
}
|
||||
Ok(Arc::clone(&MAINNET_KZG_TRUSTED_SETUP))
|
||||
}
|
||||
|
||||
/// Installs the prometheus recorder.
|
||||
@ -729,7 +711,7 @@ impl NodeConfig {
|
||||
// try to look up the header in the database
|
||||
if let Some(header) = header {
|
||||
info!(target: "reth::cli", ?tip, "Successfully looked up tip block in the database");
|
||||
return Ok(header.number)
|
||||
return Ok(header.number);
|
||||
}
|
||||
|
||||
Ok(self.fetch_tip_from_network(client, tip.into()).await?.number)
|
||||
@ -751,7 +733,7 @@ impl NodeConfig {
|
||||
match get_single_header(&client, tip).await {
|
||||
Ok(tip_header) => {
|
||||
info!(target: "reth::cli", ?tip, "Successfully fetched tip");
|
||||
return Ok(tip_header)
|
||||
return Ok(tip_header);
|
||||
}
|
||||
Err(error) => {
|
||||
error!(target: "reth::cli", %error, "Failed to fetch the tip. Retrying...");
|
||||
@ -924,7 +906,6 @@ impl Default for NodeConfig {
|
||||
chain: MAINNET.clone(),
|
||||
metrics: None,
|
||||
instance: 1,
|
||||
trusted_setup_file: None,
|
||||
network: NetworkArgs::default(),
|
||||
rpc: RpcServerArgs::default(),
|
||||
txpool: TxPoolArgs::default(),
|
||||
|
||||
Reference in New Issue
Block a user