Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
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
16 changes: 8 additions & 8 deletions core/bin/external_node/src/config/env_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use zksync_config::{
da_client::{
avail::{AvailClientConfig, AvailSecrets},
celestia::CelestiaSecrets,
eigenda::EigenDASecrets,
eigen::EigenSecrets,
},
DataAvailabilitySecrets,
},
AvailConfig, DAClientConfig, EigenDAConfig,
AvailConfig, DAClientConfig, EigenConfig,
};
use zksync_types::{
secrets::{APIKey, PrivateKey, SeedPhrase},
Expand All @@ -29,7 +29,7 @@ fn envy_load<T: DeserializeOwned>(name: &str, prefix: &str) -> anyhow::Result<T>

const AVAIL_CLIENT_CONFIG_NAME: &str = "Avail";
const CELESTIA_CLIENT_CONFIG_NAME: &str = "Celestia";
const EIGENDA_CLIENT_CONFIG_NAME: &str = "EigenDA";
const EIGEN_CLIENT_CONFIG_NAME: &str = "Eigen";
const OBJECT_STORE_CLIENT_CONFIG_NAME: &str = "ObjectStore";
const NO_DA_CLIENT_CONFIG_NAME: &str = "NoDA";
const AVAIL_GAS_RELAY_CLIENT_NAME: &str = "GasRelay";
Expand All @@ -54,7 +54,7 @@ pub fn da_client_config_from_env(prefix: &str) -> anyhow::Result<DAClientConfig>
CELESTIA_CLIENT_CONFIG_NAME => {
DAClientConfig::Celestia(envy_load("da_celestia_config", prefix)?)
}
EIGENDA_CLIENT_CONFIG_NAME => DAClientConfig::EigenDA(EigenDAConfig {
EIGEN_CLIENT_CONFIG_NAME => DAClientConfig::Eigen(EigenConfig {
disperser_rpc: env::var(format!("{}DISPERSER_RPC", prefix))?,
eigenda_eth_rpc: match env::var(format!("{}EIGENDA_ETH_RPC", prefix)) {
// Use a specific L1 RPC URL for the EigenDA client.
Expand All @@ -72,8 +72,8 @@ pub fn da_client_config_from_env(prefix: &str) -> anyhow::Result<DAClientConfig>
.parse()
.context("EigenDA blob version not found")?,
polynomial_form: match env::var(format!("{}POLYNOMIAL_FORM", prefix))?.as_str() {
"Coeff" => zksync_config::configs::da_client::eigenda::PolynomialForm::Coeff,
"Eval" => zksync_config::configs::da_client::eigenda::PolynomialForm::Eval,
"Coeff" => zksync_config::configs::da_client::eigen::PolynomialForm::Coeff,
"Eval" => zksync_config::configs::da_client::eigen::PolynomialForm::Eval,
_ => anyhow::bail!("Unknown Eigen polynomial form"),
},
}),
Expand Down Expand Up @@ -112,10 +112,10 @@ pub fn da_client_secrets_from_env(prefix: &str) -> anyhow::Result<DataAvailabili
private_key: PrivateKey(private_key.into()),
})
}
EIGENDA_CLIENT_CONFIG_NAME => {
EIGEN_CLIENT_CONFIG_NAME => {
let private_key = env::var(format!("{}SECRETS_PRIVATE_KEY", prefix))
.context("Eigen private key not found")?;
DataAvailabilitySecrets::EigenDA(EigenDASecrets {
DataAvailabilitySecrets::Eigen(EigenSecrets {
private_key: PrivateKey(private_key.into()),
})
}
Expand Down
2 changes: 1 addition & 1 deletion core/bin/external_node/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl<R> ExternalNodeBuilder<R> {
self.node
.add_layer(CelestiaWiringLayer::new(config, secret));
}
(DAClientConfig::EigenDA(mut config), DataAvailabilitySecrets::EigenDA(secret)) => {
(DAClientConfig::Eigen(mut config), DataAvailabilitySecrets::Eigen(secret)) => {
if config.eigenda_eth_rpc.is_none() {
config.eigenda_eth_rpc = Some(self.config.required.eth_client_url.clone());
}
Expand Down
4 changes: 2 additions & 2 deletions core/bin/zksync_server/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl MainNodeBuilder {
Some(da_client_config) => Ok(match da_client_config {
DAClientConfig::Avail(_) => PubdataType::Avail,
DAClientConfig::Celestia(_) => PubdataType::Celestia,
DAClientConfig::EigenDA(_) => PubdataType::Eigen,
DAClientConfig::Eigen(_) => PubdataType::Eigen,
DAClientConfig::ObjectStore(_) => PubdataType::ObjectStore,
DAClientConfig::NoDA => PubdataType::NoDA,
}),
Expand Down Expand Up @@ -600,7 +600,7 @@ impl MainNodeBuilder {
self.node
.add_layer(CelestiaWiringLayer::new(config, secret));
}
(DAClientConfig::EigenDA(mut config), DataAvailabilitySecrets::EigenDA(secret)) => {
(DAClientConfig::Eigen(mut config), DataAvailabilitySecrets::Eigen(secret)) => {
if config.eigenda_eth_rpc.is_none() {
let l1_secrets = &self.secrets.l1;
config.eigenda_eth_rpc = l1_secrets.l1_rpc_url.clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl WellKnown for PolynomialForm {
/// This configuration is meant to be used by the EigenDA V2 client.
/// It is an insecure integration, where the dispersal is not verified.
#[derive(Clone, Debug, PartialEq, Deserialize, DescribeConfig, DeserializeConfig)]
pub struct EigenDAConfig {
pub struct EigenConfig {
/// URL of the Disperser RPC server
pub disperser_rpc: String,
/// URL of the Ethereum RPC server
Expand All @@ -58,7 +58,7 @@ pub struct EigenDAConfig {

/// Configuration for the EigenDA secrets.
#[derive(Clone, Debug, DescribeConfig, DeserializeConfig)]
pub struct EigenDASecrets {
pub struct EigenSecrets {
/// Private key used for dispersing the blobs
#[config(with = FromSecretString)]
pub private_key: PrivateKey,
Expand Down
26 changes: 13 additions & 13 deletions core/lib/config/src/configs/da_client/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use smart_config::{DescribeConfig, DeserializeConfig};

use crate::{AvailConfig, CelestiaConfig, EigenDAConfig, ObjectStoreConfig};
use crate::{AvailConfig, CelestiaConfig, EigenConfig, ObjectStoreConfig};

pub mod avail;
pub mod celestia;
pub mod eigenda;
pub mod eigen;

#[derive(Debug, Clone, PartialEq, DescribeConfig, DeserializeConfig)]
#[config(tag = "client")]
pub enum DAClientConfig {
Avail(AvailConfig),
Celestia(CelestiaConfig),
EigenDA(EigenDAConfig),
Eigen(EigenConfig),
ObjectStore(ObjectStoreConfig),
#[config(alias = "NoDa")]
NoDA,
Expand All @@ -35,7 +35,7 @@ mod tests {

use super::{avail::AvailClientConfig, *};
use crate::configs::{
da_client::eigenda::PolynomialForm, object_store::ObjectStoreMode, DataAvailabilitySecrets,
da_client::eigen::PolynomialForm, object_store::ObjectStoreMode, DataAvailabilitySecrets,
Secrets,
};

Expand Down Expand Up @@ -294,9 +294,9 @@ mod tests {
}

#[test]
fn eigenda_config_from_env() {
fn eigen_config_from_env() {
let env = r#"
DA_CLIENT="EigenDA"
DA_CLIENT="Eigen"
DA_DISPERSER_RPC="http://localhost:8080"
DA_EIGENDA_ETH_RPC="http://localhost:8545"
DA_AUTHENTICATED=false
Expand All @@ -309,7 +309,7 @@ mod tests {
.strip_prefix("DA_");

let config = test_complete::<DAClientConfig>(env).unwrap();
let DAClientConfig::EigenDA(config) = config else {
let DAClientConfig::Eigen(config) = config else {
panic!("unexpected config: {config:?}");
};

Expand All @@ -331,7 +331,7 @@ mod tests {
}

fn assert_eigen_config(config: &DAClientConfig) {
let DAClientConfig::EigenDA(config) = config else {
let DAClientConfig::Eigen(config) = config else {
panic!("unexpected config: {config:?}");
};
assert_eq!(
Expand All @@ -346,9 +346,9 @@ mod tests {
}

#[test]
fn eigenda_config_from_yaml() {
fn eigen_config_from_yaml() {
let yaml = r#"
client: EigenDA
client: Eigen
disperser_rpc: https://disperser-holesky.eigenda.xyz:443
eigenda_eth_rpc: https://holesky.infura.io/
authenticated: true
Expand All @@ -359,7 +359,7 @@ mod tests {
let yaml = Yaml::new("test.yml", serde_yaml::from_str(yaml).unwrap()).unwrap();

let config = test_complete::<DAClientConfig>(yaml).unwrap();
let DAClientConfig::EigenDA(config) = config else {
let DAClientConfig::Eigen(config) = config else {
panic!("unexpected config: {config:?}");
};

Expand All @@ -384,9 +384,9 @@ mod tests {
}

#[test]
fn eigenda_config_from_yaml_with_enum_coercion() {
fn eigen_config_from_yaml_with_enum_coercion() {
let yaml = r#"
eigen_d_a:
eigen:
disperser_rpc: https://disperser-holesky.eigenda.xyz:443
eigenda_eth_rpc: https://holesky.infura.io/
authenticated: true
Expand Down
4 changes: 1 addition & 3 deletions core/lib/config/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ pub use self::{
commitment_generator::CommitmentGeneratorConfig,
contract_verifier::ContractVerifierConfig,
contracts::chain::ContractsConfig,
da_client::{
avail::AvailConfig, celestia::CelestiaConfig, eigenda::EigenDAConfig, DAClientConfig,
},
da_client::{avail::AvailConfig, celestia::CelestiaConfig, eigen::EigenConfig, DAClientConfig},
da_dispatcher::DADispatcherConfig,
database::{DBConfig, PostgresConfig},
eth_sender::{EthConfig, GasAdjusterConfig},
Expand Down
4 changes: 2 additions & 2 deletions core/lib/config/src/configs/secrets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use zksync_basic_types::{secrets::APIKey, url::SensitiveUrl};

use crate::configs::{
consensus::ConsensusSecrets,
da_client::{avail::AvailSecrets, celestia::CelestiaSecrets, eigenda::EigenDASecrets},
da_client::{avail::AvailSecrets, celestia::CelestiaSecrets, eigen::EigenSecrets},
};

#[derive(Debug, Clone, DescribeConfig, DeserializeConfig)]
Expand Down Expand Up @@ -42,7 +42,7 @@ pub struct L1Secrets {
pub enum DataAvailabilitySecrets {
Avail(AvailSecrets),
Celestia(CelestiaSecrets),
EigenDA(EigenDASecrets),
Eigen(EigenSecrets),
// Needed for compatibility with the non-secret part of the DA config
NoDA,
}
Expand Down
2 changes: 1 addition & 1 deletion core/lib/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pub use crate::configs::{
contracts::chain::ContractsConfig, full_config_schema, ApiConfig, AvailConfig,
BaseTokenAdjusterConfig, CelestiaConfig, ContractVerifierConfig, DAClientConfig,
DADispatcherConfig, DBConfig, EigenDAConfig, EthConfig, EthWatchConfig,
DADispatcherConfig, DBConfig, EigenConfig, EthConfig, EthWatchConfig,
ExternalProofIntegrationApiConfig, GasAdjusterConfig, GenesisConfig, ObjectStoreConfig,
PostgresConfig, SnapshotsCreatorConfig,
};
Expand Down
4 changes: 2 additions & 2 deletions core/lib/da_client/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub enum ClientType {
NoDA,
Avail,
Celestia,
EigenDA,
Eigen,
ObjectStore,
}

Expand All @@ -69,7 +69,7 @@ impl ClientType {
ClientType::NoDA => PubdataType::NoDA,
ClientType::Avail => PubdataType::Avail,
ClientType::Celestia => PubdataType::Celestia,
ClientType::EigenDA => PubdataType::Eigen,
ClientType::Eigen => PubdataType::Eigen,
ClientType::ObjectStore => PubdataType::ObjectStore,
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/lib/dal/src/consensus/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ impl proto::PubdataType {
Self::NoDa => PubdataType::NoDA,
Self::Avail => PubdataType::Avail,
Self::Celestia => PubdataType::Celestia,
Self::EigenDa => PubdataType::Eigen,
Self::Eigen => PubdataType::Eigen,
Self::ObjectStore => PubdataType::ObjectStore,
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/lib/dal/src/consensus/proto/mod.proto
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ enum PubdataType {
NoDA = 1;
Avail = 2;
Celestia = 3;
EigenDA = 4;
Eigen = 4;
ObjectStore = 5;
}
2 changes: 1 addition & 1 deletion core/node/da_clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Currently, the following DataAvailability clients are implemented:
- `Object Store client` that stores the pubdata in the Object Store(GCS).
- `Avail` that sends the pubdata to the Avail DA layer.
- `Celestia` that sends the pubdata to the Celestia DA layer.
- `EigenDA` that sends the pubdata to the Eigen DA layer.
- `Eigen` that sends the pubdata to the Eigen DA layer.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You need to update the client config to the new format.

```yaml
da_client:
client: EigenDA
client: Eigen
disperser_rpc: https://disperser-testnet-holesky.eigenda.xyz
eigenda_eth_rpc: https://ethereum-holesky-rpc.publicnode.com
authenticated: true
Expand All @@ -35,28 +35,8 @@ da_client:
polynomial_form: coeff
```

Note that the client changed from `Eigen` to `EigenDA`

Check the [README.md](./README.md) for more details on the new fields.

### Note

You should also change your `chains/<YOUR_CHAIN>/configs/secrets.yaml` from:

```yaml
da_client:
client: Eigen
private_key: <your_private_key>
```

To

```yaml
da_client:
client: EigenDA
private_key: <your_private_key>
```

- Be sure that your private key has the needed permissions set on the V2 client.

Choose a reason for hiding this comment

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

Re add this part

- Remember to run `zkstackup --local` before running the new server after this changes
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ You need to add the following field:

```yaml
da_client:
client: EigenDA
client: Eigen
private_key: <PRIVATE_KEY>
```

Expand All @@ -47,7 +47,7 @@ So, for example, a client setup that uses the holesky EigenDA V2 client would lo
da_dispatcher:
use_dummy_inclusion_data: true
da_client:
client: EigenDA
client: Eigen
disperser_rpc: https://disperser-testnet-holesky.eigenda.xyz
eigenda_eth_rpc: https://ethereum-holesky-rpc.publicnode.com
authenticated: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use rust_eigenda_v2_common::{Payload, PayloadForm};
use subxt_signer::ExposeSecret;
use url::Url;
use zksync_config::{
configs::da_client::eigenda::{EigenDASecrets, PolynomialForm},
EigenDAConfig,
configs::da_client::eigen::{EigenSecrets, PolynomialForm},
EigenConfig,
};
use zksync_da_client::{
types::{ClientType, DAError, DispatchResponse, FinalityResponse, InclusionData},
Expand All @@ -23,12 +23,12 @@ use crate::utils::{to_non_retriable_da_error, to_retriable_da_error};

// We can't implement DataAvailabilityClient for an outside struct, so it is needed to defined this intermediate struct
#[derive(Debug, Clone)]
pub struct EigenDAClient {
pub struct EigenClient {
client: PayloadDisperser,
}

impl EigenDAClient {
pub async fn new(config: EigenDAConfig, secrets: EigenDASecrets) -> anyhow::Result<Self> {
impl EigenClient {
pub async fn new(config: EigenConfig, secrets: EigenSecrets) -> anyhow::Result<Self> {
let url = Url::from_str(
config
.eigenda_eth_rpc
Expand Down Expand Up @@ -66,7 +66,7 @@ impl EigenDAClient {
}

#[async_trait::async_trait]
impl DataAvailabilityClient for EigenDAClient {
impl DataAvailabilityClient for EigenClient {
async fn dispatch_blob(
&self,
_: u32, // batch number
Expand Down Expand Up @@ -147,7 +147,7 @@ impl DataAvailabilityClient for EigenDAClient {
}

fn client_type(&self) -> ClientType {
ClientType::EigenDA
ClientType::Eigen
}

async fn balance(&self) -> Result<u64, DAError> {
Expand Down
3 changes: 3 additions & 0 deletions core/node/da_clients/src/eigen/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod client;

pub use self::client::EigenClient;
3 changes: 0 additions & 3 deletions core/node/da_clients/src/eigen_da/mod.rs

This file was deleted.

2 changes: 1 addition & 1 deletion core/node/da_clients/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod avail;
pub mod celestia;
pub mod eigen_da;
pub mod eigen;
pub mod no_da;
pub mod node;
pub mod object_store;
Expand Down
Loading
Loading