Merge pull request #8680 from filecoin-project/feat/nv16-migration-bundle
[nv16] Ensure v8 bundle is loaded during migration
This commit is contained in:
commit
e87bb5db6a
@ -18,10 +18,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var manifestCids map[Version]cid.Cid = map[Version]cid.Cid{
|
||||
// TODO fill in manifest CIDs for v8 and upwards once these are fixed
|
||||
}
|
||||
|
||||
var manifestCids map[Version]cid.Cid
|
||||
var manifests map[Version]*manifest.Manifest
|
||||
var actorMeta map[cid.Cid]actorEntry
|
||||
|
||||
@ -52,6 +49,10 @@ func AddManifest(av Version, manifestCid cid.Cid) {
|
||||
manifestMx.Lock()
|
||||
defer manifestMx.Unlock()
|
||||
|
||||
if manifestCids == nil {
|
||||
manifestCids = make(map[Version]cid.Cid)
|
||||
}
|
||||
|
||||
manifestCids[av] = manifestCid
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/vm"
|
||||
"github.com/filecoin-project/lotus/node/bundle"
|
||||
)
|
||||
|
||||
func DefaultUpgradeSchedule() stmgr.UpgradeSchedule {
|
||||
@ -1369,6 +1370,13 @@ func upgradeActorsV8Common(
|
||||
buf := blockstore.NewTieredBstore(sm.ChainStore().StateBlockstore(), blockstore.NewMemorySync())
|
||||
store := store.ActorStore(ctx, buf)
|
||||
|
||||
// ensure that the manifet is loaded in the blockstore
|
||||
if err := bundle.FetchAndLoadBundles(ctx, buf, map[actors.Version]build.Bundle{
|
||||
actors.Version8: build.BuiltinActorReleases[actors.Version8],
|
||||
}); err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to load manifest bundle: %w", err)
|
||||
}
|
||||
|
||||
// Load the state root.
|
||||
var stateRoot types.StateRoot
|
||||
if err := store.Get(ctx, root, &stateRoot); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user