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-m1): Add dummy bridge #381

Open
wants to merge 10 commits into
base: eigen-client-m0-merge-sync-stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 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
4 changes: 3 additions & 1 deletion zkstack_cli/crates/config/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use xshell::Shell;
use zksync_basic_types::L2ChainId;
use zksync_config::{
configs::{gateway::GatewayChainConfig, GatewayConfig},
DAClientConfig::Avail,
DAClientConfig::{Avail, Eigen},
};

use crate::{
Expand Down Expand Up @@ -75,6 +75,7 @@ pub enum DAValidatorType {
Rollup = 0,
NoDA = 1,
Avail = 2,
EigenDA = 3,
}

impl Serialize for ChainConfig {
Expand Down Expand Up @@ -121,6 +122,7 @@ impl ChainConfig {
(L1BatchCommitmentMode::Rollup, _) => Ok(DAValidatorType::Rollup),
(L1BatchCommitmentMode::Validium, None) => Ok(DAValidatorType::NoDA),
(L1BatchCommitmentMode::Validium, Some(Avail(_))) => Ok(DAValidatorType::Avail),
(L1BatchCommitmentMode::Validium, Some(Eigen(_))) => Ok(DAValidatorType::EigenDA),
_ => anyhow::bail!("DAValidatorType is not supported"),
}
}
Expand Down
8 changes: 8 additions & 0 deletions zkstack_cli/crates/config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ impl ContractsConfig {
.deployed_addresses
.avail_l1_da_validator_addr,
);
self.l1.eigenda_l1_validator_addr = Some(
deploy_l1_output
.deployed_addresses
.eigenda_l1_validator_addr,
);
self.l1.chain_admin_addr = deploy_l1_output.deployed_addresses.chain_admin;
}

Expand Down Expand Up @@ -249,6 +254,9 @@ pub struct L1Contracts {
pub no_da_validium_l1_validator_addr: Option<Address>,
// `Option` to be able to parse configs from previous protocol version
#[serde(skip_serializing_if = "Option::is_none")]
pub eigenda_l1_validator_addr: Option<Address>,
// `Option` to be able to parse configs from previous protocol version
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_filterer_addr: Option<Address>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ impl DeployL1Config {
validator_timelock_execution_delay: initial_deployment_config
.validator_timelock_execution_delay,
avail_l1_da_validator_addr: l1_network.avail_l1_da_validator_addr(),
eigenda_l1_validator_addr: l1_network.eigenda_l1_validator_addr(),
},
tokens: TokensDeployL1Config {
token_weth_address: initial_deployment_config.token_weth_address,
Expand Down Expand Up @@ -204,6 +205,8 @@ pub struct ContractsDeployL1Config {
pub evm_emulator_hash: Option<H256>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avail_l1_da_validator_addr: Option<Address>,
#[serde(skip_serializing_if = "Option::is_none")]
pub eigenda_l1_validator_addr: Option<Address>,
}

#[derive(Debug, Deserialize, Serialize, Clone)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct DeployL1DeployedAddressesOutput {
pub rollup_l1_da_validator_addr: Address,
pub no_da_validium_l1_validator_addr: Address,
pub avail_l1_da_validator_addr: Address,
pub eigenda_l1_validator_addr: Address,
pub l1_rollup_da_manager: Address,
pub native_token_vault_addr: Address,
}
Expand Down
11 changes: 11 additions & 0 deletions zkstack_cli/crates/types/src/l1_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,15 @@ impl L1Network {
L1Network::Mainnet => None, // TODO: add mainnet address after it is known
}
}

pub fn eigenda_l1_validator_addr(&self) -> Option<Address> {
match self {
L1Network::Localhost => None,
L1Network::Sepolia | L1Network::Holesky => {
None
//TODO: add real address
}
L1Network::Mainnet => None, // TODO: add mainnet address after it is known
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct ValidiumTypeArgs {
pub enum ValidiumTypeInternal {
NoDA,
Avail,
EigenDA,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EnumIter, Display, ValueEnum)]
Expand All @@ -43,11 +44,13 @@ pub enum AvailClientTypeInternal {
pub enum ValidiumType {
NoDA,
Avail((AvailConfig, AvailSecrets)),
EigenDA,
}

impl ValidiumType {
pub fn read() -> Self {
match PromptSelect::new(MSG_VALIDIUM_TYPE_PROMPT, ValidiumTypeInternal::iter()).ask() {
ValidiumTypeInternal::EigenDA => ValidiumType::EigenDA,
ValidiumTypeInternal::NoDA => ValidiumType::NoDA,
ValidiumTypeInternal::Avail => {
let avail_client_type = PromptSelect::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ impl InitArgs {
Some(da_configs::ValidiumTypeInternal::Avail) => panic!(
"Avail is not supported via CLI args, use interactive mode" // TODO: Add support for configuration via CLI args
),
Some(da_configs::ValidiumTypeInternal::EigenDA) => Some(ValidiumType::EigenDA),
},
_ => None,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub async fn init_configs(
general_config.da_client_config = Some(avail_config.into());
secrets.data_availability = Some(DataAvailabilitySecrets::Avail(avail_secrets));
}
ValidiumType::EigenDA => {}
}
}

Expand Down
1 change: 1 addition & 0 deletions zkstack_cli/crates/zkstack/src/commands/chain/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ pub(crate) fn get_l1_da_validator(chain_config: &ChainConfig) -> anyhow::Result<
if let Some(da_client_config) = general_config.da_client_config {
match da_client_config {
DAClientConfig::Avail(_) => contracts_config.l1.avail_l1_da_validator_addr,
DAClientConfig::Eigen(_) => contracts_config.l1.eigenda_l1_validator_addr,
_ => anyhow::bail!("DA client config is not supported"),
}
} else {
Expand Down
Loading