From c7acffcc83f4285d9f424b126a09e028ae001774 Mon Sep 17 00:00:00 2001 From: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:12:24 -0300 Subject: [PATCH] Change link to url --- .../lib/config/src/configs/da_client/eigen.rs | 8 ++-- core/lib/env_config/src/da_client.rs | 44 +++++++++---------- core/lib/protobuf_config/src/da_client.rs | 8 ++-- .../src/proto/config/da_client.proto | 4 +- .../node/da_clients/src/eigen/client_tests.rs | 20 ++++----- core/node/da_clients/src/eigen/sdk.rs | 4 +- core/node/da_clients/src/eigen/verifier.rs | 16 +++---- .../da_clients/src/eigen/verifier_tests.rs | 4 +- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/core/lib/config/src/configs/da_client/eigen.rs b/core/lib/config/src/configs/da_client/eigen.rs index 8a8f4d1d58a6..68b1390d980a 100644 --- a/core/lib/config/src/configs/da_client/eigen.rs +++ b/core/lib/config/src/configs/da_client/eigen.rs @@ -16,10 +16,10 @@ pub struct EigenConfig { pub wait_for_finalization: bool, /// Authenticated dispersal pub authenticated: bool, - /// Link to the file containing the G1 point used for KZG - pub g1_link: String, - /// Link to the file containing the G2 point used for KZG - pub g2_link: String, + /// Url to the file containing the G1 point used for KZG + pub g1_url: String, + /// Url to the file containing the G2 point used for KZG + pub g2_url: String, /// Chain ID of the Ethereum network pub chain_id: u64, } diff --git a/core/lib/env_config/src/da_client.rs b/core/lib/env_config/src/da_client.rs index 9556438f23e2..9f4b0118c9c5 100644 --- a/core/lib/env_config/src/da_client.rs +++ b/core/lib/env_config/src/da_client.rs @@ -39,18 +39,18 @@ impl FromEnv for DAClientConfig { }), CELESTIA_CLIENT_CONFIG_NAME => Self::Celestia(envy_load("da_celestia_config", "DA_")?), EIGEN_CLIENT_CONFIG_NAME => Self::Eigen(EigenConfig { - disperser_rpc: env::var("DA_DISPERSER_RPC")?, + disperser_rpc: env::var("EIGENDA_DISPERSER_RPC")?, settlement_layer_confirmation_depth: env::var( - "DA_SETTLEMENT_LAYER_CONFIRMATION_DEPTH", + "EIGENDA_SETTLEMENT_LAYER_CONFIRMATION_DEPTH", )? .parse()?, - eigenda_eth_rpc: env::var("DA_EIGENDA_ETH_RPC")?, - eigenda_svc_manager_address: env::var("DA_EIGENDA_SVC_MANAGER_ADDRESS")?, - wait_for_finalization: env::var("DA_WAIT_FOR_FINALIZATION")?.parse()?, - authenticated: env::var("DA_AUTHENTICATED")?.parse()?, - g1_link: env::var("DA_G1_LINK")?.parse()?, - g2_link: env::var("DA_G2_LINK")?.parse()?, - chain_id: env::var("DA_CHAIN_ID")?.parse()?, + eigenda_eth_rpc: env::var("EIGENDA_EIGENDA_ETH_RPC")?, + eigenda_svc_manager_address: env::var("EIGENDA_EIGENDA_SVC_MANAGER_ADDRESS")?, + wait_for_finalization: env::var("EIGENDA_WAIT_FOR_FINALIZATION")?.parse()?, + authenticated: env::var("EIGENDA_AUTHENTICATED")?.parse()?, + g1_url: env::var("EIGENDA_G1_URL")?.parse()?, + g2_url: env::var("EIGENDA_G2_URL")?.parse()?, + chain_id: env::var("EIGENDA_CHAIN_ID")?.parse()?, }), OBJECT_STORE_CLIENT_CONFIG_NAME => { Self::ObjectStore(envy_load("da_object_store", "DA_")?) @@ -264,17 +264,17 @@ mod tests { fn from_env_eigen_client() { let mut lock = MUTEX.lock(); let config = r#" - DA_CLIENT="Eigen" - DA_EIGEN_CLIENT_TYPE="Disperser" - DA_DISPERSER_RPC="http://localhost:8080" - DA_SETTLEMENT_LAYER_CONFIRMATION_DEPTH=0 - DA_EIGENDA_ETH_RPC="http://localhost:8545" - DA_EIGENDA_SVC_MANAGER_ADDRESS="0x123" - DA_WAIT_FOR_FINALIZATION=true - DA_AUTHENTICATED=false - DA_G1_LINK="resources1" - DA_G2_LINK="resources2" - DA_CHAIN_ID=1 + EIGENDA_CLIENT="Eigen" + EIGENDA_EIGEN_CLIENT_TYPE="Disperser" + EIGENDA_DISPERSER_RPC="http://localhost:8080" + EIGENDA_SETTLEMENT_LAYER_CONFIRMATION_DEPTH=0 + EIGENDA_EIGENDA_ETH_RPC="http://localhost:8545" + EIGENDA_EIGENDA_SVC_MANAGER_ADDRESS="0x123" + EIGENDA_WAIT_FOR_FINALIZATION=true + EIGENDA_AUTHENTICATED=false + EIGENDA_G1_URL="resources1" + EIGENDA_G2_URL="resources2" + EIGENDA_CHAIN_ID=1 "#; lock.set_env(config); @@ -288,8 +288,8 @@ mod tests { eigenda_svc_manager_address: "0x123".to_string(), wait_for_finalization: true, authenticated: false, - g1_link: "resources1".to_string(), - g2_link: "resources2".to_string(), + g1_url: "resources1".to_string(), + g2_url: "resources2".to_string(), chain_id: 1 }) ); diff --git a/core/lib/protobuf_config/src/da_client.rs b/core/lib/protobuf_config/src/da_client.rs index 9bd278ccd1a8..bd817826de7f 100644 --- a/core/lib/protobuf_config/src/da_client.rs +++ b/core/lib/protobuf_config/src/da_client.rs @@ -72,8 +72,8 @@ impl ProtoRepr for proto::DataAvailabilityClient { wait_for_finalization: *required(&conf.wait_for_finalization) .context("wait_for_finalization")?, authenticated: *required(&conf.authenticated).context("authenticated")?, - g1_link: required(&conf.g1_link).context("g1_link")?.clone(), - g2_link: required(&conf.g2_link).context("g2_link")?.clone(), + g1_url: required(&conf.g1_url).context("g1_url")?.clone(), + g2_url: required(&conf.g2_url).context("g2_url")?.clone(), chain_id: *required(&conf.chain_id).context("chain_id")?, }), proto::data_availability_client::Config::ObjectStore(conf) => { @@ -121,8 +121,8 @@ impl ProtoRepr for proto::DataAvailabilityClient { eigenda_svc_manager_address: Some(config.eigenda_svc_manager_address.clone()), wait_for_finalization: Some(config.wait_for_finalization), authenticated: Some(config.authenticated), - g1_link: Some(config.g1_link.clone()), - g2_link: Some(config.g2_link.clone()), + g1_url: Some(config.g1_url.clone()), + g2_url: Some(config.g2_url.clone()), chain_id: Some(config.chain_id), }), ObjectStore(config) => proto::data_availability_client::Config::ObjectStore( diff --git a/core/lib/protobuf_config/src/proto/config/da_client.proto b/core/lib/protobuf_config/src/proto/config/da_client.proto index dfa565bdddd5..dd44d0ad14d1 100644 --- a/core/lib/protobuf_config/src/proto/config/da_client.proto +++ b/core/lib/protobuf_config/src/proto/config/da_client.proto @@ -43,8 +43,8 @@ message EigenConfig { optional string eigenda_svc_manager_address = 6; optional bool wait_for_finalization = 7; optional bool authenticated = 8; - optional string g1_link = 9; - optional string g2_link = 10; + optional string g1_url = 9; + optional string g2_url = 10; optional uint64 chain_id = 11; reserved 1,2; reserved "rpc_node_url","inclusion_polling_interval_ms"; diff --git a/core/node/da_clients/src/eigen/client_tests.rs b/core/node/da_clients/src/eigen/client_tests.rs index a46aa10c4470..e504e4892b61 100644 --- a/core/node/da_clients/src/eigen/client_tests.rs +++ b/core/node/da_clients/src/eigen/client_tests.rs @@ -75,8 +75,8 @@ mod tests { eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(), wait_for_finalization: false, authenticated: false, - g1_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), - g2_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), + g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), + g2_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), chain_id: 17000, }; let secrets = EigenSecrets { @@ -115,8 +115,8 @@ mod tests { eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(), wait_for_finalization: false, authenticated: true, - g1_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), - g2_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), + g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), + g2_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), chain_id: 17000, }; let secrets = EigenSecrets { @@ -152,8 +152,8 @@ mod tests { disperser_rpc: "https://disperser-holesky.eigenda.xyz:443".to_string(), wait_for_finalization: true, authenticated: true, - g1_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), - g2_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), + g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), + g2_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), settlement_layer_confirmation_depth: 0, eigenda_eth_rpc: "https://ethereum-holesky-rpc.publicnode.com".to_string(), eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(), @@ -195,8 +195,8 @@ mod tests { eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(), wait_for_finalization: false, authenticated: false, - g1_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), - g2_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), + g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), + g2_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), chain_id: 17000, }; let secrets = EigenSecrets { @@ -235,8 +235,8 @@ mod tests { eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(), wait_for_finalization: false, authenticated: true, - g1_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), - g2_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), + g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), + g2_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), chain_id: 17000, }; let secrets = EigenSecrets { diff --git a/core/node/da_clients/src/eigen/sdk.rs b/core/node/da_clients/src/eigen/sdk.rs index c2660c8414a3..b00a9a959887 100644 --- a/core/node/da_clients/src/eigen/sdk.rs +++ b/core/node/da_clients/src/eigen/sdk.rs @@ -56,8 +56,8 @@ impl RawEigenClient { rpc_url: config.eigenda_eth_rpc.clone(), svc_manager_addr: config.eigenda_svc_manager_address.clone(), max_blob_size: Self::BLOB_SIZE_LIMIT as u32, - g1_link: config.g1_link.clone(), - g2_link: config.g2_link.clone(), + g1_url: config.g1_url.clone(), + g2_url: config.g2_url.clone(), settlement_layer_confirmation_depth: config.settlement_layer_confirmation_depth.max(0) as u32, private_key: hex::encode(private_key.secret_bytes()), diff --git a/core/node/da_clients/src/eigen/verifier.rs b/core/node/da_clients/src/eigen/verifier.rs index c252c6c1bcfc..6acd5398d220 100644 --- a/core/node/da_clients/src/eigen/verifier.rs +++ b/core/node/da_clients/src/eigen/verifier.rs @@ -70,8 +70,8 @@ pub struct VerifierConfig { pub rpc_url: String, pub svc_manager_addr: String, pub max_blob_size: u32, - pub g1_link: String, - pub g2_link: String, + pub g1_url: String, + pub g2_url: String, pub settlement_layer_confirmation_depth: u32, pub private_key: String, pub chain_id: u64, @@ -101,8 +101,8 @@ impl Verifier { pub const DEFAULT_PRIORITY_FEE_PER_GAS: u64 = 100; pub const SRSORDER: u32 = 268435456; // 2 ^ 28 - async fn save_point(link: String, point: String) -> Result<(), VerificationError> { - let url = Url::parse(&link).map_err(|_| VerificationError::LinkError)?; + async fn save_point(url: String, point: String) -> Result<(), VerificationError> { + let url = Url::parse(&url).map_err(|_| VerificationError::LinkError)?; let response = reqwest::get(url) .await .map_err(|_| VerificationError::LinkError)?; @@ -119,9 +119,9 @@ impl Verifier { copy(&mut content.as_ref(), &mut file).map_err(|_| VerificationError::LinkError)?; Ok(()) } - async fn save_points(link_g1: String, link_g2: String) -> Result { - Self::save_point(link_g1.clone(), "g1.point".to_string()).await?; - Self::save_point(link_g2.clone(), "g2.point.powerOf2".to_string()).await?; + async fn save_points(url_g1: String, url_g2: String) -> Result { + Self::save_point(url_g1.clone(), "g1.point".to_string()).await?; + Self::save_point(url_g2.clone(), "g2.point.powerOf2".to_string()).await?; Ok(".".to_string()) } @@ -130,7 +130,7 @@ impl Verifier { signing_client: T, ) -> Result { let srs_points_to_load = cfg.max_blob_size / 32; - let path = Self::save_points(cfg.clone().g1_link, cfg.clone().g2_link).await?; + let path = Self::save_points(cfg.clone().g1_url, cfg.clone().g2_url).await?; let kzg = Kzg::setup( &format!("{}{}", path, "/g1.point"), "", diff --git a/core/node/da_clients/src/eigen/verifier_tests.rs b/core/node/da_clients/src/eigen/verifier_tests.rs index 183aaa1ee582..bdea8f9a9960 100644 --- a/core/node/da_clients/src/eigen/verifier_tests.rs +++ b/core/node/da_clients/src/eigen/verifier_tests.rs @@ -23,8 +23,8 @@ mod test { rpc_url: "https://ethereum-holesky-rpc.publicnode.com".to_string(), svc_manager_addr: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(), max_blob_size: 2 * 1024 * 1024, - g1_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), - g2_link: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), + g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(), + g2_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g2.point.powerOf2".to_string(), settlement_layer_confirmation_depth: 0, private_key: "0xd08aa7ae1bb5ddd46c3c2d8cdb5894ab9f54dec467233686ca42629e826ac4c6" .to_string(),