Skip to content

Commit 771e6f0

Browse files
juanbonojuan518munozgianbelinche
authored
feat(eigenda): implement eigenDA client remaining features (#3243)
## What ❔ ### Note: Related era-contract PR: matter-labs/era-contracts#1233 This PR adds extra functionality to the eigen client: - [x] Non authenticated blob dispersal lambdaclass/zksync-era#318 - [x] RLP encoding for blobs lambdaclass/zksync-era#319 - [x] Get inclusion data lambdaclass/zksync-era#324 - [x] Memstore lambdaclass/zksync-era#321 - [x] Blob size limit lambdaclass/zksync-era#325 - [x] Soft confirmations lambdaclass/zksync-era#322 - [x] Verification logic lambdaclass/zksync-era#326 - [x] EigenDA Documentation lambdaclass/zksync-era#327 ## Why ❔ These features are needed to have a full featured client and to have the same features as when communicating with the EigenDA proxy. ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --------- Co-authored-by: Juan Munoz <juanmunoz890@gmail.com> Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com>
1 parent 3540988 commit 771e6f0

File tree

8 files changed

+16
-8
lines changed

8 files changed

+16
-8
lines changed

crates/config/src/forge_interface/deploy_l2_contracts/input.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ async fn get_da_validator_type(config: &ChainConfig) -> anyhow::Result<DAValidat
5555
(L1BatchCommitmentMode::Rollup, _) => Ok(DAValidatorType::Rollup),
5656
(L1BatchCommitmentMode::Validium, None | Some("no_da")) => Ok(DAValidatorType::NoDA),
5757
(L1BatchCommitmentMode::Validium, Some("avail")) => Ok(DAValidatorType::Avail),
58+
(L1BatchCommitmentMode::Validium, Some("eigen")) => Ok(DAValidatorType::NoDA), // TODO: change to EigenDA for M1
5859
_ => anyhow::bail!("DAValidatorType is not supported"),
5960
}
6061
}

crates/zkstack/completion/_zkstack.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ _arguments "${_arguments_options[@]}" : \
134134
'-o+[Enable Grafana]' \
135135
'--observability=[Enable Grafana]' \
136136
'--update-submodules=[]:UPDATE_SUBMODULES:(true false)' \
137-
'--validium-type=[Type of the Validium network]:VALIDIUM_TYPE:(no-da avail)' \
137+
'--validium-type=[Type of the Validium network]:VALIDIUM_TYPE:(no-da avail eigen-da)' \
138138
'--support-l2-legacy-shared-bridge-test=[]' \
139139
'--chain=[Chain to use]:CHAIN:_default' \
140140
'--resume[]' \
@@ -295,7 +295,7 @@ _arguments "${_arguments_options[@]}" : \
295295
'--deploy-paymaster=[]' \
296296
'--l1-rpc-url=[L1 RPC URL]:L1_RPC_URL:_default' \
297297
'--update-submodules=[]:UPDATE_SUBMODULES:(true false)' \
298-
'--validium-type=[Type of the Validium network]:VALIDIUM_TYPE:(no-da avail)' \
298+
'--validium-type=[Type of the Validium network]:VALIDIUM_TYPE:(no-da avail eigen-da)' \
299299
'--chain=[Chain to use]:CHAIN:_default' \
300300
'--resume[]' \
301301
'--zksync[]' \

crates/zkstack/completion/zkstack.fish

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ false\t''"
141141
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l update-submodules -r -f -a "true\t''
142142
false\t''"
143143
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l validium-type -d 'Type of the Validium network' -r -f -a "no-da\t''
144-
avail\t''"
144+
avail\t''
145+
eigen-da\t''"
145146
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l support-l2-legacy-shared-bridge-test -r -f -a "true\t''
146147
false\t''"
147148
complete -c zkstack -n "__fish_zkstack_using_subcommand ecosystem; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r
@@ -247,7 +248,8 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_s
247248
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l update-submodules -r -f -a "true\t''
248249
false\t''"
249250
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l validium-type -d 'Type of the Validium network' -r -f -a "no-da\t''
250-
avail\t''"
251+
avail\t''
252+
eigen-da\t''"
251253
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l chain -d 'Chain to use' -r
252254
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l resume
253255
complete -c zkstack -n "__fish_zkstack_using_subcommand chain; and __fish_seen_subcommand_from init" -l zksync

