Skip to content

Commit

Permalink
Merge branch 'eigen-client-solve-comments' into eigen-client-solve-co…
Browse files Browse the repository at this point in the history
…mments-p2
  • Loading branch information
juan518munoz committed Dec 17, 2024
2 parents c9d1b4a + d824eba commit 3877956
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 27 deletions.
4 changes: 2 additions & 2 deletions core/lib/config/src/configs/da_client/eigen.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::Deserialize;
use zksync_basic_types::{secrets::PrivateKey, Address};
use zksync_basic_types::secrets::PrivateKey;
/// Configuration for the EigenDA remote disperser client.
#[derive(Clone, Debug, PartialEq, Deserialize, Default)]
pub struct EigenConfig {
Expand All @@ -11,7 +11,7 @@ pub struct EigenConfig {
/// URL of the Ethereum RPC server
pub eigenda_eth_rpc: Option<String>,
/// Address of the service manager contract
pub eigenda_svc_manager_address: Address,
pub eigenda_svc_manager_address: String,
/// Wait for the blob to be finalized before returning the response
pub wait_for_finalization: bool,
/// Authenticated dispersal
Expand Down
10 changes: 2 additions & 8 deletions core/lib/env_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ impl FromEnv for DataAvailabilitySecrets {

#[cfg(test)]
mod tests {
use std::str::FromStr;

use zksync_basic_types::Address;
use zksync_config::{
configs::{
da_client::{
Expand Down Expand Up @@ -254,7 +251,7 @@ mod tests {
DA_DISPERSER_RPC="http://localhost:8080"
DA_SETTLEMENT_LAYER_CONFIRMATION_DEPTH=0
DA_EIGENDA_ETH_RPC="http://localhost:8545"
DA_EIGENDA_SVC_MANAGER_ADDRESS="0xD4A7E1Bd8015057293f0D0A557088c286942e84b"
DA_EIGENDA_SVC_MANAGER_ADDRESS="0x123"
DA_WAIT_FOR_FINALIZATION=true
DA_AUTHENTICATED=false
DA_G1_URL="resources1"
Expand All @@ -270,10 +267,7 @@ mod tests {
disperser_rpc: "http://localhost:8080".to_string(),
settlement_layer_confirmation_depth: 0,
eigenda_eth_rpc: Some("http://localhost:8545".to_string()),
eigenda_svc_manager_address: Address::from_str(
"0xD4A7E1Bd8015057293f0D0A557088c286942e84b"
)
.unwrap(),
eigenda_svc_manager_address: "0x123".to_string(),
wait_for_finalization: true,
authenticated: false,
g1_url: "resources1".to_string(),
Expand Down
12 changes: 4 additions & 8 deletions core/lib/protobuf_config/src/da_client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::str::FromStr;

use anyhow::Context;
use zksync_config::configs::{
self,
Expand All @@ -11,7 +9,6 @@ use zksync_config::configs::{
},
};
use zksync_protobuf::{required, ProtoRepr};
use zksync_types::Address;

use crate::proto::{
da_client::{self as proto},
Expand Down Expand Up @@ -67,10 +64,9 @@ impl ProtoRepr for proto::DataAvailabilityClient {
)
.context("settlement_layer_confirmation_depth")?,
eigenda_eth_rpc: required(&conf.eigenda_eth_rpc).ok().cloned(),
eigenda_svc_manager_address: Address::from_str(
required(&conf.eigenda_svc_manager_address)
.context("eigenda_svc_manager_address")?,
)?,
eigenda_svc_manager_address: required(&conf.eigenda_svc_manager_address)
.context("eigenda_svc_manager_address")?
.clone(),
wait_for_finalization: *required(&conf.wait_for_finalization)
.context("wait_for_finalization")?,
authenticated: *required(&conf.authenticated).context("authenticated")?,
Expand Down Expand Up @@ -120,7 +116,7 @@ impl ProtoRepr for proto::DataAvailabilityClient {
config.settlement_layer_confirmation_depth,
),
eigenda_eth_rpc: config.eigenda_eth_rpc.clone(),
eigenda_svc_manager_address: Some(config.eigenda_svc_manager_address.to_string()),
eigenda_svc_manager_address: Some(config.eigenda_svc_manager_address.clone()),
wait_for_finalization: Some(config.wait_for_finalization),
authenticated: Some(config.authenticated),
g1_url: Some(config.g1_url.clone()),
Expand Down
12 changes: 6 additions & 6 deletions core/node/da_clients/src/eigen/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mod tests {
types::{DAError, DispatchResponse},
DataAvailabilityClient,
};
use zksync_types::{secrets::PrivateKey, Address};
use zksync_types::secrets::PrivateKey;

use crate::eigen::{blob_info::BlobInfo, EigenClient, GetBlobData};

Expand Down Expand Up @@ -72,7 +72,7 @@ mod tests {
disperser_rpc: "https://disperser-holesky.eigenda.xyz:443".to_string(),
settlement_layer_confirmation_depth: 0,
eigenda_eth_rpc: Some("https://ethereum-holesky-rpc.publicnode.com".to_string()),
eigenda_svc_manager_address: Address::from_str("0xD4A7E1Bd8015057293f0D0A557088c286942e84b").unwrap(),
eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
wait_for_finalization: false,
authenticated: false,
g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(),
Expand Down Expand Up @@ -112,7 +112,7 @@ mod tests {
disperser_rpc: "https://disperser-holesky.eigenda.xyz:443".to_string(),
settlement_layer_confirmation_depth: 0,
eigenda_eth_rpc: Some("https://ethereum-holesky-rpc.publicnode.com".to_string()),
eigenda_svc_manager_address: Address::from_str("0xD4A7E1Bd8015057293f0D0A557088c286942e84b").unwrap(),
eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
wait_for_finalization: false,
authenticated: true,
g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(),
Expand Down Expand Up @@ -156,7 +156,7 @@ mod tests {
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: Some("https://ethereum-holesky-rpc.publicnode.com".to_string()),
eigenda_svc_manager_address: Address::from_str("0xD4A7E1Bd8015057293f0D0A557088c286942e84b").unwrap(),
eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
chain_id: 17000,
};
let secrets = EigenSecrets {
Expand Down Expand Up @@ -192,7 +192,7 @@ mod tests {
disperser_rpc: "https://disperser-holesky.eigenda.xyz:443".to_string(),
settlement_layer_confirmation_depth: 5,
eigenda_eth_rpc: Some("https://ethereum-holesky-rpc.publicnode.com".to_string()),
eigenda_svc_manager_address:Address::from_str("0xD4A7E1Bd8015057293f0D0A557088c286942e84b").unwrap(),
eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
wait_for_finalization: false,
authenticated: false,
g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(),
Expand Down Expand Up @@ -232,7 +232,7 @@ mod tests {
disperser_rpc: "https://disperser-holesky.eigenda.xyz:443".to_string(),
settlement_layer_confirmation_depth: 5,
eigenda_eth_rpc: Some("https://ethereum-holesky-rpc.publicnode.com".to_string()),
eigenda_svc_manager_address: Address::from_str("0xD4A7E1Bd8015057293f0D0A557088c286942e84b").unwrap(),
eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
wait_for_finalization: false,
authenticated: true,
g1_url: "https://github.com/Layr-Labs/eigenda-proxy/raw/2fd70b99ef5bf137d7bbca3461cf9e1f2c899451/resources/g1.point".to_string(),
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 @@ -10,7 +10,7 @@ use tonic::{
use zksync_config::EigenConfig;
use zksync_da_client::types::DAError;
use zksync_eth_client::clients::PKSigningClient;
use zksync_types::{url::SensitiveUrl, K256PrivateKey, SLChainId};
use zksync_types::{url::SensitiveUrl, Address, K256PrivateKey, SLChainId};
use zksync_web3_decl::client::{Client, DynClient, L1};

use super::{
Expand Down Expand Up @@ -58,7 +58,7 @@ impl<T: GetBlobData> RawEigenClient<T> {
.eigenda_eth_rpc
.clone()
.ok_or(anyhow::anyhow!("EigenDA ETH RPC not set"))?,
svc_manager_addr: config.eigenda_svc_manager_address,
svc_manager_addr: Address::from_str(&config.eigenda_svc_manager_address)?,
max_blob_size: Self::BLOB_SIZE_LIMIT as u32,
g1_url: config.g1_url.clone(),
g2_url: config.g2_url.clone(),
Expand Down
1 change: 0 additions & 1 deletion core/node/da_clients/src/eigen/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ impl Verifier {

let call_request = CallRequest {
to: Some(self.cfg.svc_manager_addr),

data: Some(zksync_basic_types::web3::Bytes(data)),
..Default::default()
};
Expand Down

0 comments on commit 3877956

Please sign in to comment.