Skip to content

Commit

Permalink
Change string for address
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Dec 17, 2024
1 parent 49bbb5c commit d824eba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
6 changes: 3 additions & 3 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, H160};
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.clone(),
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 All @@ -74,7 +74,7 @@ impl<T: GetBlobData> RawEigenClient<T> {
K256PrivateKey::from_bytes(zksync_types::H256::from_str(
&verifier_config.private_key,
)?)?,
H160::from_str(&verifier_config.svc_manager_addr)?,
verifier_config.svc_manager_addr,
Verifier::DEFAULT_PRIORITY_FEE_PER_GAS,
SLChainId(verifier_config.chain_id),
query_client,
Expand Down
21 changes: 6 additions & 15 deletions core/node/da_clients/src/eigen/verifier.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, fs::File, io::copy, path::Path, str::FromStr};
use std::{collections::HashMap, fs::File, io::copy, path::Path};

use ark_bn254::{Fq, G1Affine};
use ethabi::{encode, ParamType, Token};
Expand All @@ -9,7 +9,7 @@ use zksync_basic_types::web3::CallRequest;
use zksync_eth_client::{clients::PKSigningClient, EnrichedClientResult};
use zksync_types::{
web3::{self, BlockId, BlockNumber},
H160, U256, U64,
Address, U256, U64,
};

use super::blob_info::{BatchHeader, BlobHeader, BlobInfo, G1Commitment};
Expand Down Expand Up @@ -68,7 +68,7 @@ pub enum VerificationError {
#[derive(Debug, Clone)]
pub struct VerifierConfig {
pub rpc_url: String,
pub svc_manager_addr: String,
pub svc_manager_addr: Address,
pub max_blob_size: u32,
pub g1_url: String,
pub g2_url: String,
Expand Down Expand Up @@ -342,10 +342,7 @@ impl Verifier {
data.append(batch_id_vec.to_vec().as_mut());

let call_request = CallRequest {
to: Some(
H160::from_str(&self.cfg.svc_manager_addr)
.map_err(|_| VerificationError::ServiceManagerError)?,
),
to: Some(self.cfg.svc_manager_addr),
data: Some(zksync_basic_types::web3::Bytes(data)),
..Default::default()
};
Expand Down Expand Up @@ -445,10 +442,7 @@ impl Verifier {
let data = func_selector.to_vec();

let call_request = CallRequest {
to: Some(
H160::from_str(&self.cfg.svc_manager_addr)
.map_err(|_| VerificationError::ServiceManagerError)?,
),
to: Some(self.cfg.svc_manager_addr),
data: Some(zksync_basic_types::web3::Bytes(data)),
..Default::default()
};
Expand All @@ -474,10 +468,7 @@ impl Verifier {
let func_selector = ethabi::short_signature("quorumNumbersRequired", &[]);
let data = func_selector.to_vec();
let call_request = CallRequest {
to: Some(
H160::from_str(&self.cfg.svc_manager_addr)
.map_err(|_| VerificationError::ServiceManagerError)?,
),
to: Some(self.cfg.svc_manager_addr),
data: Some(zksync_basic_types::web3::Bytes(data)),
..Default::default()
};
Expand Down
8 changes: 3 additions & 5 deletions core/node/da_clients/src/eigen/verifier_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod test {
use zksync_types::{
url::SensitiveUrl,
web3::{BlockId, Bytes, CallRequest},
K256PrivateKey, SLChainId, H160, U64,
Address, K256PrivateKey, SLChainId, H160, U64,
};
use zksync_web3_decl::client::{Client, DynClient, L1};

Expand All @@ -21,7 +21,7 @@ mod test {
fn get_verifier_config() -> VerifierConfig {
VerifierConfig {
rpc_url: "https://ethereum-holesky-rpc.publicnode.com".to_string(),
svc_manager_addr: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
svc_manager_addr: Address::from_str("0xD4A7E1Bd8015057293f0D0A557088c286942e84b").unwrap(),
max_blob_size: 2 * 1024 * 1024,
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(),
Expand Down Expand Up @@ -82,9 +82,7 @@ mod test {
)
.map_err(|_| VerificationError::ServiceManagerError)
.unwrap(),
zksync_types::H160::from_str(&cfg.svc_manager_addr)
.map_err(|_| VerificationError::ServiceManagerError)
.unwrap(),
cfg.svc_manager_addr,
Verifier::DEFAULT_PRIORITY_FEE_PER_GAS,
SLChainId(cfg.chain_id),
query_client,
Expand Down

0 comments on commit d824eba

Please sign in to comment.