Skip to content

Commit

Permalink
Change link to url
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Dec 6, 2024
1 parent dec443a commit c7acffc
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 54 deletions.
8 changes: 4 additions & 4 deletions core/lib/config/src/configs/da_client/eigen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
44 changes: 22 additions & 22 deletions core/lib/env_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_")?)
Expand Down Expand Up @@ -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);

Expand All @@ -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
})
);
Expand Down
8 changes: 4 additions & 4 deletions core/lib/protobuf_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions core/lib/protobuf_config/src/proto/config/da_client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
20 changes: 10 additions & 10 deletions core/node/da_clients/src/eigen/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions core/node/da_clients/src/eigen/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ impl<T: GetBlobData> RawEigenClient<T> {
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()),
Expand Down
16 changes: 8 additions & 8 deletions core/node/da_clients/src/eigen/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)?;
Expand All @@ -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<String, VerificationError> {
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<String, VerificationError> {
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())
}
Expand All @@ -130,7 +130,7 @@ impl Verifier {
signing_client: T,
) -> Result<Self, VerificationError> {
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"),
"",
Expand Down
4 changes: 2 additions & 2 deletions core/node/da_clients/src/eigen/verifier_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit c7acffc

Please sign in to comment.