Conversation
WalkthroughThis PR introduces a new NV28 state migration module that registers migrators for built-in actors and performs state tree migration. It adds module declarations, a migration orchestration function, and system state definitions to support the NV28 network upgrade. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant run_migration
participant ChainConfig
participant Blockstore as Blockstore
participant StateMigration
participant StateTree
Client->>run_migration: run_migration(chain_config, blockstore, state, epoch)
run_migration->>ChainConfig: Lookup manifest CID from height_infos
run_migration->>Blockstore: Validate manifest exists
run_migration->>Blockstore: Load BuiltinActorManifest
run_migration->>StateMigration: Create with Verifier (Arc)
run_migration->>StateMigration: add_nv28_migrations(store, state, new_manifest)
StateMigration->>Blockstore: Load current StateTree from root CID
StateMigration->>Blockstore: Load system actor manifest
StateMigration->>StateMigration: Register per-actor migrators
run_migration->>Blockstore: Load input StateTree
run_migration->>StateMigration: migrate_state_tree (V5, epoch)
StateMigration->>StateTree: Apply registered migrators
run_migration->>Client: Return new state root CID
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/state_migration/mod.rs`:
- Line 31: The new nv28 module was added but not wired into get_migrations, so
run_state_migrations never reaches the NV28 migration; update the get_migrations
function to include the nv28 migration in the appropriate network branches (the
same branches that should execute NV28) by adding the nv28 migration entry
alongside the existing migrations so that Height::Xxx is returned/executed for
those networks; ensure you reference the nv28 module and include it in each
network match arm in get_migrations where NV28 should run.
In `@src/state_migration/nv28/migration.rs`:
- Around line 31-42: The code calls several fallible functions without
contextual error messages; wrap each call with anyhow context so failures
identify the step: add .context("creating StateTree from root") to
StateTree::new_from_root(store.clone(), state), .context("getting system actor
from state tree") to state_tree.get_required_actor(&Address::SYSTEM_ACTOR),
.context("loading old SystemState from store") to
store.get_cbor_required::<SystemStateOld>(&system_actor.state),
.context("loading current builtin manifest") to
BuiltinActorManifest::load_v1_actor_list(store, ¤t_manifest_data), and add
context when retrieving new_manifest.get(name) and when calling
self.add_migrator(code, nil_migrator(new_code)); apply the same pattern for the
similar fallible calls around lines 79-85 so any error clearly states which
migration step failed.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a831001e-2566-4ddb-8dbf-3cac1f59b58b
📒 Files selected for processing (3)
src/state_migration/mod.rssrc/state_migration/nv28/migration.rssrc/state_migration/nv28/mod.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit