Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3d36788
finished devnet 1
Nov 19, 2026
4d87c35
ops: run Morph L2 with native processes on public Hoodi (no Docker)
Nov 19, 2026
ad1d790
Merge branch 'main' into native-hoodi
Nov 25, 2026
1e8c729
ops(native-hoodi): make dryrun-fork.sh mine blocks on its own
Nov 25, 2026
492a15e
ops(native-hoodi): run the challenger service as an optional native p…
Nov 25, 2026
8c12f01
docs(native-hoodi): document running the challenger
Nov 25, 2026
34a20e8
ops(native-hoodi): top the challenger up to the target balance
Nov 25, 2026
a4e4683
ops(native-hoodi): take owner, admin and fee-recipient addresses from…
Nov 25, 2026
a143261
ops(native-hoodi): build node-2 from the genesis of L1_RUN, not run/l1
Nov 27, 2026
61fa94a
ops(native-hoodi): keep private keys out of the repository
Nov 30, 2026
8056bd3
ops(native-hoodi): keep private keys off command lines
Nov 30, 2026
75234bc
ops(native-hoodi): size the challenger top-up from the same balance r…
Nov 30, 2026
3151403
ops(native-hoodi): translate the script comments and messages to English
Nov 30, 2026
4bda90c
docs(native-hoodi): translate the runbook and the notes to English, a…
Nov 30, 2026
0037299
ops(native-hoodi): make deploy-l1.sh robust against relative paths, f…
Nov 30, 2026
cbcf45b
ops(native-hoodi): fix the RPC consistency proxy's handling of ranges…
Nov 30, 2026
1306003
ops(native-hoodi): resolve the run paths to absolute ones in morph-na…
Nov 30, 2026
85b3312
ops(native-hoodi): reset-env.sh sees every run directory; restart-tes…
Nov 30, 2026
38db72d
ops(native-hoodi): dryrun-fork.sh must not reuse an earlier run, leak…
Nov 30, 2026
a407a78
ops(native-hoodi): export-deployment.sh describes the selected run, a…
Nov 30, 2026
d4dcd92
ops(native-hoodi): a failed read is a failure in register-challenger,…
Nov 30, 2026
2002c43
ops(native-hoodi): smaller review fixes
Nov 30, 2026
1b696dc
docs(native-hoodi): fix submodule command, restore note, reset-env an…
Nov 30, 2026
b39a7d4
fix(native-hoodi): harden secret scan, init-secrets, nonce record, sw…
Nov 30, 2026
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
20 changes: 20 additions & 0 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import "./tasks/token_deploy"
import "./tasks/mainnet_upgrade"
import "./src/plugin"
import * as process from "process";
import { Wallet } from "ethers";

