diff --git a/chain/actors/manifest.go b/chain/actors/manifest.go index bfc06e9e5..2276ee3e4 100644 --- a/chain/actors/manifest.go +++ b/chain/actors/manifest.go @@ -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 } diff --git a/chain/consensus/filcns/upgrades.go b/chain/consensus/filcns/upgrades.go index bed5ceecf..f21a448ef 100644 --- a/chain/consensus/filcns/upgrades.go +++ b/chain/consensus/filcns/upgrades.go @@ -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 {