Skip to content

refactor(node): remove zk-to-mpt migration cleanup leftovers#936

Open
curryxbo wants to merge 2 commits intomainfrom
cleanup/remove-zk-to-mpt-migration-code
Open

refactor(node): remove zk-to-mpt migration cleanup leftovers#936
curryxbo wants to merge 2 commits intomainfrom
cleanup/remove-zk-to-mpt-migration-code

Conversation

@curryxbo
Copy link
Copy Markdown
Contributor

@curryxbo curryxbo commented Apr 17, 2026

Summary

  • remove temporary dual-geth switch path introduced for zk->mpt migration (L2Next config/flags, runtime switch logic, and eth_config migration metadata fetch)
  • remove fork-boundary-only batch forcing logic in node batching (forceBatchPointForJadeFork) now that migration is complete
  • remove derivation transition-only root validation bypass and clean related migration-specific logging/messages

Test plan

  • cd node && go build ./...
  • verify touched files have no lint diagnostics in Cursor
  • run integration/e2e regression in CI

Made with Cursor

Summary by CodeRabbit

  • Chores
    • Removed legacy fork-specific batching and related state handling.
    • Removed multi-endpoint upgrade-switch support and associated CLI flags.
    • Simplified startup to use a single L2 endpoint and reduced client initialization steps.
    • Consolidated retry/client logic to a single consistent RPC path.
    • Clarified and toned down node sync/error messages.

Now that the network has fully migrated to MPT, remove temporary dual-geth switch paths, fork boundary batch forcing, and transition-only validation bypasses to simplify node and derivation runtime behavior.

Made-with: Cursor
@curryxbo curryxbo requested a review from a team as a code owner April 17, 2026 03:25
@curryxbo curryxbo requested review from tomatoishealthy and removed request for a team April 17, 2026 03:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a13a1340-53bb-42b3-8512-2fb878d992ed

📥 Commits

Reviewing files that changed from the base of the PR and between b03614e and 66ef55a.

📒 Files selected for processing (1)
  • node/derivation/derivation.go

📝 Walkthrough

Walkthrough

Removes Jade/MPT fork upgrade-switch logic and L2Next geth-upgrade support across the node: deletes switch-state, next-client wiring, fork-specific batching override, CLI flags and config fields, and simplifies RetryableClient and related control flow.

Changes

Cohort / File(s) Summary
Configuration & Flags
node/core/config.go, node/derivation/config.go, node/flags/flags.go
Deleted L2Next fields and removed CLI flags L2NextEthAddr / L2NextEngineAddr; removed CLI wiring that constructed L2Next config and any geth-upgrade switch handling.
Retryable client
node/types/retryable_client.go
Removed next-client support, switch-time state, and methods (JadeForkTime, EnsureSwitched); changed NewRetryableClient signature to accept only core auth/eth clients and logger; simplified all RPC call sites to use single clients.
Executor & Batching
node/core/executor.go, node/core/batch.go
Removed executor fork-state fields and helper forceBatchPointForJadeFork; eliminated conditional batch-point forcing and related logs; simplified DeliverBlock flow (removed EnsureSwitched and post-switch height re-check and reduced critical/error phrasing).
Derivation
node/derivation/derivation.go
Removed switchTime/useZktrie state and startup geth-config fetch; removed conditional skip of root/withdrawal validation during upgrade transition so mismatches always trigger state exception and optional challenge.
Build ignores
.gitignore
Removed ignore rule for ops/mpt-switch-test (local testing dir).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~55 minutes

Possibly related PRs

  • ZK to MPT #827: Adds MPT/upgrade-switch wiring (L2Next, switchTime, EnsureSwitched, forceBatchPointForMPTFork); directly inverses many removals in this PR.

Suggested reviewers

  • r3aker86
  • FletcherMan

Poem

🐇 I hopped through code at break of day,
Removed the forks that led astray,
One client now, the paths made clear,
Simpler logs and fewer fear —
My carrots crunch, the repo cheers. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR: removing temporary migration-related code (zk-to-mpt migration cleanup leftovers) including L2Next config, fork-boundary batching logic, and transition-only validation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup/remove-zk-to-mpt-migration-code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@node/derivation/derivation.go`:
- Around line 257-262: The log for a failed ChallengeState call omits the
underlying error; update the block around
d.validator.ChallengeState(batchInfo.batchIndex) to include the returned err in
the log (use d.logger.Error/ Errorf/ Errorw as appropriate) so the message
includes the error details and context (e.g., "challenge state failed" plus err
and the batch index), keeping the same control flow and return behavior; locate
symbols d.validator, ChallengeState, ChallengeEnable, d.logger.Error and
batchInfo.batchIndex to make the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62d16add-ccac-4bcf-8a1b-cd392ab5b452

📥 Commits

Reviewing files that changed from the base of the PR and between 0165591 and b03614e.

📒 Files selected for processing (8)
  • .gitignore
  • node/core/batch.go
  • node/core/config.go
  • node/core/executor.go
  • node/derivation/config.go
  • node/derivation/derivation.go
  • node/flags/flags.go
  • node/types/retryable_client.go
💤 Files with no reviewable changes (4)
  • node/core/batch.go
  • node/core/config.go
  • node/derivation/config.go
  • node/flags/flags.go

Comment thread node/derivation/derivation.go
Include batch index and underlying error in the challenge-state failure log to make debugging easier when challenge submission fails.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant