Skip to content

Commit

Permalink
feat(eigen-client-extra-features): Remove Alloy Dependency (#349)
Browse files Browse the repository at this point in the history
* Add zksync client

* Call service manager with zksync client

* Add rest of calls

* Remove alloy

* Remove unwraps

* Remove todos

* Harcode function selectors

* Remove service manager json

* Fix clippy
  • Loading branch information
gianbelinche authored Nov 21, 2024
1 parent 6e1de82 commit 8d0b908
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 11,376 deletions.
845 changes: 12 additions & 833 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ pbjson-types = "0.6.0"

# Eigen
tokio-stream = "0.1.16"
alloy = { version = "0.3", features = ["full"] }
rust-kzg-bn254 = "0.2.1"
ark-bn254 = "0.5.0"
num-bigint = "0.4.6"
Expand Down
2 changes: 2 additions & 0 deletions core/lib/config/src/configs/da_client/eigen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub struct EigenConfig {
pub verify_cert: bool,
/// Path to the file containing the points used for KZG
pub path_to_points: String,
/// Chain ID of the Ethereum network
pub chain_id: u64,
}

#[derive(Clone, Debug, PartialEq)]
Expand Down
2 changes: 2 additions & 0 deletions core/lib/env_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ mod tests {
DA_AUTHENTICATED=false
DA_VERIFY_CERT=false
DA_PATH_TO_POINTS="resources"
DA_CHAIN_ID=1
"#;
lock.set_env(config);

Expand All @@ -278,6 +279,7 @@ mod tests {
authenticated: false,
verify_cert: false,
path_to_points: "resources".to_string(),
chain_id: 1
})
);
}
Expand Down
2 changes: 2 additions & 0 deletions core/lib/protobuf_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl ProtoRepr for proto::DataAvailabilityClient {
path_to_points: required(&conf.path_to_points)
.context("path_to_points")?
.clone(),
chain_id: *required(&conf.chain_id).context("chain_id")?,
}),
proto::data_availability_client::Config::ObjectStore(conf) => {
ObjectStore(object_store_proto::ObjectStore::read(conf)?)
Expand Down Expand Up @@ -125,6 +126,7 @@ impl ProtoRepr for proto::DataAvailabilityClient {
authenticated: Some(config.authenticated),
verify_cert: Some(config.verify_cert),
path_to_points: Some(config.path_to_points.clone()),
chain_id: Some(config.chain_id),
}),
ObjectStore(config) => proto::data_availability_client::Config::ObjectStore(
object_store_proto::ObjectStore::build(config),
Expand Down
1 change: 1 addition & 0 deletions core/lib/protobuf_config/src/proto/config/da_client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ message EigenConfig {
optional bool authenticated = 11;
optional bool verify_cert = 12;
optional string path_to_points = 13;
optional uint64 chain_id = 14;
}

message DataAvailabilityClient {
Expand Down
3 changes: 2 additions & 1 deletion core/node/da_clients/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ rlp.workspace = true
rand.workspace = true
sha3.workspace = true
tiny-keccak.workspace = true
alloy.workspace = true
ethabi.workspace = true
rust-kzg-bn254.workspace = true
ark-bn254.workspace = true
num-bigint.workspace = true
serial_test.workspace = true
zksync_web3_decl.workspace = true
zksync_eth_client.workspace = true
6 changes: 6 additions & 0 deletions core/node/da_clients/src/eigen/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ mod tests {
authenticated: false,
verify_cert: true,
path_to_points: "../../../resources".to_string(),
chain_id: 17000,
};
let secrets = EigenSecrets {
private_key: PrivateKey::from_str(
Expand Down Expand Up @@ -151,6 +152,7 @@ mod tests {
authenticated: true,
verify_cert: true,
path_to_points: "../../../resources".to_string(),
chain_id: 17000,
};
let secrets = EigenSecrets {
private_key: PrivateKey::from_str(
Expand Down Expand Up @@ -190,6 +192,7 @@ mod tests {
eth_confirmation_depth: 0,
eigenda_eth_rpc: "https://ethereum-holesky-rpc.publicnode.com".to_string(),
eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
chain_id: 17000,
};
let secrets = EigenSecrets {
private_key: PrivateKey::from_str(
Expand Down Expand Up @@ -228,6 +231,7 @@ mod tests {
eth_confirmation_depth: 0,
eigenda_eth_rpc: "https://ethereum-holesky-rpc.publicnode.com".to_string(),
eigenda_svc_manager_address: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b".to_string(),
chain_id: 17000,
};
let secrets = EigenSecrets {
private_key: PrivateKey::from_str(
Expand Down Expand Up @@ -262,6 +266,7 @@ mod tests {
authenticated: false,
verify_cert: true,
path_to_points: "../../../resources".to_string(),
chain_id: 17000,
};
let secrets = EigenSecrets {
private_key: PrivateKey::from_str(
Expand Down Expand Up @@ -301,6 +306,7 @@ mod tests {
authenticated: true,
verify_cert: true,
path_to_points: "../../../resources".to_string(),
chain_id: 17000,
};
let secrets = EigenSecrets {
private_key: PrivateKey::from_str(
Expand Down
1 change: 1 addition & 0 deletions core/node/da_clients/src/eigen/eigenda-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ da_client:
authenticated: false
verify_cert: true
path_to_points: ./resources
chain_id: <your_chain_id>
```
Also set the private key in `etc/env/file_based/secrets.yaml`:
Expand Down
Loading

0 comments on commit 8d0b908

Please sign in to comment.