Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eigenda): implement eigenDA client remaining features #3243

Open
wants to merge 131 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
fcecc81
add integration doc
juan518munoz Oct 31, 2024
2bcf78f
Reimplement eigen config (#320)
gianbelinche Nov 1, 2024
537cf92
feat(eigen-client-extra-feature): rlp encoding (#319)
juan518munoz Nov 1, 2024
f58e0bf
feat(eigen-client-extra-features): non auth dispersal (#318)
juan518munoz Nov 1, 2024
04b93e6
initial commit
juan518munoz Nov 1, 2024
c121eca
add spaces
juan518munoz Nov 1, 2024
4a38ee2
Revert wrong push
juan518munoz Nov 1, 2024
e64cc2e
initial commit
juan518munoz Nov 1, 2024
5b8665b
Merge pull request #324 from lambdaclass/eigen-client-get-inclusion-data
juanbono Nov 1, 2024
aa9f1b2
fix(eigen-client-extra-features): fix eigen config test (#323)
juan518munoz Nov 4, 2024
e033630
feat(eigen-client-extra-features): Eigen client memstore (#321)
gianbelinche Nov 5, 2024
b164870
feat(eigen-client-extra-features): blob size limit (#325)
juan518munoz Nov 5, 2024
f95bc1b
feat(eigen-client-extra-features): Add soft confirmations (#322)
gianbelinche Nov 5, 2024
9c06b40
feat(eigen-client-extra-features): Verifier (#326)
gianbelinche Nov 5, 2024
3b9e766
feat(eigen-client-extra-features): Eigen client documentation (#327)
juan518munoz Nov 5, 2024
6668ab9
feat(eigen-client-extra-features): Eth confirmation depth (#328)
gianbelinche Nov 7, 2024
cc9e2be
feat(eigen-client-extra-features): Remove unused custom quorum number…
gianbelinche Nov 7, 2024
9769a17
doc & cargo check all
juan518munoz Nov 7, 2024
91bb79b
clippy
juan518munoz Nov 7, 2024
cbe124e
Merge branch 'main' into eigen-client-merge-main
juan518munoz Nov 7, 2024
9c73b3f
update contracts submodule
juan518munoz Nov 7, 2024
94ecb52
Merge pull request #330 from lambdaclass/eigen-client-clippy-and-doc
juanbono Nov 8, 2024
342b476
Merge pull request #331 from lambdaclass/eigen-client-merge-main
juanbono Nov 8, 2024
077bc13
Merge branch 'main' into eigen-client-extra-features
juanbono Nov 8, 2024
c98726a
Update integration readme (#335)
gianbelinche Nov 11, 2024
991c340
update contracts submodule
juan518munoz Nov 12, 2024
f55a424
Merge pull request #337 from lambdaclass/eigen-client-contracts-submo…
juanbono Nov 12, 2024
f2fb12c
feat(eigen-client-extra-features): Remove kzgpad (#339)
gianbelinche Nov 15, 2024
b825d4f
Create eigendaservicemanager type (#340)
gianbelinche Nov 15, 2024
9561bc3
Change match to if (#341)
gianbelinche Nov 15, 2024
986a1d2
feat(eigen-client-eigen-features): Move dependencies (#342)
gianbelinche Nov 15, 2024
09ecfdd
feat(eigen-client-extra-features): Backon (#344)
gianbelinche Nov 19, 2024
a2ddcc3
Remove memstore (#346)
gianbelinche Nov 19, 2024
7d369a8
Add reserved to proto (#343)
gianbelinche Nov 21, 2024
a9c31a7
Remove extra config (#351)
gianbelinche Nov 21, 2024
6e1de82
feat(eigen-client-extra-features): Kzg bn254 crate (#352)
gianbelinche Nov 21, 2024
8d0b908
feat(eigen-client-extra-features): Remove Alloy Dependency (#349)
gianbelinche Nov 21, 2024
28c826c
Merge branch 'main' into eigen-client-extra-features-merge-main
gianbelinche Nov 22, 2024
68abc97
Fix cargo lock
gianbelinche Nov 22, 2024
99b153a
Merge pull request #354 from lambdaclass/eigen-client-extra-features-…
gianbelinche Nov 22, 2024
01b50ed
feat(eigen-client-extra-features): Move inclusion logic (#357)
gianbelinche Nov 28, 2024
daace34
feat(eigen-client-extra-features): Remove verify cert (#359)
gianbelinche Nov 28, 2024
99c6d42
feat(eigen-client-extra-features): Small changes (#358)
gianbelinche Nov 28, 2024
163c41a
feat(eigen-client-extra-features): minimal client changes (#362)
juan518munoz Nov 28, 2024
cef9a89
feat(eigen-client-extra-features): Add option to download points (#361)
gianbelinche Nov 28, 2024
75090b6
feat(eigen-client-extra-features): Replace third party dependant test…
juan518munoz Nov 28, 2024
7a61574
feat(eigen-client-extra-features): Remove steps to run from integrati…
gianbelinche Nov 28, 2024
bc90cc6
Merge branch 'main' into eigen-client-extra-features-and-main
gianbelinche Nov 28, 2024
87d450f
Update Cargo.lock
gianbelinche Nov 28, 2024
e2d4dab
Merge pull request #363 from lambdaclass/eigen-client-extra-features-…
gianbelinche Nov 29, 2024
4d1fadb
Merge branch 'main' into eigen-client-extra-features
juanbono Dec 3, 2024
4bb08b9
feat(eigen-client-pr-comments): Eigen client pr comments (#365)
gianbelinche Dec 6, 2024
0d01df7
Remove points (#366)
gianbelinche Dec 6, 2024
2100256
Merge branch 'main' into eigen-client-extra-features
gianbelinche Dec 6, 2024
83c3e13
Merge pull request #367 from lambdaclass/eigen-client-extra-main
gianbelinche Dec 6, 2024
fe8f68c
feat(eigen-client-extra-features): Fix PR comments (#369)
gianbelinche Dec 11, 2024
64a08bc
Merge branch 'main' into eigen-client-extra-features
gianbelinche Dec 11, 2024
8395cca
Cargo lock conflicts
gianbelinche Dec 11, 2024
f2d7941
Merge pull request #370 from lambdaclass/eigen-client-extra-main-merged
gianbelinche Dec 11, 2024
4b3c059
Solve comments (#372)
gianbelinche Dec 12, 2024
93b94b2
feat(eigen-client-extra-features): address PR comments (#375)
gianbelinche Dec 19, 2024
068f90f
Merge branch 'main' into eigen-client-extra-features
juanbono Jan 6, 2025
9e1ebfa
fix(eigen-client-extra-features): address comments (#383)
juan518munoz Jan 13, 2025
c007aa8
use `H160` for `DEFAULT_EIGENDA_SVC_MANAGER_ADDRESS`
juan518munoz Jan 17, 2025
2e7d6cc
`parse` instead of `from_str`
juan518munoz Jan 17, 2025
405b413
replace val with shif operation
juan518munoz Jan 17, 2025
9b6fe48
replace `.map_err` with `.context`
juan518munoz Jan 17, 2025
5a144ad
remove needless parentheses
juan518munoz Jan 17, 2025
2431a0c
use `div_ceil`
juan518munoz Jan 17, 2025
a880375
remove needles `Clone` derives
juan518munoz Jan 17, 2025
801aca6
remove redundant `to_vec()`
juan518munoz Jan 17, 2025
cd4c631
use `anyhow::bail!`
juan518munoz Jan 17, 2025
68825c4
remove needless `Option` and obscuring `anyhow::Result`
juan518munoz Jan 17, 2025
e3b6f17
move verifier test to separate file
juan518munoz Jan 17, 2025
2bded08
replace u64 constant with Duration
juan518munoz Jan 17, 2025
12d29c7
use `ethabi::encode()`
juan518munoz Jan 17, 2025
351d5a8
refactor `decode_bytes`
juan518munoz Jan 17, 2025
d312b51
wrap `G1Affine` inside of `Box` / fix clippy
juan518munoz Jan 17, 2025
57f608e
use `SensitiveUrl` for `eigenda_eth_rpc`
juan518munoz Jan 17, 2025
1832819
refactor `save_point` fn
juan518munoz Jan 17, 2025
3a97228
remove retriable error wrapping
juan518munoz Jan 17, 2025
5c4309d
replace `PKSigningClient` for simpler L1 Client
juan518munoz Jan 17, 2025
a66e9eb
remove chain id from `EigenConfig`
juan518munoz Jan 17, 2025
c89d8c2
use temp dir for kzg points
juan518munoz Jan 20, 2025
2880367
refactor `VerifierClient` trait
juan518munoz Jan 21, 2025
5a7e533
remove `VerifierConfig`
juan518munoz Jan 21, 2025
87d5e0d
fix eigen config not initializing correctly
juan518munoz Jan 21, 2025
ab6a374
merge branch `main` into `eigen-client-extra-features`
juan518munoz Jan 21, 2025
c3cb48c
fix/refactor mock tests
juan518munoz Jan 22, 2025
de8ad1a
remove unwraps
juan518munoz Jan 22, 2025
c476920
address comments/suggestions
juan518munoz Jan 22, 2025
d64acd2
improve Error handling
juan518munoz Jan 22, 2025
709adca
Merge branch 'eigen-client-extra-features-address-comments-third' int…
juan518munoz Jan 23, 2025
0b1397e
create temp file inside closure
juan518munoz Jan 23, 2025
e2ae59c
Merge branch 'eigen-client-extra-features-address-comments-third' int…
juan518munoz Jan 23, 2025
d3f1faf
Merge branch 'main' into eigen-client-extra-features-merge-main
juan518munoz Jan 23, 2025
bfcd206
add EigenDA to validium init cfg
juan518munoz Jan 24, 2025
278975c
update contracts submodule
juan518munoz Jan 24, 2025
56cda84
Remove unnecessary clone
gianbelinche Jan 27, 2025
cfba485
add eigenda validator
juan518munoz Jan 27, 2025
b0b080d
address comments
juan518munoz Jan 27, 2025
efdf1b4
address comments
juan518munoz Jan 28, 2025
2587277
update yarn.lock
juan518munoz Jan 28, 2025
28de691
change `path()` fn to return `&std::path::Path`
juan518munoz Jan 28, 2025
1870c2a
replace `Path(String)` for `Path(PathBuf)`
juan518munoz Jan 28, 2025
b68a43e
Merge branch 'eigen-client-extra-features-address-comments-third' int…
juan518munoz Jan 28, 2025
0575785
feat(eigen-cllient-extra-features): Address more comments (#386)
juan518munoz Jan 28, 2025
51e88d3
Merge remote-tracking branch 'origin/eigen-client-extra-features' int…
juan518munoz Jan 28, 2025
b33700b
run linter
juan518munoz Jan 28, 2025
2080f16
update genesis.yaml hashes
juan518munoz Jan 28, 2025
1273ed2
Merge pull request #387 from lambdaclass/eigen-client-extra-features-…
juan518munoz Jan 29, 2025
889b513
Merge branch 'main' into eigen-client-extra-features-merge
gianbelinche Jan 30, 2025
efa3a4b
Fix conflicts
gianbelinche Jan 30, 2025
9075650
Remove bad merge
gianbelinche Jan 30, 2025
f60bbf5
Update da validator type
gianbelinche Jan 30, 2025
da3fd9e
Fix error
gianbelinche Jan 30, 2025
2116030
Merge pull request #389 from lambdaclass/eigen-client-extra-features-…
gianbelinche Jan 30, 2025
d6eb001
Merge branch 'main' into eigen-client-extra-features-update-contracts
gianbelinche Feb 4, 2025
e17b879
Update contracts
gianbelinche Feb 4, 2025
ca4f11a
Merge pull request #394 from lambdaclass/eigen-client-extra-features-…
gianbelinche Feb 4, 2025
34df5ff
feat(eigen-client-extra-features): address comments (#395)
juan518munoz Feb 7, 2025
34e21b5
merge main
juan518munoz Feb 10, 2025
bdcb268
Merge pull request #396 from lambdaclass/eigen-client-extra-features-…
juan518munoz Feb 10, 2025
f0093c5
fix query
juan518munoz Feb 10, 2025
9810b37
suggestion
juan518munoz Feb 11, 2025
3c2e049
fix suggestion
juan518munoz Feb 11, 2025
b7306cc
fix hashes
juan518munoz Feb 12, 2025
c1936c3
Fix cargo deny (#398)
gianbelinche Feb 12, 2025
92b1ca6
Merge pull request #399 from lambdaclass/eigen-client-extra-features-…
juan518munoz Feb 12, 2025
ed37e47
Merge branch 'main' into eigen-client-extra-features
gianbelinche Feb 12, 2025
e5108bf
Format code
gianbelinche Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,667 changes: 838 additions & 829 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ pbjson-types = "0.6.0"

# Eigen
tokio-stream = "0.1.16"
rust-kzg-bn254 = "0.2.1"
ark-bn254 = "0.5.0"
num-bigint = "0.4.6"
serial_test = "3.1.1"

# Here and below:
# We *always* pin the latest version of protocol to disallow accidental changes in the execution logic.
Expand Down
6 changes: 5 additions & 1 deletion core/bin/zksync_server/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ impl MainNodeBuilder {
};

let secrets = try_load_config!(self.secrets.data_availability);
let l1_secrets = try_load_config!(self.secrets.l1);
match (da_client_config, secrets) {
(DAClientConfig::Avail(config), DataAvailabilitySecrets::Avail(secret)) => {
self.node.add_layer(AvailWiringLayer::new(config, secret));
Expand All @@ -535,7 +536,10 @@ impl MainNodeBuilder {
.add_layer(CelestiaWiringLayer::new(config, secret));
}

(DAClientConfig::Eigen(config), DataAvailabilitySecrets::Eigen(secret)) => {
(DAClientConfig::Eigen(mut config), DataAvailabilitySecrets::Eigen(secret)) => {
if config.eigenda_eth_rpc.is_none() {
config.eigenda_eth_rpc = Some(l1_secrets.l1_rpc_url.expose_str().to_string());
}
self.node.add_layer(EigenWiringLayer::new(config, secret));
}

Expand Down
25 changes: 21 additions & 4 deletions core/lib/config/src/configs/da_client/eigen.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
use serde::Deserialize;
use zksync_basic_types::secrets::PrivateKey;

#[derive(Clone, Debug, Default, PartialEq, Deserialize)]
/// Configuration for the EigenDA remote disperser client.
#[derive(Clone, Debug, PartialEq, Deserialize, Default)]
pub struct EigenConfig {
pub rpc_node_url: String,
pub inclusion_polling_interval_ms: u64,
/// URL of the Disperser RPC server
pub disperser_rpc: String,
slowli marked this conversation as resolved.
Show resolved Hide resolved
/// Block height needed to reach in order to consider the blob finalized
/// a value less or equal to 0 means that the disperser will not wait for finalization
pub settlement_layer_confirmation_depth: i32,
lferrigno marked this conversation as resolved.
Show resolved Hide resolved
lferrigno marked this conversation as resolved.
Show resolved Hide resolved
/// URL of the Ethereum RPC server
pub eigenda_eth_rpc: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this URL works as an ordinary Web3 provider URL, please use SensitiveUrl here, since it may contain sensitive parts for authentication.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, it was fixed here lambdaclass#386

/// Address of the service manager contract
pub eigenda_svc_manager_address: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not Address? Also, again, addresses don't have meaningful defaults, and "" is not a valid address.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed here lambdaclass#375, the testnet URL was used as default

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about making this an Address? AFAIU, it is parsed as such down the line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed here lambdaclass#383, the type is now Address as suggested.

/// Wait for the blob to be finalized before returning the response
pub wait_for_finalization: bool,
/// Authenticated dispersal
pub authenticated: bool,
/// Url to the file containing the G1 point used for KZG
pub g1_url: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any integrity checks for the file contents? What is the outcome of receiving invalid points (e.g., is this an attack vector)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The outcome will be that with invalid points the verification will fail.

/// 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,
dimazhornyk marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If chain_id is removed from the verifier config (see the other comment), this looks unused.
  • If this is somehow still required, a dumb question: can this chain ID differ from the Ethereum network chain ID in the genesis config (i.e., the L1 network for the validium)? Or the settlement network ID from GatewayChainId? If this config param is redundant, it shouldn't be copied; instead, the existing param should be reused.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed here lambdaclass#386

}

#[derive(Clone, Debug, PartialEq)]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions core/lib/dal/src/data_availability_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,43 @@ impl DataAvailabilityDal<'_, '_> {
})
.collect())
}

/// Fetches the pubdata for the L1 batch with a given blob id.
pub async fn get_blob_data_by_blob_id(
&mut self,
blob_id: &str,
) -> DalResult<Option<L1BatchDA>> {
let row = sqlx::query!(
r#"
SELECT
number,
pubdata_input
FROM
l1_batches
LEFT JOIN
data_availability
ON data_availability.l1_batch_number = l1_batches.number
WHERE
number != 0
AND data_availability.blob_id = $1
slowli marked this conversation as resolved.
Show resolved Hide resolved
AND pubdata_input IS NOT NULL
ORDER BY
number
LIMIT
1
"#,
blob_id,
)
.instrument("get_blob_data_by_blob_id")
.with_arg("blob_id", &blob_id)
.fetch_optional(self.storage)
.await?
.map(|row| L1BatchDA {
// `unwrap` is safe here because we have a `WHERE` clause that filters out `NULL` values
pubdata: row.pubdata_input.unwrap(),
l1_batch_number: L1BatchNumber(row.number as u32),
});

Ok(row)
}
}
22 changes: 18 additions & 4 deletions core/lib/env_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,31 @@ mod tests {
let mut lock = MUTEX.lock();
let config = r#"
DA_CLIENT="Eigen"
DA_RPC_NODE_URL="localhost:12345"
DA_INCLUSION_POLLING_INTERVAL_MS="1000"
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_URL="resources1"
DA_G2_URL="resources2"
DA_CHAIN_ID=1
"#;
lock.set_env(config);

let actual = DAClientConfig::from_env().unwrap();
assert_eq!(
actual,
DAClientConfig::Eigen(EigenConfig {
rpc_node_url: "localhost:12345".to_string(),
inclusion_polling_interval_ms: 1000,
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: "0x123".to_string(),
wait_for_finalization: true,
authenticated: false,
g1_url: "resources1".to_string(),
g2_url: "resources2".to_string(),
chain_id: 1
})
);
}
Expand Down
3 changes: 1 addition & 2 deletions core/lib/env_config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use anyhow::Context as _;
use serde::de::DeserializeOwned;

mod api;
Expand Down Expand Up @@ -44,5 +43,5 @@ pub trait FromEnv: Sized {
pub fn envy_load<T: DeserializeOwned>(name: &str, prefix: &str) -> anyhow::Result<T> {
envy::prefixed(prefix)
.from_env()
.with_context(|| format!("Cannot load config <{name}>"))
.map_err(|e| anyhow::anyhow!("Failed to load {} from env: {}", name, e))
}
41 changes: 34 additions & 7 deletions core/lib/protobuf_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ use zksync_config::configs::{
};
use zksync_protobuf::{required, ProtoRepr};

use crate::proto::{da_client as proto, object_store as object_store_proto};
use crate::proto::{
da_client::{self as proto},
object_store as object_store_proto,
};

impl ProtoRepr for proto::DataAvailabilityClient {
type Type = configs::DAClientConfig;
Expand Down Expand Up @@ -53,11 +56,26 @@ impl ProtoRepr for proto::DataAvailabilityClient {
timeout_ms: *required(&conf.timeout_ms).context("timeout_ms")?,
}),
proto::data_availability_client::Config::Eigen(conf) => Eigen(EigenConfig {
rpc_node_url: required(&conf.rpc_node_url)
.context("rpc_node_url")?
disperser_rpc: required(&conf.disperser_rpc)
.context("disperser_rpc")?
.clone(),
settlement_layer_confirmation_depth: *required(
&conf.settlement_layer_confirmation_depth,
)
.context("settlement_layer_confirmation_depth")?,
eigenda_eth_rpc: match required(&conf.eigenda_eth_rpc) {
Ok(rpc) => Some(rpc.clone()),
Err(_) => None,
},
dimazhornyk marked this conversation as resolved.
Show resolved Hide resolved
eigenda_svc_manager_address: required(&conf.eigenda_svc_manager_address)
.context("eigenda_svc_manager_address")?
.clone(),
inclusion_polling_interval_ms: *required(&conf.inclusion_polling_interval_ms)
.context("inclusion_polling_interval_ms")?,
wait_for_finalization: *required(&conf.wait_for_finalization)
.context("wait_for_finalization")?,
authenticated: *required(&conf.authenticated).context("authenticated")?,
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) => {
ObjectStore(object_store_proto::ObjectStore::read(conf)?)
Expand Down Expand Up @@ -96,8 +114,17 @@ impl ProtoRepr for proto::DataAvailabilityClient {
})
}
Eigen(config) => proto::data_availability_client::Config::Eigen(proto::EigenConfig {
rpc_node_url: Some(config.rpc_node_url.clone()),
inclusion_polling_interval_ms: Some(config.inclusion_polling_interval_ms),
disperser_rpc: Some(config.disperser_rpc.clone()),
settlement_layer_confirmation_depth: Some(
config.settlement_layer_confirmation_depth,
),
eigenda_eth_rpc: config.eigenda_eth_rpc.clone(),
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()),
g2_url: Some(config.g2_url.clone()),
chain_id: Some(config.chain_id),
}),
ObjectStore(config) => proto::data_availability_client::Config::ObjectStore(
object_store_proto::ObjectStore::build(config),
Expand Down
13 changes: 11 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 @@ -37,8 +37,17 @@ message CelestiaConfig {
}

message EigenConfig {
optional string rpc_node_url = 1;
optional uint64 inclusion_polling_interval_ms = 2;
optional string disperser_rpc = 3;
optional int32 settlement_layer_confirmation_depth = 4;
optional string eigenda_eth_rpc = 5;
optional string eigenda_svc_manager_address = 6;
optional bool wait_for_finalization = 7;
optional bool authenticated = 8;
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";
}

message DataAvailabilityClient {
Expand Down
11 changes: 11 additions & 0 deletions core/node/da_clients/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,14 @@ pbjson-types.workspace = true

# Eigen dependencies
tokio-stream.workspace = true
rand.workspace = true
sha3.workspace = true
tiny-keccak.workspace = true
ethabi.workspace = true
rust-kzg-bn254.workspace = true
ark-bn254.workspace = true
num-bigint.workspace = true
serial_test.workspace = true
lferrigno marked this conversation as resolved.
Show resolved Hide resolved
zksync_web3_decl.workspace = true
zksync_eth_client.workspace = true
url.workspace = true
18 changes: 10 additions & 8 deletions core/node/da_clients/src/eigen/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# EigenDA client
# EigenDA Client

---
EigenDA is as a high-throughput data availability layer for rollups. It is an EigenLayer AVS (Actively Validated
Service), so it leverages Ethereum's economic security instead of bootstrapping a new network with its own validators.
For more information you can check the [docs](https://docs.eigenda.xyz/).

This is an implementation of the EigenDA client capable of sending the blobs to DA layer. It uses authenticated
requests, though the auth headers are kind of mocked in the current API implementation.
## Temporary

The generated files are received by compiling the `.proto` files from EigenDA repo using the following function:
In order to implement the integration we generated some `.proto` files from EigenDA repo that were compiled using the
following function:

```rust
pub fn compile_protos() {
Expand All @@ -28,8 +30,8 @@ pub fn compile_protos() {
}
```

The generated folder is considered a temporary solution until the EigenDA has a library with either a protogen, or
preferably a full Rust client implementation.

proto files are not included here to not create confusion in case they are not updated in time, so the EigenDA
[repo](https://github.com/Layr-Labs/eigenda/tree/master/api/proto) has to be a source of truth for the proto files.

dimazhornyk marked this conversation as resolved.
Show resolved Hide resolved
The generated folder here is considered a temporary solution until the EigenDA has a library with either a protogen, or
preferably a full Rust client implementation.
Loading
Loading