Skip to content

Commit c393210

Browse files
committed
feat(zkstack): Change places of deploy scripts
Signed-off-by: Danil <[email protected]>
1 parent 8b2c1a0 commit c393210

File tree

5 files changed

+15
-57
lines changed

5 files changed

+15
-57
lines changed

contracts

Submodule contracts updated 113 files

zkstack_cli/crates/config/src/forge_interface/script_params.rs

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,49 +27,49 @@ impl ForgeScriptParams {
2727
pub const DEPLOY_CTM_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
2828
input: "script-config/config-deploy-ctm.toml",
2929
output: "script-out/output-deploy-ctm.toml",
30-
script_path: "deploy-scripts/DeployCTM.s.sol",
30+
script_path: "deploy-scripts/ctm/DeployCTM.s.sol",
3131
};
3232

3333
pub const DEPLOY_ECOSYSTEM_CORE_CONTRACTS_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
3434
input: "script-config/config-deploy-l1.toml",
3535
output: "script-out/output-deploy-l1.toml",
36-
script_path: "deploy-scripts/DeployL1CoreContracts.s.sol",
36+
script_path: "deploy-scripts/ecosystem/DeployL1CoreContracts.s.sol",
3737
};
3838

3939
pub const REGISTER_CTM_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
4040
input: "script-config/config-register-ctm-l1.toml",
4141
output: "script-out/register-ctm-l1.toml",
42-
script_path: "deploy-scripts/RegisterCTM.s.sol",
42+
script_path: "deploy-scripts/ecosystem/RegisterCTM.s.sol",
4343
};
4444

4545
pub const DEPLOY_L2_CONTRACTS_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
4646
input: "script-config/config-deploy-l2-contracts.toml",
4747
output: "script-out/output-deploy-l2-contracts.toml",
48-
script_path: "deploy-scripts/DeployL2Contracts.sol",
48+
script_path: "deploy-scripts/chain/DeployL2Contracts.sol",
4949
};
5050

5151
pub const REGISTER_CHAIN_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
5252
input: "script-config/register-zk-chain.toml",
5353
output: "script-out/output-register-zk-chain.toml",
54-
script_path: "deploy-scripts/RegisterZKChain.s.sol",
54+
script_path: "deploy-scripts/ctm/RegisterZKChain.s.sol",
5555
};
5656

5757
pub const REGISTER_ON_ALL_CHAINS_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
5858
input: "script-config/register-on-all-chains.toml",
5959
output: "script-out/output-register-on-all-chains.toml",
60-
script_path: "deploy-scripts/RegisterOnAllChains.s.sol",
60+
script_path: "deploy-scripts/ecosystem/RegisterOnAllChains.s.sol",
6161
};
6262

6363
pub const DEPLOY_ERC20_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
6464
input: "script-config/config-deploy-erc20.toml",
6565
output: "script-out/output-deploy-erc20.toml",
66-
script_path: "deploy-scripts/DeployErc20.s.sol",
66+
script_path: "deploy-scripts/tokens/DeployErc20.s.sol",
6767
};
6868

6969
pub const DEPLOY_PAYMASTER_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
7070
input: "script-config/config-deploy-paymaster.toml",
7171
output: "script-out/output-deploy-paymaster.toml",
72-
script_path: "deploy-scripts/DeployPaymaster.s.sol",
72+
script_path: "deploy-scripts/chain/DeployPaymaster.s.sol",
7373
};
7474

