Single orchestrated deployment: BSC-parity 45-tx EVM + ChainRegistry peers (BSC, Terra Classic, Solana) #122
Labels
No labels
agent:implement
agent:ready
backend
bug
cannot-reproduce
confirmed
desktop
docs
documentation
duplicate
enhancement
feature
frontend
good first issue
help wanted
high-risk
in-review
invalid
mobile
needs-triage
P0-critical
P1-high
P2-medium
P3-low
qa
QA
question
ready
report
responsive
security
security-escalate
smart-contract
solana
tablet
test-pass
ux
wallet-issue
wallet:keplr
wallet:metamask
wallet:station
wallet:walletconnect
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-bridge-monorepo#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Deliver a single orchestrated deployment entrypoint that completes the canonical BSC-equivalent setup on a new EVM chain (e.g. MegaETH):
EVM layer: the full 45 outer transactions in historical BSC order (parity with
bsc-parity-golden.json), with only target-chain-specific parameters where appropriate (RPC, tailWETH/CHAIN_IDENTIFIER/THIS_CHAIN_ID, etc.—see GL-121 /docs/deployment-megaeth.md).Cross-chain registry layer: register all peer networks required for parity with mainnet BSC behavior on the new chain’s
ChainRegistry: BSC, Terra Classic, and Solana, using the same string identifiers andbytes4chain keys as production (not ad hoc MegaETH-only IDs for peers).This closes the gap after GL-121 (segmented
EvmParityReplay+ manual step 18) and the gap vsdeploy-evm-full.shPhase 6, which today wires Terra + peer EVM on BSC/opBNB but does not provide one MegaETH-sized single script.Motivation
cast send registerChainflows by hand.scripts/solana/register-chain-evm.sh). A new parity chain must mirror that peer matrix so routing matches BSC, differing only by this chain’s own identifier/bytes4 where applicable.Relationship to GL-121
runBroadcastHead/runBroadcastFaucet19/runBroadcastTail,parity-replay.sh.Canonical references
packages/contracts-evm/script/bsc-parity-golden.jsonpackages/contracts-evm/script/EvmParityReplay.s.soldocs/deployment-megaeth.mdscripts/deploy-evm-full.sh→register_cross_chainsregisterChain(string,bytes4)on EVM registries (Terra + peer EVM today; extend for MegaETH + Solana on new registry)scripts/solana/register-chain-evm.shChainRegistry(solana_mainnet-beta,0x00000005)scripts/megaeth/register-megaeth-on-chain-registry.shscripts/solana/register-chain-terra.shExecuteMsg::register_chain) — may be required for full meshCross-chain registration requirements (in scope)
A. On the new chain (after parity deploy exposes
ChainRegistryproxy)From the same scripting surface as the 45-tx deploy (or invoked immediately after with shared env), register peers so they match mainnet BSC’s peer set semantics:
bytes4keyevm_56BRIDGE_BSC_CHAIN_ID/ deployment constants)deploy-evm-full.sh/ frozen mainnet docsterraclassic_columbus-5BRIDGE_TERRA_CHAIN_IDin prodregister_cross_chainssolana_mainnet-beta0x00000005scripts/solana/register-chain-evm.shOrder and admin signing strategy should mirror
deploy-evm-full.shPhase 6 (interactivecast sendor documented equivalent). Do not omit Solana or Terra “because this chain is EVM-only”; the product requirement is parity with BSC configuration.B. Reverse registrations (so existing networks recognize the new chain)
Document and automate where feasible (may be separate substeps with distinct keys/RPCs):
ChainRegistry: register the new chain (e.g. MegaETHevm_4326/0x000010e6) — pattern inscripts/megaeth/register-megaeth-on-chain-registry.sh.register_chainfor the new EVM identifier + bytes4 (see Terra deployment docs /ExecuteMsg::RegisterChain).docs/deployment-solana-mainnet.md(if applicable).Exact Terra/Solana message shapes must match existing mainnet scripts; no new identifier schemes unless product explicitly changes.
EVM sequence requirements (unchanged from prior draft)
runDryCheckPASS (or fails first), then nonces 0–17 (runBroadcastHead), step 18 (Nick CREATE2 — strategy documented), nonce 19 (runBroadcastFaucet19), nonces 20–44 (runBroadcastTail)..env.examplefor MegaETH-class runs.Non-goals (narrow)
TokenRegistrydestinations) unless explicitly added as a follow-up—this issue must at minimum cover ChainRegistry peer registration for BSC / Terra / Solana in both directions as required for routing parity.Acceptance criteria
ChainRegistrywith production-identical(identifier, bytes4)peers.deployment-megaeth.md,deployment-guide.md§4.2a) updated so operators see one checklist: EVM 45-tx + peer mesh.Correction note (scope clarification)
Earlier drafts treated Terra/Solana as out of scope. That was wrong. The 45-tx sequence is EVM-only, but full BSC-equivalent setup includes registering BSC, Terra Classic, and Solana as peers—the same cross-chain surface area operators rely on after
deploy-evm-full.shPhase 6.marked this issue as related to #121
changed title from
Single orchestrated EVM deployment script: full BSC-parity 45-tx sequence (target chain identity only)toSingle orchestrated deployment: BSC-parity 45-tx EVM + ChainRegistry peers (BSC, Terra Classic, Solana)changed the description
Correction: Initial issue text incorrectly scoped out Terra/Solana. Full BSC-equivalent setup includes ChainRegistry registration of peer chains (BSC, Terra Classic, Solana) with production-identical identifiers/bytes4—not only varying target chain id on the 45 EVM txs. Description updated to match.
Addendum: canonical role addresses and gas preflight (product requirement)
The GL-122 single orchestrated deploy must default the following (overridable only for non-production / explicit opt-in):
0xD699EbC6930F593f0725D2a7dC58ACC65b41a08eDEPLOYER_ADDRESS0xCd4Eb82CFC16d5785b4f7E3bFC255E735e79F39cADMIN_ADDRESS0x1d9e02e0e8c000FE4575c4Aaea96B19De00404CDOPERATOR_ADDRESS0x732A65b80F4625658EbD2B4214E4f8Cf3A67AEEBCANCELER_ADDRESS(for preflight; deploy scripts may not consume)FEE_RECIPIENT_ADDRESSremains org policy (document in runbook; often admin or a fee vault).Preflight (before any broadcast)
RPC_URL../scripts/evm/bsc-parity-preflight.sh: enforces (1) and a conservative minimum deployer balance viaMIN_FULL_DEPLOY_BALANCE_WEI(default2e18wei; operators lower only after gas estimation on that chain).Docs
docs/deployment-megaeth.md§5.0 documents the table and preflight.Acceptance (append to GL-122)
MIN_FULL_DEPLOY_BALANCE_WEI.Registering the new chain (eg megaeth) on other evm (eg bsc), terraclassic, solana, should be through seperate one run scripts for each
mentioned in commit
566d0db854Implemented (main
566d0db)Orchestration
scripts/evm/deploy-bsc-parity-orchestrate.sh— canonical defaults forDEPLOYER_ADDRESS,ADMIN_ADDRESS,OPERATOR_ADDRESS,CANCELER_ADDRESS; Phase 0 preflight → Phase 1runDryCheck→ Phase 2runBroadcastHead→ Phase 3 guided Nick CREATE2 step 18 (nonce 18→19) → Phase 4runBroadcastFaucet19→ Phase 5runBroadcastTail→ Phase 6 optional peer registration whenCHAIN_REGISTRY_ADDRESSis set.Preflight & peers
scripts/evm/bsc-parity-preflight.sh— balance gates (MIN_FULL_DEPLOY_BALANCE_WEI, deployer/operator/canceler > 0).scripts/evm/register-parity-peers-on-registry.sh— registers evm_56 / terraclassic_columbus-5 / solana_mainnet-beta with production bytes4 values (PEER_*override supported).Docs / agents
docs/deployment-megaeth.md— §5.0 roles/preflight, §5.2a orchestrator + INV-GL122-*, §5.5 reverse registration (separate scripts per destination).docs/deployment-guide.md§4.2a cross-linked.skills/agent-evm-bsc-parity-replay.md— GL-122 workflows + INV refs.Tests:
forge test --match-contract BscParityReplayDryRunPASS.Verification checklist
docs/deployment-megaeth.md; confirm peer tuples match prod (deploy-evm-full.sh/ Solana helper semantics)../scripts/evm/parity-replay.sh dry-check→ PARITY_CHECK: PASS with historical deployer../scripts/evm/bsc-parity-preflight.shexits 0 with sane balances.0xb55a..., nonce 19 → tail completes (with correct forge env for legacy/tail).register-parity-peers-on-registry.shor orchestrator Phase 6 registers three peers;isChainRegistered(bytes4)true for0x00000038,0x00000001,0x00000005.Closing per GL-122 acceptance.
mentioned in commit
125fcc118bImplemented (main
566d0db)Orchestration
scripts/evm/deploy-bsc-parity-orchestrate.sh— canonical defaults forDEPLOYER_ADDRESS,ADMIN_ADDRESS,OPERATOR_ADDRESS,CANCELER_ADDRESS; Phase 0 preflight → Phase 1runDryCheck→ Phase 2runBroadcastHead→ Phase 3 guided Nick CREATE2 step 18 (nonce 18→19) → Phase 4runBroadcastFaucet19→ Phase 5runBroadcastTail→ Phase 6 optional peer registration whenCHAIN_REGISTRY_ADDRESSis set.Preflight & peers
scripts/evm/bsc-parity-preflight.sh— balance gates (MIN_FULL_DEPLOY_BALANCE_WEI, deployer/operator/canceler native balance > 0).scripts/evm/register-parity-peers-on-registry.sh— registers evm_56 / terraclassic_columbus-5 / solana_mainnet-beta with production bytes4 values (PEER_*override supported).Docs / agents
docs/deployment-megaeth.md— §5.0 roles/preflight, §5.2a orchestrator + INV-GL122-*, §5.5 reverse registration (separate scripts per destination).docs/deployment-guide.md§4.2a cross-linked.skills/agent-evm-bsc-parity-replay.md— GL-122 workflows + INV refs.Tests:
forge test --match-contract BscParityReplayDryRunPASS.Verification checklist
docs/deployment-megaeth.md; confirm peer tuples match prod (deploy-evm-full.sh/ Solana helper semantics)../scripts/evm/parity-replay.sh dry-check→ PARITY_CHECK: PASS with historical deployer../scripts/evm/bsc-parity-preflight.shexits 0 with sane balances.0xb55a2348487d743bad8d1e4484e31ebebab2c1ee2b75dd17fb1e3b2d20036dfb, nonce 19 → tail completes (with correct forge env for legacy/tail).register-parity-peers-on-registry.shor orchestrator Phase 6 registers three peers;isChainRegistered(bytes4)true for0x00000038,0x00000001,0x00000005.Closing per GL-122 acceptance.
mentioned in commit
a4063d368c