crates/zkstack/completion/zkstack.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,7 @@ _zkstack() {
20632063
return 0
20642064
;;
20652065
--validium-type)
2066-
COMPREPLY=($(compgen -W "no-da avail" -- "${cur}"))
2066+
COMPREPLY=($(compgen -W "no-da avail eigen-da" -- "${cur}"))
20672067
return 0
20682068
;;
20692069
--chain)
@@ -5195,7 +5195,7 @@ _zkstack() {
51955195
return 0
51965196
;;
51975197
--validium-type)
5198-
COMPREPLY=($(compgen -W "no-da avail" -- "${cur}"))
5198+
COMPREPLY=($(compgen -W "no-da avail eigen-da" -- "${cur}"))
51995199
return 0
52005200
;;
52015201
--support-l2-legacy-shared-bridge-test)

crates/zkstack/src/commands/chain/args/init/da_configs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub struct ValidiumTypeArgs {
2828
pub enum ValidiumTypeInternal {
2929
NoDA,
3030
Avail,
31+
EigenDA,
3132
}
3233

3334
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EnumIter, Display, ValueEnum)]
@@ -40,6 +41,7 @@ pub enum AvailClientTypeInternal {
4041
pub enum ValidiumType {
4142
NoDA,
4243
Avail((AvailConfig, AvailSecrets)),
44+
EigenDA,
4345
}
4446

4547
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EnumIter, Display, ValueEnum)]
@@ -51,6 +53,7 @@ pub enum AvailFinalityState {
5153
impl ValidiumType {
5254
pub fn read() -> Self {
5355
match PromptSelect::new(MSG_VALIDIUM_TYPE_PROMPT, ValidiumTypeInternal::iter()).ask() {
56+
ValidiumTypeInternal::EigenDA => ValidiumType::EigenDA, // EigenDA doesn't support configuration through CLI
5457
ValidiumTypeInternal::NoDA => ValidiumType::NoDA,
5558
ValidiumTypeInternal::Avail => {
5659
let avail_client_type = PromptSelect::new(

crates/zkstack/src/commands/chain/args/init/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ impl InitArgs {
9595
Some(da_configs::ValidiumTypeInternal::Avail) => panic!(
9696
"Avail is not supported via CLI args, use interactive mode" // TODO: Add support for configuration via CLI args
9797
),
98+
Some(da_configs::ValidiumTypeInternal::EigenDA) => Some(ValidiumType::EigenDA),
9899
},
99100
_ => None,
100101
};

crates/zkstack/src/commands/chain/init/configs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub async fn init_configs(
7272
set_genesis_specs(&mut general_config, chain_config, &consensus_keys)?;
7373

7474
match &init_args.validium_config {
75-
None | Some(ValidiumType::NoDA) => {
75+
None | Some(ValidiumType::NoDA) | Some(ValidiumType::EigenDA) => {
7676
general_config.remove("da_client");
7777
}
7878
Some(ValidiumType::Avail((avail_config, _))) => {
@@ -103,7 +103,7 @@ pub async fn init_configs(
103103
set_l1_rpc_url(&mut secrets, init_args.l1_rpc_url.clone())?;
104104
set_consensus_secrets(&mut secrets, &consensus_keys)?;
105105
match &init_args.validium_config {
106-
None | Some(ValidiumType::NoDA) => { /* Do nothing */ }
106+
None | Some(ValidiumType::NoDA) | Some(ValidiumType::EigenDA) => { /* Do nothing */ }
107107
Some(ValidiumType::Avail((_, avail_secrets))) => {
108108
secrets.insert_yaml("da.avail", avail_secrets)?;
109109
}

crates/zkstack/src/commands/chain/init/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ pub(crate) async fn get_l1_da_validator(chain_config: &ChainConfig) -> anyhow::R
258258
match get_da_client_type(&general_config) {
259259
Some("avail") => contracts_config.l1.avail_l1_da_validator_addr,
260260
Some("no_da") | None => contracts_config.l1.no_da_validium_l1_validator_addr,
261+
Some("eigen") => contracts_config.l1.no_da_validium_l1_validator_addr, // TODO: change for eigenda l1 validator for M1
261262
Some(unsupported) => {
262263
anyhow::bail!("DA client config is not supported: {unsupported:?}");
263264
}

0 commit comments

Comments
 (0)