function getRemappings() {
return fs
Expand All @@ -41,6 +42,18 @@ const QA_URL = process.env.QA_RPC_URL || 'http://127.0.0.1:8545'
const SEPOLIA_URL = process.env.SEPOLIA_RPC_URL || 'http://127.0.0.1:8545'
const HOLESKY_URL = process.env.HOLESKY_RPC_URL || 'http://127.0.0.1:8545'
const HOODI_URL = process.env.HOODI_RPC_URL || 'http://127.0.0.1:8545'
// hoodidev: a private Morph L2 whose L1 is the public Ethereum Hoodi testnet. Unlike the networks above it does NOT
// fall back to the publicly known Anvil key: without DEPLOYER_PRIVATE_KEY (or with that public key) there is no
// signer, so a deployment fails instead of putting admin rights behind a key that anyone can use.
const PUBLIC_ANVIL_ADDRESS = '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
// a key is usable for hoodidev when it parses and is not the public Anvil account #0 (the key behind the fallback above)
const usableHoodidevKey = (pk?: string): boolean => {
if (!pk) return false
try { return new Wallet(pk).address.toLowerCase() !== PUBLIC_ANVIL_ADDRESS } catch (e) { return false }
}
const HOODIDEV_URL = process.env.HOODIDEV_RPC_URL || 'http://127.0.0.1:8545'
const HOODIDEV_PK = process.env.DEPLOYER_PRIVATE_KEY
const HOODIDEV_ACCOUNTS = usableHoodidevKey(HOODIDEV_PK) ? [HOODIDEV_PK as string] : []

module.exports = {
defaultNetwork: 'hardhat',
Expand Down Expand Up @@ -107,6 +120,13 @@ module.exports = {
gas: 'auto',
gasPrice: 'auto',
accounts: [DEPLOYER_PK]
},
hoodidev: {
url: HOODIDEV_URL,
chainId: 560048,
gas: 'auto',
gasPrice: 'auto',
accounts: HOODIDEV_ACCOUNTS
}
},
foundry: {
Expand Down
71 changes: 71 additions & 0 deletions contracts/src/deploy-config/hoodidev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// hoodidev: a private Morph L2 (chain 53077) whose L1 is the public Ethereum Hoodi testnet (chain 560048).
// Derived from l1.ts (the local devnet). Do NOT reuse hoodi.ts: that is Morph's official Hoodi deployment.
// Addresses that follow whoever runs the deploy come from the environment, not from this file: deploy-l1.sh derives them
// from the keys in env/secrets.env and exports them. An empty value is rejected by the deploy tasks (isAddress checks, or the
// contract constructor), so a missing variable stops the run instead of silently using someone else's address.
const addr = (name: string): string => process.env[name] || ''

const config = {
// Global configuration
contractAdmin: addr('MORPH_DEPLOYER_ADDRESS'),
l1FeeVaultRecipient: addr('MORPH_DEPLOYER_ADDRESS'),

l1WETHAddress: "",
l1USDCAddress: "",

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

// L1MessageQueue config
l1MessageQueueMaxGasLimit: 30000000,

// gasPriceOracle config
l2BaseFee: 0.1, // Gwei

// verify contract config
programVkey: '0x0084f08a14f8199f87e7ae6011336724ec187b3656859184f04c7e8f382a2902',
// rollup contract config
// initialize config
finalizationPeriodSeconds: 10,
rollupProofWindow: 86400,
proofRewardPercent: 70,
rollupDelayPeriod: 86400,

// challenge config
// `register` uses the keys in $batchSubmitterPks when they are set (deploy-l1.sh does); this list is only the fallback.
batchSubmitterAddresses: process.env.MORPH_BATCH_SUBMITTER_ADDRESS ? [process.env.MORPH_BATCH_SUBMITTER_ADDRESS] : [],
rollupChallenger: addr('MORPH_CHALLENGER_ADDRESS'),
// genesis config
// The genesis batch header comes out of the L2 genesis tool, so it is passed in through MORPH_BATCH_HEADER instead of
// being rewritten into this file (l1.ts is rewritten in place by the devnet's main.py). Empty means "not generated yet":
// the deploy driver refuses to run `initialize` without it.
batchHeader: process.env.MORPH_BATCH_HEADER || '',

// submitter initialize config
submitterOwner: addr('MORPH_DEPLOYER_ADDRESS'),
submitterChallengeDeposit: 0.01, // 0.01 ether (devnet: l1.ts uses 1)
submitterMinimumStake: 0.01, // 0.01 ether (devnet: l1.ts uses 1); `register` stakes this from the owner
submitterRewardPercentage: 100,
// register sequencers
l2SequencerAddresses: [
"0x783698dCDEBdc96785c5c60ED96113612bA09c2b",
"0x310824AA27a29D269d2F9C0a8563C0e3C98dD226",
"0x343C5154FFe47c8a07DF5ea6846404e68E9809A2",
"0xaaC606d51De6A5aBF0d1B9dbd5ed5Ff2Ac2e521B"
],
l2SequencerTmKeys: [
"0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb",
"0xb798eb74c06721d54c659e9ea2bc232a7f95e96d234cc87186b2ab8f43db6935",
"0xecffad01129786ba9c6293aa664f952894dc4019762804799dfa1ffb6e4ed040",
"0x8d29695bb4157c6960adb486be1d9a0c9f728524d09bffcc4f8932ed15221c4a"
],
l2SequencerBlsKeys: [
"0x00000000000000000000000000000000095ad465c2895ee825c7d4f1b60a18734db57d4108369e47c6e3a94ee15846f825c06dad5d98f503bd31ece1d9f94b11000000000000000000000000000000000c5d6ba04bc9b9674dd2acbfc5caed3976c1b8be2ec90a03d78dffe924648b4fba82225aff43c744310c6a60185b75ac000000000000000000000000000000000fce6be001c871a11b9db1c6c15f0a6999de5646941a74486206dc784f0b3ffe11799212f3f44ef754b4a0f1ecf85639000000000000000000000000000000000b2f06634e5ea719682c30911c94dfb560f0b7656b5c34a871ea035e3fe7b041885420f8fe1e251f1cce5cdb7514869e",
"0x0000000000000000000000000000000010173aeac4ff317e8e60493f962b91dbd27614e1f6594e17d18a02968bd1fd698b6703092ab8622cd22d6948d9421156000000000000000000000000000000000801aea15697ab4d7a808be45377e4f0d2f54857fdc04031e476402ff16c66a6cbcc5f09a84bf85400c8afbabed006600000000000000000000000000000000015fc71b2c4e81148274e6169c9c9aace8c34fa6030547650242b6c32527dd23a996416e32640bce4f495a0afabc7dbb900000000000000000000000000000000088c4a0dffccc96bce47aef0e176b129457a5f3ae1651b132ddb418e9f7b5850a38c6fec1be6d169eb88dc1619648bf4",
"0x0000000000000000000000000000000003fd9468a8ceffc1b696874517777ef8bfdc9a1bade95c480ee2624903e648c1caf01c65de5b4fda8876a3a0e8d9f0890000000000000000000000000000000004c02f3609a0f61d12fe737dcbb047d5253bd3ff905b55c0e0f932b476fd77d172a58b72ef0f506407870988dd6038220000000000000000000000000000000017fa5765899f60f7a58f8ccdaaa295cde55992231710672692ba6a71a4faa9572f728f438ded65576a570d57e19fd304000000000000000000000000000000001226138813bde98af3464ed03649d8c731bc4e5cb3d26b53bf7483f4105d18bbb3f19e23905119e156e7d003d2fd125c",
"0x00000000000000000000000000000000109bf02a2636c0dc1968b0a50db77251eb090c3e9f51e2a2bc60c4ac72213f41f01f0a34e92c2e0625bd62e28e27edb500000000000000000000000000000000139969bd92522113c0615659874d1fae311ad8152d0584c7b57ffc14927067486dcf86413c5684fccc1163ee2d45c1c1000000000000000000000000000000000f172603f70a0730d100ad6d28bde477195987062e8ade83b82d093935d956ff20ca768c26263577b094f1cb756adc400000000000000000000000000000000010dde3acca00b4ff1b4976500a8f97e92246f43f78cadc95c4993dfc4f4c501c33d42a4bf52587f4931287b59623149c"
],
}

export default config
45 changes: 42 additions & 3 deletions contracts/src/deploy-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,45 @@ import { ethers } from 'ethers'

const fs = require("fs")

// Public RPC endpoints sit behind several nodes: a read issued right after a mined write can reach a node that has not
// seen the block yet and fail (empty return data) or return stale state. Retrying the read is opt-in: with
// MORPH_READ_RETRIES unset (the default) behaviour is exactly as before, so local devnets are unaffected.
// Unset or empty keeps the default; anything else has to be a non-negative integer. (Number("15s") is NaN, and then
// `attempt >= READ_RETRIES` is never true: a persistent error would be retried forever.)
const nonNegativeInt = (name: string, fallback: number): number => {
const raw = process.env[name]
if (raw === undefined || raw.trim() === '') return fallback
const n = Number(raw)
if (!Number.isInteger(n) || n < 0) throw new Error(`${name} must be a non-negative integer, got "${raw}"`)
return n
}
const READ_RETRIES = nonNegativeInt('MORPH_READ_RETRIES', 0)
const READ_RETRY_DELAY_MS = nonNegativeInt('MORPH_READ_RETRY_DELAY_MS', 2000)

const matchesExpected = (actual: any, expected: any): boolean => {
if (ethers.utils.isAddress(expected)) {
return typeof actual === 'string' && actual.toLowerCase() === expected.toLowerCase()
}
return actual === expected || !!(actual && actual.eq && actual.eq(expected))
}

// Calls `read` until it succeeds and (if `expected` is given) matches, at most READ_RETRIES extra times.
// The final attempt is returned/thrown as-is so the caller's own assertion reports the real problem.
const readWithRetry = async (read: () => Promise<any>, expected?: any): Promise<any> => {
for (let attempt = 0; ; attempt++) {
const last = attempt >= READ_RETRIES
try {
const actual = await read()
if (last || expected === undefined || matchesExpected(actual, expected)) {
return actual
}
} catch (e) {
if (last) throw e
}
await sleep(READ_RETRY_DELAY_MS)
}
}

/**
* Helper function for asserting that a contract variable is set to the expected value.
*
Expand All @@ -28,9 +67,9 @@ export const assertContractVariable = async (
if (caller === null || !ethers.utils.isAddress(caller)) {
caller = ethers.constants.AddressZero
}
const actual = await temp.callStatic[variable]({
const actual = await readWithRetry(() => temp.callStatic[variable]({
from: caller,
})
}), expected)

if (ethers.utils.isAddress(expected)) {
assert(
Expand Down Expand Up @@ -60,7 +99,7 @@ export const assertContractVariableWithSigner = async (
contract.signer,
)

const actual = await temp.callStatic[variable]()
const actual = await readWithRetry(() => temp.callStatic[variable](), expected)

if (ethers.utils.isAddress(expected)) {
assert(
Expand Down
54 changes: 54 additions & 0 deletions ops/l2-genesis/deploy-config/hoodidev-deploy-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"l1ChainID": 560048,
"l2ChainID": 53077,
"finalSystemOwner": "REPLACE_WITH_DEPLOYER_ADDRESS",
"proxyAdminOwner": "REPLACE_WITH_DEPLOYER_ADDRESS",
"BLOCK_SIGNER_ADDRESS": "0xaEcFF2a7E677cEFa56643Ff0aD06e233a3FdC402",
"l1FeeVaultRecipient": "REPLACE_WITH_DEPLOYER_ADDRESS",
"sequencerFeeVaultRecipient": "REPLACE_WITH_DEPLOYER_ADDRESS",
"l2BridgeFeeVaultRecipient": "REPLACE_WITH_DEPLOYER_ADDRESS",
"fundDevAccounts": true,
"l1StartingBlockTag": "REPLACE_WITH_HOODI_START_BLOCK_HEX",
"maxTxPerBlock": 1000,
"maxTxPayloadBytesPerBlock": 737280,
"gasPriceOracleOverhead": 2500,
"gasPriceOracleScalar": 1000000000,
"gasPriceOracleOwner": "REPLACE_WITH_DEPLOYER_ADDRESS",
"govVotingDuration": 1000,
"govBatchBlockInterval": 200,
"govBatchTimeout": 600,
"govRollupEpoch": 100,
"recordOracleAddress": "REPLACE_WITH_DEPLOYER_ADDRESS",
"recordNextBatchSubmissionIndex": 1,
"morphTokenName": "Morph Token",
"morphTokenSymbol": "Morph",
"morphTokenOwner": "REPLACE_WITH_DEPLOYER_ADDRESS",
"morphTokenInitialSupply": 1000000000,
"morphTokenDailyInflationRate": 1,
"morph203Time": 0,
"viridianTime": 0,
"emeraldTime": 0,
"celadonTime": 0,
"l2StakingSequencerMaxSize": 4,
"l2StakingUnDelegatedLockEpochs": 2,
"l2StakingRewardStartTime": 1728000000,
"l2StakingAddresses": [
"0x783698dCDEBdc96785c5c60ED96113612bA09c2b",
"0x310824AA27a29D269d2F9C0a8563C0e3C98dD226",
"0x343C5154FFe47c8a07DF5ea6846404e68E9809A2",
"0xaaC606d51De6A5aBF0d1B9dbd5ed5Ff2Ac2e521B"
],
"l2StakingTmKeys": [
"0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb",
"0xb798eb74c06721d54c659e9ea2bc232a7f95e96d234cc87186b2ab8f43db6935",
"0xecffad01129786ba9c6293aa664f952894dc4019762804799dfa1ffb6e4ed040",
"0x8d29695bb4157c6960adb486be1d9a0c9f728524d09bffcc4f8932ed15221c4a"
],
"l2StakingBlsKeys": [
"0x00000000000000000000000000000000095ad465c2895ee825c7d4f1b60a18734db57d4108369e47c6e3a94ee15846f825c06dad5d98f503bd31ece1d9f94b11000000000000000000000000000000000c5d6ba04bc9b9674dd2acbfc5caed3976c1b8be2ec90a03d78dffe924648b4fba82225aff43c744310c6a60185b75ac000000000000000000000000000000000fce6be001c871a11b9db1c6c15f0a6999de5646941a74486206dc784f0b3ffe11799212f3f44ef754b4a0f1ecf85639000000000000000000000000000000000b2f06634e5ea719682c30911c94dfb560f0b7656b5c34a871ea035e3fe7b041885420f8fe1e251f1cce5cdb7514869e",
"0x0000000000000000000000000000000010173aeac4ff317e8e60493f962b91dbd27614e1f6594e17d18a02968bd1fd698b6703092ab8622cd22d6948d9421156000000000000000000000000000000000801aea15697ab4d7a808be45377e4f0d2f54857fdc04031e476402ff16c66a6cbcc5f09a84bf85400c8afbabed006600000000000000000000000000000000015fc71b2c4e81148274e6169c9c9aace8c34fa6030547650242b6c32527dd23a996416e32640bce4f495a0afabc7dbb900000000000000000000000000000000088c4a0dffccc96bce47aef0e176b129457a5f3ae1651b132ddb418e9f7b5850a38c6fec1be6d169eb88dc1619648bf4",
"0x0000000000000000000000000000000003fd9468a8ceffc1b696874517777ef8bfdc9a1bade95c480ee2624903e648c1caf01c65de5b4fda8876a3a0e8d9f0890000000000000000000000000000000004c02f3609a0f61d12fe737dcbb047d5253bd3ff905b55c0e0f932b476fd77d172a58b72ef0f506407870988dd6038220000000000000000000000000000000017fa5765899f60f7a58f8ccdaaa295cde55992231710672692ba6a71a4faa9572f728f438ded65576a570d57e19fd304000000000000000000000000000000001226138813bde98af3464ed03649d8c731bc4e5cb3d26b53bf7483f4105d18bbb3f19e23905119e156e7d003d2fd125c",
"0x00000000000000000000000000000000109bf02a2636c0dc1968b0a50db77251eb090c3e9f51e2a2bc60c4ac72213f41f01f0a34e92c2e0625bd62e28e27edb500000000000000000000000000000000139969bd92522113c0615659874d1fae311ad8152d0584c7b57ffc14927067486dcf86413c5684fccc1163ee2d45c1c1000000000000000000000000000000000f172603f70a0730d100ad6d28bde477195987062e8ade83b82d093935d956ff20ca768c26263577b094f1cb756adc400000000000000000000000000000000010dde3acca00b4ff1b4976500a8f97e92246f43f78cadc95c4993dfc4f4c501c33d42a4bf52587f4931287b59623149c"
],
"l1StakingProxy": "0x000000000000000000000000000000000000dEaD"
}
11 changes: 11 additions & 0 deletions ops/native-hoodi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# runtime data, binaries, secrets: never commit
/bin/
/run/
/deployments/
/env/secrets.env
/env/archive/
*.out
journal.rlp
submitter-leveldb/
__pycache__/
*.pyc
Loading
Loading