Skip to content

Commit 6a5c312

Browse files
chore: Reduction of diff between main and sync-layer-stable (#3400)
## What ❔ This PR includes: - Changes to VM. Note, that since they are only activated during usage of the new ProtocolVersion, they should not affect the current behavior. - Changes to the VM introduce the max new factory deps as equal to 64 (but only to the last subversion) - The block reverted made to work on top of gateway, but most of the diff is due to the removal of the support for env-based instead of file based inputs - Gateway config ported - Some various changes to gateway-specific logic that should not be active before the upgrade ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## 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`.
1 parent eb2b796 commit 6a5c312

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

zkstack_cli/crates/zkstack/completion/_zkstack.zsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,7 @@ _arguments "${_arguments_options[@]}" : \
21452145
'--db-url=[]:DB_URL:_default' \
21462146
'--db-name=[]:DB_NAME:_default' \
21472147
'--l1-rpc-url=[]:L1_RPC_URL:_default' \
2148+
'--gateway-rpc-url=[]:GATEWAY_RPC_URL:_default' \
21482149
'--chain=[Chain to use]:CHAIN:_default' \
21492150
'-u[Use default database urls and names]' \
21502151
'--use-default[Use default database urls and names]' \

zkstack_cli/crates/zkstack/completion/zkstack.fish

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and not _
584584
complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l db-url -r
585585
complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l db-name -r
586586
complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l l1-rpc-url -r
587+
complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l gateway-rpc-url -r
587588
complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -l chain -d 'Chain to use' -r
588589
complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -s u -l use-default -d 'Use default database urls and names'
589590
complete -c zkstack -n "__fish_zkstack_using_subcommand external-node; and __fish_seen_subcommand_from configs" -s v -l verbose -d 'Verbose mode'

zkstack_cli/crates/zkstack/completion/zkstack.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5435,7 +5435,7 @@ _zkstack() {
54355435
return 0
54365436
;;
54375437
zkstack__external__node__configs)
5438-
opts="-u -v -h --db-url --db-name --l1-rpc-url --use-default --verbose --chain --ignore-prerequisites --help"
5438+
opts="-u -v -h --db-url --db-name --l1-rpc-url --gateway-rpc-url --use-default --verbose --chain --ignore-prerequisites --help"
54395439
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
54405440
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
54415441
return 0
@@ -5453,6 +5453,10 @@ _zkstack() {
54535453
COMPREPLY=($(compgen -f "${cur}"))
54545454
return 0
54555455
;;
5456+
--gateway-rpc-url)
5457+
COMPREPLY=($(compgen -f "${cur}"))
5458+
return 0
5459+
;;
54565460
--chain)
54575461
COMPREPLY=($(compgen -f "${cur}"))
54585462
return 0

zkstack_cli/crates/zkstack/src/commands/external_node/args/prepare_configs.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ pub struct PrepareConfigArgs {
2121
pub db_name: Option<String>,
2222
#[clap(long)]
2323
pub l1_rpc_url: Option<String>,
24+
#[clap(long)]
25+
pub gateway_rpc_url: Option<String>,
2426
#[clap(long, short, help = MSG_USE_DEFAULT_DATABASES_HELP)]
2527
pub use_default: bool,
2628
}
@@ -33,6 +35,7 @@ impl PrepareConfigArgs {
3335
PrepareConfigFinal {
3436
db: DatabaseConfig::new(DATABASE_SERVER_URL.clone(), db_name),
3537
l1_rpc_url: LOCAL_RPC_URL.to_string(),
38+
gateway_rpc_url: None,
3639
}
3740
} else {
3841
let db_url = self.db_url.unwrap_or_else(|| {
@@ -57,6 +60,7 @@ impl PrepareConfigArgs {
5760
PrepareConfigFinal {
5861
db: DatabaseConfig::new(db_url, db_name),
5962
l1_rpc_url,
63+
gateway_rpc_url: self.gateway_rpc_url,
6064
}
6165
}
6266
}
@@ -66,4 +70,5 @@ impl PrepareConfigArgs {
6670
pub struct PrepareConfigFinal {
6771
pub db: DatabaseConfig,
6872
pub l1_rpc_url: String,
73+
pub gateway_rpc_url: Option<String>,
6974
}

zkstack_cli/crates/zkstack/src/commands/external_node/prepare_configs.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ fn prepare_configs(
6363
let en_config = ENConfig {
6464
l2_chain_id: genesis.l2_chain_id,
6565
l1_chain_id: genesis.l1_chain_id,
66-
sl_chain_id: genesis.sl_chain_id,
6766
l1_batch_commit_data_generator_mode: genesis.l1_batch_commit_data_generator_mode,
6867
main_node_url: SensitiveUrl::from_str(
6968
&general
@@ -75,6 +74,7 @@ fn prepare_configs(
7574
)?,
7675
main_node_rate_limit_rps: None,
7776
bridge_addresses_refresh_interval_sec: None,
77+
gateway_chain_id: None,
7878
};
7979
let mut general_en = general.clone();
8080
general_en.consensus_config = None;
@@ -102,6 +102,12 @@ fn prepare_configs(
102102
attester_key: None,
103103
node_key: Some(NodeSecretKey(Secret::new(node_key))),
104104
};
105+
106+
let gateway_rpc_url = if let Some(url) = args.gateway_rpc_url {
107+
Some(SensitiveUrl::from_str(&url).context("gateway_url")?)
108+
} else {
109+
None
110+
};
105111
let secrets = SecretsConfig {
106112
consensus: Some(consensus_secrets),
107113
database: Some(DatabaseSecrets {
@@ -111,7 +117,7 @@ fn prepare_configs(
111117
}),
112118
l1: Some(L1Secrets {
113119
l1_rpc_url: SensitiveUrl::from_str(&args.l1_rpc_url).context("l1_rpc_url")?,
114-
gateway_rpc_url: None,
120+
gateway_rpc_url,
115121
}),
116122
data_availability: None,
117123
};

0 commit comments

Comments
 (0)