Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d1b9080
Move new high level ctm commadn
Deniallugo Sep 4, 2025
ef91248
Remove redundant functions
Deniallugo Sep 4, 2025
95bb8df
fix lint
Deniallugo Sep 9, 2025
dedb756
Merge branch 'main' into deniallugo-refactor-ctm-commands
Deniallugo Sep 12, 2025
baf0257
More sync
Deniallugo Sep 12, 2025
0f6d3e1
Merge branch 'main' into deniallugo-refactor-ctm-commands
Deniallugo Sep 18, 2025
df84ae9
Update alloy
Deniallugo Sep 18, 2025
f3bd423
Merge branch 'main' into deniallugo-refactor-ctm-commands
Deniallugo Sep 25, 2025
f001339
More refactoring
Deniallugo Sep 25, 2025
5fb2ba5
Comment out skip contracts and update submodules
Deniallugo Sep 25, 2025
b7b2a4a
Comment out skip contracts and update submodules
Deniallugo Sep 25, 2025
fed51c2
Some refactoring
Deniallugo Sep 25, 2025
876d339
Probably fully functional
Deniallugo Sep 25, 2025
7afe56d
build contracts at least once
Deniallugo Sep 26, 2025
dd1ec8d
Return back skip and update args (now without a usage)
Deniallugo Sep 26, 2025
d580fc2
Fix upgrade test
Deniallugo Sep 26, 2025
756a1e8
Fix acceptance
Deniallugo Sep 26, 2025
b469949
Final fix
Deniallugo Sep 26, 2025
2f02fd0
Support registering zksync os
Deniallugo Sep 26, 2025
1ff3e76
Use local zksync os value
Deniallugo Sep 26, 2025
c1a37e1
Deploy second ctm if it exists
Deniallugo Sep 26, 2025
f9919d3
Small cleanup
Deniallugo Sep 27, 2025
bee2323
Return old commit
Deniallugo Sep 29, 2025
be0450d
fix legacy chain
Deniallugo Sep 29, 2025
b8d810c
Refactor rebuild files and submodule update
Deniallugo Sep 29, 2025
b516077
Fix linits
Deniallugo Sep 29, 2025
b6baedb
Fix bool values
Deniallugo Sep 29, 2025
010a4d0
Distibute to new operator
Deniallugo Sep 30, 2025
9b84867
small refactor
Deniallugo Sep 30, 2025
8700b85
Fix add set new ctm
Deniallugo Sep 30, 2025
704bda7
Slighlty refactor Ecosystem args
Deniallugo Sep 30, 2025
5786018
Fix redundant update submodules part
Deniallugo Sep 30, 2025
18d3230
Fix default params
Deniallugo Sep 30, 2025
781b6db
Support current contracts ecosystem config
Deniallugo Oct 2, 2025
135bba6
Move register ctm
Deniallugo Oct 6, 2025
345648e
Add correct spinners
Deniallugo Oct 6, 2025
818bd24
Use enum instead of bool for zksync os
Deniallugo Oct 7, 2025
44341ea
Merge branch 'main' into deniallugo-refactor-ctm-commands
Deniallugo Oct 7, 2025
b6bd62b
Fix review
Deniallugo Oct 8, 2025
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
5 changes: 2 additions & 3 deletions .github/workflows/ci-prover-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ jobs:
--base-token-price-denominator 1 \
--set-as-default true \
--ignore-prerequisites \
--evm-emulator false \
--update-submodules=true
--evm-emulator false

ci_run zkstack ecosystem init --dev --update-submodules=true --verbose
ci_run zkstack ecosystem init --dev --verbose

