Skip to content

Commit 2f68611

Browse files
authored
fix: allow v{major}-devnet-{iteration} in --network (#20661)
I thought we allowed anything in `--network` now that we have AztecProtocol/networks but that's not the case. This will have to be backported to v4-devnet-2
2 parents 4017643 + b95a9ef commit 2f68611

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

yarn-project/cli/src/config/chain_l2_config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export function enrichEnvironmentWithChainName(networkName: NetworkNames) {
4545
}
4646

4747
// Apply generated network config from defaults.yml
48-
const generatedConfig = NetworkConfigs[networkName];
48+
// For devnet iterations (v4-devnet-1, etc.), use the base devnet config
49+
const configKey = /^v\d+-devnet-\d+$/.test(networkName) ? 'devnet' : networkName;
50+
const generatedConfig = NetworkConfigs[configKey];
4951
if (generatedConfig) {
5052
enrichEnvironmentWithNetworkConfig(generatedConfig);
5153
}

yarn-project/foundation/src/config/network_name.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export type NetworkNames =
55
| 'testnet'
66
| 'mainnet'
77
| 'next-net'
8-
| 'devnet';
8+
| 'devnet'
9+
| `v${number}-devnet-${number}`;
910

1011
export function getActiveNetworkName(name?: string): NetworkNames {
1112
const network = name || process.env.NETWORK;
@@ -23,6 +24,8 @@ export function getActiveNetworkName(name?: string): NetworkNames {
2324
return 'next-net';
2425
} else if (network === 'devnet') {
2526
return 'devnet';
27+
} else if (/^v\d+-devnet-\d+$/.test(network)) {
28+
return network as `v${number}-devnet-${number}`;
2629
}
2730
throw new Error(`Unknown network: ${network}`);
2831
}

0 commit comments

Comments
 (0)