Skip to content

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Sep 16, 2025

Summary of changes

https://github.com/filecoin-project/lotus/blob/v1.34.0/build/buildconstants/params_mainnet.go#L142

// 2025-09-24T23:00:00Z
var UpgradeGoldenWeekHeight = abi.ChainEpoch(5348280)

Performed a dummy upgrade @ epoch 5325160, Lotus and Forest produces the same state tree (bafy2bzacebggqplsoqxtyobh5kct4hmegtylvtbedyn5auzuzadfooqp5ybjm)

Lotus:

2025-09-17T00:23:25.759+0200    WARN    chain   chain/sync.go:220       InformNewHead called on block marked as bad: bafy2bzacedfc5lopt53ht6ldephu4yvgnvecjgl3hf2xw5qmfqi6xs3la364u (reason: linked to bafy2bzaced6x2rg6knvgqxdb3egkinbvpvsxvkokp6ifhuc752xnheapmqrpu caused by: [bafy2bzaced6pqff54sr4xnyji7n5kz7fa3wgh6pacfmr2f2znhdnw3lwue3hc] 1 error occurred:
        * parent state root did not match computed state (bafy2bzacedopk6v2uf6xl46fs7cslkl7hjbzyqcpapbsbdzgqs4fniqp5e6gm != bafy2bzacebggqplsoqxtyobh5kct4hmegtylvtbedyn5auzuzadfooqp5ybjm):
    github.com/filecoin-project/lotus/chain/consensus.CommonBlkChecks.func3
        /home/hm/git/lotus/chain/consensus/common.go:119

Forest:

2025-09-16T22:26:27.455498Z  WARN forest::chain_sync::tipset_syncer: Validating block [CID = bafy2bzaced56aiiqmjjipth6ltx4eveex6455mo4d2kxejgvk24l77wmzxf7o] in EPOCH = 5325162 failed: Validation error: Validation error: Parent state root did not match computed state: bafy2bzacedopk6v2uf6xl46fs7cslkl7hjbzyqcpapbsbdzgqs4fniqp5e6gm (header), bafy2bzacebggqplsoqxtyobh5kct4hmegtylvtbedyn5auzuzadfooqp5ybjm (computed)

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes #5989

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • New Features

    • Enable the GoldenWeek network upgrade on mainnet at height 5,348,280 (Wed 24 Sep 2025, 23:00 UTC), including automatic state migration.
    • Adopt actors v17.0.0 on mainnet with the standard 16-actor roster.
  • Chores

    • Promote calibnet, butterflynet, and devnet actor bundles from v17.0.0-rc1 to v17.0.0.
    • Add a mainnet manifest entry for v17.0.0 and update associated bundle references.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Walkthrough

Promotes actor bundle versions from v17.0.0-rc1 to v17.0.0 across calibnet, butterflynet, and devnet; adds mainnet v17.0.0 manifest and actor bundle; sets mainnet GoldenWeek height to 5_348_280 with v17.0.0 bundle; re-enables NV27 GoldenWeek state migration for mainnet.

Changes

Cohort / File(s) Summary
Manifests
build/manifest.json
Updated calibnet/butterflynet/devnet entries from v17.0.0-rc1 to v17.0.0; appended mainnet v17.0.0 manifest with actor list and CID.
Actor bundles registry
src/networks/actors_bundle.rs
Switched rc versions to v17.0.0 for calibrationnet, butterflynet, devnet; added mainnet v17.0.0 bundle with new manifest CID.
Testnets GoldenWeek height info
src/networks/butterflynet/mod.rs, src/networks/calibnet/mod.rs, src/networks/devnet/mod.rs
Updated GoldenWeek entries to use get_bundle_cid("v17.0.0") instead of "v17.0.0-rc1".
Mainnet GoldenWeek scheduling
src/networks/mainnet/mod.rs
Set GoldenWeek to height 5_348_280 with get_bundle_cid("v17.0.0"); updated comment with timestamp.
State migration enablement
src/state_migration/mod.rs
Re-enabled mainnet GoldenWeek migration by adding (Height::GoldenWeek, nv27::run_migration::) to mainnet migrations.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Node
    participant ChainSync as Chain Sync
    participant NetCfg as Network Config
    participant HeightInfos as HEIGHT_INFOS
    participant Bundles as Actor Bundle Registry
    participant SM as State Migration

    Node->>ChainSync: Import tipsets
    ChainSync->>NetCfg: Identify network (mainnet)
    ChainSync->>HeightInfos: Lookup upgrade at current epoch
    alt Epoch == GoldenWeek (5_348_280)
        HeightInfos->>Bundles: get_bundle_cid("v17.0.0")
        Bundles-->>HeightInfos: v17.0.0 CID
        ChainSync->>SM: nv27::run_migration(DB)
        SM-->>ChainSync: Migration result (success/failure)
    else Before/After GoldenWeek
        Note over ChainSync: Continue normal processing
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • akaladarshi
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/set-nv27-mainnet-upgrade-epoch

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

Pre-merge checks

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR also updates actor bundle versions and GoldenWeek lookups for calibnet, butterflynet, and devnet from "v17.0.0-rc1" to "v17.0.0", which is not explicitly requested by linked issue [#5989] and therefore represents out-of-scope changes relative to that issue. Please confirm whether the non-mainnet bundle/version updates are intentional; if not, revert or move them to a separate PR, and if intentional, document them in the PR description and link or update the issue so reviewers can validate the broader release impact and run full test/migration checks.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: set nv27 mainnet upgrade epoch" is concise and accurately describes the primary change in the changeset — setting the NV27 mainnet upgrade epoch and associated mainnet manifest/migration updates.
Linked Issues Check ✅ Passed The PR implements the objectives from linked issue [#5989]: the mainnet NV27 epoch is set to 5,348,280 (Wed 24 Sep 2025 23:00:00 UTC) and the mainnet actor bundle is updated to v17.0.0 with the mainnet manifest CID added, and the Mainnet GoldenWeek migration is re-enabled (changes visible in mainnet/mod.rs, actors_bundle.rs, build/manifest.json, and state_migration/mod.rs).
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

@hanabi1224 hanabi1224 marked this pull request as ready for review September 16, 2025 00:04
@hanabi1224 hanabi1224 requested a review from a team as a code owner September 16, 2025 00:04
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team September 16, 2025 00:04
Copy link
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: 0

🧹 Nitpick comments (1)
src/networks/actors_bundle.rs (1)

87-109: ACTOR_BUNDLES: add mainnet v17.0.0 and promote testnets/devnet — OK; add test case for v17

Small nit: extend test_actor_major_version_correct with v17 to lock behavior.

@@
     fn test_actor_major_version_correct() {
         let cases = [
             ("8.0.0-rc.1", 8),
             ("v9.0.3", 9),
             ("v10.0.0-rc.1", 10),
             ("v12.0.0", 12),
             ("v13.0.0-rc.3", 13),
             ("v13.0.0", 13),
             ("v14.0.0-rc.1", 14),
+            ("v17.0.0", 17),
         ];
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36e372e and 818b983.

📒 Files selected for processing (7)
  • build/manifest.json (4 hunks)
  • src/networks/actors_bundle.rs (3 hunks)
  • src/networks/butterflynet/mod.rs (1 hunks)
  • src/networks/calibnet/mod.rs (1 hunks)
  • src/networks/devnet/mod.rs (1 hunks)
  • src/networks/mainnet/mod.rs (1 hunks)
  • src/state_migration/mod.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: hanabi1224
PR: ChainSafe/forest#5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
🧬 Code graph analysis (5)
src/networks/devnet/mod.rs (3)
src/networks/butterflynet/mod.rs (1)
  • get_bundle_cid (112-117)
src/networks/calibnet/mod.rs (1)
  • get_bundle_cid (101-106)
src/networks/mainnet/mod.rs (1)
  • get_bundle_cid (98-103)
src/networks/butterflynet/mod.rs (3)
src/networks/calibnet/mod.rs (1)
  • get_bundle_cid (101-106)
src/networks/devnet/mod.rs (1)
  • get_bundle_cid (170-175)
src/networks/mainnet/mod.rs (1)
  • get_bundle_cid (98-103)
src/state_migration/mod.rs (1)
src/state_migration/nv27/migration.rs (1)
  • run_migration (55-88)
src/networks/mainnet/mod.rs (3)
src/networks/butterflynet/mod.rs (1)
  • get_bundle_cid (112-117)
src/networks/calibnet/mod.rs (1)
  • get_bundle_cid (101-106)
src/networks/devnet/mod.rs (1)
  • get_bundle_cid (170-175)
src/networks/calibnet/mod.rs (3)
src/networks/butterflynet/mod.rs (1)
  • get_bundle_cid (112-117)
src/networks/devnet/mod.rs (1)
  • get_bundle_cid (170-175)
src/networks/mainnet/mod.rs (1)
  • get_bundle_cid (98-103)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: tests-release
  • GitHub Check: tests
  • GitHub Check: Build MacOS
  • GitHub Check: Build Ubuntu
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: All lint checks
🔇 Additional comments (9)
src/networks/devnet/mod.rs (1)

163-166: GoldenWeek: promote bundle to v17.0.0 — looks good

Matches ACTOR_BUNDLES updates and keeps env-override behavior. No concerns.

src/networks/butterflynet/mod.rs (1)

108-109: Butterflynet GoldenWeek → v17.0.0 — OK

Aligned with manifest and bundle table.

build/manifest.json (4)

1157-1166: Calibnet: promote to v17.0.0 — OK

CID/version consistent with actors_bundle.rs.


1433-1445: Butterflynet: promote to v17.0.0 — OK

Matches bundle table.


2251-2260: Devnet: promote to v17.0.0 — OK

Consistent across sources.


3055-3145: Approve Mainnet v17.0.0 manifest — roster and CID coherent

Actors (16) and bundle_cid match src/networks/actors_bundle.rs.

src/networks/calibnet/mod.rs (1)

97-98: Calibnet GoldenWeek → v17.0.0 — OK

Aligned with manifest/bundles.

src/state_migration/mod.rs (1)

50-51: Re-enable NV27 (GoldenWeek) migration on Mainnet — OK

Ordering is consistent and the bundle is present: make_height!(GoldenWeek, 5_348_280, get_bundle_cid("v17.0.0")) in src/networks/mainnet/mod.rs, v17.0.0 registered for "mainnet" in src/networks/actors_bundle.rs, and Height::GoldenWeek → nv27::run_migration:: is present in src/state_migration/mod.rs.

src/networks/mainnet/mod.rs (1)

93-95: Approve: Set Mainnet GoldenWeek to 5,348,280 (v17.0.0) — verified

  • Lotus v1.34.0 UpgradeGoldenWeekHeight = 5,348,280 (2025-09-24T23:00:00Z).
  • Tock check: 5,348,280 > 5,138,040 (OK).
  • Bundle wiring: "bafy2bzaceai74ppsvuxs3nvpzzeuptdr3wl7vmdpbphvtz4qt5hfq2qdfvz3e" @ "v17.0.0" present in src/networks/actors_bundle.rs:108.

@LesnyRumcajs
Copy link
Member

@hanabi1224 Could you please check that Forest outputs the same stateroot after the migration as Lotus?

@hanabi1224
Copy link
Contributor Author

Could you please check that Forest outputs the same stateroot after the migration as Lotus?

@LesnyRumcajs just tested and updated the result in the PR description.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Sep 17, 2025
Merged via the queue into main with commit 89f6cb3 Sep 17, 2025
39 checks passed
@LesnyRumcajs LesnyRumcajs deleted the hm/set-nv27-mainnet-upgrade-epoch branch September 17, 2025 07:56
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.

[NV27] Mainnet upgrade

4 participants