Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions contracts/src/deploy-config/qanetl1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const config = {
contractAdmin: '0x7161DB99e6ffA72053f0817aBfaF2fDb4ab6ccC8',

// chainID config
l1ChainID: 900,
// hoodi chainID
l1ChainID: 560048,
l2ChainID: 53077,

// L1MessageQueue config
Expand Down Expand Up @@ -38,10 +39,10 @@ const config = {
stakingChallengerRewardPercentage: 50,
// register sequencers
l2SequencerAddresses: [
"0x25d36d94b64165f72a817ae0ff9bad2ce6914c70",
"0x4a1f64dec538835c125874e275edca367bf6022a",
"0xbb8605961105bb3dcd0e86ef94a1bf9fb2270a29",
"0x7d7201ad7da2b9b9ab9a36c454a3c2d55c4fbdd8"
"0x0000fD664ED5baAF56b058ba5F090E7B72A1aebA",
"0x00003484c8B3F3c66C8AC79f768747276f5EAdAB",
"0x00007F2eF2fd5EbE1fF350024D8FAa09102c764c",
"0x0000B25e20153327CB80a63cb21bE4F21597ca3D"
],
l2SequencerTmKeys: [
"0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb",
Expand Down
10 changes: 5 additions & 5 deletions ops/l2-genesis/deploy-config/qanet-deploy-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"l1ChainID": 900,
"l1ChainID": 560048,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify all dependent systems are updated for the chain ID change.

Changing the L1 chain ID from 900 to 560048 (Hoodi Chain) is a breaking change that affects L1 network connectivity, cross-chain operations, and any external integrations. Ensure all dependent systems, SDKs, and documentation are updated accordingly.

Run the following script to check for hardcoded references to the old chain ID:


🏁 Script executed:

#!/bin/bash
# Search for hardcoded references to the old chain ID (900)
rg -nP '\b900\b' -g '!*.json' -g '!.git/**' --type-not binary -C3

Length of output: 30


I'll correct the script and conduct a more comprehensive search for references to the old chain ID 900.


🏁 Script executed:

#!/bin/bash
# Search for hardcoded references to chain ID 900 in source files (not json or git)
echo "=== Searching for hardcoded '900' references in source files ==="
rg -nP '\b900\b' -g '!*.json' -g '!.git/**' -C3

echo ""
echo "=== Searching for chain ID references in config/constant files ==="
rg -nP '900|chainId|chain.*id' --type=ts --type=js --type=py -C2

echo ""
echo "=== Checking for qanet or chain ID in source files ==="
rg -nP 'qanet|hoodi|560048' -C2

Length of output: 306850


Action required — update all hardcoded L1 chain-ID references (900 → 560048).

Changing L1 from 900 to 560048 is a breaking, network-level change. Search found hardcoded 900 in deployment, runtime, test and contract code. Update these references (or make the value configurable), coordinate a rollout with node operators/validators, and run full integration tests.

High‑priority locations to update now:

  • git/tx-submitter/types/blob_params.go (DevnetChainConfig / ChainConfigMap).
  • git/ops/docker/layer1/docker-compose.yml (geth --networkid=900).
  • git/ops/docker/docker-compose-4nodes.yml and git/node/ops-morph/docker-compose*.yml (MORPH_NODE_L1_CHAIN_ID=900, TX_SUBMITTER_CHAIN_ID=900).
  • git/contracts/hardhat.config.ts (l1/qanetl1 chainId: 900).
  • git/contracts/src/deploy-config/l1.ts, testnetl1.ts (l1ChainID: 900).
  • git/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go (L1ChainID: 900).

Recommended next steps:

  • Run a repo-wide search for '\b900\b' and review each hit; update deployment scripts, env vars, genesis files, tests, and docs.
  • Coordinate an ops/validator cutover plan (node configs, JWT/engine auth, re-initialize/geth network IDs if needed).
  • Update CI/Hardhat tasks and re-run unit + integration tests before merging.
🤖 Prompt for AI Agents
In ops/l2-genesis/deploy-config/qanet-deploy-config.json around line 2 the L1
chain ID is hardcoded as 900 and must be changed to 560048; update the value to
560048 and ensure the same replacement (or make it configurable via an
env/central config) across all hardcoded occurrences listed in the review
(git/tx-submitter/types/blob_params.go DevnetChainConfig/ChainConfigMap,
docker-compose files with geth --networkid and
MORPH_NODE_L1_CHAIN_ID/TX_SUBMITTER_CHAIN_ID, contracts hardhat.config.ts
l1/qanetl1 chainId, contracts/src/deploy-config/*.ts l1ChainID, and
layer_two_test.go L1ChainID), run a repo-wide search for '\b900\b' to find and
update any additional hits, update CI/Hardhat tasks and deployment scripts
accordingly, and coordinate a rollout with node operators/validators and full
integration tests before merging.

"l2ChainID": 53077,
"finalSystemOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E",
"proxyAdminOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E",
Expand Down Expand Up @@ -34,10 +34,10 @@
"l2StakingUnDelegatedLockEpochs": 2,
"l2StakingRewardStartTime": 1728000000,
"l2StakingAddresses": [
"0x675cfc328f9f2e79a51e499b2be44462270572fe",
"0xb096665645994775eeba8aa114752d569734dcb4",
"0x3a587733d38e5487d2a7e81d84625f25c99ab3a1",
"0xb6346ded94fc61b637763610d0c59846b7781080"
"0x0000fD664ED5baAF56b058ba5F090E7B72A1aebA",
"0x00003484c8B3F3c66C8AC79f768747276f5EAdAB",
"0x00007F2eF2fd5EbE1fF350024D8FAa09102c764c",
"0x0000B25e20153327CB80a63cb21bE4F21597ca3D"
],
"l2StakingTmKeys": [
"0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb",
Expand Down
14 changes: 7 additions & 7 deletions ops/l2-genesis/qanet-l2genesis.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -eu

source ../../contracts/.env
source ../../contracts/.env.qa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix shell portability issue.

The script uses #!/bin/sh but the source command is bash-specific, not POSIX-compliant. Either change the shebang to #!/bin/bash or use the POSIX-compliant . (dot) command.

Apply this diff to fix the portability issue:

-source ../../contracts/.env.qa
+. ../../contracts/.env.qa

Or alternatively, update the shebang:

-#!/bin/sh
+#!/bin/bash
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
source ../../contracts/.env.qa
. ../../contracts/.env.qa
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 4-4: In POSIX sh, 'source' in place of '.' is undefined.

(SC3046)

🤖 Prompt for AI Agents
In ops/l2-genesis/qanet-l2genesis.sh around line 4, the script uses the
bash-only `source` command while the shebang is `#!/bin/sh`; replace `source
../../contracts/.env.qa` with the POSIX-compliant `. ../../contracts/.env.qa` to
keep the `#!/bin/sh` shebang, or alternatively change the shebang to
`#!/bin/bash` if you intend to rely on bash features—apply one of these two
fixes so the script is portable and consistent.

QANET=".qanet"
CONTRACT_CONFIG="../../contracts/src/deploy-config/qanetl1.ts"
echo "Regenerating genesis files"
Expand All @@ -28,15 +28,15 @@ go run cmd/main.go genesis l2 \
--outfile.genbatchheader $QANET/genesis-batch-header.json
touch "$QANET/done"
)
l2_genesis_state_root=$(cat $QANET/rollup.json | jq -r .l2_genesis_state_root)
withdraw_root=$(cat $QANET/rollup.json | jq -r .withdraw_root)
# l2_genesis_state_root=$(cat $QANET/rollup.json | jq -r .l2_genesis_state_root)
# withdraw_root=$(cat $QANET/rollup.json | jq -r .withdraw_root)
genesis_batch_header=$(cat $QANET/rollup.json | jq -r .genesis_batch_header)

echo "Replacing l2_genesis_state_root: $l2_genesis_state_root"
sed -i "s#rollupGenesisStateRoot: '.*'#rollupGenesisStateRoot: '$l2_genesis_state_root'#g" $CONTRACT_CONFIG
# echo "Replacing l2_genesis_state_root: $l2_genesis_state_root"
# sed -i "s#rollupGenesisStateRoot: '.*'#rollupGenesisStateRoot: '$l2_genesis_state_root'#g" $CONTRACT_CONFIG

echo "Replacing withdraw_root: $withdraw_root"
sed -i "s#withdrawRoot: '.*'#withdrawRoot: '$withdraw_root'#g" $CONTRACT_CONFIG
# echo "Replacing withdraw_root: $withdraw_root"
# sed -i "s#withdrawRoot: '.*'#withdrawRoot: '$withdraw_root'#g" $CONTRACT_CONFIG

echo "Replacing genesis_batch_header: $genesis_batch_header"
sed -i "s#batchHeader: '.*'#batchHeader: '$genesis_batch_header'#g" $CONTRACT_CONFIG
Loading