Skip to content

Commit ae65b18

Browse files
committed
feat(zkstack): Add zksync_os flag for ecosystem init
Signed-off-by: Danil <[email protected]>
1 parent ef21c1a commit ae65b18

File tree

7 files changed

+25
-1
lines changed

7 files changed

+25
-1
lines changed

zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ pub struct DeployL1Config {
142142
pub support_l2_legacy_shared_bridge_test: bool,
143143
pub contracts: ContractsDeployL1Config,
144144
pub tokens: TokensDeployL1Config,
145+
pub is_zk_sync_os: bool,
145146
}
146147

147148
impl FileConfigTrait for DeployL1Config {}
@@ -155,8 +156,10 @@ impl DeployL1Config {
155156
testnet_verifier: bool,
156157
l1_network: L1Network,
157158
support_l2_legacy_shared_bridge_test: bool,
159+
zksync_os: bool,
158160
) -> Self {
159161
Self {
162+
is_zk_sync_os: zksync_os,
160163
era_chain_id,
161164
testnet_verifier,
162165
owner_address: wallets_config.governor.address,

zkstack_cli/crates/zkstack/src/commands/ecosystem/args/init.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::{
1717
MSG_BRIDGEHUB, MSG_DEPLOY_ECOSYSTEM_PROMPT, MSG_DEPLOY_ERC20_PROMPT, MSG_DEV_ARG_HELP,
1818
MSG_L1_RPC_URL_HELP, MSG_L1_RPC_URL_INVALID_ERR, MSG_NO_PORT_REALLOCATION_HELP,
1919
MSG_OBSERVABILITY_HELP, MSG_OBSERVABILITY_PROMPT, MSG_RPC_URL_PROMPT,
20-
MSG_SERVER_COMMAND_HELP, MSG_SERVER_DB_NAME_HELP, MSG_SERVER_DB_URL_HELP,
20+
MSG_SERVER_COMMAND_HELP, MSG_SERVER_DB_NAME_HELP, MSG_SERVER_DB_URL_HELP, MSG_ZKSYNC_OS,
2121
},
2222
};
2323

@@ -127,6 +127,8 @@ pub struct EcosystemInitArgs {
127127
pub server_command: Option<String>,
128128
#[clap(long, help = MSG_BRIDGEHUB)]
129129
pub bridgehub: Option<String>,
130+
#[clap(long, help = MSG_ZKSYNC_OS)]
131+
pub zksync_os: bool,
130132
}
131133

132134
impl EcosystemInitArgs {
@@ -153,6 +155,7 @@ impl EcosystemInitArgs {
153155
validium_args,
154156
support_l2_legacy_shared_bridge_test,
155157
bridgehub,
158+
zksync_os,
156159
..
157160
} = self;
158161

@@ -213,6 +216,7 @@ impl EcosystemInitArgs {
213216
.unwrap_or_default(),
214217
bridgehub_address,
215218
deploy_ecosystem,
219+
zksync_os,
216220
})
217221
}
218222
}
@@ -231,6 +235,7 @@ pub struct EcosystemInitArgsFinal {
231235
pub support_l2_legacy_shared_bridge_test: bool,
232236
pub bridgehub_address: Option<H160>,
233237
pub deploy_ecosystem: bool,
238+
pub zksync_os: bool,
234239
}
235240

236241
#[derive(Debug, Clone, Serialize, Deserialize, Parser)]
@@ -302,6 +307,8 @@ pub struct InitNewCTMArgs {
302307
pub support_l2_legacy_shared_bridge_test: Option<bool>,
303308
#[clap(long, help = MSG_BRIDGEHUB)]
304309
pub bridgehub: Option<String>,
310+
#[clap(long, help = MSG_ZKSYNC_OS)]
311+
pub zksync_os: bool,
305312
}
306313

307314
impl InitNewCTMArgs {
@@ -316,6 +323,7 @@ impl InitNewCTMArgs {
316323
skip_contract_compilation_override,
317324
support_l2_legacy_shared_bridge_test,
318325
bridgehub,
326+
zksync_os,
319327
} = self;
320328

321329
// Fill ecosystem args
@@ -340,6 +348,7 @@ impl InitNewCTMArgs {
340348
support_l2_legacy_shared_bridge_test: support_l2_legacy_shared_bridge_test
341349
.unwrap_or(false),
342350
bridgehub_address,
351+
zksync_os,
343352
})
344353
}
345354
}
@@ -352,6 +361,7 @@ pub struct InitNewCTMArgsFinal {
352361
pub skip_contract_compilation_override: bool,
353362
pub support_l2_legacy_shared_bridge_test: bool,
354363
pub bridgehub_address: Option<H160>,
364+
pub zksync_os: bool,
355365
}
356366

357367
impl From<EcosystemInitArgsFinal> for InitNewCTMArgsFinal {
@@ -363,6 +373,7 @@ impl From<EcosystemInitArgsFinal> for InitNewCTMArgsFinal {
363373
skip_contract_compilation_override: args.skip_contract_compilation_override,
364374
support_l2_legacy_shared_bridge_test: args.support_l2_legacy_shared_bridge_test,
365375
bridgehub_address: args.bridgehub_address,
376+
zksync_os: args.zksync_os,
366377
}
367378
}
368379
}

zkstack_cli/crates/zkstack/src/commands/ecosystem/build_transactions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub async fn run(args: BuildTransactionsArgs, shell: &Shell) -> anyhow::Result<(
5151
false,
5252
false,
5353
None,
54+
false,
5455
)
5556
.await?;
5657

zkstack_cli/crates/zkstack/src/commands/ecosystem/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub async fn deploy_l1(
5151
broadcast: bool,
5252
support_l2_legacy_shared_bridge_test: bool,
5353
bridgehub_address: Option<H160>,
54+
zksync_os: bool,
5455
) -> anyhow::Result<ContractsConfig> {
5556
let deploy_config_path = DEPLOY_ECOSYSTEM_SCRIPT_PARAMS.input(&config.path_to_l1_foundry());
5657
let genesis_config_path = config.default_configs_path().join(GENESIS_FILE);
@@ -67,6 +68,7 @@ pub async fn deploy_l1(
6768
config.prover_version == ProverMode::NoProofs,
6869
config.l1_network,
6970
support_l2_legacy_shared_bridge_test,
71+
zksync_os,
7072
);
7173
deploy_config.save(shell, deploy_config_path)?;
7274

@@ -138,6 +140,8 @@ pub async fn deploy_l1_core_contracts(
138140
config.prover_version == ProverMode::NoProofs,
139141
config.l1_network,
140142
support_l2_legacy_shared_bridge_test,
143+
// ZKSync OS flag is not used in core contracts deployment
144+
false,
141145
);
142146

143147
deploy_config.save(shell, deploy_config_path)?;

zkstack_cli/crates/zkstack/src/commands/ecosystem/init.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ async fn init_ecosystem(
134134
initial_deployment_config,
135135
init_args.support_l2_legacy_shared_bridge_test,
136136
init_args.bridgehub_address,
137+
init_args.zksync_os,
137138
)
138139
.await?;
139140
contracts.save_with_base_path(shell, &ecosystem_config.config)?;

zkstack_cli/crates/zkstack/src/commands/ecosystem/init_new_ctm.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ async fn init_ctm(
7979
initial_deployment_config,
8080
init_args.support_l2_legacy_shared_bridge_test,
8181
init_args.bridgehub_address, // Scripts are expected to consume 0 address for BH
82+
init_args.zksync_os,
8283
)
8384
.await?;
8485
contracts.save_with_base_path(shell, &ecosystem_config.config)?;
@@ -93,6 +94,7 @@ pub async fn deploy_new_ctm(
9394
initial_deployment_config: &InitialDeploymentConfig,
9495
support_l2_legacy_shared_bridge_test: bool,
9596
bridgehub_address: Option<H160>,
97+
zksync_os: bool,
9698
) -> anyhow::Result<ContractsConfig> {
9799
let l1_rpc_url = ecosystem.l1_rpc_url.clone();
98100
let spinner = Spinner::new(MSG_DEPLOYING_ECOSYSTEM_CONTRACTS_SPINNER);
@@ -106,6 +108,7 @@ pub async fn deploy_new_ctm(
106108
true,
107109
support_l2_legacy_shared_bridge_test,
108110
bridgehub_address,
111+
zksync_os,
109112
)
110113
.await?;
111114
spinner.finish();

zkstack_cli/crates/zkstack/src/messages.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,3 +662,4 @@ pub(super) const MSG_AVAIL_BRIDGE_API_URL_PROMPT: &str = "Attestation bridge API
662662
pub(super) const MSG_AVAIL_SEED_PHRASE_PROMPT: &str = "Seed phrase";
663663
pub(super) const MSG_AVAIL_GAS_RELAY_API_KEY_PROMPT: &str = "Gas relay API key";
664664
pub(super) const MSG_INVALID_URL_ERR: &str = "Invalid URL format";
665+
pub(super) const MSG_ZKSYNC_OS: &str = "Deploy CTM for zksync os flag";

0 commit comments

Comments
 (0)