Repository navigation
contracts: generate CGTv2 direct upgrade deposits - #570
Conversation
f785ced to
f815d31
Compare
3c8915e to
8c7d7a1
Compare
Generate the final 15-step CGTv2 group through existing v6 proxy methods. Deploy six implementations and initialize the bridge, controller and fee vault without Karst manager backports or initializer resets. Clients append the dynamic reserve-funding deposit separately. Preserve ProxyAdmin, legacy fee-vault settings, balances and totalProcessed. Cover execution, authorization, failed initialization and zero funding, and align the existing L2 tests with CGT genesis settings.
Export the synthetic NUT bundle and prestate as deposit RLP vectors with source hashes, transaction hashes, compiler settings and artifact digests. Include the separate reserve-funding vector. Retain the reviewed generated bytes and their original build provenance. Production network inputs and gas calibration remain unresolved.
Resolve the latest L2 block once, then read legacy fee-vault settings at that block hash using EIP-1898. Require token metadata in the deployment config so legacy Ether/ETH getters cannot replace the intended Celo/CELO. Record the source block, frozen settings and bundle digest. Add preflight verification, local JSON-RPC workflow tests, usage docs and a Just entry point. These tools perform no on-chain writes.
f815d31 to
2386275
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
aa32fa2 to
43a8c02
Compare
Pin a compatible mise version and invalidate the old tool cache. Verify the selected version and Foundry tools after installation. Resolve Semgrep baselines from GitHub PR merge refs without REST API access. Cover retargeting, shallow clones and invalid refs, and keep full scans for non-PR pushes and separate rule tests. Use Celo runners for Go and memory acceptance tests. Make unused Celo genesis input addresses explicit in interopgen and remove the upstream devnet metrics upload workflow.
fa99ecb to
512ba56
Compare
| Predeploys.isPredeployNamespace(_config.bridgeProxy) && !Predeploys.notProxied(_config.bridgeProxy) | ||
| && !Predeploys.isSupportedPredeploy(_config.bridgeProxy, type(uint256).max, true, true) | ||
| && _config.l1Bridge != address(0) && _config.l1Token != address(0) && _config.owner != address(0), | ||
| "GenerateCgtV2NUTBundle: invalid configuration" |
There was a problem hiding this comment.
bridgeProxy is free config, but L1 expects CeloPredeploys.CELO_GAS_BRIDGE_L2 (0x…07ef, moved in 80cfc40): OPCM uses it as otherBridge and MigrateV1V2 requires it. The fixture uses 0x…07fE. Use the constant and drop the field, or require(bridgeProxy == CELO_GAS_BRIDGE_L2).
There was a problem hiding this comment.
Fixed in 3dfab8e and regenerated the fixtures in 8344403. The generator now uses CeloPredeploys.CELO_GAS_BRIDGE_L2 (0x…07ef) for the proxy upgrade, minter authorization and prestate, and bridgeProxy is no longer configurable.
Added regression checks for the upgrade target and rejected config overrides. All 8 migration tests and 20 production-tool tests pass locally. Matching Go/Rust fixture updates are ready locally for the companion PRs.
Use CeloPredeploys.CELO_GAS_BRIDGE_L2 for upgrades, minter authorization and fixture prestate so L1 and L2 agree on the bridge address. Remove the free bridgeProxy config input and reject overrides in the production tool. Record the actual contract base and check creation bytecode when exporting fixture provenance.
Regenerate upgrade targets, minter calldata, prestate and transaction hashes from the canonical bridge generator. Preserve all six implementation deployment bytecodes and the dynamic reserve-funding deposit.
CGT genesis authorizes the canonical Celo bridge. Exclude every authorized minter from the unauthorized-caller case, matching the burn test precondition.
Use CircleCI archive RPC secrets for Go tests, pin Semgrep in mise and its Docker job, and remove Codecov uploads. Exclude upstream OP-chain upgrade/coverage jobs from the Celo workflow. Remove the external OP Sepolia hardfork sync tests, following ethereum-optimism/optimism@38f07c5. Celo already dropped these in its later acceptance-test setup. Preserve failed Forge diagnostics as artifacts and print only the final 200 console lines so VerifyOPCM failures can be investigated without the trace output limit.
karlb
left a comment
There was a problem hiding this comment.
Code looks fine. I didn't check the CI failures in detail.
|
CI triage for current head Confirmed target failures
Updates included in this head
Local verification passed: 149 tests/subtests across the script packages and RPC-independent pipeline tests, Final hosted CI result
CI remains red because of the confirmed target failures described above, including the OPCM Go integration failure. No checks are still running. |
Handle string and error panics for every snapshot revision ID using the default branch predicate. Adapt the patch to v6's string-only recovery. Keep the upstream predicate tests and extend Host.Call regression tests for error values, revision 36 and preservation of the original EVM error. (cherry picked from commit 781654f)
Query ProxyAdmin for the SuperchainConfig implementation instead of comparing live state with a fixed implementation address. Backport the relevant test change while keeping v6's ProtocolVersions expectations. The upstream OPCMv2 test changes do not apply to v6. (cherry picked from commit a4982ff)
Remove the duplicate mise-installed Semgrep scan from the contracts checker. Keep the repository-wide Docker scan, rule tests and rule formatting check unchanged.
|
Final CI summary for head All remaining failures reproduce on the exact target. No new CI failures attributable to this PR were found.
CI remains red because of these confirmed target issues. The reproduction details and passing CI fixes are recorded in the earlier triage comment. |
Prepare the CGTv2 L2 migration as ordinary upgrade deposits using the existing v6 proxies. The work supports the client migration in celo-org/celo-kona#241, #567 and the Kona integration in celo-org/celo-kona#364, tracked in celo-org/celo-blockchain-planning#1466.
The generator freezes 15 static deposits for implementation deployment, direct upgrades/initialization, authorization, ownership transfer and CGT enablement. It preserves legacy fee-vault settings, balances and
totalProcessed, with no initializer reset or StorageSetter. Clients append the separate dynamic reserve-funding deposit using the authenticatedEscrowSeededamount.The production tool resolves one L2 block and captures three legacy vault getters at that block hash. Token metadata must be supplied explicitly in deployment config as
Celo/CELO: the legacy mainnet L1Block getters returnEther/ETH. Generation and preflight verification check the configured metadata against the frozen initializer calldata.Activation ordering: all Portal deposits from the activation L1 origin, including deposits emitted after
EscrowSeeded, execute against the pre-migration L2 state. The client appends the CGTv2 upgrade group after all of that origin's deposits and excludes ordinary L2 user transactions from the activation block.This remains a draft: the checked-in bundle is synthetic. Final reserved bridge/L1 addresses, governance inputs, production bundle/compiler approval, gas calibration and production devnet parity remain required.
Rebased onto target
8c7d7a12c8with the same three PR patches. Post-rebase validation at23862755b7: migration suite 8/8, production workflow 19/19, formatting and all 19 frozen-fixture digests pass. Frozen fixtures are unchanged.Earlier validation at
f815d3176cwith the repository's Foundry 1.2.3 pin:cicompiler profile because the inheritedciheavyprofile fails compilation before tests.totalProcessedand L1 origin fields. Production-tool generation and verification also pass against this parent. Deployment addresses in this test are placeholders; no transaction was broadcast.Inherited failures are reported separately, as agreed: strict Semgrep reproduces 817 base findings with zero new findings; existing interface/import/semver/test-naming checks and generated snapshot/Kontrol-summary comparisons remain failing. Kontrol summary generation and proof-source compilation pass, but coverage compilation fails on warnings in unchanged dependencies. These are not reported as green CI gates.
CI repair validation on
512ba56c89: 8 baseline regression tests and full config validation/processing pass locally, with zero new diff-aware Semgrep findings. PR baselines now come from GitHub PR merge refs without REST API access. Go and memory acceptance jobs usecelo-org/2xlarge. In pipeline 3818, the diff-aware Semgrep scan, Go lint and contracts build pass. Go and memory acceptance jobs are still waiting to start, and the contracts test matrix is running. Full CI remains red: contracts checks fail snapshot/interface/import checks and the pinned Semgrep installation lackspkg_resources; the Cannon job fails during Codecov GPG key validation.