ci_run zkstack prover init --dev --verbose
WEB3_HTTP_URL=$(yq -e '.api.web3_json_rpc.http_url' < ./chains/proving_chain/configs/general.yaml)
Expand Down
4 changes: 0 additions & 4 deletions core/tests/highlevel-test-tools/src/create-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ export async function createChainAndStartServer(chainType: ChainType, testSuiteN
[
'chain',
'create',
'--update-submodules',
'false',
'--chain-name',
chainConfig.chainName,
'--chain-id',
Expand Down Expand Up @@ -228,8 +226,6 @@ export async function createChainAndStartServer(chainType: ChainType, testSuiteN
chainConfig.chainName,
'--validium-type',
'no-da',
'--update-submodules',
'false',
'--verbose'
],
chainConfig.chainName,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guides/launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To completely reset the dev environment:
--base-token-price-denominator 1 \
--set-as-default false \
--evm-emulator false \
--ignore-prerequisites --update-submodules false
--ignore-prerequisites
```

- Initialise `gateway` chain:
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/scripts/interop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ zkstack chain create \
--base-token-price-denominator 1 \
--set-as-default false \
--evm-emulator false \
--ignore-prerequisites --update-submodules false
--ignore-prerequisites

zkstack chain init \
--deploy-paymaster \
Expand All @@ -53,7 +53,7 @@ zkstack chain create \
--base-token-price-denominator 1 \
--set-as-default false \
--evm-emulator false \
--ignore-prerequisites --update-submodules false
--ignore-prerequisites

zkstack chain init \
--deploy-paymaster \
Expand Down
32 changes: 32 additions & 0 deletions zkstack_cli/crates/common/src/contracts.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::path::Path;

use xshell::{cmd, Shell};
use zksync_system_constants::L2_NATIVE_TOKEN_VAULT_ADDRESS;
use zksync_types::{ethabi::encode, web3::keccak256, Address, H256, U256};

use crate::cmd::Cmd;

Expand All @@ -27,3 +29,33 @@ pub fn build_system_contracts(shell: Shell, link_to_contracts: &Path) -> anyhow:
let _dir_guard = shell.push_dir(link_to_contracts.join("system-contracts"));
Ok(Cmd::new(cmd!(shell, "yarn build:foundry")).run()?)
}

pub fn install_yarn_dependencies(shell: &Shell, link_to_code: &Path) -> anyhow::Result<()> {
let _dir_guard = shell.push_dir(link_to_code);
Ok(Cmd::new(cmd!(shell, "yarn install")).run()?)
}

pub fn build_da_contracts(shell: &Shell, link_to_contracts: &Path) -> anyhow::Result<()> {
let _dir_guard = shell.push_dir(link_to_contracts);
Ok(Cmd::new(cmd!(shell, "yarn da build:foundry")).run()?)
}

pub fn rebuild_all_contracts(shell: &Shell, link_to_contracts: &Path) -> anyhow::Result<()> {
install_yarn_dependencies(shell, link_to_contracts)?;
build_l1_contracts(shell.clone(), link_to_contracts)?;
build_l1_da_contracts(shell.clone(), link_to_contracts)?;
build_l2_contracts(shell.clone(), link_to_contracts)?;
build_system_contracts(shell.clone(), link_to_contracts)?;
build_da_contracts(shell, link_to_contracts)?;
Ok(())
}

pub fn encode_ntv_asset_id(l1_chain_id: U256, addr: Address) -> H256 {
let encoded_data = encode(&[
ethers::abi::Token::Uint(l1_chain_id),
ethers::abi::Token::Address(L2_NATIVE_TOKEN_VAULT_ADDRESS),
ethers::abi::Token::Address(addr),
]);

H256(keccak256(&encoded_data))
}
29 changes: 21 additions & 8 deletions zkstack_cli/crates/config/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use anyhow::Context;
use serde::{Deserialize, Serialize, Serializer};
use xshell::Shell;
use zkstack_cli_common::files::find_file;
use zkstack_cli_types::{BaseToken, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation};
use zkstack_cli_types::{
BaseToken, L1BatchCommitmentMode, L1Network, ProverMode, VMOption, WalletCreation,
};
use zksync_basic_types::L2ChainId;

use crate::{
Expand Down Expand Up @@ -51,7 +53,9 @@ pub struct ChainConfigInternal {
#[serde(default)] // for backward compatibility
pub tight_ports: bool,
#[serde(default)] // for backward compatibility
pub zksync_os: bool,
pub vm_option: VMOption,
#[serde(skip_serializing_if = "Option::is_none")]
pub contracts_source_path: Option<PathBuf>,
}

/// Chain configuration file. This file is created in the chain
Expand All @@ -73,10 +77,11 @@ pub struct ChainConfig {
pub legacy_bridge: Option<bool>,
pub evm_emulator: bool,
pub tight_ports: bool,
pub zksync_os: bool,
pub vm_option: VMOption,
shell: OnceCell<Shell>,
self_path: PathBuf,
link_to_code: PathBuf,
contracts_source_path: Option<PathBuf>,
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -116,7 +121,8 @@ impl ChainConfig {
legacy_bridge: Option<bool>,
evm_emulator: bool,
tight_ports: bool,
zksync_os: bool,
vm_option: VMOption,
contracts_source_path: Option<PathBuf>,
) -> Self {
Self {
id,
Expand All @@ -137,7 +143,8 @@ impl ChainConfig {
legacy_bridge,
evm_emulator,
tight_ports,
zksync_os,
vm_option,
contracts_source_path,
}
}

Expand Down Expand Up @@ -239,7 +246,8 @@ impl ChainConfig {
legacy_bridge: self.legacy_bridge,
evm_emulator: self.evm_emulator,
tight_ports: self.tight_ports,
zksync_os: self.zksync_os,
vm_option: self.vm_option,
contracts_source_path: self.contracts_source_path.clone(),
}
}
pub(crate) fn from_internal(
Expand Down Expand Up @@ -273,7 +281,8 @@ impl ChainConfig {
tight_ports: chain_internal.tight_ports,
self_path: shell.current_dir(),
shell: shell.into(),
zksync_os: chain_internal.zksync_os,
vm_option: chain_internal.vm_option,
contracts_source_path: chain_internal.contracts_source_path.clone(),
})
}
}
Expand Down Expand Up @@ -316,7 +325,11 @@ impl ZkStackConfigTrait for ChainConfig {
}

fn contracts_path(&self) -> PathBuf {
self.link_to_code().join(CONTRACTS_PATH)
if let Some(contracts_path) = &self.contracts_source_path {
contracts_path.clone()
} else {
self.link_to_code().join(CONTRACTS_PATH)
}
}

fn path_to_foundry_scripts(&self) -> PathBuf {
Expand Down
Loading
Loading