Skip to content

Commit

Permalink
make v10 upgrade error, it is a lot deeper than a simple lite migration
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Nov 8, 2022
1 parent 2b4fc23 commit 99181ed
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions chain/consensus/filcns/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -1556,26 +1556,10 @@ func upgradeActorsV9Common(
func UpgradeActorsV10(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor,
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {

oldv := actorstypes.Version9
newv := actorstypes.Version10
// This may change for upgrade
newStateTreeVersion := types.StateTreeVersion4

// ensure that the manifest is loaded in the blockstore
if err := bundle.LoadBundles(ctx, sm.ChainStore().StateBlockstore(), actorstypes.Version10); err != nil {
return cid.Undef, xerrors.Errorf("failed to load manifest bundle: %w", err)
}

newActorsManifestCid, ok := actors.GetManifest(newv)
if !ok {
return cid.Undef, xerrors.Errorf("no manifest CID for v10 upgrade")
}

// TODO this is fine for now, but we need to also migrate the init actor state to include
// the (empty) installed actors field if it is staying; note that currently fvm3 expects
// it to be there.
bstore := sm.ChainStore().StateBlockstore()
return LiteMigration(ctx, bstore, newActorsManifestCid, root, oldv, newv, types.StateTreeVersion4, newStateTreeVersion)
// TODO migration
// - the init actor state to include the (empty) installed actors field
// - state tree migration to v5
return cid.Undef, fmt.Errorf("IMPLEMENTME: v10 migration")
}

// Example upgrade function if upgrade requires only code changes
Expand Down

0 comments on commit 99181ed

Please sign in to comment.