7575
pub const ACCEPT_GOVERNANCE_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {
@@ -87,7 +87,7 @@ pub const SETUP_LEGACY_BRIDGE: ForgeScriptParams = ForgeScriptParams {
8787
pub const ENABLE_EVM_EMULATOR_PARAMS: ForgeScriptParams = ForgeScriptParams {
8888
input: "script-config/enable-evm-emulator.toml",
8989
output: "script-out/output-enable-evm-emulator.toml",
90-
script_path: "deploy-scripts/EnableEvmEmulator.s.sol",
90+
script_path: "deploy-scripts/chain/EnableEvmEmulator.s.sol",
9191
};
9292

9393
pub const GATEWAY_UTILS_SCRIPT_PATH: &str = "deploy-scripts/gateway/GatewayUtils.s.sol";
@@ -110,40 +110,19 @@ pub const GATEWAY_VOTE_PREPARATION: ForgeScriptParams = ForgeScriptParams {
110110
script_path: "deploy-scripts/gateway/GatewayVotePreparation.s.sol",
111111
};
112112

113-
pub const GATEWAY_GOVERNANCE_TX_PATH1: &str =
114-
"contracts/l1-contracts/script-out/gateway-deploy-governance-txs-1.json";
115-
116113
pub const GATEWAY_MIGRATE_TOKEN_BALANCES_SCRIPT_PATH: &str =
117114
"deploy-scripts/gateway/GatewayMigrateTokenBalances.s.sol";
118115

119116
pub const V29_UPGRADE_ECOSYSTEM_PARAMS: ForgeScriptParams = ForgeScriptParams {
120117
input: "script-config/v29-upgrade-ecosystem.toml",
121118
output: "script-out/v29-upgrade-ecosystem.toml",
122-
script_path: "deploy-scripts/upgrade/EcosystemUpgrade_v29.s.sol",
119+
script_path: "deploy-scripts/upgrade/v29/EcosystemUpgrade_v29.s.sol",
123120
};
124121

125122
pub const V29_UPGRADE_CHAIN_PARAMS: ForgeScriptParams = ForgeScriptParams {
126123
input: "script-config/v29-upgrade-chain.toml",
127124
output: "script-out/v29-upgrade-chain.toml",
128-
script_path: "deploy-scripts/upgrade/ChainUpgrade_v29.s.sol",
129-
};
130-
131-
pub const ZK_OS_V28_1_UPGRADE_ECOSYSTEM_PARAMS: ForgeScriptParams = ForgeScriptParams {
132-
input: "script-config/zk-os-v28-1-upgrade-ecosystem.toml",
133-
output: "script-out/zk-os-v28-1-upgrade-ecosystem.toml",
134-
script_path: "deploy-scripts/upgrade/EcosystemUpgrade_v28_1_zk_os.s.sol",
135-
};
136-
137-
pub const ERA_V28_1_UPGRADE_ECOSYSTEM_PARAMS: ForgeScriptParams = ForgeScriptParams {
138-
input: "script-config/era-v28-1-upgrade-ecosystem.toml",
139-
output: "script-out/era-v28-1-upgrade-ecosystem.toml",
140-
script_path: "deploy-scripts/upgrade/EcosystemUpgrade_v28_1.s.sol",
141-
};
142-
143-
pub const ZK_OS_V28_1_UPGRADE_CHAIN_PARAMS: ForgeScriptParams = ForgeScriptParams {
144-
input: "script-config/zk-os-v28-1-upgrade-chain.toml",
145-
output: "script-out/zk-os-v28-1-upgrade-chain.toml",
146-
script_path: "deploy-scripts/upgrade/ChainUpgrade_v28_1_zk_os.s.sol",
125+
script_path: "deploy-scripts/upgrade/v29/ChainUpgrade_v29.s.sol",
147126
};
148127

149128
pub const FINALIZE_UPGRADE_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams {

zkstack_cli/crates/zkstack/src/commands/dev/commands/upgrades/default_chain_upgrade.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ async fn verify_next_batch_new_version(
6868
)
6969
})?;
7070
match upgrade_versions {
71-
UpgradeVersion::V28_1Vk | UpgradeVersion::V28_1VkEra => {
72-
ensure!(
73-
protocol_version >= ProtocolVersionId::Version28,
74-
"THe block does not yet contain the v28 upgrade"
75-
)
76-
}
77-
_ => ensure!(
71+
UpgradeVersion::V29InteropAFf => ensure!(
7872
protocol_version >= ProtocolVersionId::Version29,
7973
"THe block does not yet contain the v29 upgrade"
8074
),

zkstack_cli/crates/zkstack/src/commands/dev/commands/upgrades/default_ecosystem_upgrade.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ use zkstack_cli_config::{
1313
forge_interface::{
1414
deploy_ecosystem::input::GenesisInput,
1515
script_params::{
16-
ForgeScriptParams, ERA_V28_1_UPGRADE_ECOSYSTEM_PARAMS, FINALIZE_UPGRADE_SCRIPT_PARAMS,
17-
V29_UPGRADE_ECOSYSTEM_PARAMS, ZK_OS_V28_1_UPGRADE_ECOSYSTEM_PARAMS,
16+
ForgeScriptParams, FINALIZE_UPGRADE_SCRIPT_PARAMS, V29_UPGRADE_ECOSYSTEM_PARAMS,
1817
},
1918
upgrade_ecosystem::{
2019
input::{
@@ -190,17 +189,12 @@ async fn no_governance_prepare(
190189
.input(&ecosystem_config.path_to_foundry_scripts_for_ctm(vm_option));
191190

192191
let mut new_genesis = default_genesis_input;
193-
let mut new_version = new_genesis.protocol_version;
194-
// This part is needed for v28 upgrades only.
195-
if upgrade_version == &UpgradeVersion::V28_1Vk {
196-
new_version.patch += 1;
197-
}
192+
let new_version = new_genesis.protocol_version;
198193
new_genesis.protocol_version = new_version;
199194

200195
let gateway_upgrade_config = get_gateway_state_transition_config(ecosystem_config).await?;
201196

202197
let upgrade_specific_config = match upgrade_version {
203-
UpgradeVersion::V28_1Vk => EcosystemUpgradeSpecificConfig::V28,
204198
UpgradeVersion::V29InteropAFf => {
205199
let gateway_chain_config = get_local_gateway_chain_config(ecosystem_config)?;
206200
let gateway_validator_timelock_addr = gateway_chain_config
@@ -220,7 +214,6 @@ async fn no_governance_prepare(
220214
)])),
221215
})
222216
}
223-
UpgradeVersion::V28_1VkEra => EcosystemUpgradeSpecificConfig::V28,
224217
};
225218

226219
let ecosystem_upgrade = EcosystemUpgradeInput::new(
@@ -626,9 +619,7 @@ async fn no_governance_stage_2(
626619

627620
fn get_ecosystem_upgrade_params(upgrade_version: &UpgradeVersion) -> ForgeScriptParams {
628621
match upgrade_version {
629-
UpgradeVersion::V28_1Vk => ZK_OS_V28_1_UPGRADE_ECOSYSTEM_PARAMS,
630622
UpgradeVersion::V29InteropAFf => V29_UPGRADE_ECOSYSTEM_PARAMS,
631-
UpgradeVersion::V28_1VkEra => ERA_V28_1_UPGRADE_ECOSYSTEM_PARAMS,
632623
}
633624
}
634625

zkstack_cli/crates/zkstack/src/commands/dev/commands/upgrades/types.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ use zksync_web3_decl::jsonrpsee::core::Serialize;
88
)]
99
pub enum UpgradeVersion {
1010
V29InteropAFf,
11-
V28_1Vk,
12-
V28_1VkEra,
1311
}
1412

1513
impl UpgradeVersion {
1614
pub const fn get_default_upgrade_description_path(&self) -> &'static str {
1715
match self {
1816
UpgradeVersion::V29InteropAFf => "./l1-contracts/script-out/v29-upgrade-ecosystem.toml",
19-
UpgradeVersion::V28_1Vk => {
20-
"./l1-contracts/script-out/zk-os-v28-1-upgrade-ecosystem.toml"
21-
}
22-
UpgradeVersion::V28_1VkEra => "./l1-contracts/script-out/v28-1-upgrade-ecosystem.toml",
2317
}
2418
}
2519
}

0 commit comments

Comments
 (0)