Skip to content

Commit e7e930e

Browse files
0xVolosnikovslowlizksync-admin-bot2joonazanDeniallugo
authored
feat!: V27 update (#3580)
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## 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. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. - [ ] Documentation comments have been added / updated. --------- Signed-off-by: Danil <deniallugo@gmail.com> Co-authored-by: Alex Ostrovski <aov@matterlabs.dev> Co-authored-by: zksync-admin-bot2 <temp-bot@matterlabs.dev> Co-authored-by: Alex Ostrovski <slowli@users.noreply.github.com> Co-authored-by: Joonatan Saarhelo <joon.saar@gmail.com> Co-authored-by: Danil <deniallugo@gmail.com>
1 parent 4a356cd commit e7e930e

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub struct DeployGatewayCTMInput {
3939

4040
bootloader_hash: H256,
4141
default_aa_hash: H256,
42+
evm_emulator_hash: Option<H256>,
4243

4344
priority_tx_max_gas_limit: u64,
4445

@@ -109,6 +110,7 @@ impl DeployGatewayCTMInput {
109110

110111
bootloader_hash: genesis_input.bootloader_hash,
111112
default_aa_hash: genesis_input.default_aa_hash,
113+
evm_emulator_hash: genesis_input.evm_emulator_hash,
112114

113115
priority_tx_max_gas_limit: initial_deployment_config.priority_tx_max_gas_limit,
114116

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub async fn init_configs(
4949
chain_config: &ChainConfig,
5050
) -> anyhow::Result<ContractsConfig> {
5151
// Port scanner should run before copying configs to avoid marking initial ports as assigned
52-
let mut ecosystem_ports = EcosystemPortsScanner::scan(shell)?;
52+
let mut ecosystem_ports = EcosystemPortsScanner::scan(shell, Some(&chain_config.name))?;
5353
copy_configs(shell, &ecosystem_config.link_to_code, &chain_config.configs)?;
5454

5555
if !init_args.no_port_reallocation {

zkstack_cli/crates/zkstack/src/commands/chain/migrate_to_gateway.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ async fn await_for_tx_to_complete(
399399
if receipt.status == Some(U64::from(1)) {
400400
println!("Transaction completed successfully!");
401401
} else {
402-
panic!("Transaction failed!");
402+
panic!("Transaction failed! Receipt: {:?}", receipt);
403403
}
404404

405405
Ok(())

zkstack_cli/crates/zkstack/src/commands/dev/commands/genesis.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ pub(crate) async fn run(shell: &Shell) -> anyhow::Result<()> {
1717
.load_chain(Some(ecosystem.current_chain().to_string()))
1818
.context(MSG_CHAIN_NOT_FOUND_ERR)?;
1919
let spinner = Spinner::new(MSG_GENESIS_FILE_GENERATION_STARTED);
20-
let secrets_path = chain.path_to_secrets_config();
20+
let secrets_path = chain.path_to_secrets_config().canonicalize().unwrap();
2121
let dal = get_core_dal(shell, None).await?;
2222
reset_database(shell, ecosystem.link_to_code, dal).await?;
23+
let _a = shell.push_dir("core");
2324
Cmd::new(cmd!(shell,"cargo run --package genesis_generator --bin genesis_generator -- --config-path={secrets_path}")).run()?;
2425
spinner.finish();
2526
Ok(())

zkstack_cli/crates/zkstack/src/commands/dev/commands/status/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn print_status(health_check_url: String) -> anyhow::Result<()> {
9393
}
9494

9595
fn print_ports(shell: &Shell) -> anyhow::Result<()> {
96-
let ports = EcosystemPortsScanner::scan(shell)?;
96+
let ports = EcosystemPortsScanner::scan(shell, None)?;
9797
let grouped_ports = ports.group_by_file_path();
9898

9999
let mut all_port_lines: Vec<String> = Vec::new();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ pub(crate) async fn run(shell: &Shell) -> anyhow::Result<()> {
2828
Some(ref chain_name) => vec![chain_name.clone()],
2929
None => ecosystem_config.list_of_chains(),
3030
};
31-
let mut ports = EcosystemPortsScanner::scan(shell)?;
3231
// Initialize chains one by one
3332
let mut explorer_config = ExplorerConfig::read_or_create_default(shell)?;
3433
for chain_name in chains_enabled.iter() {
3534
// Load chain config
3635
let chain_config = ecosystem_config
3736
.load_chain(Some(chain_name.clone()))
3837
.context(msg_chain_load_err(chain_name))?;
38+
let mut ports = EcosystemPortsScanner::scan(shell, Some(&chain_config.name))?;
3939
// Build backend config - parameters required to create explorer backend services
4040
let backend_config = build_backend_config(&mut ports, &chain_config)?;
4141
// Initialize explorer database

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ async fn prepare_configs(
5050
en_configs_path: &Path,
5151
args: PrepareConfigFinal,
5252
) -> anyhow::Result<()> {
53-
let mut ports = EcosystemPortsScanner::scan(shell)?;
53+
// Reallocating ports for en required to use the current chain ports as well
54+
let mut ports = EcosystemPortsScanner::scan(shell, None)?;
5455
let genesis = config.get_genesis_config().await?;
5556
let general = config.get_general_config().await?;
5657
let gateway = config.get_gateway_chain_config().ok();

zkstack_cli/crates/zkstack/src/utils/ports.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ pub struct EcosystemPortsScanner;
205205
impl EcosystemPortsScanner {
206206
/// Scans the ecosystem directory for YAML files and extracts port information.
207207
/// Specifically, it looks for keys ending with "port" or "ports" and collects their values.
208-
pub fn scan(shell: &Shell) -> Result<EcosystemPorts> {
208+
/// We could skip searching ports in the current chain if we initialize this chain.
209+
/// It allows to reuse default ports even if the general file exist with previously allocated ports.
210+
/// It makes allocation more predictable
211+
pub fn scan(shell: &Shell, current_chain: Option<&str>) -> Result<EcosystemPorts> {
209212
let ecosystem_config = EcosystemConfig::from_file(shell)?;
210213

211214
// Create a list of directories to scan:
@@ -215,6 +218,12 @@ impl EcosystemPortsScanner {
215218
// - Ecosystem directory (docker-compose files)
216219
let mut dirs = vec![ecosystem_config.config.clone()];
217220
for chain in ecosystem_config.list_of_chains() {
221+
// skip current chain for avoiding wrong reallocation
222+
if let Some(name) = current_chain {
223+
if name.eq(&chain) {
224+
continue;
225+
}
226+
}
218227
if let Ok(chain_config) = ecosystem_config.load_chain(Some(chain)) {
219228
dirs.push(chain_config.configs.clone());
220229
if let Some(external_node_config_path) = &chain_config.external_node_config_path {

0 commit comments

Comments
 (0)