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(eigen-client-extra-features): Small changes #3332

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 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
092677e
Change eth conf depth for settlement layer
gianbelinche Nov 25, 2024
90a2b32
Remove blob size limit
gianbelinche Nov 25, 2024
dc2dddc
Move reserved
gianbelinche Nov 25, 2024
e6616a6
Change function name
gianbelinche Nov 25, 2024
98ae8b7
Add constants to lib
gianbelinche Nov 25, 2024
5187c05
Fix compilation
gianbelinche Nov 25, 2024
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
346 changes: 315 additions & 31 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
29 changes: 25 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,31 @@
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,
/// 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,
/// URL of the Ethereum RPC server
pub eigenda_eth_rpc: String,
/// Address of the service manager contract
pub eigenda_svc_manager_address: String,
/// Maximun amount of time in milliseconds to wait for a status query response
pub status_query_timeout: u64,
/// Interval in milliseconds to query the status of a blob
pub status_query_interval: u64,
/// Wait for the blob to be finalized before returning the response
pub wait_for_finalization: bool,
/// Authenticated dispersal
pub authenticated: bool,
/// Verify the certificate of dispatched blobs
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
27 changes: 23 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,36 @@ 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_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_STATUS_QUERY_TIMEOUT=2
DA_STATUS_QUERY_INTERVAL=3
DA_WAIT_FOR_FINALIZATION=true
DA_AUTHENTICATED=false
DA_VERIFY_CERT=false
DA_PATH_TO_POINTS="resources"
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: "http://localhost:8545".to_string(),
eigenda_svc_manager_address: "0x123".to_string(),
status_query_timeout: 2,
status_query_interval: 3,
wait_for_finalization: true,
authenticated: false,
verify_cert: false,
path_to_points: "resources".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))
}
43 changes: 37 additions & 6 deletions core/lib/protobuf_config/src/da_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,31 @@ 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(),
inclusion_polling_interval_ms: *required(&conf.inclusion_polling_interval_ms)
.context("inclusion_polling_interval_ms")?,
settlement_layer_confirmation_depth: *required(
&conf.settlement_layer_confirmation_depth,
)
.context("settlement_layer_confirmation_depth")?,
eigenda_eth_rpc: required(&conf.eigenda_eth_rpc)
.context("eigenda_eth_rpc")?
.clone(),
eigenda_svc_manager_address: required(&conf.eigenda_svc_manager_address)
.context("eigenda_svc_manager_address")?
.clone(),
status_query_timeout: *required(&conf.status_query_timeout)
.context("status_query_timeout")?,
status_query_interval: *required(&conf.status_query_interval)
.context("status_query_interval")?,
wait_for_finalization: *required(&conf.wait_for_finalization)
.context("wait_for_finalization")?,
authenticated: *required(&conf.authenticated).context("authenticated")?,
verify_cert: *required(&conf.verify_cert).context("verify_cert")?,
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 @@ -96,8 +116,19 @@ 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: Some(config.eigenda_eth_rpc.clone()),
eigenda_svc_manager_address: Some(config.eigenda_svc_manager_address.clone()),
status_query_timeout: Some(config.status_query_timeout),
status_query_interval: Some(config.status_query_interval),
wait_for_finalization: Some(config.wait_for_finalization),
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
15 changes: 13 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,19 @@ 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 uint64 status_query_timeout = 7;
optional uint64 status_query_interval = 8;
optional bool wait_for_finalization = 9;
optional bool authenticated = 10;
optional bool verify_cert = 11;
optional string path_to_points = 12;
optional uint64 chain_id = 13;
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
rlp.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
zksync_web3_decl.workspace = true
zksync_eth_client.workspace = true
Loading