pub async fn fetch_remote(
        self,
        main_node_client: &DynClient<L2>,
    ) -> anyhow::Result<ExternalNodeConfig> {
        let remote = RemoteENConfig::fetch(main_node_client)
            .await
            .context("Unable to fetch required config values from the main node")?;
        let remote_diamond_proxy_addr = remote.l1_diamond_proxy_addr;
        if let Some(local_diamond_proxy_addr) = self.optional.contracts_diamond_proxy_addr {
            anyhow::ensure!(
                local_diamond_proxy_addr == remote_diamond_proxy_addr,
                "L1 diamond proxy address {local_diamond_proxy_addr:?} specified in config doesn't match one returned \
                by main node ({remote_diamond_proxy_addr:?})"
            );
        } else {
            tracing::info!(
                "L1 diamond proxy address is not specified in config; will use address \
                returned by main node: {remote_diamond_proxy_addr:?}"
            );
        }
        Ok(ExternalNodeConfig {
            required: self.required,
            postgres: self.postgres,
            optional: self.optional,
            prometheus: self.prometheus,
            experimental: self.experimental,
            consensus: self.consensus,
            tree_component: self.tree_component,
            api_component: self.api_component,
            consensus_secrets: self.consensus_secrets,
            data_availability: self.data_availability,
            consistency_checker: self.consistency_checker,
            config_params: self.config_params,
            remote,
        })
    }
Fetches contracts addresses from the main node, completing the configuration.
core/bin/external_node/src/config/mod.rs